!135 synchronize dmadev and refactor for hns3 PMD
From: @speech_white Reviewed-by: @li-yangyang20 Signed-off-by: @li-yangyang20
This commit is contained in:
commit
587ea78194
33
0234-app-testpmd-delete-unused-function.patch
Normal file
33
0234-app-testpmd-delete-unused-function.patch
Normal file
@ -0,0 +1,33 @@
|
||||
From 888d05e90f1dd78cd5075048206e573b0e30e40c Mon Sep 17 00:00:00 2001
|
||||
From: "Min Hu (Connor)" <humin29@huawei.com>
|
||||
Date: Wed, 10 Nov 2021 16:50:56 +0800
|
||||
Subject: [PATCH 01/33] app/testpmd: delete unused function
|
||||
|
||||
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
|
||||
---
|
||||
app/test-pmd/testpmd.c | 9 ---------
|
||||
1 file changed, 9 deletions(-)
|
||||
|
||||
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
|
||||
index 50a2a5a94..e3b5a165d 100644
|
||||
--- a/app/test-pmd/testpmd.c
|
||||
+++ b/app/test-pmd/testpmd.c
|
||||
@@ -552,15 +552,6 @@ mempool_free_mp(struct rte_mempool *mp)
|
||||
rte_mempool_free(mp);
|
||||
}
|
||||
|
||||
-static int
|
||||
-eth_dev_set_mtu_mp(uint16_t port_id, uint16_t mtu)
|
||||
-{
|
||||
- if (is_proc_primary())
|
||||
- return rte_eth_dev_set_mtu(port_id, mtu);
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
/* Forward function declarations */
|
||||
static void setup_attached_port(portid_t pi);
|
||||
static void check_all_ports_link_status(uint32_t port_mask);
|
||||
--
|
||||
2.33.0
|
||||
|
||||
7487
0235-dmadev-introduce-DMA-device-support.patch
Normal file
7487
0235-dmadev-introduce-DMA-device-support.patch
Normal file
File diff suppressed because it is too large
Load Diff
75
0236-net-hns3-rename-multicast-address-function.patch
Normal file
75
0236-net-hns3-rename-multicast-address-function.patch
Normal file
@ -0,0 +1,75 @@
|
||||
From d7faa4a4fee44a2fdaa003e3ab8df477d710f76c Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Fri, 22 Oct 2021 17:19:52 +0800
|
||||
Subject: [PATCH 03/33] net/hns3: rename multicast address function
|
||||
|
||||
This patch renames hns3_add_mc_addr() to hns3_add_mc_mac_addr().
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_ethdev.c | 14 +++++++-------
|
||||
1 file changed, 7 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
|
||||
index 2ae4cb9b7..b67386b1f 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.c
|
||||
@@ -95,8 +95,8 @@ static int hns3_vlan_pvid_configure(struct hns3_adapter *hns, uint16_t pvid,
|
||||
static int hns3_update_link_info(struct rte_eth_dev *eth_dev);
|
||||
static bool hns3_update_link_status(struct hns3_hw *hw);
|
||||
|
||||
-static int hns3_add_mc_addr(struct hns3_hw *hw,
|
||||
- struct rte_ether_addr *mac_addr);
|
||||
+static int hns3_add_mc_mac_addr(struct hns3_hw *hw,
|
||||
+ struct rte_ether_addr *mac_addr);
|
||||
static int hns3_remove_mc_addr(struct hns3_hw *hw,
|
||||
struct rte_ether_addr *mac_addr);
|
||||
static int hns3_restore_fec(struct hns3_hw *hw);
|
||||
@@ -1630,7 +1630,7 @@ hns3_add_mc_addr_common(struct hns3_hw *hw, struct rte_ether_addr *mac_addr)
|
||||
}
|
||||
}
|
||||
|
||||
- ret = hns3_add_mc_addr(hw, mac_addr);
|
||||
+ ret = hns3_add_mc_mac_addr(hw, mac_addr);
|
||||
if (ret) {
|
||||
hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
|
||||
mac_addr);
|
||||
@@ -1826,7 +1826,7 @@ hns3_configure_all_mac_addr(struct hns3_adapter *hns, bool del)
|
||||
continue;
|
||||
if (rte_is_multicast_ether_addr(addr))
|
||||
ret = del ? hns3_remove_mc_addr(hw, addr) :
|
||||
- hns3_add_mc_addr(hw, addr);
|
||||
+ hns3_add_mc_mac_addr(hw, addr);
|
||||
else
|
||||
ret = del ? hns3_remove_uc_addr_common(hw, addr) :
|
||||
hns3_add_uc_addr_common(hw, addr);
|
||||
@@ -1872,7 +1872,7 @@ hns3_update_desc_vfid(struct hns3_cmd_desc *desc, uint8_t vfid, bool clr)
|
||||
}
|
||||
|
||||
static int
|
||||
-hns3_add_mc_addr(struct hns3_hw *hw, struct rte_ether_addr *mac_addr)
|
||||
+hns3_add_mc_mac_addr(struct hns3_hw *hw, struct rte_ether_addr *mac_addr)
|
||||
{
|
||||
struct hns3_cmd_desc desc[HNS3_MC_MAC_VLAN_OPS_DESC_NUM];
|
||||
struct hns3_mac_vlan_tbl_entry_cmd req;
|
||||
@@ -2156,7 +2156,7 @@ hns3_set_mc_mac_addr_list(struct rte_eth_dev *dev,
|
||||
/* Add mc mac addresses */
|
||||
for (i = 0; i < add_addr_num; i++) {
|
||||
addr = &add_addr_list[i];
|
||||
- ret = hns3_add_mc_addr(hw, addr);
|
||||
+ ret = hns3_add_mc_mac_addr(hw, addr);
|
||||
if (ret) {
|
||||
rte_spinlock_unlock(&hw->lock);
|
||||
return ret;
|
||||
@@ -2188,7 +2188,7 @@ hns3_configure_all_mc_mac_addr(struct hns3_adapter *hns, bool del)
|
||||
if (del)
|
||||
ret = hns3_remove_mc_addr(hw, addr);
|
||||
else
|
||||
- ret = hns3_add_mc_addr(hw, addr);
|
||||
+ ret = hns3_add_mc_mac_addr(hw, addr);
|
||||
if (ret) {
|
||||
err = ret;
|
||||
hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
|
||||
--
|
||||
2.33.0
|
||||
|
||||
65
0237-net-hns3-rename-unicast-address-function.patch
Normal file
65
0237-net-hns3-rename-unicast-address-function.patch
Normal file
@ -0,0 +1,65 @@
|
||||
From 5182a373038fc21368ffb61450e5e63d63471d4f Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Fri, 22 Oct 2021 17:19:53 +0800
|
||||
Subject: [PATCH 04/33] net/hns3: rename unicast address function
|
||||
|
||||
This patch renames hns3_add_uc_addr() to hns3_add_uc_mac_addr().
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_ethdev.c | 10 +++++-----
|
||||
1 file changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
|
||||
index b67386b1f..83472a83b 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.c
|
||||
@@ -1540,7 +1540,7 @@ hns3_remove_mac_vlan_tbl(struct hns3_hw *hw,
|
||||
}
|
||||
|
||||
static int
|
||||
-hns3_add_uc_addr_common(struct hns3_hw *hw, struct rte_ether_addr *mac_addr)
|
||||
+hns3_add_uc_mac_addr(struct hns3_hw *hw, struct rte_ether_addr *mac_addr)
|
||||
{
|
||||
struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
|
||||
struct hns3_mac_vlan_tbl_entry_cmd req;
|
||||
@@ -1678,7 +1678,7 @@ hns3_add_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr,
|
||||
if (rte_is_multicast_ether_addr(mac_addr))
|
||||
ret = hns3_add_mc_addr_common(hw, mac_addr);
|
||||
else
|
||||
- ret = hns3_add_uc_addr_common(hw, mac_addr);
|
||||
+ ret = hns3_add_uc_mac_addr(hw, mac_addr);
|
||||
|
||||
if (ret) {
|
||||
rte_spinlock_unlock(&hw->lock);
|
||||
@@ -1768,7 +1768,7 @@ hns3_set_default_mac_addr(struct rte_eth_dev *dev,
|
||||
return ret;
|
||||
}
|
||||
|
||||
- ret = hns3_add_uc_addr_common(hw, mac_addr);
|
||||
+ ret = hns3_add_uc_mac_addr(hw, mac_addr);
|
||||
if (ret) {
|
||||
hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
|
||||
mac_addr);
|
||||
@@ -1799,7 +1799,7 @@ hns3_set_default_mac_addr(struct rte_eth_dev *dev,
|
||||
}
|
||||
|
||||
err_add_uc_addr:
|
||||
- ret_val = hns3_add_uc_addr_common(hw, oaddr);
|
||||
+ ret_val = hns3_add_uc_mac_addr(hw, oaddr);
|
||||
if (ret_val) {
|
||||
hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE, oaddr);
|
||||
hns3_warn(hw, "Failed to restore old uc mac addr(%s): %d",
|
||||
@@ -1829,7 +1829,7 @@ hns3_configure_all_mac_addr(struct hns3_adapter *hns, bool del)
|
||||
hns3_add_mc_mac_addr(hw, addr);
|
||||
else
|
||||
ret = del ? hns3_remove_uc_addr_common(hw, addr) :
|
||||
- hns3_add_uc_addr_common(hw, addr);
|
||||
+ hns3_add_uc_mac_addr(hw, addr);
|
||||
|
||||
if (ret) {
|
||||
err = ret;
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -0,0 +1,76 @@
|
||||
From 11e3b4820eba69f93a623565609fa3e48de6dbdb Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Fri, 22 Oct 2021 17:19:54 +0800
|
||||
Subject: [PATCH 05/33] net/hns3: rename multicast address removal function
|
||||
|
||||
This patch renames hns3_remove_mc_addr() to hns3_remove_mc_mac_addr().
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_ethdev.c | 14 +++++++-------
|
||||
1 file changed, 7 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
|
||||
index 83472a83b..e0ec99811 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.c
|
||||
@@ -97,8 +97,8 @@ static bool hns3_update_link_status(struct hns3_hw *hw);
|
||||
|
||||
static int hns3_add_mc_mac_addr(struct hns3_hw *hw,
|
||||
struct rte_ether_addr *mac_addr);
|
||||
-static int hns3_remove_mc_addr(struct hns3_hw *hw,
|
||||
- struct rte_ether_addr *mac_addr);
|
||||
+static int hns3_remove_mc_mac_addr(struct hns3_hw *hw,
|
||||
+ struct rte_ether_addr *mac_addr);
|
||||
static int hns3_restore_fec(struct hns3_hw *hw);
|
||||
static int hns3_query_dev_fec_info(struct hns3_hw *hw);
|
||||
static int hns3_do_stop(struct hns3_adapter *hns);
|
||||
@@ -1646,7 +1646,7 @@ hns3_remove_mc_addr_common(struct hns3_hw *hw, struct rte_ether_addr *mac_addr)
|
||||
char mac_str[RTE_ETHER_ADDR_FMT_SIZE];
|
||||
int ret;
|
||||
|
||||
- ret = hns3_remove_mc_addr(hw, mac_addr);
|
||||
+ ret = hns3_remove_mc_mac_addr(hw, mac_addr);
|
||||
if (ret) {
|
||||
hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
|
||||
mac_addr);
|
||||
@@ -1825,7 +1825,7 @@ hns3_configure_all_mac_addr(struct hns3_adapter *hns, bool del)
|
||||
if (rte_is_zero_ether_addr(addr))
|
||||
continue;
|
||||
if (rte_is_multicast_ether_addr(addr))
|
||||
- ret = del ? hns3_remove_mc_addr(hw, addr) :
|
||||
+ ret = del ? hns3_remove_mc_mac_addr(hw, addr) :
|
||||
hns3_add_mc_mac_addr(hw, addr);
|
||||
else
|
||||
ret = del ? hns3_remove_uc_addr_common(hw, addr) :
|
||||
@@ -1921,7 +1921,7 @@ hns3_add_mc_mac_addr(struct hns3_hw *hw, struct rte_ether_addr *mac_addr)
|
||||
}
|
||||
|
||||
static int
|
||||
-hns3_remove_mc_addr(struct hns3_hw *hw, struct rte_ether_addr *mac_addr)
|
||||
+hns3_remove_mc_mac_addr(struct hns3_hw *hw, struct rte_ether_addr *mac_addr)
|
||||
{
|
||||
struct hns3_mac_vlan_tbl_entry_cmd req;
|
||||
struct hns3_cmd_desc desc[3];
|
||||
@@ -2145,7 +2145,7 @@ hns3_set_mc_mac_addr_list(struct rte_eth_dev *dev,
|
||||
for (i = 0; i < rm_addr_num; i++) {
|
||||
num = rm_addr_num - i - 1;
|
||||
addr = &rm_addr_list[num];
|
||||
- ret = hns3_remove_mc_addr(hw, addr);
|
||||
+ ret = hns3_remove_mc_mac_addr(hw, addr);
|
||||
if (ret) {
|
||||
rte_spinlock_unlock(&hw->lock);
|
||||
return ret;
|
||||
@@ -2186,7 +2186,7 @@ hns3_configure_all_mc_mac_addr(struct hns3_adapter *hns, bool del)
|
||||
if (!rte_is_multicast_ether_addr(addr))
|
||||
continue;
|
||||
if (del)
|
||||
- ret = hns3_remove_mc_addr(hw, addr);
|
||||
+ ret = hns3_remove_mc_mac_addr(hw, addr);
|
||||
else
|
||||
ret = hns3_add_mc_mac_addr(hw, addr);
|
||||
if (ret) {
|
||||
--
|
||||
2.33.0
|
||||
|
||||
114
0239-net-hns3-extract-common-interface-to-check-duplicate.patch
Normal file
114
0239-net-hns3-extract-common-interface-to-check-duplicate.patch
Normal file
@ -0,0 +1,114 @@
|
||||
From e7ad3ead98f61e7f759293ad05dfe48627c72e2c Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Fri, 22 Oct 2021 17:19:55 +0800
|
||||
Subject: [PATCH 06/33] net/hns3: extract common interface to check duplicates
|
||||
|
||||
Extract a common interface for PF and VF to check whether the configured
|
||||
multicast MAC address from rte_eth_dev_mac_addr_add() is the same as the
|
||||
multicast MAC address from rte_eth_dev_set_mc_addr_list().
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_ethdev.c | 25 ++++++++++++++++++-------
|
||||
drivers/net/hns3/hns3_ethdev.h | 4 ++++
|
||||
drivers/net/hns3/hns3_ethdev_vf.c | 16 ++--------------
|
||||
3 files changed, 24 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
|
||||
index e0ec99811..f1346ee9f 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.c
|
||||
@@ -1609,27 +1609,38 @@ hns3_add_uc_mac_addr(struct hns3_hw *hw, struct rte_ether_addr *mac_addr)
|
||||
return ret;
|
||||
}
|
||||
|
||||
-static int
|
||||
-hns3_add_mc_addr_common(struct hns3_hw *hw, struct rte_ether_addr *mac_addr)
|
||||
+bool
|
||||
+hns3_find_duplicate_mc_addr(struct hns3_hw *hw, struct rte_ether_addr *mc_addr)
|
||||
{
|
||||
char mac_str[RTE_ETHER_ADDR_FMT_SIZE];
|
||||
struct rte_ether_addr *addr;
|
||||
- int ret;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < hw->mc_addrs_num; i++) {
|
||||
addr = &hw->mc_addrs[i];
|
||||
- /* Check if there are duplicate addresses */
|
||||
- if (rte_is_same_ether_addr(addr, mac_addr)) {
|
||||
+ /* Check if there are duplicate addresses in mc_addrs[] */
|
||||
+ if (rte_is_same_ether_addr(addr, mc_addr)) {
|
||||
hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
|
||||
- addr);
|
||||
+ addr);
|
||||
hns3_err(hw, "failed to add mc mac addr, same addrs"
|
||||
"(%s) is added by the set_mc_mac_addr_list "
|
||||
"API", mac_str);
|
||||
- return -EINVAL;
|
||||
+ return true;
|
||||
}
|
||||
}
|
||||
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+hns3_add_mc_addr_common(struct hns3_hw *hw, struct rte_ether_addr *mac_addr)
|
||||
+{
|
||||
+ char mac_str[RTE_ETHER_ADDR_FMT_SIZE];
|
||||
+ int ret;
|
||||
+
|
||||
+ if (hns3_find_duplicate_mc_addr(hw, mac_addr))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
ret = hns3_add_mc_mac_addr(hw, mac_addr);
|
||||
if (ret) {
|
||||
hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h
|
||||
index 84f5a9f29..a97406198 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.h
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.h
|
||||
@@ -1049,6 +1049,10 @@ void hns3vf_update_link_status(struct hns3_hw *hw, uint8_t link_status,
|
||||
uint32_t link_speed, uint8_t link_duplex);
|
||||
void hns3_parse_devargs(struct rte_eth_dev *dev);
|
||||
void hns3vf_update_push_lsc_cap(struct hns3_hw *hw, bool supported);
|
||||
+
|
||||
+bool hns3_find_duplicate_mc_addr(struct hns3_hw *hw,
|
||||
+ struct rte_ether_addr *mc_addr);
|
||||
+
|
||||
int hns3_restore_ptp(struct hns3_adapter *hns);
|
||||
int hns3_mbuf_dyn_rx_timestamp_register(struct rte_eth_dev *dev,
|
||||
struct rte_eth_conf *conf);
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
index 29313c2f7..f60849606 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
@@ -208,22 +208,10 @@ static int
|
||||
hns3vf_add_mc_addr_common(struct hns3_hw *hw, struct rte_ether_addr *mac_addr)
|
||||
{
|
||||
char mac_str[RTE_ETHER_ADDR_FMT_SIZE];
|
||||
- struct rte_ether_addr *addr;
|
||||
int ret;
|
||||
- int i;
|
||||
|
||||
- for (i = 0; i < hw->mc_addrs_num; i++) {
|
||||
- addr = &hw->mc_addrs[i];
|
||||
- /* Check if there are duplicate addresses */
|
||||
- if (rte_is_same_ether_addr(addr, mac_addr)) {
|
||||
- hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
|
||||
- addr);
|
||||
- hns3_err(hw, "failed to add mc mac addr, same addrs"
|
||||
- "(%s) is added by the set_mc_mac_addr_list "
|
||||
- "API", mac_str);
|
||||
- return -EINVAL;
|
||||
- }
|
||||
- }
|
||||
+ if (hns3_find_duplicate_mc_addr(hw, mac_addr))
|
||||
+ return -EINVAL;
|
||||
|
||||
ret = hns3vf_add_mc_mac_addr(hw, mac_addr);
|
||||
if (ret) {
|
||||
--
|
||||
2.33.0
|
||||
|
||||
117
0240-net-hns3-remove-redundant-multicast-MAC-interface.patch
Normal file
117
0240-net-hns3-remove-redundant-multicast-MAC-interface.patch
Normal file
@ -0,0 +1,117 @@
|
||||
From b84b0e518dc64f3aada5b30511db1c6f6fdb0694 Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Fri, 22 Oct 2021 17:19:56 +0800
|
||||
Subject: [PATCH 07/33] net/hns3: remove redundant multicast MAC interface
|
||||
|
||||
This patch removes hns3_add_mc_addr_common() in PF and
|
||||
hns3vf_add_mc_addr_common() in VF.
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_ethdev.c | 31 ++++++++-----------------------
|
||||
drivers/net/hns3/hns3_ethdev_vf.c | 30 ++++++++----------------------
|
||||
2 files changed, 16 insertions(+), 45 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
|
||||
index f1346ee9f..7f4419c54 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.c
|
||||
@@ -1632,25 +1632,6 @@ hns3_find_duplicate_mc_addr(struct hns3_hw *hw, struct rte_ether_addr *mc_addr)
|
||||
return false;
|
||||
}
|
||||
|
||||
-static int
|
||||
-hns3_add_mc_addr_common(struct hns3_hw *hw, struct rte_ether_addr *mac_addr)
|
||||
-{
|
||||
- char mac_str[RTE_ETHER_ADDR_FMT_SIZE];
|
||||
- int ret;
|
||||
-
|
||||
- if (hns3_find_duplicate_mc_addr(hw, mac_addr))
|
||||
- return -EINVAL;
|
||||
-
|
||||
- ret = hns3_add_mc_mac_addr(hw, mac_addr);
|
||||
- if (ret) {
|
||||
- hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
|
||||
- mac_addr);
|
||||
- hns3_err(hw, "failed to add mc mac addr(%s), ret = %d",
|
||||
- mac_str, ret);
|
||||
- }
|
||||
- return ret;
|
||||
-}
|
||||
-
|
||||
static int
|
||||
hns3_remove_mc_addr_common(struct hns3_hw *hw, struct rte_ether_addr *mac_addr)
|
||||
{
|
||||
@@ -1686,11 +1667,15 @@ hns3_add_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr,
|
||||
* using the rte_eth_dev_mac_addr_add API function to set MC mac address
|
||||
* may affect the specifications of UC mac addresses.
|
||||
*/
|
||||
- if (rte_is_multicast_ether_addr(mac_addr))
|
||||
- ret = hns3_add_mc_addr_common(hw, mac_addr);
|
||||
- else
|
||||
+ if (rte_is_multicast_ether_addr(mac_addr)) {
|
||||
+ if (hns3_find_duplicate_mc_addr(hw, mac_addr)) {
|
||||
+ rte_spinlock_unlock(&hw->lock);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+ ret = hns3_add_mc_mac_addr(hw, mac_addr);
|
||||
+ } else {
|
||||
ret = hns3_add_uc_mac_addr(hw, mac_addr);
|
||||
-
|
||||
+ }
|
||||
if (ret) {
|
||||
rte_spinlock_unlock(&hw->lock);
|
||||
hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
index f60849606..92673d29b 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
@@ -204,25 +204,6 @@ hns3vf_remove_uc_mac_addr(struct hns3_hw *hw, struct rte_ether_addr *mac_addr)
|
||||
return ret;
|
||||
}
|
||||
|
||||
-static int
|
||||
-hns3vf_add_mc_addr_common(struct hns3_hw *hw, struct rte_ether_addr *mac_addr)
|
||||
-{
|
||||
- char mac_str[RTE_ETHER_ADDR_FMT_SIZE];
|
||||
- int ret;
|
||||
-
|
||||
- if (hns3_find_duplicate_mc_addr(hw, mac_addr))
|
||||
- return -EINVAL;
|
||||
-
|
||||
- ret = hns3vf_add_mc_mac_addr(hw, mac_addr);
|
||||
- if (ret) {
|
||||
- hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
|
||||
- mac_addr);
|
||||
- hns3_err(hw, "failed to add mc mac addr(%s), ret = %d",
|
||||
- mac_str, ret);
|
||||
- }
|
||||
- return ret;
|
||||
-}
|
||||
-
|
||||
static int
|
||||
hns3vf_add_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr,
|
||||
__rte_unused uint32_t idx,
|
||||
@@ -243,10 +224,15 @@ hns3vf_add_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr,
|
||||
* using the rte_eth_dev_mac_addr_add API function to set MC mac address
|
||||
* may affect the specifications of UC mac addresses.
|
||||
*/
|
||||
- if (rte_is_multicast_ether_addr(mac_addr))
|
||||
- ret = hns3vf_add_mc_addr_common(hw, mac_addr);
|
||||
- else
|
||||
+ if (rte_is_multicast_ether_addr(mac_addr)) {
|
||||
+ if (hns3_find_duplicate_mc_addr(hw, mac_addr)) {
|
||||
+ rte_spinlock_unlock(&hw->lock);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+ ret = hns3vf_add_mc_mac_addr(hw, mac_addr);
|
||||
+ } else {
|
||||
ret = hns3vf_add_uc_mac_addr(hw, mac_addr);
|
||||
+ }
|
||||
|
||||
rte_spinlock_unlock(&hw->lock);
|
||||
if (ret) {
|
||||
--
|
||||
2.33.0
|
||||
|
||||
66
0241-net-hns3-rename-unicast-address-removal-function.patch
Normal file
66
0241-net-hns3-rename-unicast-address-removal-function.patch
Normal file
@ -0,0 +1,66 @@
|
||||
From d89d75e54b10a18d40306e3dcc8921275cc9b81b Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Fri, 22 Oct 2021 17:19:57 +0800
|
||||
Subject: [PATCH 08/33] net/hns3: rename unicast address removal function
|
||||
|
||||
This patch renames hns3_remove_uc_addr_common() to
|
||||
hns3_remove_uc_mac_addr() in PF.
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_ethdev.c | 10 +++++-----
|
||||
1 file changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
|
||||
index 7f4419c54..485995a43 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.c
|
||||
@@ -1691,7 +1691,7 @@ hns3_add_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr,
|
||||
}
|
||||
|
||||
static int
|
||||
-hns3_remove_uc_addr_common(struct hns3_hw *hw, struct rte_ether_addr *mac_addr)
|
||||
+hns3_remove_uc_mac_addr(struct hns3_hw *hw, struct rte_ether_addr *mac_addr)
|
||||
{
|
||||
struct hns3_mac_vlan_tbl_entry_cmd req;
|
||||
char mac_str[RTE_ETHER_ADDR_FMT_SIZE];
|
||||
@@ -1732,7 +1732,7 @@ hns3_remove_mac_addr(struct rte_eth_dev *dev, uint32_t idx)
|
||||
if (rte_is_multicast_ether_addr(mac_addr))
|
||||
ret = hns3_remove_mc_addr_common(hw, mac_addr);
|
||||
else
|
||||
- ret = hns3_remove_uc_addr_common(hw, mac_addr);
|
||||
+ ret = hns3_remove_uc_mac_addr(hw, mac_addr);
|
||||
rte_spinlock_unlock(&hw->lock);
|
||||
if (ret) {
|
||||
hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
|
||||
@@ -1753,7 +1753,7 @@ hns3_set_default_mac_addr(struct rte_eth_dev *dev,
|
||||
|
||||
rte_spinlock_lock(&hw->lock);
|
||||
oaddr = (struct rte_ether_addr *)hw->mac.mac_addr;
|
||||
- ret = hns3_remove_uc_addr_common(hw, oaddr);
|
||||
+ ret = hns3_remove_uc_mac_addr(hw, oaddr);
|
||||
if (ret) {
|
||||
hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
|
||||
oaddr);
|
||||
@@ -1785,7 +1785,7 @@ hns3_set_default_mac_addr(struct rte_eth_dev *dev,
|
||||
return 0;
|
||||
|
||||
err_pause_addr_cfg:
|
||||
- ret_val = hns3_remove_uc_addr_common(hw, mac_addr);
|
||||
+ ret_val = hns3_remove_uc_mac_addr(hw, mac_addr);
|
||||
if (ret_val) {
|
||||
hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
|
||||
mac_addr);
|
||||
@@ -1824,7 +1824,7 @@ hns3_configure_all_mac_addr(struct hns3_adapter *hns, bool del)
|
||||
ret = del ? hns3_remove_mc_mac_addr(hw, addr) :
|
||||
hns3_add_mc_mac_addr(hw, addr);
|
||||
else
|
||||
- ret = del ? hns3_remove_uc_addr_common(hw, addr) :
|
||||
+ ret = del ? hns3_remove_uc_mac_addr(hw, addr) :
|
||||
hns3_add_uc_mac_addr(hw, addr);
|
||||
|
||||
if (ret) {
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -0,0 +1,53 @@
|
||||
From 3e96668301de4168ef51a6b43535b851c25290da Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Fri, 22 Oct 2021 17:19:58 +0800
|
||||
Subject: [PATCH 09/33] net/hns3: remove redundant multicast removal interface
|
||||
|
||||
This patch removes redundant hns3_remove_mc_addr_common(), which can be
|
||||
replaced by hns3_remove_mc_mac_addr().
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_ethdev.c | 18 +-----------------
|
||||
1 file changed, 1 insertion(+), 17 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
|
||||
index 485995a43..a2d365a28 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.c
|
||||
@@ -1632,22 +1632,6 @@ hns3_find_duplicate_mc_addr(struct hns3_hw *hw, struct rte_ether_addr *mc_addr)
|
||||
return false;
|
||||
}
|
||||
|
||||
-static int
|
||||
-hns3_remove_mc_addr_common(struct hns3_hw *hw, struct rte_ether_addr *mac_addr)
|
||||
-{
|
||||
- char mac_str[RTE_ETHER_ADDR_FMT_SIZE];
|
||||
- int ret;
|
||||
-
|
||||
- ret = hns3_remove_mc_mac_addr(hw, mac_addr);
|
||||
- if (ret) {
|
||||
- hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
|
||||
- mac_addr);
|
||||
- hns3_err(hw, "failed to remove mc mac addr(%s), ret = %d",
|
||||
- mac_str, ret);
|
||||
- }
|
||||
- return ret;
|
||||
-}
|
||||
-
|
||||
static int
|
||||
hns3_add_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr,
|
||||
__rte_unused uint32_t idx, __rte_unused uint32_t pool)
|
||||
@@ -1730,7 +1714,7 @@ hns3_remove_mac_addr(struct rte_eth_dev *dev, uint32_t idx)
|
||||
rte_spinlock_lock(&hw->lock);
|
||||
|
||||
if (rte_is_multicast_ether_addr(mac_addr))
|
||||
- ret = hns3_remove_mc_addr_common(hw, mac_addr);
|
||||
+ ret = hns3_remove_mc_mac_addr(hw, mac_addr);
|
||||
else
|
||||
ret = hns3_remove_uc_mac_addr(hw, mac_addr);
|
||||
rte_spinlock_unlock(&hw->lock);
|
||||
--
|
||||
2.33.0
|
||||
|
||||
106
0243-net-hns3-add-HW-ops-structure-to-operate-hardware.patch
Normal file
106
0243-net-hns3-add-HW-ops-structure-to-operate-hardware.patch
Normal file
@ -0,0 +1,106 @@
|
||||
From ce3a4cda823aabc34c9166022b0cdb102723ef2a Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Fri, 22 Oct 2021 17:19:59 +0800
|
||||
Subject: [PATCH 10/33] net/hns3: add HW ops structure to operate hardware
|
||||
|
||||
This patch adds hns3_hw_ops structure to operate hardware in PF and VF
|
||||
driver.
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_ethdev.c | 10 ++++++++++
|
||||
drivers/net/hns3/hns3_ethdev.h | 13 +++++++++++++
|
||||
drivers/net/hns3/hns3_ethdev_vf.c | 10 ++++++++++
|
||||
3 files changed, 33 insertions(+)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
|
||||
index a2d365a28..48c6483e1 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.c
|
||||
@@ -7478,6 +7478,15 @@ static const struct hns3_reset_ops hns3_reset_ops = {
|
||||
.start_service = hns3_start_service,
|
||||
};
|
||||
|
||||
+static void
|
||||
+hns3_init_hw_ops(struct hns3_hw *hw)
|
||||
+{
|
||||
+ hw->ops.add_mc_mac_addr = hns3_add_mc_mac_addr;
|
||||
+ hw->ops.del_mc_mac_addr = hns3_remove_mc_mac_addr;
|
||||
+ hw->ops.add_uc_mac_addr = hns3_add_uc_mac_addr;
|
||||
+ hw->ops.del_uc_mac_addr = hns3_remove_uc_mac_addr;
|
||||
+}
|
||||
+
|
||||
static int
|
||||
hns3_dev_init(struct rte_eth_dev *eth_dev)
|
||||
{
|
||||
@@ -7530,6 +7539,7 @@ hns3_dev_init(struct rte_eth_dev *eth_dev)
|
||||
goto err_init_reset;
|
||||
hw->reset.ops = &hns3_reset_ops;
|
||||
|
||||
+ hns3_init_hw_ops(hw);
|
||||
ret = hns3_init_pf(eth_dev);
|
||||
if (ret) {
|
||||
PMD_INIT_LOG(ERR, "Failed to init pf: %d", ret);
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h
|
||||
index a97406198..73947e194 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.h
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.h
|
||||
@@ -428,6 +428,17 @@ struct hns3_reset_data {
|
||||
struct hns3_wait_data *wait_data;
|
||||
};
|
||||
|
||||
+struct hns3_hw_ops {
|
||||
+ int (*add_mc_mac_addr)(struct hns3_hw *hw,
|
||||
+ struct rte_ether_addr *mac_addr);
|
||||
+ int (*del_mc_mac_addr)(struct hns3_hw *hw,
|
||||
+ struct rte_ether_addr *mac_addr);
|
||||
+ int (*add_uc_mac_addr)(struct hns3_hw *hw,
|
||||
+ struct rte_ether_addr *mac_addr);
|
||||
+ int (*del_uc_mac_addr)(struct hns3_hw *hw,
|
||||
+ struct rte_ether_addr *mac_addr);
|
||||
+};
|
||||
+
|
||||
#define HNS3_INTR_MAPPING_VEC_RSV_ONE 0
|
||||
#define HNS3_INTR_MAPPING_VEC_ALL 1
|
||||
|
||||
@@ -638,6 +649,8 @@ struct hns3_hw {
|
||||
struct hns3_rss_filter_list flow_rss_list; /* flow RSS rule list */
|
||||
struct hns3_flow_mem_list flow_list;
|
||||
|
||||
+ struct hns3_hw_ops ops;
|
||||
+
|
||||
/*
|
||||
* PMD setup and configuration is not thread safe. Since it is not
|
||||
* performance sensitive, it is better to guarantee thread-safety
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
index 92673d29b..1020b42e1 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
@@ -2920,6 +2920,15 @@ static const struct hns3_reset_ops hns3vf_reset_ops = {
|
||||
.start_service = hns3vf_start_service,
|
||||
};
|
||||
|
||||
+static void
|
||||
+hns3vf_init_hw_ops(struct hns3_hw *hw)
|
||||
+{
|
||||
+ hw->ops.add_mc_mac_addr = hns3vf_add_mc_mac_addr;
|
||||
+ hw->ops.del_mc_mac_addr = hns3vf_remove_mc_mac_addr;
|
||||
+ hw->ops.add_uc_mac_addr = hns3vf_add_uc_mac_addr;
|
||||
+ hw->ops.del_uc_mac_addr = hns3vf_remove_uc_mac_addr;
|
||||
+}
|
||||
+
|
||||
static int
|
||||
hns3vf_dev_init(struct rte_eth_dev *eth_dev)
|
||||
{
|
||||
@@ -2964,6 +2973,7 @@ hns3vf_dev_init(struct rte_eth_dev *eth_dev)
|
||||
goto err_init_reset;
|
||||
hw->reset.ops = &hns3vf_reset_ops;
|
||||
|
||||
+ hns3vf_init_hw_ops(hw);
|
||||
ret = hns3vf_init_vf(eth_dev);
|
||||
if (ret) {
|
||||
PMD_INIT_LOG(ERR, "Failed to init vf: %d", ret);
|
||||
--
|
||||
2.33.0
|
||||
|
||||
213
0244-net-hns3-use-HW-ops-to-config-MAC-features.patch
Normal file
213
0244-net-hns3-use-HW-ops-to-config-MAC-features.patch
Normal file
@ -0,0 +1,213 @@
|
||||
From 6e06ab138687a620035dbc3643c115d2199f5058 Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Fri, 22 Oct 2021 17:20:00 +0800
|
||||
Subject: [PATCH 11/33] net/hns3: use HW ops to config MAC features
|
||||
|
||||
This patch uses APIs in hns3_hw_ops to configure MAC related features.
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_ethdev.c | 32 +++++++++++++++----------------
|
||||
drivers/net/hns3/hns3_ethdev_vf.c | 27 +++++++++++++-------------
|
||||
2 files changed, 30 insertions(+), 29 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
|
||||
index 48c6483e1..00016d58e 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.c
|
||||
@@ -1656,9 +1656,9 @@ hns3_add_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr,
|
||||
rte_spinlock_unlock(&hw->lock);
|
||||
return -EINVAL;
|
||||
}
|
||||
- ret = hns3_add_mc_mac_addr(hw, mac_addr);
|
||||
+ ret = hw->ops.add_mc_mac_addr(hw, mac_addr);
|
||||
} else {
|
||||
- ret = hns3_add_uc_mac_addr(hw, mac_addr);
|
||||
+ ret = hw->ops.add_uc_mac_addr(hw, mac_addr);
|
||||
}
|
||||
if (ret) {
|
||||
rte_spinlock_unlock(&hw->lock);
|
||||
@@ -1714,9 +1714,9 @@ hns3_remove_mac_addr(struct rte_eth_dev *dev, uint32_t idx)
|
||||
rte_spinlock_lock(&hw->lock);
|
||||
|
||||
if (rte_is_multicast_ether_addr(mac_addr))
|
||||
- ret = hns3_remove_mc_mac_addr(hw, mac_addr);
|
||||
+ ret = hw->ops.del_mc_mac_addr(hw, mac_addr);
|
||||
else
|
||||
- ret = hns3_remove_uc_mac_addr(hw, mac_addr);
|
||||
+ ret = hw->ops.del_uc_mac_addr(hw, mac_addr);
|
||||
rte_spinlock_unlock(&hw->lock);
|
||||
if (ret) {
|
||||
hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
|
||||
@@ -1737,7 +1737,7 @@ hns3_set_default_mac_addr(struct rte_eth_dev *dev,
|
||||
|
||||
rte_spinlock_lock(&hw->lock);
|
||||
oaddr = (struct rte_ether_addr *)hw->mac.mac_addr;
|
||||
- ret = hns3_remove_uc_mac_addr(hw, oaddr);
|
||||
+ ret = hw->ops.del_uc_mac_addr(hw, oaddr);
|
||||
if (ret) {
|
||||
hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
|
||||
oaddr);
|
||||
@@ -1748,7 +1748,7 @@ hns3_set_default_mac_addr(struct rte_eth_dev *dev,
|
||||
return ret;
|
||||
}
|
||||
|
||||
- ret = hns3_add_uc_mac_addr(hw, mac_addr);
|
||||
+ ret = hw->ops.add_uc_mac_addr(hw, mac_addr);
|
||||
if (ret) {
|
||||
hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
|
||||
mac_addr);
|
||||
@@ -1769,7 +1769,7 @@ hns3_set_default_mac_addr(struct rte_eth_dev *dev,
|
||||
return 0;
|
||||
|
||||
err_pause_addr_cfg:
|
||||
- ret_val = hns3_remove_uc_mac_addr(hw, mac_addr);
|
||||
+ ret_val = hw->ops.del_uc_mac_addr(hw, mac_addr);
|
||||
if (ret_val) {
|
||||
hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
|
||||
mac_addr);
|
||||
@@ -1779,7 +1779,7 @@ hns3_set_default_mac_addr(struct rte_eth_dev *dev,
|
||||
}
|
||||
|
||||
err_add_uc_addr:
|
||||
- ret_val = hns3_add_uc_mac_addr(hw, oaddr);
|
||||
+ ret_val = hw->ops.add_uc_mac_addr(hw, oaddr);
|
||||
if (ret_val) {
|
||||
hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE, oaddr);
|
||||
hns3_warn(hw, "Failed to restore old uc mac addr(%s): %d",
|
||||
@@ -1805,11 +1805,11 @@ hns3_configure_all_mac_addr(struct hns3_adapter *hns, bool del)
|
||||
if (rte_is_zero_ether_addr(addr))
|
||||
continue;
|
||||
if (rte_is_multicast_ether_addr(addr))
|
||||
- ret = del ? hns3_remove_mc_mac_addr(hw, addr) :
|
||||
- hns3_add_mc_mac_addr(hw, addr);
|
||||
+ ret = del ? ops->del_mc_mac_addr(hw, addr) :
|
||||
+ ops->add_mc_mac_addr(hw, addr);
|
||||
else
|
||||
- ret = del ? hns3_remove_uc_mac_addr(hw, addr) :
|
||||
- hns3_add_uc_mac_addr(hw, addr);
|
||||
+ ret = del ? ops->del_uc_mac_addr(hw, addr) :
|
||||
+ ops->add_uc_mac_addr(hw, addr);
|
||||
|
||||
if (ret) {
|
||||
err = ret;
|
||||
@@ -2125,7 +2125,7 @@ hns3_set_mc_mac_addr_list(struct rte_eth_dev *dev,
|
||||
for (i = 0; i < rm_addr_num; i++) {
|
||||
num = rm_addr_num - i - 1;
|
||||
addr = &rm_addr_list[num];
|
||||
- ret = hns3_remove_mc_mac_addr(hw, addr);
|
||||
+ ret = hw->ops.del_mc_mac_addr(hw, addr);
|
||||
if (ret) {
|
||||
rte_spinlock_unlock(&hw->lock);
|
||||
return ret;
|
||||
@@ -2136,7 +2136,7 @@ hns3_set_mc_mac_addr_list(struct rte_eth_dev *dev,
|
||||
/* Add mc mac addresses */
|
||||
for (i = 0; i < add_addr_num; i++) {
|
||||
addr = &add_addr_list[i];
|
||||
- ret = hns3_add_mc_mac_addr(hw, addr);
|
||||
+ ret = hw->ops.add_mc_mac_addr(hw, addr);
|
||||
if (ret) {
|
||||
rte_spinlock_unlock(&hw->lock);
|
||||
return ret;
|
||||
@@ -2166,9 +2166,9 @@ hns3_configure_all_mc_mac_addr(struct hns3_adapter *hns, bool del)
|
||||
if (!rte_is_multicast_ether_addr(addr))
|
||||
continue;
|
||||
if (del)
|
||||
- ret = hns3_remove_mc_mac_addr(hw, addr);
|
||||
+ ret = hw->ops.del_mc_mac_addr(hw, addr);
|
||||
else
|
||||
- ret = hns3_add_mc_mac_addr(hw, addr);
|
||||
+ ret = hw->ops.add_mc_mac_addr(hw, addr);
|
||||
if (ret) {
|
||||
err = ret;
|
||||
hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
index 1020b42e1..f9c5e3b4f 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
@@ -229,9 +229,9 @@ hns3vf_add_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr,
|
||||
rte_spinlock_unlock(&hw->lock);
|
||||
return -EINVAL;
|
||||
}
|
||||
- ret = hns3vf_add_mc_mac_addr(hw, mac_addr);
|
||||
+ ret = hw->ops.add_mc_mac_addr(hw, mac_addr);
|
||||
} else {
|
||||
- ret = hns3vf_add_uc_mac_addr(hw, mac_addr);
|
||||
+ ret = hw->ops.add_uc_mac_addr(hw, mac_addr);
|
||||
}
|
||||
|
||||
rte_spinlock_unlock(&hw->lock);
|
||||
@@ -257,9 +257,9 @@ hns3vf_remove_mac_addr(struct rte_eth_dev *dev, uint32_t idx)
|
||||
rte_spinlock_lock(&hw->lock);
|
||||
|
||||
if (rte_is_multicast_ether_addr(mac_addr))
|
||||
- ret = hns3vf_remove_mc_mac_addr(hw, mac_addr);
|
||||
+ ret = hw->ops.del_mc_mac_addr(hw, mac_addr);
|
||||
else
|
||||
- ret = hns3vf_remove_uc_mac_addr(hw, mac_addr);
|
||||
+ ret = hw->ops.del_uc_mac_addr(hw, mac_addr);
|
||||
|
||||
rte_spinlock_unlock(&hw->lock);
|
||||
if (ret) {
|
||||
@@ -326,9 +326,10 @@ hns3vf_set_default_mac_addr(struct rte_eth_dev *dev,
|
||||
static int
|
||||
hns3vf_configure_mac_addr(struct hns3_adapter *hns, bool del)
|
||||
{
|
||||
+ char mac_str[RTE_ETHER_ADDR_FMT_SIZE];
|
||||
struct hns3_hw *hw = &hns->hw;
|
||||
+ struct hns3_hw_ops *ops = &hw->ops;
|
||||
struct rte_ether_addr *addr;
|
||||
- char mac_str[RTE_ETHER_ADDR_FMT_SIZE];
|
||||
int err = 0;
|
||||
int ret;
|
||||
int i;
|
||||
@@ -338,11 +339,11 @@ hns3vf_configure_mac_addr(struct hns3_adapter *hns, bool del)
|
||||
if (rte_is_zero_ether_addr(addr))
|
||||
continue;
|
||||
if (rte_is_multicast_ether_addr(addr))
|
||||
- ret = del ? hns3vf_remove_mc_mac_addr(hw, addr) :
|
||||
- hns3vf_add_mc_mac_addr(hw, addr);
|
||||
+ ret = del ? ops->del_mc_mac_addr(hw, addr) :
|
||||
+ ops->add_mc_mac_addr(hw, addr);
|
||||
else
|
||||
- ret = del ? hns3vf_remove_uc_mac_addr(hw, addr) :
|
||||
- hns3vf_add_uc_mac_addr(hw, addr);
|
||||
+ ret = del ? ops->del_uc_mac_addr(hw, addr) :
|
||||
+ ops->add_uc_mac_addr(hw, addr);
|
||||
|
||||
if (ret) {
|
||||
err = ret;
|
||||
@@ -484,7 +485,7 @@ hns3vf_set_mc_mac_addr_list(struct rte_eth_dev *dev,
|
||||
for (i = 0; i < cur_addr_num; i++) {
|
||||
num = cur_addr_num - i - 1;
|
||||
addr = &hw->mc_addrs[num];
|
||||
- ret = hns3vf_remove_mc_mac_addr(hw, addr);
|
||||
+ ret = hw->ops.del_mc_mac_addr(hw, addr);
|
||||
if (ret) {
|
||||
rte_spinlock_unlock(&hw->lock);
|
||||
return ret;
|
||||
@@ -496,7 +497,7 @@ hns3vf_set_mc_mac_addr_list(struct rte_eth_dev *dev,
|
||||
set_addr_num = (int)nb_mc_addr;
|
||||
for (i = 0; i < set_addr_num; i++) {
|
||||
addr = &mc_addr_set[i];
|
||||
- ret = hns3vf_add_mc_mac_addr(hw, addr);
|
||||
+ ret = hw->ops.add_mc_mac_addr(hw, addr);
|
||||
if (ret) {
|
||||
rte_spinlock_unlock(&hw->lock);
|
||||
return ret;
|
||||
@@ -525,9 +526,9 @@ hns3vf_configure_all_mc_mac_addr(struct hns3_adapter *hns, bool del)
|
||||
if (!rte_is_multicast_ether_addr(addr))
|
||||
continue;
|
||||
if (del)
|
||||
- ret = hns3vf_remove_mc_mac_addr(hw, addr);
|
||||
+ ret = hw->ops.del_mc_mac_addr(hw, addr);
|
||||
else
|
||||
- ret = hns3vf_add_mc_mac_addr(hw, addr);
|
||||
+ ret = hw->ops.add_mc_mac_addr(hw, addr);
|
||||
if (ret) {
|
||||
err = ret;
|
||||
hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
|
||||
--
|
||||
2.33.0
|
||||
|
||||
251
0245-net-hns3-unify-MAC-and-multicast-address-configurati.patch
Normal file
251
0245-net-hns3-unify-MAC-and-multicast-address-configurati.patch
Normal file
@ -0,0 +1,251 @@
|
||||
From 67d013484d9b521fd174e8485f7ebed333195bca Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Fri, 22 Oct 2021 17:20:01 +0800
|
||||
Subject: [PATCH 12/33] net/hns3: unify MAC and multicast address configuration
|
||||
|
||||
Currently, the interface logic for adding and deleting all MAC address
|
||||
and multicast address in PF and VF driver is the same. This patch
|
||||
extracts two common interfaces to configure them separately.
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_ethdev.c | 32 ++++++-------
|
||||
drivers/net/hns3/hns3_ethdev.h | 2 +
|
||||
drivers/net/hns3/hns3_ethdev_vf.c | 77 +++----------------------------
|
||||
3 files changed, 25 insertions(+), 86 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
|
||||
index 00016d58e..bdd29220a 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.c
|
||||
@@ -1790,17 +1790,20 @@ hns3_set_default_mac_addr(struct rte_eth_dev *dev,
|
||||
return ret;
|
||||
}
|
||||
|
||||
-static int
|
||||
+int
|
||||
hns3_configure_all_mac_addr(struct hns3_adapter *hns, bool del)
|
||||
{
|
||||
char mac_str[RTE_ETHER_ADDR_FMT_SIZE];
|
||||
struct hns3_hw *hw = &hns->hw;
|
||||
+ struct hns3_hw_ops *ops = &hw->ops;
|
||||
struct rte_ether_addr *addr;
|
||||
- int err = 0;
|
||||
- int ret;
|
||||
+ uint16_t mac_addrs_capa;
|
||||
+ int ret = 0;
|
||||
int i;
|
||||
|
||||
- for (i = 0; i < HNS3_UC_MACADDR_NUM; i++) {
|
||||
+ mac_addrs_capa =
|
||||
+ hns->is_vf ? HNS3_VF_UC_MACADDR_NUM : HNS3_UC_MACADDR_NUM;
|
||||
+ for (i = 0; i < mac_addrs_capa; i++) {
|
||||
addr = &hw->data->mac_addrs[i];
|
||||
if (rte_is_zero_ether_addr(addr))
|
||||
continue;
|
||||
@@ -1812,15 +1815,14 @@ hns3_configure_all_mac_addr(struct hns3_adapter *hns, bool del)
|
||||
ops->add_uc_mac_addr(hw, addr);
|
||||
|
||||
if (ret) {
|
||||
- err = ret;
|
||||
hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
|
||||
- addr);
|
||||
- hns3_err(hw, "failed to %s mac addr(%s) index:%d "
|
||||
- "ret = %d.", del ? "remove" : "restore",
|
||||
- mac_str, i, ret);
|
||||
+ addr);
|
||||
+ hns3_err(hw, "failed to %s mac addr(%s) index:%d ret = %d.",
|
||||
+ del ? "remove" : "restore", mac_str, i, ret);
|
||||
}
|
||||
}
|
||||
- return err;
|
||||
+
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -2151,14 +2153,13 @@ hns3_set_mc_mac_addr_list(struct rte_eth_dev *dev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int
|
||||
+int
|
||||
hns3_configure_all_mc_mac_addr(struct hns3_adapter *hns, bool del)
|
||||
{
|
||||
char mac_str[RTE_ETHER_ADDR_FMT_SIZE];
|
||||
struct hns3_hw *hw = &hns->hw;
|
||||
struct rte_ether_addr *addr;
|
||||
- int err = 0;
|
||||
- int ret;
|
||||
+ int ret = 0;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < hw->mc_addrs_num; i++) {
|
||||
@@ -2170,14 +2171,13 @@ hns3_configure_all_mc_mac_addr(struct hns3_adapter *hns, bool del)
|
||||
else
|
||||
ret = hw->ops.add_mc_mac_addr(hw, addr);
|
||||
if (ret) {
|
||||
- err = ret;
|
||||
hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
|
||||
addr);
|
||||
- hns3_dbg(hw, "%s mc mac addr: %s failed for pf: ret = %d",
|
||||
+ hns3_dbg(hw, "failed to %s mc mac addr: %s ret = %d",
|
||||
del ? "Remove" : "Restore", mac_str, ret);
|
||||
}
|
||||
}
|
||||
- return err;
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h
|
||||
index 73947e194..942e8419c 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.h
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.h
|
||||
@@ -1065,6 +1065,8 @@ void hns3vf_update_push_lsc_cap(struct hns3_hw *hw, bool supported);
|
||||
|
||||
bool hns3_find_duplicate_mc_addr(struct hns3_hw *hw,
|
||||
struct rte_ether_addr *mc_addr);
|
||||
+int hns3_configure_all_mc_mac_addr(struct hns3_adapter *hns, bool del);
|
||||
+int hns3_configure_all_mac_addr(struct hns3_adapter *hns, bool del);
|
||||
|
||||
int hns3_restore_ptp(struct hns3_adapter *hns);
|
||||
int hns3_mbuf_dyn_rx_timestamp_register(struct rte_eth_dev *dev,
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
index f9c5e3b4f..cce4d3450 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
@@ -323,40 +323,6 @@ hns3vf_set_default_mac_addr(struct rte_eth_dev *dev,
|
||||
return ret;
|
||||
}
|
||||
|
||||
-static int
|
||||
-hns3vf_configure_mac_addr(struct hns3_adapter *hns, bool del)
|
||||
-{
|
||||
- char mac_str[RTE_ETHER_ADDR_FMT_SIZE];
|
||||
- struct hns3_hw *hw = &hns->hw;
|
||||
- struct hns3_hw_ops *ops = &hw->ops;
|
||||
- struct rte_ether_addr *addr;
|
||||
- int err = 0;
|
||||
- int ret;
|
||||
- int i;
|
||||
-
|
||||
- for (i = 0; i < HNS3_VF_UC_MACADDR_NUM; i++) {
|
||||
- addr = &hw->data->mac_addrs[i];
|
||||
- if (rte_is_zero_ether_addr(addr))
|
||||
- continue;
|
||||
- if (rte_is_multicast_ether_addr(addr))
|
||||
- ret = del ? ops->del_mc_mac_addr(hw, addr) :
|
||||
- ops->add_mc_mac_addr(hw, addr);
|
||||
- else
|
||||
- ret = del ? ops->del_uc_mac_addr(hw, addr) :
|
||||
- ops->add_uc_mac_addr(hw, addr);
|
||||
-
|
||||
- if (ret) {
|
||||
- err = ret;
|
||||
- hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
|
||||
- addr);
|
||||
- hns3_err(hw, "failed to %s mac addr(%s) index:%d "
|
||||
- "ret = %d.", del ? "remove" : "restore",
|
||||
- mac_str, i, ret);
|
||||
- }
|
||||
- }
|
||||
- return err;
|
||||
-}
|
||||
-
|
||||
static int
|
||||
hns3vf_add_mc_mac_addr(struct hns3_hw *hw,
|
||||
struct rte_ether_addr *mac_addr)
|
||||
@@ -511,35 +477,6 @@ hns3vf_set_mc_mac_addr_list(struct rte_eth_dev *dev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int
|
||||
-hns3vf_configure_all_mc_mac_addr(struct hns3_adapter *hns, bool del)
|
||||
-{
|
||||
- char mac_str[RTE_ETHER_ADDR_FMT_SIZE];
|
||||
- struct hns3_hw *hw = &hns->hw;
|
||||
- struct rte_ether_addr *addr;
|
||||
- int err = 0;
|
||||
- int ret;
|
||||
- int i;
|
||||
-
|
||||
- for (i = 0; i < hw->mc_addrs_num; i++) {
|
||||
- addr = &hw->mc_addrs[i];
|
||||
- if (!rte_is_multicast_ether_addr(addr))
|
||||
- continue;
|
||||
- if (del)
|
||||
- ret = hw->ops.del_mc_mac_addr(hw, addr);
|
||||
- else
|
||||
- ret = hw->ops.add_mc_mac_addr(hw, addr);
|
||||
- if (ret) {
|
||||
- err = ret;
|
||||
- hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
|
||||
- addr);
|
||||
- hns3_err(hw, "Failed to %s mc mac addr: %s for vf: %d",
|
||||
- del ? "Remove" : "Restore", mac_str, ret);
|
||||
- }
|
||||
- }
|
||||
- return err;
|
||||
-}
|
||||
-
|
||||
static int
|
||||
hns3vf_set_promisc_mode(struct hns3_hw *hw, bool en_bc_pmc,
|
||||
bool en_uc_pmc, bool en_mc_pmc)
|
||||
@@ -2077,7 +2014,7 @@ hns3vf_do_stop(struct hns3_adapter *hns)
|
||||
hns3_dev_release_mbufs(hns);
|
||||
|
||||
if (__atomic_load_n(&hw->reset.disable_cmd, __ATOMIC_RELAXED) == 0) {
|
||||
- hns3vf_configure_mac_addr(hns, true);
|
||||
+ hns3_configure_all_mac_addr(hns, true);
|
||||
ret = hns3_reset_all_tqps(hns);
|
||||
if (ret) {
|
||||
hns3_err(hw, "failed to reset all queues ret = %d",
|
||||
@@ -2172,7 +2109,7 @@ hns3vf_dev_close(struct rte_eth_dev *eth_dev)
|
||||
hns3_reset_abort(hns);
|
||||
hw->adapter_state = HNS3_NIC_CLOSED;
|
||||
rte_eal_alarm_cancel(hns3vf_keep_alive_handler, eth_dev);
|
||||
- hns3vf_configure_all_mc_mac_addr(hns, true);
|
||||
+ hns3_configure_all_mc_mac_addr(hns, true);
|
||||
hns3vf_remove_all_vlan_table(hns);
|
||||
hns3vf_uninit_vf(eth_dev);
|
||||
hns3_free_all_queues(eth_dev);
|
||||
@@ -2598,7 +2535,7 @@ hns3vf_stop_service(struct hns3_adapter *hns)
|
||||
* required to delete the entries.
|
||||
*/
|
||||
if (__atomic_load_n(&hw->reset.disable_cmd, __ATOMIC_RELAXED) == 0)
|
||||
- hns3vf_configure_all_mc_mac_addr(hns, true);
|
||||
+ hns3_configure_all_mc_mac_addr(hns, true);
|
||||
rte_spinlock_unlock(&hw->lock);
|
||||
|
||||
return 0;
|
||||
@@ -2684,11 +2621,11 @@ hns3vf_restore_conf(struct hns3_adapter *hns)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
- ret = hns3vf_configure_mac_addr(hns, false);
|
||||
+ ret = hns3_configure_all_mac_addr(hns, false);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
- ret = hns3vf_configure_all_mc_mac_addr(hns, false);
|
||||
+ ret = hns3_configure_all_mc_mac_addr(hns, false);
|
||||
if (ret)
|
||||
goto err_mc_mac;
|
||||
|
||||
@@ -2729,9 +2666,9 @@ hns3vf_restore_conf(struct hns3_adapter *hns)
|
||||
return 0;
|
||||
|
||||
err_vlan_table:
|
||||
- hns3vf_configure_all_mc_mac_addr(hns, true);
|
||||
+ hns3_configure_all_mc_mac_addr(hns, true);
|
||||
err_mc_mac:
|
||||
- hns3vf_configure_mac_addr(hns, true);
|
||||
+ hns3_configure_all_mac_addr(hns, true);
|
||||
return ret;
|
||||
}
|
||||
|
||||
--
|
||||
2.33.0
|
||||
|
||||
177
0246-net-hns3-unify-MAC-address-add-and-remove.patch
Normal file
177
0246-net-hns3-unify-MAC-address-add-and-remove.patch
Normal file
@ -0,0 +1,177 @@
|
||||
From f1e4c77136cc5d65606ad07cd7204c0994c14904 Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Fri, 22 Oct 2021 17:20:02 +0800
|
||||
Subject: [PATCH 13/33] net/hns3: unify MAC address add and remove
|
||||
|
||||
The code logic of adding and removing MAC address in PF and VF is the
|
||||
same.
|
||||
This patch extracts two common interfaces to add and remove them
|
||||
separately.
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_ethdev.c | 11 ++---
|
||||
drivers/net/hns3/hns3_ethdev.h | 5 ++-
|
||||
drivers/net/hns3/hns3_ethdev_vf.c | 70 +------------------------------
|
||||
3 files changed, 9 insertions(+), 77 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
|
||||
index bdd29220a..bf49d5f75 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.c
|
||||
@@ -1609,7 +1609,7 @@ hns3_add_uc_mac_addr(struct hns3_hw *hw, struct rte_ether_addr *mac_addr)
|
||||
return ret;
|
||||
}
|
||||
|
||||
-bool
|
||||
+static bool
|
||||
hns3_find_duplicate_mc_addr(struct hns3_hw *hw, struct rte_ether_addr *mc_addr)
|
||||
{
|
||||
char mac_str[RTE_ETHER_ADDR_FMT_SIZE];
|
||||
@@ -1632,7 +1632,7 @@ hns3_find_duplicate_mc_addr(struct hns3_hw *hw, struct rte_ether_addr *mc_addr)
|
||||
return false;
|
||||
}
|
||||
|
||||
-static int
|
||||
+int
|
||||
hns3_add_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr,
|
||||
__rte_unused uint32_t idx, __rte_unused uint32_t pool)
|
||||
{
|
||||
@@ -1660,17 +1660,14 @@ hns3_add_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr,
|
||||
} else {
|
||||
ret = hw->ops.add_uc_mac_addr(hw, mac_addr);
|
||||
}
|
||||
+ rte_spinlock_unlock(&hw->lock);
|
||||
if (ret) {
|
||||
- rte_spinlock_unlock(&hw->lock);
|
||||
hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
|
||||
mac_addr);
|
||||
hns3_err(hw, "failed to add mac addr(%s), ret = %d", mac_str,
|
||||
ret);
|
||||
- return ret;
|
||||
}
|
||||
|
||||
- rte_spinlock_unlock(&hw->lock);
|
||||
-
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1702,7 +1699,7 @@ hns3_remove_uc_mac_addr(struct hns3_hw *hw, struct rte_ether_addr *mac_addr)
|
||||
return ret;
|
||||
}
|
||||
|
||||
-static void
|
||||
+void
|
||||
hns3_remove_mac_addr(struct rte_eth_dev *dev, uint32_t idx)
|
||||
{
|
||||
struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h
|
||||
index 942e8419c..276ac8b54 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.h
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.h
|
||||
@@ -1063,10 +1063,11 @@ void hns3vf_update_link_status(struct hns3_hw *hw, uint8_t link_status,
|
||||
void hns3_parse_devargs(struct rte_eth_dev *dev);
|
||||
void hns3vf_update_push_lsc_cap(struct hns3_hw *hw, bool supported);
|
||||
|
||||
-bool hns3_find_duplicate_mc_addr(struct hns3_hw *hw,
|
||||
- struct rte_ether_addr *mc_addr);
|
||||
int hns3_configure_all_mc_mac_addr(struct hns3_adapter *hns, bool del);
|
||||
int hns3_configure_all_mac_addr(struct hns3_adapter *hns, bool del);
|
||||
+int hns3_add_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr,
|
||||
+ __rte_unused uint32_t idx, __rte_unused uint32_t pool);
|
||||
+void hns3_remove_mac_addr(struct rte_eth_dev *dev, uint32_t idx);
|
||||
|
||||
int hns3_restore_ptp(struct hns3_adapter *hns);
|
||||
int hns3_mbuf_dyn_rx_timestamp_register(struct rte_eth_dev *dev,
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
index cce4d3450..fb7eda21d 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
@@ -204,72 +204,6 @@ hns3vf_remove_uc_mac_addr(struct hns3_hw *hw, struct rte_ether_addr *mac_addr)
|
||||
return ret;
|
||||
}
|
||||
|
||||
-static int
|
||||
-hns3vf_add_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr,
|
||||
- __rte_unused uint32_t idx,
|
||||
- __rte_unused uint32_t pool)
|
||||
-{
|
||||
- struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
|
||||
- char mac_str[RTE_ETHER_ADDR_FMT_SIZE];
|
||||
- int ret;
|
||||
-
|
||||
- rte_spinlock_lock(&hw->lock);
|
||||
-
|
||||
- /*
|
||||
- * In hns3 network engine adding UC and MC mac address with different
|
||||
- * commands with firmware. We need to determine whether the input
|
||||
- * address is a UC or a MC address to call different commands.
|
||||
- * By the way, it is recommended calling the API function named
|
||||
- * rte_eth_dev_set_mc_addr_list to set the MC mac address, because
|
||||
- * using the rte_eth_dev_mac_addr_add API function to set MC mac address
|
||||
- * may affect the specifications of UC mac addresses.
|
||||
- */
|
||||
- if (rte_is_multicast_ether_addr(mac_addr)) {
|
||||
- if (hns3_find_duplicate_mc_addr(hw, mac_addr)) {
|
||||
- rte_spinlock_unlock(&hw->lock);
|
||||
- return -EINVAL;
|
||||
- }
|
||||
- ret = hw->ops.add_mc_mac_addr(hw, mac_addr);
|
||||
- } else {
|
||||
- ret = hw->ops.add_uc_mac_addr(hw, mac_addr);
|
||||
- }
|
||||
-
|
||||
- rte_spinlock_unlock(&hw->lock);
|
||||
- if (ret) {
|
||||
- hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
|
||||
- mac_addr);
|
||||
- hns3_err(hw, "failed to add mac addr(%s), ret = %d", mac_str,
|
||||
- ret);
|
||||
- }
|
||||
-
|
||||
- return ret;
|
||||
-}
|
||||
-
|
||||
-static void
|
||||
-hns3vf_remove_mac_addr(struct rte_eth_dev *dev, uint32_t idx)
|
||||
-{
|
||||
- struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
|
||||
- /* index will be checked by upper level rte interface */
|
||||
- struct rte_ether_addr *mac_addr = &dev->data->mac_addrs[idx];
|
||||
- char mac_str[RTE_ETHER_ADDR_FMT_SIZE];
|
||||
- int ret;
|
||||
-
|
||||
- rte_spinlock_lock(&hw->lock);
|
||||
-
|
||||
- if (rte_is_multicast_ether_addr(mac_addr))
|
||||
- ret = hw->ops.del_mc_mac_addr(hw, mac_addr);
|
||||
- else
|
||||
- ret = hw->ops.del_uc_mac_addr(hw, mac_addr);
|
||||
-
|
||||
- rte_spinlock_unlock(&hw->lock);
|
||||
- if (ret) {
|
||||
- hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
|
||||
- mac_addr);
|
||||
- hns3_err(hw, "failed to remove mac addr(%s), ret = %d",
|
||||
- mac_str, ret);
|
||||
- }
|
||||
-}
|
||||
-
|
||||
static int
|
||||
hns3vf_set_default_mac_addr(struct rte_eth_dev *dev,
|
||||
struct rte_ether_addr *mac_addr)
|
||||
@@ -2831,8 +2765,8 @@ static const struct eth_dev_ops hns3vf_eth_dev_ops = {
|
||||
.txq_info_get = hns3_txq_info_get,
|
||||
.rx_burst_mode_get = hns3_rx_burst_mode_get,
|
||||
.tx_burst_mode_get = hns3_tx_burst_mode_get,
|
||||
- .mac_addr_add = hns3vf_add_mac_addr,
|
||||
- .mac_addr_remove = hns3vf_remove_mac_addr,
|
||||
+ .mac_addr_add = hns3_add_mac_addr,
|
||||
+ .mac_addr_remove = hns3_remove_mac_addr,
|
||||
.mac_addr_set = hns3vf_set_default_mac_addr,
|
||||
.set_mc_addr_list = hns3vf_set_mc_mac_addr_list,
|
||||
.link_update = hns3vf_dev_link_update,
|
||||
--
|
||||
2.33.0
|
||||
|
||||
157
0247-net-hns3-unify-multicast-address-check.patch
Normal file
157
0247-net-hns3-unify-multicast-address-check.patch
Normal file
@ -0,0 +1,157 @@
|
||||
From 35da8e628f28e84f1f7b1dff10a984a44bae44e0 Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Fri, 22 Oct 2021 17:20:03 +0800
|
||||
Subject: [PATCH 14/33] net/hns3: unify multicast address check
|
||||
|
||||
This patch uniforms a common function to check multicast address
|
||||
validity for PF and VF.
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_ethdev.c | 12 ++++--
|
||||
drivers/net/hns3/hns3_ethdev.h | 4 +-
|
||||
drivers/net/hns3/hns3_ethdev_vf.c | 66 +------------------------------
|
||||
3 files changed, 12 insertions(+), 70 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
|
||||
index bf49d5f75..97129c428 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.c
|
||||
@@ -1947,13 +1947,15 @@ hns3_remove_mc_mac_addr(struct hns3_hw *hw, struct rte_ether_addr *mac_addr)
|
||||
return ret;
|
||||
}
|
||||
|
||||
-static int
|
||||
+int
|
||||
hns3_set_mc_addr_chk_param(struct hns3_hw *hw,
|
||||
struct rte_ether_addr *mc_addr_set,
|
||||
uint32_t nb_mc_addr)
|
||||
{
|
||||
+ struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
|
||||
char mac_str[RTE_ETHER_ADDR_FMT_SIZE];
|
||||
struct rte_ether_addr *addr;
|
||||
+ uint16_t mac_addrs_capa;
|
||||
uint32_t i;
|
||||
uint32_t j;
|
||||
|
||||
@@ -1993,12 +1995,14 @@ hns3_set_mc_addr_chk_param(struct hns3_hw *hw,
|
||||
* Check if there are duplicate addresses between mac_addrs
|
||||
* and mc_addr_set
|
||||
*/
|
||||
- for (j = 0; j < HNS3_UC_MACADDR_NUM; j++) {
|
||||
+ mac_addrs_capa = hns->is_vf ? HNS3_VF_UC_MACADDR_NUM :
|
||||
+ HNS3_UC_MACADDR_NUM;
|
||||
+ for (j = 0; j < mac_addrs_capa; j++) {
|
||||
if (rte_is_same_ether_addr(addr,
|
||||
&hw->data->mac_addrs[j])) {
|
||||
hns3_ether_format_addr(mac_str,
|
||||
- RTE_ETHER_ADDR_FMT_SIZE,
|
||||
- addr);
|
||||
+ RTE_ETHER_ADDR_FMT_SIZE,
|
||||
+ addr);
|
||||
hns3_err(hw, "failed to set mc mac addr, "
|
||||
"addrs invalid. addrs(%s) has already "
|
||||
"configured in mac_addr add API",
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h
|
||||
index 276ac8b54..1606a6407 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.h
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.h
|
||||
@@ -1062,7 +1062,9 @@ void hns3vf_update_link_status(struct hns3_hw *hw, uint8_t link_status,
|
||||
uint32_t link_speed, uint8_t link_duplex);
|
||||
void hns3_parse_devargs(struct rte_eth_dev *dev);
|
||||
void hns3vf_update_push_lsc_cap(struct hns3_hw *hw, bool supported);
|
||||
-
|
||||
+int hns3_set_mc_addr_chk_param(struct hns3_hw *hw,
|
||||
+ struct rte_ether_addr *mc_addr_set,
|
||||
+ uint32_t nb_mc_addr);
|
||||
int hns3_configure_all_mc_mac_addr(struct hns3_adapter *hns, bool del);
|
||||
int hns3_configure_all_mac_addr(struct hns3_adapter *hns, bool del);
|
||||
int hns3_add_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr,
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
index fb7eda21d..835e783c3 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
@@ -299,70 +299,6 @@ hns3vf_remove_mc_mac_addr(struct hns3_hw *hw,
|
||||
return ret;
|
||||
}
|
||||
|
||||
-static int
|
||||
-hns3vf_set_mc_addr_chk_param(struct hns3_hw *hw,
|
||||
- struct rte_ether_addr *mc_addr_set,
|
||||
- uint32_t nb_mc_addr)
|
||||
-{
|
||||
- char mac_str[RTE_ETHER_ADDR_FMT_SIZE];
|
||||
- struct rte_ether_addr *addr;
|
||||
- uint32_t i;
|
||||
- uint32_t j;
|
||||
-
|
||||
- if (nb_mc_addr > HNS3_MC_MACADDR_NUM) {
|
||||
- hns3_err(hw, "failed to set mc mac addr, nb_mc_addr(%u) "
|
||||
- "invalid. valid range: 0~%d",
|
||||
- nb_mc_addr, HNS3_MC_MACADDR_NUM);
|
||||
- return -EINVAL;
|
||||
- }
|
||||
-
|
||||
- /* Check if input mac addresses are valid */
|
||||
- for (i = 0; i < nb_mc_addr; i++) {
|
||||
- addr = &mc_addr_set[i];
|
||||
- if (!rte_is_multicast_ether_addr(addr)) {
|
||||
- hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
|
||||
- addr);
|
||||
- hns3_err(hw,
|
||||
- "failed to set mc mac addr, addr(%s) invalid.",
|
||||
- mac_str);
|
||||
- return -EINVAL;
|
||||
- }
|
||||
-
|
||||
- /* Check if there are duplicate addresses */
|
||||
- for (j = i + 1; j < nb_mc_addr; j++) {
|
||||
- if (rte_is_same_ether_addr(addr, &mc_addr_set[j])) {
|
||||
- hns3_ether_format_addr(mac_str,
|
||||
- RTE_ETHER_ADDR_FMT_SIZE,
|
||||
- addr);
|
||||
- hns3_err(hw, "failed to set mc mac addr, "
|
||||
- "addrs invalid. two same addrs(%s).",
|
||||
- mac_str);
|
||||
- return -EINVAL;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- /*
|
||||
- * Check if there are duplicate addresses between mac_addrs
|
||||
- * and mc_addr_set
|
||||
- */
|
||||
- for (j = 0; j < HNS3_VF_UC_MACADDR_NUM; j++) {
|
||||
- if (rte_is_same_ether_addr(addr,
|
||||
- &hw->data->mac_addrs[j])) {
|
||||
- hns3_ether_format_addr(mac_str,
|
||||
- RTE_ETHER_ADDR_FMT_SIZE,
|
||||
- addr);
|
||||
- hns3_err(hw, "failed to set mc mac addr, "
|
||||
- "addrs invalid. addrs(%s) has already "
|
||||
- "configured in mac_addr add API",
|
||||
- mac_str);
|
||||
- return -EINVAL;
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
static int
|
||||
hns3vf_set_mc_mac_addr_list(struct rte_eth_dev *dev,
|
||||
struct rte_ether_addr *mc_addr_set,
|
||||
@@ -376,7 +312,7 @@ hns3vf_set_mc_mac_addr_list(struct rte_eth_dev *dev,
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
- ret = hns3vf_set_mc_addr_chk_param(hw, mc_addr_set, nb_mc_addr);
|
||||
+ ret = hns3_set_mc_addr_chk_param(hw, mc_addr_set, nb_mc_addr);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
--
|
||||
2.33.0
|
||||
|
||||
171
0248-net-hns3-refactor-multicast-MAC-address-set-for-PF.patch
Normal file
171
0248-net-hns3-refactor-multicast-MAC-address-set-for-PF.patch
Normal file
@ -0,0 +1,171 @@
|
||||
From 4696316a47ed084bdfddc5a7fd12ad743643b602 Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Fri, 22 Oct 2021 17:20:04 +0800
|
||||
Subject: [PATCH 15/33] net/hns3: refactor multicast MAC address set for PF
|
||||
|
||||
Currently, when configuring a group of multicast MAC addresses, the PF
|
||||
driver reorder mc_addr array in hw struct to remove multicast MAC
|
||||
addresses that are not in mc_addr_set array from user and then adds new
|
||||
multicast MAC addresses. Actually, it can be simplified by removing all
|
||||
previous MAC addresses and then adding new MAC addresses.
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_ethdev.c | 112 ++++-----------------------------
|
||||
1 file changed, 11 insertions(+), 101 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
|
||||
index 97129c428..dd239f6e7 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.c
|
||||
@@ -2015,94 +2015,15 @@ hns3_set_mc_addr_chk_param(struct hns3_hw *hw,
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static void
|
||||
-hns3_set_mc_addr_calc_addr(struct hns3_hw *hw,
|
||||
- struct rte_ether_addr *mc_addr_set,
|
||||
- int mc_addr_num,
|
||||
- struct rte_ether_addr *reserved_addr_list,
|
||||
- int *reserved_addr_num,
|
||||
- struct rte_ether_addr *add_addr_list,
|
||||
- int *add_addr_num,
|
||||
- struct rte_ether_addr *rm_addr_list,
|
||||
- int *rm_addr_num)
|
||||
-{
|
||||
- struct rte_ether_addr *addr;
|
||||
- int current_addr_num;
|
||||
- int reserved_num = 0;
|
||||
- int add_num = 0;
|
||||
- int rm_num = 0;
|
||||
- int num;
|
||||
- int i;
|
||||
- int j;
|
||||
- bool same_addr;
|
||||
-
|
||||
- /* Calculate the mc mac address list that should be removed */
|
||||
- current_addr_num = hw->mc_addrs_num;
|
||||
- for (i = 0; i < current_addr_num; i++) {
|
||||
- addr = &hw->mc_addrs[i];
|
||||
- same_addr = false;
|
||||
- for (j = 0; j < mc_addr_num; j++) {
|
||||
- if (rte_is_same_ether_addr(addr, &mc_addr_set[j])) {
|
||||
- same_addr = true;
|
||||
- break;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- if (!same_addr) {
|
||||
- rte_ether_addr_copy(addr, &rm_addr_list[rm_num]);
|
||||
- rm_num++;
|
||||
- } else {
|
||||
- rte_ether_addr_copy(addr,
|
||||
- &reserved_addr_list[reserved_num]);
|
||||
- reserved_num++;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- /* Calculate the mc mac address list that should be added */
|
||||
- for (i = 0; i < mc_addr_num; i++) {
|
||||
- addr = &mc_addr_set[i];
|
||||
- same_addr = false;
|
||||
- for (j = 0; j < current_addr_num; j++) {
|
||||
- if (rte_is_same_ether_addr(addr, &hw->mc_addrs[j])) {
|
||||
- same_addr = true;
|
||||
- break;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- if (!same_addr) {
|
||||
- rte_ether_addr_copy(addr, &add_addr_list[add_num]);
|
||||
- add_num++;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- /* Reorder the mc mac address list maintained by driver */
|
||||
- for (i = 0; i < reserved_num; i++)
|
||||
- rte_ether_addr_copy(&reserved_addr_list[i], &hw->mc_addrs[i]);
|
||||
-
|
||||
- for (i = 0; i < rm_num; i++) {
|
||||
- num = reserved_num + i;
|
||||
- rte_ether_addr_copy(&rm_addr_list[i], &hw->mc_addrs[num]);
|
||||
- }
|
||||
-
|
||||
- *reserved_addr_num = reserved_num;
|
||||
- *add_addr_num = add_num;
|
||||
- *rm_addr_num = rm_num;
|
||||
-}
|
||||
-
|
||||
static int
|
||||
hns3_set_mc_mac_addr_list(struct rte_eth_dev *dev,
|
||||
struct rte_ether_addr *mc_addr_set,
|
||||
uint32_t nb_mc_addr)
|
||||
{
|
||||
struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
|
||||
- struct rte_ether_addr reserved_addr_list[HNS3_MC_MACADDR_NUM];
|
||||
- struct rte_ether_addr add_addr_list[HNS3_MC_MACADDR_NUM];
|
||||
- struct rte_ether_addr rm_addr_list[HNS3_MC_MACADDR_NUM];
|
||||
struct rte_ether_addr *addr;
|
||||
- int reserved_addr_num;
|
||||
- int add_addr_num;
|
||||
- int rm_addr_num;
|
||||
- int mc_addr_num;
|
||||
+ int cur_addr_num;
|
||||
+ int set_addr_num;
|
||||
int num;
|
||||
int ret;
|
||||
int i;
|
||||
@@ -2113,40 +2034,29 @@ hns3_set_mc_mac_addr_list(struct rte_eth_dev *dev,
|
||||
return ret;
|
||||
|
||||
rte_spinlock_lock(&hw->lock);
|
||||
-
|
||||
- /*
|
||||
- * Calculate the mc mac address lists those should be removed and be
|
||||
- * added, Reorder the mc mac address list maintained by driver.
|
||||
- */
|
||||
- mc_addr_num = (int)nb_mc_addr;
|
||||
- hns3_set_mc_addr_calc_addr(hw, mc_addr_set, mc_addr_num,
|
||||
- reserved_addr_list, &reserved_addr_num,
|
||||
- add_addr_list, &add_addr_num,
|
||||
- rm_addr_list, &rm_addr_num);
|
||||
-
|
||||
- /* Remove mc mac addresses */
|
||||
- for (i = 0; i < rm_addr_num; i++) {
|
||||
- num = rm_addr_num - i - 1;
|
||||
- addr = &rm_addr_list[num];
|
||||
+ cur_addr_num = hw->mc_addrs_num;
|
||||
+ for (i = 0; i < cur_addr_num; i++) {
|
||||
+ num = cur_addr_num - i - 1;
|
||||
+ addr = &hw->mc_addrs[num];
|
||||
ret = hw->ops.del_mc_mac_addr(hw, addr);
|
||||
if (ret) {
|
||||
rte_spinlock_unlock(&hw->lock);
|
||||
return ret;
|
||||
}
|
||||
+
|
||||
hw->mc_addrs_num--;
|
||||
}
|
||||
|
||||
- /* Add mc mac addresses */
|
||||
- for (i = 0; i < add_addr_num; i++) {
|
||||
- addr = &add_addr_list[i];
|
||||
+ set_addr_num = (int)nb_mc_addr;
|
||||
+ for (i = 0; i < set_addr_num; i++) {
|
||||
+ addr = &mc_addr_set[i];
|
||||
ret = hw->ops.add_mc_mac_addr(hw, addr);
|
||||
if (ret) {
|
||||
rte_spinlock_unlock(&hw->lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
- num = reserved_addr_num + i;
|
||||
- rte_ether_addr_copy(addr, &hw->mc_addrs[num]);
|
||||
+ rte_ether_addr_copy(addr, &hw->mc_addrs[hw->mc_addrs_num]);
|
||||
hw->mc_addrs_num++;
|
||||
}
|
||||
rte_spinlock_unlock(&hw->lock);
|
||||
--
|
||||
2.33.0
|
||||
|
||||
132
0249-net-hns3-unify-multicast-MAC-address-set-list.patch
Normal file
132
0249-net-hns3-unify-multicast-MAC-address-set-list.patch
Normal file
@ -0,0 +1,132 @@
|
||||
From bbe20957bf59a4c2467b768865daa02c74ef907c Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Fri, 22 Oct 2021 17:20:05 +0800
|
||||
Subject: [PATCH 16/33] net/hns3: unify multicast MAC address set list
|
||||
|
||||
This patch removes hns3vf_set_mc_mac_addr_list() and uses
|
||||
hns3_set_mc_mac_addr_list() to do this.
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_ethdev.c | 4 +--
|
||||
drivers/net/hns3/hns3_ethdev.h | 7 ++---
|
||||
drivers/net/hns3/hns3_ethdev_vf.c | 50 +------------------------------
|
||||
3 files changed, 6 insertions(+), 55 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
|
||||
index dd239f6e7..85c50ce67 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.c
|
||||
@@ -1947,7 +1947,7 @@ hns3_remove_mc_mac_addr(struct hns3_hw *hw, struct rte_ether_addr *mac_addr)
|
||||
return ret;
|
||||
}
|
||||
|
||||
-int
|
||||
+static int
|
||||
hns3_set_mc_addr_chk_param(struct hns3_hw *hw,
|
||||
struct rte_ether_addr *mc_addr_set,
|
||||
uint32_t nb_mc_addr)
|
||||
@@ -2015,7 +2015,7 @@ hns3_set_mc_addr_chk_param(struct hns3_hw *hw,
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int
|
||||
+int
|
||||
hns3_set_mc_mac_addr_list(struct rte_eth_dev *dev,
|
||||
struct rte_ether_addr *mc_addr_set,
|
||||
uint32_t nb_mc_addr)
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h
|
||||
index 1606a6407..1f1364304 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.h
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.h
|
||||
@@ -1062,15 +1062,14 @@ void hns3vf_update_link_status(struct hns3_hw *hw, uint8_t link_status,
|
||||
uint32_t link_speed, uint8_t link_duplex);
|
||||
void hns3_parse_devargs(struct rte_eth_dev *dev);
|
||||
void hns3vf_update_push_lsc_cap(struct hns3_hw *hw, bool supported);
|
||||
-int hns3_set_mc_addr_chk_param(struct hns3_hw *hw,
|
||||
- struct rte_ether_addr *mc_addr_set,
|
||||
- uint32_t nb_mc_addr);
|
||||
int hns3_configure_all_mc_mac_addr(struct hns3_adapter *hns, bool del);
|
||||
int hns3_configure_all_mac_addr(struct hns3_adapter *hns, bool del);
|
||||
int hns3_add_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr,
|
||||
__rte_unused uint32_t idx, __rte_unused uint32_t pool);
|
||||
void hns3_remove_mac_addr(struct rte_eth_dev *dev, uint32_t idx);
|
||||
-
|
||||
+int hns3_set_mc_mac_addr_list(struct rte_eth_dev *dev,
|
||||
+ struct rte_ether_addr *mc_addr_set,
|
||||
+ uint32_t nb_mc_addr);
|
||||
int hns3_restore_ptp(struct hns3_adapter *hns);
|
||||
int hns3_mbuf_dyn_rx_timestamp_register(struct rte_eth_dev *dev,
|
||||
struct rte_eth_conf *conf);
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
index 835e783c3..095f635cc 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
@@ -299,54 +299,6 @@ hns3vf_remove_mc_mac_addr(struct hns3_hw *hw,
|
||||
return ret;
|
||||
}
|
||||
|
||||
-static int
|
||||
-hns3vf_set_mc_mac_addr_list(struct rte_eth_dev *dev,
|
||||
- struct rte_ether_addr *mc_addr_set,
|
||||
- uint32_t nb_mc_addr)
|
||||
-{
|
||||
- struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
|
||||
- struct rte_ether_addr *addr;
|
||||
- int cur_addr_num;
|
||||
- int set_addr_num;
|
||||
- int num;
|
||||
- int ret;
|
||||
- int i;
|
||||
-
|
||||
- ret = hns3_set_mc_addr_chk_param(hw, mc_addr_set, nb_mc_addr);
|
||||
- if (ret)
|
||||
- return ret;
|
||||
-
|
||||
- rte_spinlock_lock(&hw->lock);
|
||||
- cur_addr_num = hw->mc_addrs_num;
|
||||
- for (i = 0; i < cur_addr_num; i++) {
|
||||
- num = cur_addr_num - i - 1;
|
||||
- addr = &hw->mc_addrs[num];
|
||||
- ret = hw->ops.del_mc_mac_addr(hw, addr);
|
||||
- if (ret) {
|
||||
- rte_spinlock_unlock(&hw->lock);
|
||||
- return ret;
|
||||
- }
|
||||
-
|
||||
- hw->mc_addrs_num--;
|
||||
- }
|
||||
-
|
||||
- set_addr_num = (int)nb_mc_addr;
|
||||
- for (i = 0; i < set_addr_num; i++) {
|
||||
- addr = &mc_addr_set[i];
|
||||
- ret = hw->ops.add_mc_mac_addr(hw, addr);
|
||||
- if (ret) {
|
||||
- rte_spinlock_unlock(&hw->lock);
|
||||
- return ret;
|
||||
- }
|
||||
-
|
||||
- rte_ether_addr_copy(addr, &hw->mc_addrs[hw->mc_addrs_num]);
|
||||
- hw->mc_addrs_num++;
|
||||
- }
|
||||
- rte_spinlock_unlock(&hw->lock);
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
static int
|
||||
hns3vf_set_promisc_mode(struct hns3_hw *hw, bool en_bc_pmc,
|
||||
bool en_uc_pmc, bool en_mc_pmc)
|
||||
@@ -2704,7 +2656,7 @@ static const struct eth_dev_ops hns3vf_eth_dev_ops = {
|
||||
.mac_addr_add = hns3_add_mac_addr,
|
||||
.mac_addr_remove = hns3_remove_mac_addr,
|
||||
.mac_addr_set = hns3vf_set_default_mac_addr,
|
||||
- .set_mc_addr_list = hns3vf_set_mc_mac_addr_list,
|
||||
+ .set_mc_addr_list = hns3_set_mc_mac_addr_list,
|
||||
.link_update = hns3vf_dev_link_update,
|
||||
.rss_hash_update = hns3_dev_rss_hash_update,
|
||||
.rss_hash_conf_get = hns3_dev_rss_hash_conf_get,
|
||||
--
|
||||
2.33.0
|
||||
|
||||
38
0250-bonding-show-Tx-policy-for-802.3AD-mode.patch
Normal file
38
0250-bonding-show-Tx-policy-for-802.3AD-mode.patch
Normal file
@ -0,0 +1,38 @@
|
||||
From 6ae8a77985dd6a896c304fa1c344980747e88e66 Mon Sep 17 00:00:00 2001
|
||||
From: "Min Hu (Connor)" <humin29@huawei.com>
|
||||
Date: Mon, 25 Oct 2021 11:15:11 +0800
|
||||
Subject: [PATCH 17/33] bonding: show Tx policy for 802.3AD mode
|
||||
|
||||
As balance xmit policy is supported in bonding mode 4(802.3AD). This
|
||||
patch adds balance xmit policy show in testpmd commands for mode 4. Like:
|
||||
testpmd> show bonding config 2
|
||||
Bonding mode: 4
|
||||
Balance Xmit Policy: BALANCE_XMIT_POLICY_LAYER34
|
||||
IEEE802.3AD Aggregator Mode: stable
|
||||
Slaves (2): [0 1]
|
||||
Active Slaves (2): [1 0]
|
||||
Primary: [1]
|
||||
|
||||
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
|
||||
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
|
||||
---
|
||||
app/test-pmd/cmdline.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
|
||||
index b701129d8..66e3815de 100644
|
||||
--- a/app/test-pmd/cmdline.c
|
||||
+++ b/app/test-pmd/cmdline.c
|
||||
@@ -6257,7 +6257,8 @@ static void cmd_show_bonding_config_parsed(void *parsed_result,
|
||||
} else
|
||||
printf("\tBonding mode: %d\n", bonding_mode);
|
||||
|
||||
- if (bonding_mode == BONDING_MODE_BALANCE) {
|
||||
+ if (bonding_mode == BONDING_MODE_BALANCE ||
|
||||
+ bonding_mode == BONDING_MODE_8023AD) {
|
||||
int balance_xmit_policy;
|
||||
|
||||
balance_xmit_policy = rte_eth_bond_xmit_policy_get(port_id);
|
||||
--
|
||||
2.33.0
|
||||
|
||||
116
0251-net-hns3-fix-secondary-process-reference-count.patch
Normal file
116
0251-net-hns3-fix-secondary-process-reference-count.patch
Normal file
@ -0,0 +1,116 @@
|
||||
From 1058a9cd1fa03e94b7e8634f1f26902ed9a376b1 Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Tue, 2 Nov 2021 09:38:26 +0800
|
||||
Subject: [PATCH 18/33] net/hns3: fix secondary process reference count
|
||||
|
||||
The "secondary_cnt" will be increased when a secondary process
|
||||
initialized. But the value of this variable is not decreased when the
|
||||
secondary process exits, which causes the primary process senses that
|
||||
the secondary process still exists. As a result, the primary process
|
||||
fails to send messages to the secondary process after the secondary
|
||||
process exits.
|
||||
|
||||
Fixes: 23d4b61fee5d ("net/hns3: support multiple process")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_ethdev.c | 10 +++++++---
|
||||
drivers/net/hns3/hns3_ethdev_vf.c | 10 +++++++---
|
||||
drivers/net/hns3/hns3_mp.c | 4 +++-
|
||||
3 files changed, 17 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
|
||||
index 85c50ce67..31d027836 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.c
|
||||
@@ -5894,8 +5894,10 @@ hns3_dev_close(struct rte_eth_dev *eth_dev)
|
||||
struct hns3_hw *hw = &hns->hw;
|
||||
int ret = 0;
|
||||
|
||||
- if (rte_eal_process_type() != RTE_PROC_PRIMARY)
|
||||
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
|
||||
+ __atomic_fetch_sub(&hw->secondary_cnt, 1, __ATOMIC_RELAXED);
|
||||
return 0;
|
||||
+ }
|
||||
|
||||
if (hw->adapter_state == HNS3_NIC_STARTED)
|
||||
ret = hns3_dev_stop(eth_dev);
|
||||
@@ -7421,7 +7423,7 @@ hns3_dev_init(struct rte_eth_dev *eth_dev)
|
||||
"process, ret = %d", ret);
|
||||
goto err_mp_init_secondary;
|
||||
}
|
||||
- hw->secondary_cnt++;
|
||||
+ __atomic_fetch_add(&hw->secondary_cnt, 1, __ATOMIC_RELAXED);
|
||||
hns3_tx_push_init(eth_dev);
|
||||
return 0;
|
||||
}
|
||||
@@ -7524,8 +7526,10 @@ hns3_dev_uninit(struct rte_eth_dev *eth_dev)
|
||||
|
||||
PMD_INIT_FUNC_TRACE();
|
||||
|
||||
- if (rte_eal_process_type() != RTE_PROC_PRIMARY)
|
||||
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
|
||||
+ __atomic_fetch_sub(&hw->secondary_cnt, 1, __ATOMIC_RELAXED);
|
||||
return 0;
|
||||
+ }
|
||||
|
||||
if (hw->adapter_state < HNS3_NIC_CLOSING)
|
||||
hns3_dev_close(eth_dev);
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
index 095f635cc..76721b0d7 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
@@ -1921,8 +1921,10 @@ hns3vf_dev_close(struct rte_eth_dev *eth_dev)
|
||||
struct hns3_hw *hw = &hns->hw;
|
||||
int ret = 0;
|
||||
|
||||
- if (rte_eal_process_type() != RTE_PROC_PRIMARY)
|
||||
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
|
||||
+ __atomic_fetch_sub(&hw->secondary_cnt, 1, __ATOMIC_RELAXED);
|
||||
return 0;
|
||||
+ }
|
||||
|
||||
if (hw->adapter_state == HNS3_NIC_STARTED)
|
||||
ret = hns3vf_dev_stop(eth_dev);
|
||||
@@ -2710,7 +2712,7 @@ hns3vf_dev_init(struct rte_eth_dev *eth_dev)
|
||||
"process, ret = %d", ret);
|
||||
goto err_mp_init_secondary;
|
||||
}
|
||||
- hw->secondary_cnt++;
|
||||
+ __atomic_fetch_add(&hw->secondary_cnt, 1, __ATOMIC_RELAXED);
|
||||
hns3_tx_push_init(eth_dev);
|
||||
return 0;
|
||||
}
|
||||
@@ -2812,8 +2814,10 @@ hns3vf_dev_uninit(struct rte_eth_dev *eth_dev)
|
||||
|
||||
PMD_INIT_FUNC_TRACE();
|
||||
|
||||
- if (rte_eal_process_type() != RTE_PROC_PRIMARY)
|
||||
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
|
||||
+ __atomic_fetch_sub(&hw->secondary_cnt, 1, __ATOMIC_RELAXED);
|
||||
return 0;
|
||||
+ }
|
||||
|
||||
if (hw->adapter_state < HNS3_NIC_CLOSING)
|
||||
hns3vf_dev_close(eth_dev);
|
||||
diff --git a/drivers/net/hns3/hns3_mp.c b/drivers/net/hns3/hns3_mp.c
|
||||
index 4891c6e4f..184acfe02 100644
|
||||
--- a/drivers/net/hns3/hns3_mp.c
|
||||
+++ b/drivers/net/hns3/hns3_mp.c
|
||||
@@ -150,8 +150,10 @@ mp_req_on_rxtx(struct rte_eth_dev *dev, enum hns3_mp_req_type type)
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
- if (rte_eal_process_type() == RTE_PROC_SECONDARY || !hw->secondary_cnt)
|
||||
+ if (rte_eal_process_type() == RTE_PROC_SECONDARY ||
|
||||
+ __atomic_load_n(&hw->secondary_cnt, __ATOMIC_RELAXED) == 0)
|
||||
return;
|
||||
+
|
||||
if (!mp_req_type_is_valid(type)) {
|
||||
hns3_err(hw, "port %u unknown request (req_type %d)",
|
||||
dev->data->port_id, type);
|
||||
--
|
||||
2.33.0
|
||||
|
||||
166
0252-net-hns3-fix-multi-process-action-register-and-unreg.patch
Normal file
166
0252-net-hns3-fix-multi-process-action-register-and-unreg.patch
Normal file
@ -0,0 +1,166 @@
|
||||
From c4ae016e0b548882c5f777cd1782b8661a34f252 Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Tue, 2 Nov 2021 09:38:27 +0800
|
||||
Subject: [PATCH 19/33] net/hns3: fix multi-process action register and
|
||||
unregister
|
||||
|
||||
The multi-process has the following problems:
|
||||
1) After a port in primary process is closed, the mp action of the
|
||||
process is unregistered. Which will cause that other device in the
|
||||
primary process cannot respond to requests from secondary processes.
|
||||
2) Because variable "hns3_inited" is set to true without returning an
|
||||
initial value, the mp action cannot be registered again after it is
|
||||
unregistered.
|
||||
3) The mp action of primary and secondary process need to be registered
|
||||
only once regardless of port numbers in the process. That's what
|
||||
variable "hns3_inited" does. But the variable is difficult to
|
||||
understand.
|
||||
|
||||
This patch adds a hns3_process_local_data structure to resolve above
|
||||
problems.
|
||||
|
||||
Fixes: 9570b1fdbdad ("net/hns3: check multi-process action register result")
|
||||
Fixes: 23d4b61fee5d ("net/hns3: support multiple process")
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_ethdev.c | 2 ++
|
||||
drivers/net/hns3/hns3_ethdev_vf.c | 2 ++
|
||||
drivers/net/hns3/hns3_mp.c | 37 ++++++++++++++++++-------------
|
||||
drivers/net/hns3/hns3_mp.h | 7 ++++++
|
||||
4 files changed, 33 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
|
||||
index 31d027836..2f2d2a605 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.c
|
||||
@@ -7424,6 +7424,7 @@ hns3_dev_init(struct rte_eth_dev *eth_dev)
|
||||
goto err_mp_init_secondary;
|
||||
}
|
||||
__atomic_fetch_add(&hw->secondary_cnt, 1, __ATOMIC_RELAXED);
|
||||
+ process_data.eth_dev_cnt++;
|
||||
hns3_tx_push_init(eth_dev);
|
||||
return 0;
|
||||
}
|
||||
@@ -7435,6 +7436,7 @@ hns3_dev_init(struct rte_eth_dev *eth_dev)
|
||||
ret);
|
||||
goto err_mp_init_primary;
|
||||
}
|
||||
+ process_data.eth_dev_cnt++;
|
||||
|
||||
hw->adapter_state = HNS3_NIC_UNINITIALIZED;
|
||||
hns->is_vf = false;
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
index 76721b0d7..108bd61d5 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
@@ -2713,6 +2713,7 @@ hns3vf_dev_init(struct rte_eth_dev *eth_dev)
|
||||
goto err_mp_init_secondary;
|
||||
}
|
||||
__atomic_fetch_add(&hw->secondary_cnt, 1, __ATOMIC_RELAXED);
|
||||
+ process_data.eth_dev_cnt++;
|
||||
hns3_tx_push_init(eth_dev);
|
||||
return 0;
|
||||
}
|
||||
@@ -2724,6 +2725,7 @@ hns3vf_dev_init(struct rte_eth_dev *eth_dev)
|
||||
ret);
|
||||
goto err_mp_init_primary;
|
||||
}
|
||||
+ process_data.eth_dev_cnt++;
|
||||
|
||||
hw->adapter_state = HNS3_NIC_UNINITIALIZED;
|
||||
hns->is_vf = true;
|
||||
diff --git a/drivers/net/hns3/hns3_mp.c b/drivers/net/hns3/hns3_mp.c
|
||||
index 184acfe02..753b93f09 100644
|
||||
--- a/drivers/net/hns3/hns3_mp.c
|
||||
+++ b/drivers/net/hns3/hns3_mp.c
|
||||
@@ -12,7 +12,8 @@
|
||||
#include "hns3_rxtx.h"
|
||||
#include "hns3_mp.h"
|
||||
|
||||
-static bool hns3_inited;
|
||||
+/* local data for primary or secondary process. */
|
||||
+struct hns3_process_local_data process_data;
|
||||
|
||||
/*
|
||||
* Initialize IPC message.
|
||||
@@ -230,14 +231,15 @@ int hns3_mp_init_primary(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
- if (!hns3_inited) {
|
||||
- /* primary is allowed to not support IPC */
|
||||
- ret = rte_mp_action_register(HNS3_MP_NAME, mp_primary_handle);
|
||||
- if (ret && rte_errno != ENOTSUP)
|
||||
- return ret;
|
||||
+ if (process_data.init_done)
|
||||
+ return 0;
|
||||
|
||||
- hns3_inited = true;
|
||||
- }
|
||||
+ /* primary is allowed to not support IPC */
|
||||
+ ret = rte_mp_action_register(HNS3_MP_NAME, mp_primary_handle);
|
||||
+ if (ret && rte_errno != ENOTSUP)
|
||||
+ return ret;
|
||||
+
|
||||
+ process_data.init_done = true;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -247,8 +249,12 @@ int hns3_mp_init_primary(void)
|
||||
*/
|
||||
void hns3_mp_uninit_primary(void)
|
||||
{
|
||||
- if (hns3_inited)
|
||||
+ process_data.eth_dev_cnt--;
|
||||
+
|
||||
+ if (process_data.eth_dev_cnt == 0) {
|
||||
rte_mp_action_unregister(HNS3_MP_NAME);
|
||||
+ process_data.init_done = false;
|
||||
+ }
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -258,13 +264,14 @@ int hns3_mp_init_secondary(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
- if (!hns3_inited) {
|
||||
- ret = rte_mp_action_register(HNS3_MP_NAME, mp_secondary_handle);
|
||||
- if (ret)
|
||||
- return ret;
|
||||
+ if (process_data.init_done)
|
||||
+ return 0;
|
||||
|
||||
- hns3_inited = true;
|
||||
- }
|
||||
+ ret = rte_mp_action_register(HNS3_MP_NAME, mp_secondary_handle);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ process_data.init_done = true;
|
||||
|
||||
return 0;
|
||||
}
|
||||
diff --git a/drivers/net/hns3/hns3_mp.h b/drivers/net/hns3/hns3_mp.h
|
||||
index e0e4aeaf6..b49532f98 100644
|
||||
--- a/drivers/net/hns3/hns3_mp.h
|
||||
+++ b/drivers/net/hns3/hns3_mp.h
|
||||
@@ -5,6 +5,13 @@
|
||||
#ifndef _HNS3_MP_H_
|
||||
#define _HNS3_MP_H_
|
||||
|
||||
+/* Local data for primary or secondary process. */
|
||||
+struct hns3_process_local_data {
|
||||
+ bool init_done; /* Process action register completed flag. */
|
||||
+ int eth_dev_cnt; /* Ethdev count under the current process. */
|
||||
+};
|
||||
+extern struct hns3_process_local_data process_data;
|
||||
+
|
||||
void hns3_mp_req_start_rxtx(struct rte_eth_dev *dev);
|
||||
void hns3_mp_req_stop_rxtx(struct rte_eth_dev *dev);
|
||||
void hns3_mp_req_start_tx(struct rte_eth_dev *dev);
|
||||
--
|
||||
2.33.0
|
||||
|
||||
128
0253-net-hns3-unregister-MP-action-on-close-for-secondary.patch
Normal file
128
0253-net-hns3-unregister-MP-action-on-close-for-secondary.patch
Normal file
@ -0,0 +1,128 @@
|
||||
From 9bc0df6a4fa9b3ea1decc519c778e48a27037589 Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Tue, 2 Nov 2021 09:38:28 +0800
|
||||
Subject: [PATCH 20/33] net/hns3: unregister MP action on close for secondary
|
||||
|
||||
This patch fixes lack of unregistering MP action for secondary process
|
||||
when PMD is closed.
|
||||
|
||||
Fixes: 9570b1fdbdad ("net/hns3: check multi-process action register result")
|
||||
Fixes: 23d4b61fee5d ("net/hns3: support multiple process")
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_ethdev.c | 6 ++++--
|
||||
drivers/net/hns3/hns3_ethdev_vf.c | 6 ++++--
|
||||
drivers/net/hns3/hns3_mp.c | 5 +----
|
||||
drivers/net/hns3/hns3_mp.h | 2 +-
|
||||
4 files changed, 10 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
|
||||
index 2f2d2a605..b4f375bf2 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.c
|
||||
@@ -5896,6 +5896,7 @@ hns3_dev_close(struct rte_eth_dev *eth_dev)
|
||||
|
||||
if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
|
||||
__atomic_fetch_sub(&hw->secondary_cnt, 1, __ATOMIC_RELAXED);
|
||||
+ hns3_mp_uninit();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -5912,7 +5913,7 @@ hns3_dev_close(struct rte_eth_dev *eth_dev)
|
||||
hns3_uninit_pf(eth_dev);
|
||||
hns3_free_all_queues(eth_dev);
|
||||
rte_free(hw->reset.wait_data);
|
||||
- hns3_mp_uninit_primary();
|
||||
+ hns3_mp_uninit();
|
||||
hns3_warn(hw, "Close port %u finished", hw->data->port_id);
|
||||
|
||||
return ret;
|
||||
@@ -7507,7 +7508,7 @@ hns3_dev_init(struct rte_eth_dev *eth_dev)
|
||||
rte_free(hw->reset.wait_data);
|
||||
|
||||
err_init_reset:
|
||||
- hns3_mp_uninit_primary();
|
||||
+ hns3_mp_uninit();
|
||||
|
||||
err_mp_init_primary:
|
||||
err_mp_init_secondary:
|
||||
@@ -7530,6 +7531,7 @@ hns3_dev_uninit(struct rte_eth_dev *eth_dev)
|
||||
|
||||
if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
|
||||
__atomic_fetch_sub(&hw->secondary_cnt, 1, __ATOMIC_RELAXED);
|
||||
+ hns3_mp_uninit();
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
index 108bd61d5..ac0dcbe36 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
@@ -1923,6 +1923,7 @@ hns3vf_dev_close(struct rte_eth_dev *eth_dev)
|
||||
|
||||
if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
|
||||
__atomic_fetch_sub(&hw->secondary_cnt, 1, __ATOMIC_RELAXED);
|
||||
+ hns3_mp_uninit();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1938,7 +1939,7 @@ hns3vf_dev_close(struct rte_eth_dev *eth_dev)
|
||||
hns3vf_uninit_vf(eth_dev);
|
||||
hns3_free_all_queues(eth_dev);
|
||||
rte_free(hw->reset.wait_data);
|
||||
- hns3_mp_uninit_primary();
|
||||
+ hns3_mp_uninit();
|
||||
hns3_warn(hw, "Close port %u finished", hw->data->port_id);
|
||||
|
||||
return ret;
|
||||
@@ -2794,7 +2795,7 @@ hns3vf_dev_init(struct rte_eth_dev *eth_dev)
|
||||
rte_free(hw->reset.wait_data);
|
||||
|
||||
err_init_reset:
|
||||
- hns3_mp_uninit_primary();
|
||||
+ hns3_mp_uninit();
|
||||
|
||||
err_mp_init_primary:
|
||||
err_mp_init_secondary:
|
||||
@@ -2818,6 +2819,7 @@ hns3vf_dev_uninit(struct rte_eth_dev *eth_dev)
|
||||
|
||||
if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
|
||||
__atomic_fetch_sub(&hw->secondary_cnt, 1, __ATOMIC_RELAXED);
|
||||
+ hns3_mp_uninit();
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_mp.c b/drivers/net/hns3/hns3_mp.c
|
||||
index 753b93f09..2ecb16861 100644
|
||||
--- a/drivers/net/hns3/hns3_mp.c
|
||||
+++ b/drivers/net/hns3/hns3_mp.c
|
||||
@@ -244,10 +244,7 @@ int hns3_mp_init_primary(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-/*
|
||||
- * Un-initialize by primary process.
|
||||
- */
|
||||
-void hns3_mp_uninit_primary(void)
|
||||
+void hns3_mp_uninit(void)
|
||||
{
|
||||
process_data.eth_dev_cnt--;
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_mp.h b/drivers/net/hns3/hns3_mp.h
|
||||
index b49532f98..5738ab74a 100644
|
||||
--- a/drivers/net/hns3/hns3_mp.h
|
||||
+++ b/drivers/net/hns3/hns3_mp.h
|
||||
@@ -18,7 +18,7 @@ void hns3_mp_req_start_tx(struct rte_eth_dev *dev);
|
||||
void hns3_mp_req_stop_tx(struct rte_eth_dev *dev);
|
||||
|
||||
int hns3_mp_init_primary(void);
|
||||
-void hns3_mp_uninit_primary(void);
|
||||
+void hns3_mp_uninit(void);
|
||||
int hns3_mp_init_secondary(void);
|
||||
|
||||
#endif /* _HNS3_MP_H_ */
|
||||
--
|
||||
2.33.0
|
||||
|
||||
300
0254-net-hns3-refactor-multi-process-initialization.patch
Normal file
300
0254-net-hns3-refactor-multi-process-initialization.patch
Normal file
@ -0,0 +1,300 @@
|
||||
From 8388c42414d8f33ba97b01cbe4bf4e945a9819b4 Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Tue, 2 Nov 2021 09:38:29 +0800
|
||||
Subject: [PATCH 21/33] net/hns3: refactor multi-process initialization
|
||||
|
||||
Currently, the logic of the PF and VF initialization codes for multiple
|
||||
process is the same. A common function can be extracted to initialize
|
||||
and unload multiple process.
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_ethdev.c | 34 +++++------------
|
||||
drivers/net/hns3/hns3_ethdev_vf.c | 33 +++++-----------
|
||||
drivers/net/hns3/hns3_mp.c | 62 ++++++++++++++++++++++++-------
|
||||
drivers/net/hns3/hns3_mp.h | 6 +--
|
||||
4 files changed, 68 insertions(+), 67 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
|
||||
index b4f375bf2..ecf912a9f 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.c
|
||||
@@ -5895,8 +5895,7 @@ hns3_dev_close(struct rte_eth_dev *eth_dev)
|
||||
int ret = 0;
|
||||
|
||||
if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
|
||||
- __atomic_fetch_sub(&hw->secondary_cnt, 1, __ATOMIC_RELAXED);
|
||||
- hns3_mp_uninit();
|
||||
+ hns3_mp_uninit(eth_dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -5913,7 +5912,7 @@ hns3_dev_close(struct rte_eth_dev *eth_dev)
|
||||
hns3_uninit_pf(eth_dev);
|
||||
hns3_free_all_queues(eth_dev);
|
||||
rte_free(hw->reset.wait_data);
|
||||
- hns3_mp_uninit();
|
||||
+ hns3_mp_uninit(eth_dev);
|
||||
hns3_warn(hw, "Close port %u finished", hw->data->port_id);
|
||||
|
||||
return ret;
|
||||
@@ -7417,28 +7416,15 @@ hns3_dev_init(struct rte_eth_dev *eth_dev)
|
||||
hns3_set_rxtx_function(eth_dev);
|
||||
eth_dev->dev_ops = &hns3_eth_dev_ops;
|
||||
eth_dev->rx_queue_count = hns3_rx_queue_count;
|
||||
+ ret = hns3_mp_init(eth_dev);
|
||||
+ if (ret)
|
||||
+ goto err_mp_init;
|
||||
+
|
||||
if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
|
||||
- ret = hns3_mp_init_secondary();
|
||||
- if (ret) {
|
||||
- PMD_INIT_LOG(ERR, "Failed to init for secondary "
|
||||
- "process, ret = %d", ret);
|
||||
- goto err_mp_init_secondary;
|
||||
- }
|
||||
- __atomic_fetch_add(&hw->secondary_cnt, 1, __ATOMIC_RELAXED);
|
||||
- process_data.eth_dev_cnt++;
|
||||
hns3_tx_push_init(eth_dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
- ret = hns3_mp_init_primary();
|
||||
- if (ret) {
|
||||
- PMD_INIT_LOG(ERR,
|
||||
- "Failed to init for primary process, ret = %d",
|
||||
- ret);
|
||||
- goto err_mp_init_primary;
|
||||
- }
|
||||
- process_data.eth_dev_cnt++;
|
||||
-
|
||||
hw->adapter_state = HNS3_NIC_UNINITIALIZED;
|
||||
hns->is_vf = false;
|
||||
hw->data = eth_dev->data;
|
||||
@@ -7508,10 +7494,9 @@ hns3_dev_init(struct rte_eth_dev *eth_dev)
|
||||
rte_free(hw->reset.wait_data);
|
||||
|
||||
err_init_reset:
|
||||
- hns3_mp_uninit();
|
||||
+ hns3_mp_uninit(eth_dev);
|
||||
|
||||
-err_mp_init_primary:
|
||||
-err_mp_init_secondary:
|
||||
+err_mp_init:
|
||||
eth_dev->dev_ops = NULL;
|
||||
eth_dev->rx_pkt_burst = NULL;
|
||||
eth_dev->rx_descriptor_status = NULL;
|
||||
@@ -7530,8 +7515,7 @@ hns3_dev_uninit(struct rte_eth_dev *eth_dev)
|
||||
PMD_INIT_FUNC_TRACE();
|
||||
|
||||
if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
|
||||
- __atomic_fetch_sub(&hw->secondary_cnt, 1, __ATOMIC_RELAXED);
|
||||
- hns3_mp_uninit();
|
||||
+ hns3_mp_uninit(eth_dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
index ac0dcbe36..1e0cb1b63 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
@@ -1922,8 +1922,7 @@ hns3vf_dev_close(struct rte_eth_dev *eth_dev)
|
||||
int ret = 0;
|
||||
|
||||
if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
|
||||
- __atomic_fetch_sub(&hw->secondary_cnt, 1, __ATOMIC_RELAXED);
|
||||
- hns3_mp_uninit();
|
||||
+ hns3_mp_uninit(eth_dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1939,7 +1938,7 @@ hns3vf_dev_close(struct rte_eth_dev *eth_dev)
|
||||
hns3vf_uninit_vf(eth_dev);
|
||||
hns3_free_all_queues(eth_dev);
|
||||
rte_free(hw->reset.wait_data);
|
||||
- hns3_mp_uninit();
|
||||
+ hns3_mp_uninit(eth_dev);
|
||||
hns3_warn(hw, "Close port %u finished", hw->data->port_id);
|
||||
|
||||
return ret;
|
||||
@@ -2706,28 +2705,15 @@ hns3vf_dev_init(struct rte_eth_dev *eth_dev)
|
||||
hns3_set_rxtx_function(eth_dev);
|
||||
eth_dev->dev_ops = &hns3vf_eth_dev_ops;
|
||||
eth_dev->rx_queue_count = hns3_rx_queue_count;
|
||||
+ ret = hns3_mp_init(eth_dev);
|
||||
+ if (ret)
|
||||
+ goto err_mp_init;
|
||||
+
|
||||
if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
|
||||
- ret = hns3_mp_init_secondary();
|
||||
- if (ret) {
|
||||
- PMD_INIT_LOG(ERR, "Failed to init for secondary "
|
||||
- "process, ret = %d", ret);
|
||||
- goto err_mp_init_secondary;
|
||||
- }
|
||||
- __atomic_fetch_add(&hw->secondary_cnt, 1, __ATOMIC_RELAXED);
|
||||
- process_data.eth_dev_cnt++;
|
||||
hns3_tx_push_init(eth_dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
- ret = hns3_mp_init_primary();
|
||||
- if (ret) {
|
||||
- PMD_INIT_LOG(ERR,
|
||||
- "Failed to init for primary process, ret = %d",
|
||||
- ret);
|
||||
- goto err_mp_init_primary;
|
||||
- }
|
||||
- process_data.eth_dev_cnt++;
|
||||
-
|
||||
hw->adapter_state = HNS3_NIC_UNINITIALIZED;
|
||||
hns->is_vf = true;
|
||||
hw->data = eth_dev->data;
|
||||
@@ -2795,10 +2781,9 @@ hns3vf_dev_init(struct rte_eth_dev *eth_dev)
|
||||
rte_free(hw->reset.wait_data);
|
||||
|
||||
err_init_reset:
|
||||
- hns3_mp_uninit();
|
||||
+ hns3_mp_uninit(eth_dev);
|
||||
|
||||
-err_mp_init_primary:
|
||||
-err_mp_init_secondary:
|
||||
+err_mp_init:
|
||||
eth_dev->dev_ops = NULL;
|
||||
eth_dev->rx_pkt_burst = NULL;
|
||||
eth_dev->rx_descriptor_status = NULL;
|
||||
@@ -2819,7 +2804,7 @@ hns3vf_dev_uninit(struct rte_eth_dev *eth_dev)
|
||||
|
||||
if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
|
||||
__atomic_fetch_sub(&hw->secondary_cnt, 1, __ATOMIC_RELAXED);
|
||||
- hns3_mp_uninit();
|
||||
+ hns3_mp_uninit(eth_dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_mp.c b/drivers/net/hns3/hns3_mp.c
|
||||
index 2ecb16861..63d22bcd3 100644
|
||||
--- a/drivers/net/hns3/hns3_mp.c
|
||||
+++ b/drivers/net/hns3/hns3_mp.c
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "hns3_mp.h"
|
||||
|
||||
/* local data for primary or secondary process. */
|
||||
-struct hns3_process_local_data process_data;
|
||||
+static struct hns3_process_local_data process_data;
|
||||
|
||||
/*
|
||||
* Initialize IPC message.
|
||||
@@ -227,7 +227,8 @@ hns3_mp_req_start_tx(struct rte_eth_dev *dev)
|
||||
/*
|
||||
* Initialize by primary process.
|
||||
*/
|
||||
-int hns3_mp_init_primary(void)
|
||||
+static int
|
||||
+hns3_mp_init_primary(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@@ -244,20 +245,11 @@ int hns3_mp_init_primary(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-void hns3_mp_uninit(void)
|
||||
-{
|
||||
- process_data.eth_dev_cnt--;
|
||||
-
|
||||
- if (process_data.eth_dev_cnt == 0) {
|
||||
- rte_mp_action_unregister(HNS3_MP_NAME);
|
||||
- process_data.init_done = false;
|
||||
- }
|
||||
-}
|
||||
-
|
||||
/*
|
||||
* Initialize by secondary process.
|
||||
*/
|
||||
-int hns3_mp_init_secondary(void)
|
||||
+static int
|
||||
+hns3_mp_init_secondary(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@@ -265,10 +257,52 @@ int hns3_mp_init_secondary(void)
|
||||
return 0;
|
||||
|
||||
ret = rte_mp_action_register(HNS3_MP_NAME, mp_secondary_handle);
|
||||
- if (ret)
|
||||
+ if (ret && rte_errno != ENOTSUP)
|
||||
return ret;
|
||||
|
||||
process_data.init_done = true;
|
||||
|
||||
return 0;
|
||||
}
|
||||
+
|
||||
+int
|
||||
+hns3_mp_init(struct rte_eth_dev *dev)
|
||||
+{
|
||||
+ struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
|
||||
+ int ret;
|
||||
+
|
||||
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
|
||||
+ ret = hns3_mp_init_secondary();
|
||||
+ if (ret) {
|
||||
+ PMD_INIT_LOG(ERR, "Failed to init for secondary process, ret = %d",
|
||||
+ ret);
|
||||
+ return ret;
|
||||
+ }
|
||||
+ __atomic_fetch_add(&hw->secondary_cnt, 1, __ATOMIC_RELAXED);
|
||||
+ } else {
|
||||
+ ret = hns3_mp_init_primary();
|
||||
+ if (ret) {
|
||||
+ PMD_INIT_LOG(ERR, "Failed to init for primary process, ret = %d",
|
||||
+ ret);
|
||||
+ return ret;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ process_data.eth_dev_cnt++;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+void hns3_mp_uninit(struct rte_eth_dev *dev)
|
||||
+{
|
||||
+ struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
|
||||
+
|
||||
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
|
||||
+ __atomic_fetch_sub(&hw->secondary_cnt, 1, __ATOMIC_RELAXED);
|
||||
+
|
||||
+ process_data.eth_dev_cnt--;
|
||||
+ if (process_data.eth_dev_cnt == 0) {
|
||||
+ rte_mp_action_unregister(HNS3_MP_NAME);
|
||||
+ process_data.init_done = false;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/drivers/net/hns3/hns3_mp.h b/drivers/net/hns3/hns3_mp.h
|
||||
index 5738ab74a..a74221d08 100644
|
||||
--- a/drivers/net/hns3/hns3_mp.h
|
||||
+++ b/drivers/net/hns3/hns3_mp.h
|
||||
@@ -10,15 +10,13 @@ struct hns3_process_local_data {
|
||||
bool init_done; /* Process action register completed flag. */
|
||||
int eth_dev_cnt; /* Ethdev count under the current process. */
|
||||
};
|
||||
-extern struct hns3_process_local_data process_data;
|
||||
|
||||
void hns3_mp_req_start_rxtx(struct rte_eth_dev *dev);
|
||||
void hns3_mp_req_stop_rxtx(struct rte_eth_dev *dev);
|
||||
void hns3_mp_req_start_tx(struct rte_eth_dev *dev);
|
||||
void hns3_mp_req_stop_tx(struct rte_eth_dev *dev);
|
||||
|
||||
-int hns3_mp_init_primary(void);
|
||||
-void hns3_mp_uninit(void);
|
||||
-int hns3_mp_init_secondary(void);
|
||||
+int hns3_mp_init(struct rte_eth_dev *dev);
|
||||
+void hns3_mp_uninit(struct rte_eth_dev *dev);
|
||||
|
||||
#endif /* _HNS3_MP_H_ */
|
||||
--
|
||||
2.33.0
|
||||
|
||||
41
0255-usertools-devbind-add-Kunpeng-DMA.patch
Normal file
41
0255-usertools-devbind-add-Kunpeng-DMA.patch
Normal file
@ -0,0 +1,41 @@
|
||||
From 62c1169fb30dd7407c35377364a7da2336ac1c24 Mon Sep 17 00:00:00 2001
|
||||
From: Chengwen Feng <fengchengwen@huawei.com>
|
||||
Date: Tue, 2 Nov 2021 20:37:43 +0800
|
||||
Subject: [PATCH 22/33] usertools/devbind: add Kunpeng DMA
|
||||
|
||||
Add Kunpeng DMA device ID to dmadev category.
|
||||
|
||||
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
|
||||
---
|
||||
usertools/dpdk-devbind.py | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
mode change 100755 => 100644 usertools/dpdk-devbind.py
|
||||
|
||||
diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py
|
||||
old mode 100755
|
||||
new mode 100644
|
||||
index c2ede3d4d..8af3089ae
|
||||
--- a/usertools/dpdk-devbind.py
|
||||
+++ b/usertools/dpdk-devbind.py
|
||||
@@ -45,6 +45,8 @@
|
||||
octeontx2_ree = {'Class': '08', 'Vendor': '177d', 'Device': 'a0f4',
|
||||
'SVendor': None, 'SDevice': None}
|
||||
|
||||
+hisilicon_dma = {'Class': '08', 'Vendor': '19e5', 'Device': 'a122',
|
||||
+ 'SVendor': None, 'SDevice': None}
|
||||
intel_ioat_bdw = {'Class': '08', 'Vendor': '8086',
|
||||
'Device': '6f20,6f21,6f22,6f23,6f24,6f25,6f26,6f27,6f2e,6f2f',
|
||||
'SVendor': None, 'SDevice': None}
|
||||
@@ -62,7 +64,8 @@
|
||||
network_devices = [network_class, cavium_pkx, avp_vnic, ifpga_class]
|
||||
baseband_devices = [acceleration_class]
|
||||
crypto_devices = [encryption_class, intel_processor_class]
|
||||
-eventdev_devices = [cavium_sso, cavium_tim, octeontx2_sso]
|
||||
+dma_devices = [hisilicon_dma]
|
||||
+eventdev_devices = [cavium_sso, cavium_tim, intel_dlb, octeontx2_sso]
|
||||
mempool_devices = [cavium_fpa, octeontx2_npa]
|
||||
compress_devices = [cavium_zip]
|
||||
regex_devices = [octeontx2_ree]
|
||||
--
|
||||
2.33.0
|
||||
|
||||
54
0256-kni-check-error-code-of-allmulticast-mode-switch.patch
Normal file
54
0256-kni-check-error-code-of-allmulticast-mode-switch.patch
Normal file
@ -0,0 +1,54 @@
|
||||
From 72387188c6847df9a88d77c5428604db88441617 Mon Sep 17 00:00:00 2001
|
||||
From: Chengwen Feng <fengchengwen@huawei.com>
|
||||
Date: Fri, 23 Apr 2021 16:12:42 +0800
|
||||
Subject: [PATCH 23/33] kni: check error code of allmulticast mode switch
|
||||
|
||||
Some drivers may return errcode when switch allmulticast mode,
|
||||
so it's necessary to check the return code.
|
||||
|
||||
Fixes: b34801d1aa2e ("kni: support allmulticast mode set")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
|
||||
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
|
||||
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
|
||||
---
|
||||
lib/librte_kni/rte_kni.c | 13 ++++++++++---
|
||||
1 file changed, 10 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c
|
||||
index 837d0217d..54ea792fc 100644
|
||||
--- a/lib/librte_kni/rte_kni.c
|
||||
+++ b/lib/librte_kni/rte_kni.c
|
||||
@@ -514,6 +514,8 @@ kni_config_promiscusity(uint16_t port_id, uint8_t to_on)
|
||||
static int
|
||||
kni_config_allmulticast(uint16_t port_id, uint8_t to_on)
|
||||
{
|
||||
+ int ret;
|
||||
+
|
||||
if (!rte_eth_dev_is_valid_port(port_id)) {
|
||||
RTE_LOG(ERR, KNI, "Invalid port id %d\n", port_id);
|
||||
return -EINVAL;
|
||||
@@ -523,11 +525,16 @@ kni_config_allmulticast(uint16_t port_id, uint8_t to_on)
|
||||
port_id, to_on);
|
||||
|
||||
if (to_on)
|
||||
- rte_eth_allmulticast_enable(port_id);
|
||||
+ ret = rte_eth_allmulticast_enable(port_id);
|
||||
else
|
||||
- rte_eth_allmulticast_disable(port_id);
|
||||
+ ret = rte_eth_allmulticast_disable(port_id);
|
||||
+ if (ret != 0)
|
||||
+ RTE_LOG(ERR, KNI,
|
||||
+ "Failed to %s allmulticast mode for port %u: %s\n",
|
||||
+ to_on ? "enable" : "disable", port_id,
|
||||
+ rte_strerror(-ret));
|
||||
|
||||
- return 0;
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
int
|
||||
--
|
||||
2.33.0
|
||||
|
||||
42
0257-net-hns3-simplify-queue-DMA-address-arithmetic.patch
Normal file
42
0257-net-hns3-simplify-queue-DMA-address-arithmetic.patch
Normal file
@ -0,0 +1,42 @@
|
||||
From cc6216dd998af8500649b7eeb520af2b80abdb90 Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Sat, 6 Nov 2021 09:42:58 +0800
|
||||
Subject: [PATCH 24/33] net/hns3: simplify queue DMA address arithmetic
|
||||
|
||||
The patch obtains the upper 32 bits of the Rx/Tx queue DMA address in one
|
||||
step instead of two steps.
|
||||
|
||||
Fixes: bba636698316 ("net/hns3: support Rx/Tx and related operations")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_rxtx.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
|
||||
index bb1723e29..b63024997 100644
|
||||
--- a/drivers/net/hns3/hns3_rxtx.c
|
||||
+++ b/drivers/net/hns3/hns3_rxtx.c
|
||||
@@ -310,7 +310,7 @@ hns3_init_rx_queue_hw(struct hns3_rx_queue *rxq)
|
||||
|
||||
hns3_write_dev(rxq, HNS3_RING_RX_BASEADDR_L_REG, (uint32_t)dma_addr);
|
||||
hns3_write_dev(rxq, HNS3_RING_RX_BASEADDR_H_REG,
|
||||
- (uint32_t)((dma_addr >> 31) >> 1));
|
||||
+ (uint32_t)(dma_addr >> 32));
|
||||
|
||||
hns3_write_dev(rxq, HNS3_RING_RX_BD_LEN_REG,
|
||||
hns3_buf_size2type(rx_buf_len));
|
||||
@@ -325,7 +325,7 @@ hns3_init_tx_queue_hw(struct hns3_tx_queue *txq)
|
||||
|
||||
hns3_write_dev(txq, HNS3_RING_TX_BASEADDR_L_REG, (uint32_t)dma_addr);
|
||||
hns3_write_dev(txq, HNS3_RING_TX_BASEADDR_H_REG,
|
||||
- (uint32_t)((dma_addr >> 31) >> 1));
|
||||
+ (uint32_t)(dma_addr >> 32));
|
||||
|
||||
hns3_write_dev(txq, HNS3_RING_TX_BD_NUM_REG,
|
||||
HNS3_CFG_DESC_NUM(txq->nb_tx_desc));
|
||||
--
|
||||
2.33.0
|
||||
|
||||
29
0258-net-hns3-remove-redundant-function-declaration.patch
Normal file
29
0258-net-hns3-remove-redundant-function-declaration.patch
Normal file
@ -0,0 +1,29 @@
|
||||
From 0527eaf2489c1657ccf02a9e71f4e684eec5da77 Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Sat, 6 Nov 2021 09:42:59 +0800
|
||||
Subject: [PATCH 25/33] net/hns3: remove redundant function declaration
|
||||
|
||||
This patch removes a redundant function declaration for
|
||||
hns3_rx_check_vec_support().
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_rxtx.h | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_rxtx.h b/drivers/net/hns3/hns3_rxtx.h
|
||||
index cd7c21c1d..4c8b88352 100644
|
||||
--- a/drivers/net/hns3/hns3_rxtx.h
|
||||
+++ b/drivers/net/hns3/hns3_rxtx.h
|
||||
@@ -712,7 +712,6 @@ uint16_t hns3_recv_pkts_vec_sve(void *rx_queue, struct rte_mbuf **rx_pkts,
|
||||
int hns3_rx_burst_mode_get(struct rte_eth_dev *dev,
|
||||
__rte_unused uint16_t queue_id,
|
||||
struct rte_eth_burst_mode *mode);
|
||||
-int hns3_rx_check_vec_support(struct rte_eth_dev *dev);
|
||||
uint16_t hns3_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
|
||||
uint16_t nb_pkts);
|
||||
uint16_t hns3_xmit_pkts_simple(void *tx_queue, struct rte_mbuf **tx_pkts,
|
||||
--
|
||||
2.33.0
|
||||
|
||||
30
0259-net-hns3-modify-an-indent-alignment.patch
Normal file
30
0259-net-hns3-modify-an-indent-alignment.patch
Normal file
@ -0,0 +1,30 @@
|
||||
From e3b6924c495f721af74a89c001dbb2497dfbcc1d Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Sat, 6 Nov 2021 09:43:00 +0800
|
||||
Subject: [PATCH 26/33] net/hns3: modify an indent alignment
|
||||
|
||||
This patch modifies some code alignment issues to make the code style
|
||||
more consistent.
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_rxtx.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
|
||||
index b63024997..d5aa72c8f 100644
|
||||
--- a/drivers/net/hns3/hns3_rxtx.c
|
||||
+++ b/drivers/net/hns3/hns3_rxtx.c
|
||||
@@ -1895,7 +1895,7 @@ hns3_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t nb_desc,
|
||||
*/
|
||||
if (hns->is_vf || hw->vlan_mode == HNS3_SW_SHIFT_AND_DISCARD_MODE)
|
||||
rxq->pvid_sw_discard_en = hw->port_base_vlan_cfg.state ==
|
||||
- HNS3_PORT_BASE_VLAN_ENABLE;
|
||||
+ HNS3_PORT_BASE_VLAN_ENABLE;
|
||||
else
|
||||
rxq->pvid_sw_discard_en = false;
|
||||
rxq->ptype_en = hns3_dev_get_support(hw, RXD_ADV_LAYOUT) ? true : false;
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -0,0 +1,39 @@
|
||||
From 36c73d69efda51972d64318ef8cb1c7fefde482f Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Sat, 6 Nov 2021 09:43:01 +0800
|
||||
Subject: [PATCH 27/33] net/hns3: use unsigned integer for bitwise operations
|
||||
|
||||
Bitwise operations should be used only with unsigned integer. This patch
|
||||
modifies some code that does not meet this rule.
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_ethdev.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
|
||||
index ecf912a9f..03f6da5bc 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.c
|
||||
@@ -2104,7 +2104,7 @@ hns3_check_mq_mode(struct rte_eth_dev *dev)
|
||||
int max_tc = 0;
|
||||
int i;
|
||||
|
||||
- if ((rx_mq_mode & ETH_MQ_RX_VMDQ_FLAG) ||
|
||||
+ if (((uint32_t)rx_mq_mode & ETH_MQ_RX_VMDQ_FLAG) ||
|
||||
(tx_mq_mode == ETH_MQ_TX_VMDQ_DCB ||
|
||||
tx_mq_mode == ETH_MQ_TX_VMDQ_ONLY)) {
|
||||
hns3_err(hw, "VMDQ is not supported, rx_mq_mode = %d, tx_mq_mode = %d.",
|
||||
@@ -2114,7 +2114,7 @@ hns3_check_mq_mode(struct rte_eth_dev *dev)
|
||||
|
||||
dcb_rx_conf = &dev->data->dev_conf.rx_adv_conf.dcb_rx_conf;
|
||||
dcb_tx_conf = &dev->data->dev_conf.tx_adv_conf.dcb_tx_conf;
|
||||
- if (rx_mq_mode & ETH_MQ_RX_DCB_FLAG) {
|
||||
+ if ((uint32_t)rx_mq_mode & ETH_MQ_RX_DCB_FLAG) {
|
||||
if (dcb_rx_conf->nb_tcs > pf->tc_max) {
|
||||
hns3_err(hw, "nb_tcs(%u) > max_tc(%u) driver supported.",
|
||||
dcb_rx_conf->nb_tcs, pf->tc_max);
|
||||
--
|
||||
2.33.0
|
||||
|
||||
1143
0261-net-hns3-extract-common-code-to-its-own-file.patch
Normal file
1143
0261-net-hns3-extract-common-code-to-its-own-file.patch
Normal file
File diff suppressed because it is too large
Load Diff
191
0262-net-hns3-move-declarations-in-flow-header-file.patch
Normal file
191
0262-net-hns3-move-declarations-in-flow-header-file.patch
Normal file
@ -0,0 +1,191 @@
|
||||
From f50d0076e2e9dad6e94fcc64108fb52592bf5c00 Mon Sep 17 00:00:00 2001
|
||||
From: "Min Hu (Connor)" <humin29@huawei.com>
|
||||
Date: Sat, 6 Nov 2021 09:43:03 +0800
|
||||
Subject: [PATCH 29/33] net/hns3: move declarations in flow header file
|
||||
|
||||
This patch adds a hns3_flow.h to make the code easier to maintain.
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_ethdev.c | 1 +
|
||||
drivers/net/hns3/hns3_ethdev.h | 1 +
|
||||
drivers/net/hns3/hns3_ethdev_vf.c | 1 +
|
||||
drivers/net/hns3/hns3_fdir.h | 31 ----------------------
|
||||
drivers/net/hns3/hns3_flow.c | 1 +
|
||||
drivers/net/hns3/hns3_flow.h | 44 +++++++++++++++++++++++++++++++
|
||||
6 files changed, 48 insertions(+), 31 deletions(-)
|
||||
create mode 100644 drivers/net/hns3/hns3_flow.h
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
|
||||
index 818835391..5a826c7aa 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.c
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "hns3_regs.h"
|
||||
#include "hns3_dcb.h"
|
||||
#include "hns3_mp.h"
|
||||
+#include "hns3_flow.h"
|
||||
|
||||
#define HNS3_SERVICE_INTERVAL 1000000 /* us */
|
||||
#define HNS3_SERVICE_QUICK_INTERVAL 10
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h
|
||||
index 96671159b..960f781e1 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev.h
|
||||
+++ b/drivers/net/hns3/hns3_ethdev.h
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "hns3_fdir.h"
|
||||
#include "hns3_stats.h"
|
||||
#include "hns3_tm.h"
|
||||
+#include "hns3_flow.h"
|
||||
|
||||
/* Vendor ID */
|
||||
#define PCI_VENDOR_ID_HUAWEI 0x19e5
|
||||
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
index c234e74b8..84ae26987 100644
|
||||
--- a/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "hns3_intr.h"
|
||||
#include "hns3_dcb.h"
|
||||
#include "hns3_mp.h"
|
||||
+#include "hns3_flow.h"
|
||||
|
||||
#define HNS3VF_KEEP_ALIVE_INTERVAL 2000000 /* us */
|
||||
#define HNS3VF_SERVICE_INTERVAL 1000000 /* us */
|
||||
diff --git a/drivers/net/hns3/hns3_fdir.h b/drivers/net/hns3/hns3_fdir.h
|
||||
index 3f610f7b1..f9efff3b5 100644
|
||||
--- a/drivers/net/hns3/hns3_fdir.h
|
||||
+++ b/drivers/net/hns3/hns3_fdir.h
|
||||
@@ -5,8 +5,6 @@
|
||||
#ifndef _HNS3_FDIR_H_
|
||||
#define _HNS3_FDIR_H_
|
||||
|
||||
-#include <rte_flow.h>
|
||||
-
|
||||
struct hns3_fd_key_cfg {
|
||||
uint8_t key_sel;
|
||||
uint8_t inner_sipv6_word_en;
|
||||
@@ -124,14 +122,6 @@ struct hns3_fd_ad_data {
|
||||
uint16_t rule_id;
|
||||
};
|
||||
|
||||
-struct hns3_flow_counter {
|
||||
- LIST_ENTRY(hns3_flow_counter) next; /* Pointer to the next counter. */
|
||||
- uint32_t shared:1; /* Share counter ID with other flow rules. */
|
||||
- uint32_t ref_cnt:31; /* Reference counter. */
|
||||
- uint16_t id; /* Counter ID. */
|
||||
- uint64_t hits; /* Number of packets matched by the rule. */
|
||||
-};
|
||||
-
|
||||
#define HNS3_RULE_FLAG_FDID 0x1
|
||||
#define HNS3_RULE_FLAG_VF_ID 0x2
|
||||
#define HNS3_RULE_FLAG_COUNTER 0x4
|
||||
@@ -173,21 +163,7 @@ struct hns3_fdir_rule_ele {
|
||||
struct hns3_fdir_rule fdir_conf;
|
||||
};
|
||||
|
||||
-/* rss filter list structure */
|
||||
-struct hns3_rss_conf_ele {
|
||||
- TAILQ_ENTRY(hns3_rss_conf_ele) entries;
|
||||
- struct hns3_rss_conf filter_info;
|
||||
-};
|
||||
-
|
||||
-/* hns3_flow memory list structure */
|
||||
-struct hns3_flow_mem {
|
||||
- TAILQ_ENTRY(hns3_flow_mem) entries;
|
||||
- struct rte_flow *flow;
|
||||
-};
|
||||
-
|
||||
TAILQ_HEAD(hns3_fdir_rule_list, hns3_fdir_rule_ele);
|
||||
-TAILQ_HEAD(hns3_rss_filter_list, hns3_rss_conf_ele);
|
||||
-TAILQ_HEAD(hns3_flow_mem_list, hns3_flow_mem);
|
||||
|
||||
/*
|
||||
* A structure used to define fields of a FDIR related info.
|
||||
@@ -199,11 +175,6 @@ struct hns3_fdir_info {
|
||||
struct hns3_fd_cfg fd_cfg;
|
||||
};
|
||||
|
||||
-struct rte_flow {
|
||||
- enum rte_filter_type filter_type;
|
||||
- void *rule;
|
||||
- uint32_t counter_id;
|
||||
-};
|
||||
struct hns3_adapter;
|
||||
|
||||
int hns3_init_fd_config(struct hns3_adapter *hns);
|
||||
@@ -213,8 +184,6 @@ int hns3_fdir_filter_program(struct hns3_adapter *hns,
|
||||
struct hns3_fdir_rule *rule, bool del);
|
||||
int hns3_clear_all_fdir_filter(struct hns3_adapter *hns);
|
||||
int hns3_get_count(struct hns3_hw *hw, uint32_t id, uint64_t *value);
|
||||
-void hns3_flow_init(struct rte_eth_dev *dev);
|
||||
-void hns3_flow_uninit(struct rte_eth_dev *dev);
|
||||
int hns3_restore_all_fdir_filter(struct hns3_adapter *hns);
|
||||
|
||||
#endif /* _HNS3_FDIR_H_ */
|
||||
diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
|
||||
index b25fccbca..73ef91ce9 100644
|
||||
--- a/drivers/net/hns3/hns3_flow.c
|
||||
+++ b/drivers/net/hns3/hns3_flow.c
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#include "hns3_ethdev.h"
|
||||
#include "hns3_logs.h"
|
||||
+#include "hns3_flow.h"
|
||||
|
||||
/* Default default keys */
|
||||
static uint8_t hns3_hash_key[] = {
|
||||
diff --git a/drivers/net/hns3/hns3_flow.h b/drivers/net/hns3/hns3_flow.h
|
||||
new file mode 100644
|
||||
index 000000000..2eb451b72
|
||||
--- /dev/null
|
||||
+++ b/drivers/net/hns3/hns3_flow.h
|
||||
@@ -0,0 +1,44 @@
|
||||
+/* SPDX-License-Identifier: BSD-3-Clause
|
||||
+ * Copyright(C) 2021 HiSilicon Limited
|
||||
+ */
|
||||
+
|
||||
+#ifndef _HNS3_FLOW_H_
|
||||
+#define _HNS3_FLOW_H_
|
||||
+
|
||||
+#include <rte_flow.h>
|
||||
+
|
||||
+struct hns3_flow_counter {
|
||||
+ LIST_ENTRY(hns3_flow_counter) next; /* Pointer to the next counter. */
|
||||
+ uint32_t shared:1; /* Share counter ID with other flow rules. */
|
||||
+ uint32_t ref_cnt:31; /* Reference counter. */
|
||||
+ uint16_t id; /* Counter ID. */
|
||||
+ uint64_t hits; /* Number of packets matched by the rule. */
|
||||
+};
|
||||
+
|
||||
+struct rte_flow {
|
||||
+ enum rte_filter_type filter_type;
|
||||
+ void *rule;
|
||||
+ uint32_t counter_id;
|
||||
+};
|
||||
+
|
||||
+/* rss filter list structure */
|
||||
+struct hns3_rss_conf_ele {
|
||||
+ TAILQ_ENTRY(hns3_rss_conf_ele) entries;
|
||||
+ struct hns3_rss_conf filter_info;
|
||||
+};
|
||||
+
|
||||
+/* hns3_flow memory list structure */
|
||||
+struct hns3_flow_mem {
|
||||
+ TAILQ_ENTRY(hns3_flow_mem) entries;
|
||||
+ struct rte_flow *flow;
|
||||
+};
|
||||
+
|
||||
+TAILQ_HEAD(hns3_rss_filter_list, hns3_rss_conf_ele);
|
||||
+TAILQ_HEAD(hns3_flow_mem_list, hns3_flow_mem);
|
||||
+
|
||||
+int hns3_dev_flow_ops_get(struct rte_eth_dev *dev,
|
||||
+ const struct rte_flow_ops **ops);
|
||||
+void hns3_flow_init(struct rte_eth_dev *dev);
|
||||
+void hns3_flow_uninit(struct rte_eth_dev *dev);
|
||||
+
|
||||
+#endif /* _HNS3_FLOW_H_ */
|
||||
--
|
||||
2.33.0
|
||||
|
||||
53
0263-net-hns3-remove-magic-numbers.patch
Normal file
53
0263-net-hns3-remove-magic-numbers.patch
Normal file
@ -0,0 +1,53 @@
|
||||
From b96b2ca6d5b510d372137ef4b3ef66b762434c92 Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Sat, 6 Nov 2021 09:43:04 +0800
|
||||
Subject: [PATCH 30/33] net/hns3: remove magic numbers
|
||||
|
||||
Removing magic numbers with macros.
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_common.c | 4 ++--
|
||||
drivers/net/hns3/hns3_common.h | 3 +++
|
||||
2 files changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_common.c b/drivers/net/hns3/hns3_common.c
|
||||
index 85316d342..c306e0b0e 100644
|
||||
--- a/drivers/net/hns3/hns3_common.c
|
||||
+++ b/drivers/net/hns3/hns3_common.c
|
||||
@@ -54,7 +54,7 @@ hns3_parse_dev_caps_mask(const char *key, const char *value, void *extra_args)
|
||||
|
||||
RTE_SET_USED(key);
|
||||
|
||||
- val = strtoull(value, NULL, 16);
|
||||
+ val = strtoull(value, NULL, HNS3_CONVERT_TO_HEXADECIMAL);
|
||||
*(uint64_t *)extra_args = val;
|
||||
|
||||
return 0;
|
||||
@@ -67,7 +67,7 @@ hns3_parse_mbx_time_limit(const char *key, const char *value, void *extra_args)
|
||||
|
||||
RTE_SET_USED(key);
|
||||
|
||||
- val = strtoul(value, NULL, 10);
|
||||
+ val = strtoul(value, NULL, HNS3_CONVERT_TO_DECIMAL);
|
||||
if (val > HNS3_MBX_DEF_TIME_LIMIT_MS && val <= UINT16_MAX)
|
||||
*(uint16_t *)extra_args = val;
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_common.h b/drivers/net/hns3/hns3_common.h
|
||||
index 094a0bc5f..68f9b1b96 100644
|
||||
--- a/drivers/net/hns3/hns3_common.h
|
||||
+++ b/drivers/net/hns3/hns3_common.h
|
||||
@@ -9,6 +9,9 @@
|
||||
|
||||
#include "hns3_ethdev.h"
|
||||
|
||||
+#define HNS3_CONVERT_TO_DECIMAL 10
|
||||
+#define HNS3_CONVERT_TO_HEXADECIMAL 16
|
||||
+
|
||||
enum {
|
||||
HNS3_IO_FUNC_HINT_NONE = 0,
|
||||
HNS3_IO_FUNC_HINT_VEC,
|
||||
--
|
||||
2.33.0
|
||||
|
||||
38
0264-net-hns3-mark-unchecked-return-of-snprintf.patch
Normal file
38
0264-net-hns3-mark-unchecked-return-of-snprintf.patch
Normal file
@ -0,0 +1,38 @@
|
||||
From dee0abb3ec0a868c1f213165bd88c7a26c4ee253 Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Sat, 6 Nov 2021 09:43:05 +0800
|
||||
Subject: [PATCH 31/33] net/hns3: mark unchecked return of snprintf
|
||||
|
||||
Fixing the return value of the function to clear static warning.
|
||||
|
||||
Fixes: 1181500b2fc5 ("net/hns3: adjust MAC address logging")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
|
||||
---
|
||||
drivers/net/hns3/hns3_common.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/hns3/hns3_common.c b/drivers/net/hns3/hns3_common.c
|
||||
index c306e0b0e..9a47fbfbd 100644
|
||||
--- a/drivers/net/hns3/hns3_common.c
|
||||
+++ b/drivers/net/hns3/hns3_common.c
|
||||
@@ -154,10 +154,10 @@ hns3_clock_gettime_ms(void)
|
||||
void hns3_ether_format_addr(char *buf, uint16_t size,
|
||||
const struct rte_ether_addr *ether_addr)
|
||||
{
|
||||
- snprintf(buf, size, "%02X:**:**:**:%02X:%02X",
|
||||
- ether_addr->addr_bytes[0],
|
||||
- ether_addr->addr_bytes[4],
|
||||
- ether_addr->addr_bytes[5]);
|
||||
+ (void)snprintf(buf, size, "%02X:**:**:**:%02X:%02X",
|
||||
+ ether_addr->addr_bytes[0],
|
||||
+ ether_addr->addr_bytes[4],
|
||||
+ ether_addr->addr_bytes[5]);
|
||||
}
|
||||
|
||||
static int
|
||||
--
|
||||
2.33.0
|
||||
|
||||
1256
0265-net-hns3-remove-PF-VF-duplicate-code.patch
Normal file
1256
0265-net-hns3-remove-PF-VF-duplicate-code.patch
Normal file
File diff suppressed because it is too large
Load Diff
252
0266-app-testpmd-remove-unused-header-file.patch
Normal file
252
0266-app-testpmd-remove-unused-header-file.patch
Normal file
@ -0,0 +1,252 @@
|
||||
From 11bcfb49be7f092d8d20d88dfdc5358196d3ecca Mon Sep 17 00:00:00 2001
|
||||
From: Huisong Li <lihuisong@huawei.com>
|
||||
Date: Mon, 25 Oct 2021 14:39:22 +0800
|
||||
Subject: [PATCH 33/33] app/testpmd: remove unused header file
|
||||
|
||||
This patch removes unused "rte_eth_bond.h" header file.
|
||||
|
||||
Fixes: 2950a769315e ("bond: testpmd support")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Huisong Li <lihuisong@huawei.com>
|
||||
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
|
||||
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
|
||||
---
|
||||
app/test-pmd/parameters.c | 3 -
|
||||
drivers/net/hns3/hns3_common.c | 101 +++++++++++++++++----------------
|
||||
drivers/net/hns3/hns3_flow.h | 5 +-
|
||||
3 files changed, 55 insertions(+), 54 deletions(-)
|
||||
|
||||
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
|
||||
index c464c42f6..2a69df5b7 100644
|
||||
--- a/app/test-pmd/parameters.c
|
||||
+++ b/app/test-pmd/parameters.c
|
||||
@@ -39,9 +39,6 @@
|
||||
#include <rte_ether.h>
|
||||
#include <rte_ethdev.h>
|
||||
#include <rte_string_fns.h>
|
||||
-#ifdef RTE_NET_BOND
|
||||
-#include <rte_eth_bond.h>
|
||||
-#endif
|
||||
#include <rte_flow.h>
|
||||
|
||||
#include "testpmd.h"
|
||||
diff --git a/drivers/net/hns3/hns3_common.c b/drivers/net/hns3/hns3_common.c
|
||||
index eac2aa104..0328f2beb 100644
|
||||
--- a/drivers/net/hns3/hns3_common.c
|
||||
+++ b/drivers/net/hns3/hns3_common.c
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <rte_kvargs.h>
|
||||
#include <rte_bus_pci.h>
|
||||
-#include <ethdev_pci.h>
|
||||
+#include <rte_ethdev_pci.h>
|
||||
#include <rte_pci.h>
|
||||
|
||||
#include "hns3_common.h"
|
||||
@@ -60,43 +60,42 @@ hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
|
||||
info->min_rx_bufsize = HNS3_MIN_BD_BUF_SIZE;
|
||||
info->max_mtu = info->max_rx_pktlen - HNS3_ETH_OVERHEAD;
|
||||
info->max_lro_pkt_size = HNS3_MAX_LRO_SIZE;
|
||||
- info->rx_offload_capa = (RTE_ETH_RX_OFFLOAD_IPV4_CKSUM |
|
||||
- RTE_ETH_RX_OFFLOAD_TCP_CKSUM |
|
||||
- RTE_ETH_RX_OFFLOAD_UDP_CKSUM |
|
||||
- RTE_ETH_RX_OFFLOAD_SCTP_CKSUM |
|
||||
- RTE_ETH_RX_OFFLOAD_OUTER_IPV4_CKSUM |
|
||||
- RTE_ETH_RX_OFFLOAD_OUTER_UDP_CKSUM |
|
||||
- RTE_ETH_RX_OFFLOAD_SCATTER |
|
||||
- RTE_ETH_RX_OFFLOAD_VLAN_STRIP |
|
||||
- RTE_ETH_RX_OFFLOAD_VLAN_FILTER |
|
||||
- RTE_ETH_RX_OFFLOAD_RSS_HASH |
|
||||
- RTE_ETH_RX_OFFLOAD_TCP_LRO);
|
||||
- info->tx_offload_capa = (RTE_ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM |
|
||||
- RTE_ETH_TX_OFFLOAD_IPV4_CKSUM |
|
||||
- RTE_ETH_TX_OFFLOAD_TCP_CKSUM |
|
||||
- RTE_ETH_TX_OFFLOAD_UDP_CKSUM |
|
||||
- RTE_ETH_TX_OFFLOAD_SCTP_CKSUM |
|
||||
- RTE_ETH_TX_OFFLOAD_MULTI_SEGS |
|
||||
- RTE_ETH_TX_OFFLOAD_TCP_TSO |
|
||||
- RTE_ETH_TX_OFFLOAD_VXLAN_TNL_TSO |
|
||||
- RTE_ETH_TX_OFFLOAD_GRE_TNL_TSO |
|
||||
- RTE_ETH_TX_OFFLOAD_GENEVE_TNL_TSO |
|
||||
- RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE |
|
||||
- RTE_ETH_TX_OFFLOAD_VLAN_INSERT);
|
||||
+ info->rx_offload_capa = (DEV_RX_OFFLOAD_IPV4_CKSUM |
|
||||
+ DEV_RX_OFFLOAD_TCP_CKSUM |
|
||||
+ DEV_RX_OFFLOAD_UDP_CKSUM |
|
||||
+ DEV_RX_OFFLOAD_SCTP_CKSUM |
|
||||
+ DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
|
||||
+ DEV_RX_OFFLOAD_OUTER_UDP_CKSUM |
|
||||
+ DEV_RX_OFFLOAD_SCATTER |
|
||||
+ DEV_RX_OFFLOAD_VLAN_STRIP |
|
||||
+ DEV_RX_OFFLOAD_VLAN_FILTER |
|
||||
+ DEV_RX_OFFLOAD_RSS_HASH |
|
||||
+ DEV_RX_OFFLOAD_TCP_LRO);
|
||||
+ info->tx_offload_capa = (DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM |
|
||||
+ DEV_TX_OFFLOAD_IPV4_CKSUM |
|
||||
+ DEV_TX_OFFLOAD_TCP_CKSUM |
|
||||
+ DEV_TX_OFFLOAD_UDP_CKSUM |
|
||||
+ DEV_TX_OFFLOAD_SCTP_CKSUM |
|
||||
+ DEV_TX_OFFLOAD_MULTI_SEGS |
|
||||
+ DEV_TX_OFFLOAD_TCP_TSO |
|
||||
+ DEV_TX_OFFLOAD_VXLAN_TNL_TSO |
|
||||
+ DEV_TX_OFFLOAD_GRE_TNL_TSO |
|
||||
+ DEV_TX_OFFLOAD_GENEVE_TNL_TSO |
|
||||
+ DEV_TX_OFFLOAD_MBUF_FAST_FREE |
|
||||
+ DEV_TX_OFFLOAD_VLAN_INSERT);
|
||||
|
||||
if (!hw->port_base_vlan_cfg.state)
|
||||
- info->tx_offload_capa |= RTE_ETH_TX_OFFLOAD_QINQ_INSERT;
|
||||
+ info->tx_offload_capa |= DEV_TX_OFFLOAD_QINQ_INSERT;
|
||||
|
||||
if (hns3_dev_get_support(hw, OUTER_UDP_CKSUM))
|
||||
- info->tx_offload_capa |= RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM;
|
||||
+ info->tx_offload_capa |= DEV_TX_OFFLOAD_OUTER_UDP_CKSUM;
|
||||
|
||||
if (hns3_dev_get_support(hw, INDEP_TXRX))
|
||||
info->dev_capa = RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP |
|
||||
RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP;
|
||||
- info->dev_capa &= ~RTE_ETH_DEV_CAPA_FLOW_RULE_KEEP;
|
||||
|
||||
if (hns3_dev_get_support(hw, PTP))
|
||||
- info->rx_offload_capa |= RTE_ETH_RX_OFFLOAD_TIMESTAMP;
|
||||
+ info->rx_offload_capa |= DEV_RX_OFFLOAD_TIMESTAMP;
|
||||
|
||||
info->rx_desc_lim = (struct rte_eth_desc_lim) {
|
||||
.nb_max = HNS3_MAX_RING_DESC,
|
||||
@@ -143,7 +142,7 @@ hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
|
||||
*/
|
||||
if (!hns->is_vf) {
|
||||
info->max_mac_addrs = HNS3_UC_MACADDR_NUM;
|
||||
- info->rx_offload_capa |= RTE_ETH_RX_OFFLOAD_KEEP_CRC;
|
||||
+ info->rx_offload_capa |= DEV_RX_OFFLOAD_KEEP_CRC;
|
||||
info->speed_capa = hns3_get_speed_capa(hw);
|
||||
} else {
|
||||
info->max_mac_addrs = HNS3_VF_UC_MACADDR_NUM;
|
||||
@@ -641,7 +640,7 @@ int
|
||||
hns3_map_rx_interrupt(struct rte_eth_dev *dev)
|
||||
{
|
||||
struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
|
||||
- struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
|
||||
+ struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
|
||||
struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
|
||||
uint16_t base = RTE_INTR_VEC_ZERO_OFFSET;
|
||||
uint16_t vec = RTE_INTR_VEC_ZERO_OFFSET;
|
||||
@@ -664,13 +663,16 @@ hns3_map_rx_interrupt(struct rte_eth_dev *dev)
|
||||
if (rte_intr_efd_enable(intr_handle, intr_vector))
|
||||
return -EINVAL;
|
||||
|
||||
- /* Allocate vector list */
|
||||
- if (rte_intr_vec_list_alloc(intr_handle, "intr_vec",
|
||||
- hw->used_rx_queues)) {
|
||||
- hns3_err(hw, "failed to allocate %u rx_queues intr_vec",
|
||||
- hw->used_rx_queues);
|
||||
- ret = -ENOMEM;
|
||||
- goto alloc_intr_vec_error;
|
||||
+ if (intr_handle->intr_vec == NULL) {
|
||||
+ intr_handle->intr_vec =
|
||||
+ rte_zmalloc("intr_vec",
|
||||
+ hw->used_rx_queues * sizeof(int), 0);
|
||||
+ if (intr_handle->intr_vec == NULL) {
|
||||
+ hns3_err(hw, "failed to allocate %u rx_queues intr_vec",
|
||||
+ hw->used_rx_queues);
|
||||
+ ret = -ENOMEM;
|
||||
+ goto alloc_intr_vec_error;
|
||||
+ }
|
||||
}
|
||||
|
||||
if (rte_intr_allow_others(intr_handle)) {
|
||||
@@ -683,21 +685,20 @@ hns3_map_rx_interrupt(struct rte_eth_dev *dev)
|
||||
HNS3_RING_TYPE_RX, q_id);
|
||||
if (ret)
|
||||
goto bind_vector_error;
|
||||
-
|
||||
- if (rte_intr_vec_list_index_set(intr_handle, q_id, vec))
|
||||
- goto bind_vector_error;
|
||||
+ intr_handle->intr_vec[q_id] = vec;
|
||||
/*
|
||||
* If there are not enough efds (e.g. not enough interrupt),
|
||||
* remaining queues will be bond to the last interrupt.
|
||||
*/
|
||||
- if (vec < base + rte_intr_nb_efd_get(intr_handle) - 1)
|
||||
+ if (vec < base + intr_handle->nb_efd - 1)
|
||||
vec++;
|
||||
}
|
||||
rte_intr_enable(intr_handle);
|
||||
return 0;
|
||||
|
||||
bind_vector_error:
|
||||
- rte_intr_vec_list_free(intr_handle);
|
||||
+ rte_free(intr_handle->intr_vec);
|
||||
+ intr_handle->intr_vec = NULL;
|
||||
alloc_intr_vec_error:
|
||||
rte_intr_efd_disable(intr_handle);
|
||||
return ret;
|
||||
@@ -707,7 +708,7 @@ void
|
||||
hns3_unmap_rx_interrupt(struct rte_eth_dev *dev)
|
||||
{
|
||||
struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
|
||||
- struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
|
||||
+ struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
|
||||
struct hns3_adapter *hns = dev->data->dev_private;
|
||||
struct hns3_hw *hw = &hns->hw;
|
||||
uint8_t base = RTE_INTR_VEC_ZERO_OFFSET;
|
||||
@@ -727,13 +728,16 @@ hns3_unmap_rx_interrupt(struct rte_eth_dev *dev)
|
||||
(void)hw->ops.bind_ring_with_vector(hw, vec, false,
|
||||
HNS3_RING_TYPE_RX,
|
||||
q_id);
|
||||
- if (vec < base + rte_intr_nb_efd_get(intr_handle) - 1)
|
||||
+ if (vec < base + intr_handle->nb_efd - 1)
|
||||
vec++;
|
||||
}
|
||||
}
|
||||
/* Clean datapath event and queue/vec mapping */
|
||||
rte_intr_efd_disable(intr_handle);
|
||||
- rte_intr_vec_list_free(intr_handle);
|
||||
+ if (intr_handle->intr_vec) {
|
||||
+ rte_free(intr_handle->intr_vec);
|
||||
+ intr_handle->intr_vec = NULL;
|
||||
+ }
|
||||
}
|
||||
|
||||
int
|
||||
@@ -741,7 +745,7 @@ hns3_restore_rx_interrupt(struct hns3_hw *hw)
|
||||
{
|
||||
struct rte_eth_dev *dev = &rte_eth_devices[hw->data->port_id];
|
||||
struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
|
||||
- struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
|
||||
+ struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
|
||||
uint16_t q_id;
|
||||
int ret;
|
||||
|
||||
@@ -751,9 +755,8 @@ hns3_restore_rx_interrupt(struct hns3_hw *hw)
|
||||
if (rte_intr_dp_is_en(intr_handle)) {
|
||||
for (q_id = 0; q_id < hw->used_rx_queues; q_id++) {
|
||||
ret = hw->ops.bind_ring_with_vector(hw,
|
||||
- rte_intr_vec_list_index_get(intr_handle,
|
||||
- q_id),
|
||||
- true, HNS3_RING_TYPE_RX, q_id);
|
||||
+ intr_handle->intr_vec[q_id], true,
|
||||
+ HNS3_RING_TYPE_RX, q_id);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
diff --git a/drivers/net/hns3/hns3_flow.h b/drivers/net/hns3/hns3_flow.h
|
||||
index 2eb451b72..d679e5928 100644
|
||||
--- a/drivers/net/hns3/hns3_flow.h
|
||||
+++ b/drivers/net/hns3/hns3_flow.h
|
||||
@@ -36,8 +36,9 @@ struct hns3_flow_mem {
|
||||
TAILQ_HEAD(hns3_rss_filter_list, hns3_rss_conf_ele);
|
||||
TAILQ_HEAD(hns3_flow_mem_list, hns3_flow_mem);
|
||||
|
||||
-int hns3_dev_flow_ops_get(struct rte_eth_dev *dev,
|
||||
- const struct rte_flow_ops **ops);
|
||||
+int hns3_dev_filter_ctrl(struct rte_eth_dev *dev,
|
||||
+ enum rte_filter_type filter_type,
|
||||
+ enum rte_filter_op filter_op, void *arg);
|
||||
void hns3_flow_init(struct rte_eth_dev *dev);
|
||||
void hns3_flow_uninit(struct rte_eth_dev *dev);
|
||||
|
||||
--
|
||||
2.33.0
|
||||
|
||||
38
dpdk.spec
38
dpdk.spec
@ -1,6 +1,6 @@
|
||||
Name: dpdk
|
||||
Version: 20.11
|
||||
Release: 14
|
||||
Release: 15
|
||||
Packager: packaging@6wind.com
|
||||
URL: http://dpdk.org
|
||||
%global source_version 20.11
|
||||
@ -240,6 +240,39 @@ Patch230: 0230-net-hns3-fix-mailbox-communication-with-HW.patch
|
||||
Patch231: 0231-app-testpmd-support-multi-process.patch
|
||||
Patch232: 0232-app-testpmd-fix-key-for-RSS-flow-rule.patch
|
||||
Patch233: 0233-app-testpmd-release-flows-left-before-port-stop.patch
|
||||
Patch234: 0234-app-testpmd-delete-unused-function.patch
|
||||
Patch235: 0235-dmadev-introduce-DMA-device-support.patch
|
||||
Patch236: 0236-net-hns3-rename-multicast-address-function.patch
|
||||
Patch237: 0237-net-hns3-rename-unicast-address-function.patch
|
||||
Patch238: 0238-net-hns3-rename-multicast-address-removal-function.patch
|
||||
Patch239: 0239-net-hns3-extract-common-interface-to-check-duplicate.patch
|
||||
Patch240: 0240-net-hns3-remove-redundant-multicast-MAC-interface.patch
|
||||
Patch241: 0241-net-hns3-rename-unicast-address-removal-function.patch
|
||||
Patch242: 0242-net-hns3-remove-redundant-multicast-removal-interfac.patch
|
||||
Patch243: 0243-net-hns3-add-HW-ops-structure-to-operate-hardware.patch
|
||||
Patch244: 0244-net-hns3-use-HW-ops-to-config-MAC-features.patch
|
||||
Patch245: 0245-net-hns3-unify-MAC-and-multicast-address-configurati.patch
|
||||
Patch246: 0246-net-hns3-unify-MAC-address-add-and-remove.patch
|
||||
Patch247: 0247-net-hns3-unify-multicast-address-check.patch
|
||||
Patch248: 0248-net-hns3-refactor-multicast-MAC-address-set-for-PF.patch
|
||||
Patch249: 0249-net-hns3-unify-multicast-MAC-address-set-list.patch
|
||||
Patch250: 0250-bonding-show-Tx-policy-for-802.3AD-mode.patch
|
||||
Patch251: 0251-net-hns3-fix-secondary-process-reference-count.patch
|
||||
Patch252: 0252-net-hns3-fix-multi-process-action-register-and-unreg.patch
|
||||
Patch253: 0253-net-hns3-unregister-MP-action-on-close-for-secondary.patch
|
||||
Patch254: 0254-net-hns3-refactor-multi-process-initialization.patch
|
||||
Patch255: 0255-usertools-devbind-add-Kunpeng-DMA.patch
|
||||
Patch256: 0256-kni-check-error-code-of-allmulticast-mode-switch.patch
|
||||
Patch257: 0257-net-hns3-simplify-queue-DMA-address-arithmetic.patch
|
||||
Patch258: 0258-net-hns3-remove-redundant-function-declaration.patch
|
||||
Patch259: 0259-net-hns3-modify-an-indent-alignment.patch
|
||||
Patch260: 0260-net-hns3-use-unsigned-integer-for-bitwise-operations.patch
|
||||
Patch261: 0261-net-hns3-extract-common-code-to-its-own-file.patch
|
||||
Patch262: 0262-net-hns3-move-declarations-in-flow-header-file.patch
|
||||
Patch263: 0263-net-hns3-remove-magic-numbers.patch
|
||||
Patch264: 0264-net-hns3-mark-unchecked-return-of-snprintf.patch
|
||||
Patch265: 0265-net-hns3-remove-PF-VF-duplicate-code.patch
|
||||
Patch266: 0266-app-testpmd-remove-unused-header-file.patch
|
||||
|
||||
Summary: Data Plane Development Kit core
|
||||
Group: System Environment/Libraries
|
||||
@ -378,6 +411,9 @@ strip -g $RPM_BUILD_ROOT/lib/modules/${namer}/extra/dpdk/rte_kni.ko
|
||||
/usr/sbin/depmod
|
||||
|
||||
%changelog
|
||||
* Fri Nov 12 2021 Min Hu <humin29@huawei.com> - 20.11-15
|
||||
- synchronize dmadev and refactor for hns3 PMD
|
||||
|
||||
* Wed Nov 10 2021 Min Hu <humin29@huawei.com> - 20.11-14
|
||||
- release flows left before port stop
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user