From b3342b1ee9e6211bcad21a8102eb8205f124ff1a Mon Sep 17 00:00:00 2001 From: Yonglong Liu Date: Tue, 2 Apr 2024 09:17:57 +0000 Subject: [PATCH 1/2] net: hns3: fix port vlan filter not disabled problem in dynamic vlan mode driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I9D6UN?from=project-issue DTS: DTS2024032619211 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 --- 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 { -- Gitee From 306676c8cf74cae78ef25fc3d7346612ebd492cd Mon Sep 17 00:00:00 2001 From: Yonglong Liu Date: Tue, 2 Apr 2024 09:17:58 +0000 Subject: [PATCH 2/2] net: hns3: update hns3 version to 24.3.1 driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I9D6UN?from=project-issue CVE: NA DTS: DTS2024032619211 ---------------------------- Signed-off-by: Yonglong Liu --- drivers/net/ethernet/hisilicon/hns3/hnae3.h | 2 +- drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_version.h | 2 +- drivers/net/ethernet/hisilicon/hns3/hns3_enet.h | 2 +- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h | 2 +- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h index c48db8a1bd56..dcb5134a3c70 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h +++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h @@ -32,7 +32,7 @@ #include #include -#define HNAE3_MOD_VERSION "24.2.1" +#define HNAE3_MOD_VERSION "24.3.1" #define HNAE3_MIN_VECTOR_NUM 2 /* first one for misc, another for IO */ diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_version.h b/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_version.h index 67ea1ee9c6fd..89610b25622e 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_version.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_cae/hns3_cae_version.h @@ -4,7 +4,7 @@ #ifndef __HNS3_CAE_VERSION_H__ #define __HNS3_CAE_VERSION_H__ -#define HNS3_CAE_MOD_VERSION "24.2.1" +#define HNS3_CAE_MOD_VERSION "24.3.1" #define CMT_ID_LEN 8 #define RESV_LEN 3 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h index fef3d3e95607..1cd9c0c34a76 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h @@ -8,7 +8,7 @@ #include "hnae3.h" -#define HNS3_MOD_VERSION "24.2.1" +#define HNS3_MOD_VERSION "24.3.1" extern char hns3_driver_version[]; diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h index 5233baf5a2a3..9fbaceaa939f 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h @@ -12,7 +12,7 @@ #include "hclge_cmd.h" #include "hnae3.h" -#define HCLGE_MOD_VERSION "24.2.1" +#define HCLGE_MOD_VERSION "24.3.1" #define HCLGE_DRIVER_NAME "hclge" #define HCLGE_MAX_PF_NUM 8 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h index 598b0766d0d1..a64d7f1f6ffa 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h @@ -10,7 +10,7 @@ #include "hclgevf_cmd.h" #include "hnae3.h" -#define HCLGEVF_MOD_VERSION "24.2.1" +#define HCLGEVF_MOD_VERSION "24.3.1" #define HCLGEVF_DRIVER_NAME "hclgevf" #define HCLGEVF_MAX_VLAN_ID 4095 -- Gitee