Adding PFs or VFs to the OVS Bridge

Getting Started with OVS Offload Software

Platform
Napatech IPU
Content Type
Getting Started
Capture Software Version
OVS Offload Software 1.0

To add more physical functions (PFs) or virtual functions (VFs) to the OVS bridge, modifications are required in both setup and start scripts. Both scripts use the DPDK representor concept to identify interfaces.

Representors, ports and PVFs

This table shows how representor values are assigned based on the physical port numbers / PVF numbers on the IPU and the host.
Interface Port numbers / PVF numbers Representor Representor values
Physical port 0, 1 Port# + 0x80 0x80, 0x81
PVF on the IPU 0, 1, 2, 4, 5, ...
Note: 3 is reserved for the internal use.
PVF# + 0x0 0x0, 0x1, 0x2, 0x4, 0x5, ...
PVF on the host All virtio-net PVFs PVF# + 0x1000 0x1000, 0x1001, 0x1002, ...
For information on how to identify the PVF number of each physical function or virtual function, see Understanding PFs, VFs and PVFs.

Adding PFs in the setup script

In the setup script, locate the following command.

Copy and paste the command.
csc_ovs_mgmt --tcam_cust --subPath 1 --insert --withHeader --vlanId 0x101f --stripVlan \
--stripNFwd --statsIdx 4 --dstVid 0x101f --msk0 0xfffff --msk1 0 --msk2 0 --entry 7
Adjust the following parameters.
  • vlanId: Set to the target representor using hexadecimal notation.
  • dstVid: Set to the target representor using hexadecimal notation.
  • entry: Specify a unique TCAM rule entry number.
By default, PF0 (PVF31) and PF1 (PVF30) on the host are configured in the setup scripts. The following command is an example to add PF2 (PVF29).
csc_ovs_mgmt --tcam_cust --subPath 1 --insert --withHeader --vlanId 0x101d --stripVlan \
--stripNFwd --statsIdx 4 --dstVid 0x101d --msk0 0xfffff --msk1 0 --msk2 0 --entry 13
Representor 0x101d (4125) is set: 0x1d (PVF29) + 0x1000 (4096).

Adding PFs in the start script

In the start script, locate the following command.

Copy and paste the command.
${OVS_DIR}/utilities/ovs-vsctl add-port br-int pf0 -- set \
Interface pf0 type=dpdk options:dpdk-devargs=0000:15:00.0,representor=4127
Adjust the following parameters.
  • pf0: Port name (twice). Set to the target PF.
  • representor: Set to the target representor using decimal notation.
The following command is an example for adding PF2 (PVF29).
${OVS_DIR}/utilities/ovs-vsctl add-port br-int pf2 -- set \
Interface pf2 type=dpdk options:dpdk-devargs=0000:15:00.0,representor=4125
Note: representor=4125 must match the value used in the setup scripts.

Restarting the OVS

After the changes are made, stop the OVS and run the scripts on the IPU.
soc# pkill ovs
soc# /opt/ipu_workload_ovs/bin/setup_ovs_bm.sh
soc# /opt/ipu_workload_ovs/bin/start_ovs_bm.sh