From: shenhao shenhao21@huawei.com
driver inclusion category: debug bugzilla: NA CVE: NA
----------------------------------------------------------
This patch increase vlan tag0 when close the port_base_vlan
Signed-off-by: liaoguojia liaoguojia@huawei.com Signed-off-by: shenhao shenhao21@huawei.com Reviewed-by: Zhong Zhaohui zhongzhaohui@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index cfec96f..4e53361 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -9045,8 +9045,10 @@ static int hclge_update_vlan_filter_entries(struct hclge_vport *vport, if (port_base_vlan_state == HNAE3_PORT_BASE_VLAN_ENABLE) { hclge_rm_vport_all_vlan_table(vport, false); /* force clear vlan 0 */ - hclge_set_vf_vlan_common(hdev, vport->vport_id, true, 0, - htons(ETH_P_8021Q)); + ret = hclge_set_vf_vlan_common(hdev, vport->vport_id, true, 0, + htons(ETH_P_8021Q)); + if (ret) + return ret; return hclge_set_vlan_filter_hw(hdev, htons(new_info->vlan_proto), vport->vport_id, @@ -9055,6 +9057,12 @@ static int hclge_update_vlan_filter_entries(struct hclge_vport *vport, } vport->port_base_vlan_cfg.tbl_sta = false;
+ /* force add vlan 0 */ + ret = hclge_set_vf_vlan_common(hdev, vport->vport_id, false, 0, + htons(ETH_P_8021Q)); + if (ret) + return ret; + ret = hclge_set_vlan_filter_hw(hdev, htons(old_info->vlan_proto), vport->vport_id, old_info->vlan_tag, true);