401 Star 1.4K Fork 1.3K

GVPopenEuler / kernel

 / 详情

【openEuler 20.03 lts SP3】hns3网卡VF开启防欺诈功能后,VF的vlan filter功能被错误关闭

已完成
缺陷
创建于  
2022-03-04 10:11

【标题描述】
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个

评论 (1)

Yonglong Liu 创建了缺陷

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

openeuler-ci-bot 添加了
 
sig/Kernel
标签
Qiuuuuu 通过src-openeuler/kernel Pull Request !555任务状态待办的 修改为已完成
Yonglong Liu 修改了描述

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(2)
5329419 openeuler ci bot 1632792936
C
1
https://gitee.com/openeuler/kernel.git
git@gitee.com:openeuler/kernel.git
openeuler
kernel
kernel

搜索帮助