Intel® Ethernet Controller E810 eSwitch Switchdev Mode

Technology and Configuration Guide

ID Date Version Classification
645272 12/31/2023 1.3 Public
Document Table of Contents

Configuration Steps

  1. Verify that hardware, software, and firmware requirements are met, as detailed in Hardware and Software Requirements.
  2. 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.

    1. Stop all VMs, containers, or DPDK applications using VFs connected to the PF.
    2. 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.
  3. 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
  4. 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
  5. Check that the current eSwitch mode is changed. devlink dev eswitch show $<PF1_PCI>
  6. Create SR-IOV VFs after changing eSwitch mode. echo <num_of_VFs> > /sys/class/net/$<PF1>/device/sriov_numvfs
  7. 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 ~]#
Note:By default, the 800 Series driver starts with all interfaces in Legacy mode. eSwitch switchdev settings and related filters persist with PF interface resets, but not with driver reloads or system reboots. To persist switchdev mode settings between reboots, create a script to apply the changes at boot time.