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
 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

mounter625

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值