[dpdk-stable] patch 'net/hns3: fix residual MAC address entry' has been queued to stable release 20.11.3
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Mon Jul 26 15:53:03 CEST 2021
Hi,
FYI, your patch has been queued to stable release 20.11.3
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/28/21. So please
shout if anyone has objections.
Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.
Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable
This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/471ed659c1747d04d992310c8c08fca34e9c26c5
Thanks.
Luca Boccassi
---
>From 471ed659c1747d04d992310c8c08fca34e9c26c5 Mon Sep 17 00:00:00 2001
From: Chengchang Tang <tangchengchang at huawei.com>
Date: Sat, 17 Jul 2021 10:02:49 +0800
Subject: [PATCH] net/hns3: fix residual MAC address entry
[ upstream commit 976ddf2f5a7aa1ade4300de394cdd481a5e79f1c ]
Currently, even if we fail to remove the origin MAC address from the HW,
the set_default_mac will go on, and add the new MAC address to the HW.
Eventually cause the original MAC address entry to remain in the HW, and
users may receive unexpected packets.
This patch make set_default_mac return directly to failure if deleting
the original MAC address fails, simplifying the behavior of the driver
and solving the problem of residual MAC address entry.
Fixes: 7d7f9f80bbfb ("net/hns3: support MAC address related operations")
Signed-off-by: Chengchang Tang <tangchengchang at huawei.com>
Signed-off-by: Min Hu (Connor) <humin29 at huawei.com>
---
drivers/net/hns3/hns3_ethdev.c | 22 +++++++++-------------
1 file changed, 9 insertions(+), 13 deletions(-)
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index 089c94b8e9..1ddb2e1806 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -1666,7 +1666,6 @@ hns3_set_default_mac_addr(struct rte_eth_dev *dev,
struct rte_ether_addr *oaddr;
char mac_str[RTE_ETHER_ADDR_FMT_SIZE];
bool default_addr_setted;
- bool rm_succes = false;
int ret, ret_val;
/*
@@ -1686,9 +1685,10 @@ hns3_set_default_mac_addr(struct rte_eth_dev *dev,
oaddr);
hns3_warn(hw, "Remove old uc mac address(%s) fail: %d",
mac_str, ret);
- rm_succes = false;
- } else
- rm_succes = true;
+
+ rte_spinlock_unlock(&hw->lock);
+ return ret;
+ }
}
ret = hns3_add_uc_addr_common(hw, mac_addr);
@@ -1723,16 +1723,12 @@ err_pause_addr_cfg:
}
err_add_uc_addr:
- if (rm_succes) {
- ret_val = hns3_add_uc_addr_common(hw, oaddr);
- if (ret_val) {
- rte_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
- oaddr);
- hns3_warn(hw,
- "Failed to restore old uc mac addr(%s): %d",
+ ret_val = hns3_add_uc_addr_common(hw, oaddr);
+ if (ret_val) {
+ rte_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE, oaddr);
+ hns3_warn(hw, "Failed to restore old uc mac addr(%s): %d",
mac_str, ret_val);
- hw->mac.default_addr_setted = false;
- }
+ hw->mac.default_addr_setted = false;
}
rte_spinlock_unlock(&hw->lock);
--
2.30.2
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2021-07-26 13:53:17.974758033 +0100
+++ 0040-net-hns3-fix-residual-MAC-address-entry.patch 2021-07-26 13:53:15.905293799 +0100
@@ -1 +1 @@
-From 976ddf2f5a7aa1ade4300de394cdd481a5e79f1c Mon Sep 17 00:00:00 2001
+From 471ed659c1747d04d992310c8c08fca34e9c26c5 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 976ddf2f5a7aa1ade4300de394cdd481a5e79f1c ]
+
@@ -16 +17,0 @@
-Cc: stable at dpdk.org
@@ -25 +26 @@
-index 17b995af15..3699b5636e 100644
+index 089c94b8e9..1ddb2e1806 100644
@@ -28 +29 @@
-@@ -1748,7 +1748,6 @@ hns3_set_default_mac_addr(struct rte_eth_dev *dev,
+@@ -1666,7 +1666,6 @@ hns3_set_default_mac_addr(struct rte_eth_dev *dev,
@@ -36 +37 @@
-@@ -1768,9 +1767,10 @@ hns3_set_default_mac_addr(struct rte_eth_dev *dev,
+@@ -1686,9 +1685,10 @@ hns3_set_default_mac_addr(struct rte_eth_dev *dev,
@@ -50 +51 @@
-@@ -1805,16 +1805,12 @@ err_pause_addr_cfg:
+@@ -1723,16 +1723,12 @@ err_pause_addr_cfg:
@@ -57 +58 @@
-- hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
+- rte_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
@@ -63 +64 @@
-+ hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE, oaddr);
++ rte_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE, oaddr);
More information about the stable
mailing list