【标题描述】
hns3网卡VF开启防欺诈功能(或者PF发生复位)后,VF的vlan filter功能被错误关闭,导致VF能收到任意vlan的报文。
【环境信息】
硬件信息:
TS200-2280服务器
软件信息:
1) OS版本及分支:openEuler 20.03 LTS SP3
2) 内核信息:4.19.90-2112.5.0.0129.oe1.aarch64
3) hns3问题驱动版本:1.8.11.0~21.12.4
【问题复现步骤】
1、本端按照下列步骤配置:
[root@localhost ~]# echo 2 > /sys/class/net/enp189s0f0/device/sriov_numvfs --- 需要使能2个vf,以观察不同vlan的收包情况
[root@localhost ~]# ethtool -L enp189s0f0v0 combined 1 ---- 改为1个队列便于观察收包情况
[root@localhost ~]# ethtool -L enp189s0f0v1 combined 1
[root@localhost ~]# ip link set enp189s0f0 vf 0 mac 22:a0:cb:a8:b5:19 --- 配置固定mac,便于对端mz发包构造使用
[root@localhost ~]# ip link set enp189s0f0 vf 1 mac 22:a0:cb:a8:b5:20
[root@localhost ~]# ip link set enp189s0f0 vf 0 vlan 100 --- 两个vf分别配置不同的vlan
[root@localhost ~]# ip link set enp189s0f0 vf 1 vlan 101
2、本端查询vlan过滤功能如下:
[root@localhost ~]# cat /sys/kernel/debug/hns3/0000:bd:00.0/vlan_config
I_PORT_VLAN_FILTER: on
E_PORT_VLAN_FILTER: off
FUNC_ID I_VF_VLAN_FILTER E_VF_VLAN_FILTER
pf off on
vf0 off on --- 关注此项目
vf1 off on
FUNC_ID PVID ACCEPT_TAG1 ACCEPT_TAG2 ACCEPT_UNTAG1 ACCEPT_UNTAG2 INSERT_TAG1 INSERT_TAG2 STRIP_TAG1 STRIP_TAG2 PRI_ONLY_TAG1 PRI_ONLY_TAG2
pf 0 on on on on off off off on off off
vf0 100 off on on on on off on on off off
vf1 101 off on on on on off on on off off
3、对vf配置spoof:
ip link set enp189s0f0 vf 0 spoof on
或者触发一个PF复位:
echo 1 > /sys/class/net/enp189s0f0/device/reset
4、本端用下面命令监控vf收包情况
watch -d -n 1 "ethtool -S enp189s0f0v0 |grep pktnum"
5、对端通过mz发包:
步骤1: mz enp189s0f0 -t ip sp=5000,dp=5011 -b 22:a0:cb:a8:b5:19 -p 1000 -c 1000
步骤2: mz enp189s0f0 -t ip sp=5000,dp=5011 -b 22:a0:cb:a8:b5:19 -p 1000 -c 1000 -Q 100
步骤3: mz enp189s0f0 -t ip sp=5000,dp=5011 -b 22:a0:cb:a8:b5:19 -p 1000 -c 1000 -Q 101
【预期结果】
步骤1:rx方向报文不增长
步骤2:rx方向报文增长1000个
步骤3:rx方向报文不增长
【实际结果】
步骤1:rx方向报文增长1000个
步骤2:rx方向报文增长1000个
步骤3:rx方向报文增长1000个
Hi liuyonglong86, welcome to the openEuler Community.
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here.
If you have any questions, please contact the SIG: Kernel, and any of the maintainers: @YangYingliang , @pi3orama , @成坚 (CHENG Jian) , @Qiuuuuu , @zhengzengkai , @gogooo , @Xie XiuQi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
登录 后才可以发表评论