Intel® Ethernet Controller E810 eSwitch Switchdev Mode
Technology and Configuration Guide
Configuration Steps
- Verify that hardware, software, and firmware requirements are met, as detailed in Hardware and Software Requirements.
- Remove all VFs from the PF under test.
The 800 Series Network Adapter allows switching in and out of switchdev mode only if there are no VFs created/associated with related PF.
- Stop all VMs, containers, or DPDK applications using VFs connected to the PF.
- Unload all VFs from the PF by setting the number of VFs to 0:
echo 0 > /sys/class/net/$<PF1>/device/sriov_numvfs
Note:When the PF driver is already in switchdev mode, for each VF that is attached to the PF, there is a corresponding VF_PR netdev. When the VF is removed, the corresponding VF_PR netdev is automatically removed as well. - Create the software vSwitch (Linux Bridge or OVS) and add the PF interface as an uplink to the vSwitch.
Note:This must be done before the PF is set to switchdev mode. Bridge example:
ip link add $<BR> type bridge ip link set $<PF1> master $<BR> OVS example:
ovs-vsctl add-br $<BR> ovs-vsctl add-port $<BR> $<PF1> ovs-vsctl show - Use the Linux devlink API to change the eSwitch mode of the PF PCI device to switchdev or legacy mode.
Here, PF1_PCI is
pci/0000:xx:xx.x which is the address of PCI device $PF1. It can be found by:lspci -D | grep $<PF1> or
ethtool -i $<PF1> devlink dev eswitch set $<PF1_PCI> mode switchdev or
devlink dev eswitch set $<PF1_PCI> mode legacy - Check that the current eSwitch mode is changed.
devlink dev eswitch show $<PF1_PCI> - Create SR-IOV VFs after changing eSwitch mode.
echo <num_of_VFs> > /sys/class/net/$<PF1>/device/sriov_numvfs - Add a rule to to specify naming for newly created VF Port Representors.
In switchdev mode, the VF Port Representors are created with the default naming convention ethX and it is difficult to identify the corresponding PF ports. The following rule can be added in the folder
/etc/udev/rules.d/ .SUBSYSTEM=="net", ACTION=="add", ATTR{phys_switch_id}=="b49691ffffa5c308", ATTR{phys_port_name}!="", NAME="ens6$attr{phys_port_name}" In the above command, update the NAME and phys_switch_id with the correct values. The phys_switch_id can be fetched from the following command in switchdev mode with VF configured.
[root@CLIENT-4 ~]# ip -d link show ens6f0 5: ens6f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000 link/ether b4:96:91:a5:c3:08 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 9702 addrgenmode none numtxqueues 320 numrxqueues 320 gso_max_size 65536 gso_max_segs 65535 portname p0 switchid b49691ffffa5c308 vf 0 link/ether c2:04:5b:40:18:8c brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state enable, trust off root@CLIENT-4 ~]#