configure switchdev mode to run hardware offload test

1. set 2 VFs
echo 2 > /sys/class/net/eth2/device/sriov_numvfs
ip link show

...
17: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether 98:03:9b:9f:d2:0e brd ff:ff:ff:ff:ff:ff
vf 0 MAC 00:00:00:00:00:00, spoof checking off, link-state disable, trust off, query_rss off
vf 1 MAC 00:00:00:00:00:00, spoof checking off, link-state disable, trust off, query_rss off
...
"

2. unbind the VFs
lspci | grep -i mellanox

...
00:08.2 Ethernet controller: Mellanox Technologies MT28908 Family [ConnectX-6 Virtual Function]
00:08.3 Ethernet controller: Mellanox Technologies MT28908 Family [ConnectX-6 Virtual Function]
...

echo 0000:00:08.2 > /sys/bus/pci/drivers/mlx5_core/unbind
echo 0000:00:08.3 > /sys/bus/pci/drivers/mlx5_core/unbind

3. set switchdev mode
devlink dev eswitch set pci/0000:00:08.0 mode switchdev

4. set mac address for VFs
ip link set eth2 vf 0 mac e4:11:22:33:44:50
ip link set eth2 vf 1 mac e4:11:22:33:44:51

5. bind the VFs
echo 0000:00:08.2 > /sys/bus/pci/drivers/mlx5_core/bind
echo 0000:00:08.3 > /sys/bus/pci/drivers/mlx5_core/bind

6. 
    for the NIC under test need to define a custom configurations file (at
    asap_dev_reg project root directory), which includes relevant NIC network
    interfaces data (PF0, PF1, VF0,VF1,REP0,REP1):

    1.  Nic type should be dual port NIC ConnectX-5/ConnectX-4Lx in Ethernet mode where:

        1.  <PF0> is the network interface of the NIC’s first physical function

        2.  <PF1> is the network interface of the NIC’s second physical function
            (the second port)

        3.  <VF0> is the network interface of the first virtual function created
            on PF0

        4.  <VF1> is the network interface of the second virtual function created
            on PF0

        5.  <REP0> is the network interface of the first representor created when
            switched to switchdev mode on PF0

        6.  <REP1> is the network interface of the second representor created when
            switched to switchdev mode on PF0

    2.  example configuration file needed (some example config files can be found
        at project root directory named “config_*.sh“):
        NIC=<PF0>
        NIC2=<PF1>
        VF=<VF0>
        VF1=$VF
        VF2=<VF1>
        REP=<REP0>
        REP2=<REP1>

cat config_reproduce.sh

NIC=eth2
NIC2=eth3
VF=eth4
VF1=$VF
VF2=eth5
REP=eth2_pf64vf0
REP2=eth2_pf64vf1
"

7. export CONFIG=config_reproduce.sh

8. 
ovs-vsctl set Open_vSwitch . other_config:hw-offload=true
systemctl restart openvswitch

9. ./test-eswitch-netdev-tx.sh
 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章