This patchset refactors the MAC table management, configure
the MAC address asynchronously, instead of synchronously.
Base on this change, it also refines the handle of promisc
mode and filter table entries restoring after reset.
change logs:
V2: add patch #9 to remove an unnecessary NULL check suggested
by Jakub Kicinski.
Huazhong Tan (1):
net: hns3: remove an unnecessary check in hclge_set_umv_space()
Jian Shen (8):
net: hns3: refine for unicast MAC VLAN space management
net: hns3: remove unnecessary parameter 'is_alloc' in
hclge_set_umv_space()
net: hns3: replace num_req_vfs with num_alloc_vport in
hclge_reset_umv_space()
net: hns3: refactor the MAC address configure
net: hns3: add support for dumping UC and MC MAC list
net: hns3: refactor the promisc mode setting
net: hns3: use mutex vport_lock instead of mutex umv_lock
net: hns3: optimize the filter table entries handling when resetting
drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h | 5 +
drivers/net/ethernet/hisilicon/hns3/hnae3.h | 8 +-
drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c | 2 +
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 152 +---
drivers/net/ethernet/hisilicon/hns3/hns3_enet.h | 10 +-
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 2 +-
.../ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c | 51 ++
.../ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 868 ++++++++++++++++-----
.../ethernet/hisilicon/hns3/hns3pf/hclge_main.h | 33 +-
.../net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 70 +-
.../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 368 ++++++++-
.../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h | 26 +
12 files changed, 1166 insertions(+), 429 deletions(-)
--
2.7.4
From: Jian Shen <[email protected]>
Since hclge_set_umv_space() is only called by hclge_init_umv_space(),
so parameter 'is_alloc' is redundant.
Signed-off-by: Jian Shen <[email protected]>
Signed-off-by: Huazhong Tan <[email protected]>
---
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index ccf269a..fe6e60a 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -7195,7 +7195,7 @@ static int hclge_add_mac_vlan_tbl(struct hclge_vport *vport,
}
static int hclge_set_umv_space(struct hclge_dev *hdev, u16 space_size,
- u16 *allocated_size, bool is_alloc)
+ u16 *allocated_size)
{
struct hclge_umv_spc_alc_cmd *req;
struct hclge_desc desc;
@@ -7203,20 +7203,17 @@ static int hclge_set_umv_space(struct hclge_dev *hdev, u16 space_size,
req = (struct hclge_umv_spc_alc_cmd *)desc.data;
hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_MAC_VLAN_ALLOCATE, false);
- if (!is_alloc)
- hnae3_set_bit(req->allocate, HCLGE_UMV_SPC_ALC_B, 1);
req->space_size = cpu_to_le32(space_size);
ret = hclge_cmd_send(&hdev->hw, &desc, 1);
if (ret) {
- dev_err(&hdev->pdev->dev,
- "%s umv space failed for cmd_send, ret =%d\n",
- is_alloc ? "allocate" : "free", ret);
+ dev_err(&hdev->pdev->dev, "failed to set umv space, ret = %d\n",
+ ret);
return ret;
}
- if (is_alloc && allocated_size)
+ if (allocated_size)
*allocated_size = le32_to_cpu(desc.data[1]);
return 0;
@@ -7227,8 +7224,7 @@ static int hclge_init_umv_space(struct hclge_dev *hdev)
u16 allocated_size = 0;
int ret;
- ret = hclge_set_umv_space(hdev, hdev->wanted_umv_size, &allocated_size,
- true);
+ ret = hclge_set_umv_space(hdev, hdev->wanted_umv_size, &allocated_size);
if (ret)
return ret;
--
2.7.4
Hi, david.
This V2 only adds patch #9 in V1. Since V1 has applied, could you pick
patch #9 from V2, or i just resend patch #9?
Thanks:)
On 2020/4/26 10:13, Huazhong Tan wrote:
> This patchset refactors the MAC table management, configure
> the MAC address asynchronously, instead of synchronously.
> Base on this change, it also refines the handle of promisc
> mode and filter table entries restoring after reset.
>
> change logs:
> V2: add patch #9 to remove an unnecessary NULL check suggested
> by Jakub Kicinski.
>
> Huazhong Tan (1):
> net: hns3: remove an unnecessary check in hclge_set_umv_space()
>
> Jian Shen (8):
> net: hns3: refine for unicast MAC VLAN space management
> net: hns3: remove unnecessary parameter 'is_alloc' in
> hclge_set_umv_space()
> net: hns3: replace num_req_vfs with num_alloc_vport in
> hclge_reset_umv_space()
> net: hns3: refactor the MAC address configure
> net: hns3: add support for dumping UC and MC MAC list
> net: hns3: refactor the promisc mode setting
> net: hns3: use mutex vport_lock instead of mutex umv_lock
> net: hns3: optimize the filter table entries handling when resetting
>
> drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h | 5 +
> drivers/net/ethernet/hisilicon/hns3/hnae3.h | 8 +-
> drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c | 2 +
> drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 152 +---
> drivers/net/ethernet/hisilicon/hns3/hns3_enet.h | 10 +-
> drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 2 +-
> .../ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c | 51 ++
> .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 868 ++++++++++++++++-----
> .../ethernet/hisilicon/hns3/hns3pf/hclge_main.h | 33 +-
> .../net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 70 +-
> .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 368 ++++++++-
> .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h | 26 +
> 12 files changed, 1166 insertions(+), 429 deletions(-)
>
From: tanhuazhong <[email protected]>
Date: Sun, 26 Apr 2020 11:44:18 +0800
> This V2 only adds patch #9 in V1. Since V1 has applied, could you pick
> patch #9 from V2, or i just resend patch #9?
I applied patch #9 from V2.