[v1,1/3] net/hinic: increase the protection of the VLAN

Message ID 502c35d4f03e7958216e3de8eadf9a6e68208a44.1626429126.git.zhouguoyang@huawei.com (mailing list archive)
State Accepted, archived
Headers
Series fix some problems of mtu, vlan, lro |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Guoyang Zhou July 16, 2021, 9:54 a.m. UTC
  If the vlan id 0 is deleted for hinic, all packets without
vlan will be discarded when the vlan filter is turned on.

Fixes: 50ce3e7aec8f ("ethdev: fix VLAN offloads set if no relative capabilities")
Cc: stable@dpdk.org
Signed-off-by: Guoyang Zhou <zhouguoyang@huawei.com>
---
 drivers/net/hinic/hinic_pmd_ethdev.c | 3 +++
 1 file changed, 3 insertions(+)
  

Patch

diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c
index 9464657..75849f2 100644
--- a/drivers/net/hinic/hinic_pmd_ethdev.c
+++ b/drivers/net/hinic/hinic_pmd_ethdev.c
@@ -1617,6 +1617,9 @@  static int hinic_vlan_filter_set(struct rte_eth_dev *dev,
 	if (vlan_id > RTE_ETHER_MAX_VLAN_ID)
 		return -EINVAL;
 
+	if (vlan_id == 0)
+		return 0;
+
 	func_id = hinic_global_func_id(nic_dev->hwdev);
 
 	if (enable) {