driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I9D6UN CVE: NA
-----------------------------------------------------------------------
The driver set port vlan filter to "on" when initialized, and than set port vlan filter to "off" in service task if in dynamic vlan mode. Between this two settings, if user set a vlan to the port, the port vlan filter is remain in "on" status, which is not expected.
To fix the problem, if in dynamic vlan mode, set the port vlan filter to "off".
Fixes: 7d2c54d8b68f ("net: hns3: disable port VLAN filter when support function level VLAN filter control") Fixes: b241115bd455 ("net: hns3: add support for modify VLAN filter state") Signed-off-by: Yonglong Liu liuyonglong@huawei.com --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 9 +++++++-- 1 file changed, 7 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 8589ac0643ef..6c61016bd4d9 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -8809,6 +8809,8 @@ static int hclge_init_vlan_config(struct hclge_dev *hdev) int i;
if (hdev->pdev->revision >= HNAE3_REVISION_ID_21) { + bool enable = true; + /* for revision 0x21, vf vlan filter is per function */ for (i = 0; i < hdev->num_alloc_vport; i++) { vport = &hdev->vport[i]; @@ -8822,9 +8824,12 @@ static int hclge_init_vlan_config(struct hclge_dev *hdev) vport->cur_vlan_fltr_en = true; }
+ if (hnae3_dev_vlan_fltr_mdf_supported(hdev)) + enable = false; + ret = hclge_set_vlan_filter_ctrl(hdev, HCLGE_FILTER_TYPE_PORT, - HCLGE_FILTER_FE_INGRESS, true, - 0); + HCLGE_FILTER_FE_INGRESS, + enable, 0); if (ret) return ret; } else {