VF Function Number Allocation

The VF numbers begin immediately after the PF numbers; there are no gaps in the function number allocation between PFs and VFs. The VF stride is fixed at 0x1. Therefore, all VFs that belong to the same PF are allocated successive function numbers.

Table 1. VF Function Number allocation
Routing ID Description
0 PF0
1 PF1
2 PF2
3 PF3
4 to 19 PF0_VF1 to PF0_VF16
20 to 35 PF1_VF1 to PF1_VF16
36 to 51 PF2_VF1 to PF2_VF16
52 to 67 PF3_VF1 to PF3_VF16

If you configure the PCIe Controller to have multiple PFs, you can change the total number of VFs allocated to each PF by programming bits [15:0] in the Total VF Count Register in the PFs' SR-IOV extended capabilities. When you modify the field, the VF function number allocation changes and ensures that all VFs are allocated successive function numbers. Firmware should re-program the First VF Offset field to reflect the new VF function number allocation as described below.

  • PF0 First VF Offset[15:0] = Total Number of PFs
  • PF1 First VF Offset[15:0] = Total Number of PFs + (PF0 Total VF Count[15:0]) - 1
  • PF2 First VF Offset[15:0] = Total Number of PFs + (PF0 Total VF Count[15:0]) + (PF1 Total VF Count[15:0]) - 2
  • PF3 First VF Offset[15:0] = Total Number of PFs + (PF0 Total VF Count[15:0]) + (PF1 Total VF Count[15:0]) + (PF2 Total VF Count[15:0]) - 3
  • PF4 First VF Offset[15:0] = Total Number of PFs + (PF0 Total VF Count[15:0]) + (PF1 Total VF Count[15:0]) + (PF2 Total VF Count[15:0]) + (PF3 Total VF Count[15:0]) - 4
  • PF5 First VF Offset[15:0] = Total Number of PFs + (PF0 Total VF Count[15:0]) + (PF1 Total VF Count[15:0]) + (PF2 Total VF Count[15:0]) + (PF3 Total VF Count[15:0]) + (PF4 Total VF Count[15:0]) - 5
  • PF6 First VF Offset[15:0] = Total Number of PFs + (PF0 Total VF Count[15:0]) + (PF1 Total VF Count[15:0]) + (PF2 Total VF Count[15:0]) + (PF3 Total VF Count[15:0]) + (PF4 Total VF Count[15:0]) + (PF5 Total VF Count[15:0]) - 6
  • PF7 First VF Offset[15:0] = Total Number of PFs + (PF0 Total VF Count[15:0]) + (PF1 Total VF Count[15:0]) + (PF2 Total VF Count[15:0]) + (PF3 Total VF Count[15:0]) + (PF4 Total VF Count[15:0]) + (PF5 Total VF Count[15:0]) + (PF6 Total VF Count[15:0]) – 7