[dpdk-stable] patch 'net/hns3: clear residual hardware configurations on init' has been queued to stable release 19.11.4
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Fri Jul 24 13:59:09 CEST 2020
Hi,
FYI, your patch has been queued to stable release 19.11.4
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/26/20. 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.
Thanks.
Luca Boccassi
---
>From aaf0005929b0723a19ff3f49f8da325523d91d57 Mon Sep 17 00:00:00 2001
From: Hongbo Zheng <zhenghongbo3 at huawei.com>
Date: Wed, 1 Jul 2020 19:54:38 +0800
Subject: [PATCH] net/hns3: clear residual hardware configurations on init
[ upstream commit 223d9eceaeeeb4d5156d4c96eec1a34434d6ecab ]
When the last driver exits abnormally, for example, it is killed by
'kill -9', it may be too late to clear the configuration and cause the
configuration to remain. Therefore, to ensure that the hardware
environment is clean during initialization, the PF driver actively clear
the hardware environment during initialization, including PF and
corresponding VFs' vlan, mac, flow table configurations, etc.
Fixes: d51867db65c1 ("net/hns3: add initialization")
Signed-off-by: Hongbo Zheng <zhenghongbo3 at huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei at huawei.com>
Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
---
drivers/net/hns3/hns3_cmd.h | 3 +++
drivers/net/hns3/hns3_ethdev.c | 27 +++++++++++++++++++++++++++
2 files changed, 30 insertions(+)
diff --git a/drivers/net/hns3/hns3_cmd.h b/drivers/net/hns3/hns3_cmd.h
index 26d410396..ab16b07a6 100644
--- a/drivers/net/hns3/hns3_cmd.h
+++ b/drivers/net/hns3/hns3_cmd.h
@@ -207,6 +207,9 @@ enum hns3_opcode_type {
HNS3_OPC_FD_AD_OP = 0x1204,
HNS3_OPC_FD_COUNTER_OP = 0x1205,
+ /* Clear hardware state command */
+ HNS3_OPC_CLEAR_HW_STATE = 0x700A,
+
/* SFP command */
HNS3_OPC_SFP_GET_SPEED = 0x7104,
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index f1066c079..4a1bb174c 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -4180,6 +4180,21 @@ err_mac_init:
return ret;
}
+static int
+hns3_clear_hw(struct hns3_hw *hw)
+{
+ struct hns3_cmd_desc desc;
+ int ret;
+
+ hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_CLEAR_HW_STATE, false);
+
+ ret = hns3_cmd_send(hw, &desc, 1);
+ if (ret && ret != -EOPNOTSUPP)
+ return ret;
+
+ return 0;
+}
+
static int
hns3_init_pf(struct rte_eth_dev *eth_dev)
{
@@ -4210,6 +4225,18 @@ hns3_init_pf(struct rte_eth_dev *eth_dev)
goto err_cmd_init;
}
+ /*
+ * To ensure that the hardware environment is clean during
+ * initialization, the driver actively clear the hardware environment
+ * during initialization, including PF and corresponding VFs' vlan, mac,
+ * flow table configurations, etc.
+ */
+ ret = hns3_clear_hw(hw);
+ if (ret) {
+ PMD_INIT_LOG(ERR, "failed to clear hardware: %d", ret);
+ goto err_cmd_init;
+ }
+
ret = rte_intr_callback_register(&pci_dev->intr_handle,
hns3_interrupt_handler,
eth_dev);
--
2.20.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2020-07-24 12:53:52.817439222 +0100
+++ 0111-net-hns3-clear-residual-hardware-configurations-on-i.patch 2020-07-24 12:53:48.367007950 +0100
@@ -1,8 +1,10 @@
-From 223d9eceaeeeb4d5156d4c96eec1a34434d6ecab Mon Sep 17 00:00:00 2001
+From aaf0005929b0723a19ff3f49f8da325523d91d57 Mon Sep 17 00:00:00 2001
From: Hongbo Zheng <zhenghongbo3 at huawei.com>
Date: Wed, 1 Jul 2020 19:54:38 +0800
Subject: [PATCH] net/hns3: clear residual hardware configurations on init
+[ upstream commit 223d9eceaeeeb4d5156d4c96eec1a34434d6ecab ]
+
When the last driver exits abnormally, for example, it is killed by
'kill -9', it may be too late to clear the configuration and cause the
configuration to remain. Therefore, to ensure that the hardware
@@ -11,7 +13,6 @@
corresponding VFs' vlan, mac, flow table configurations, etc.
Fixes: d51867db65c1 ("net/hns3: add initialization")
-Cc: stable at dpdk.org
Signed-off-by: Hongbo Zheng <zhenghongbo3 at huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei at huawei.com>
@@ -22,7 +23,7 @@
2 files changed, 30 insertions(+)
diff --git a/drivers/net/hns3/hns3_cmd.h b/drivers/net/hns3/hns3_cmd.h
-index da770ac95..b203e663e 100644
+index 26d410396..ab16b07a6 100644
--- a/drivers/net/hns3/hns3_cmd.h
+++ b/drivers/net/hns3/hns3_cmd.h
@@ -207,6 +207,9 @@ enum hns3_opcode_type {
@@ -36,10 +37,10 @@
HNS3_OPC_SFP_GET_SPEED = 0x7104,
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
-index 4afee5d47..8b18b47d4 100644
+index f1066c079..4a1bb174c 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
-@@ -4318,6 +4318,21 @@ err_mac_init:
+@@ -4180,6 +4180,21 @@ err_mac_init:
return ret;
}
@@ -61,7 +62,7 @@
static int
hns3_init_pf(struct rte_eth_dev *eth_dev)
{
-@@ -4348,6 +4363,18 @@ hns3_init_pf(struct rte_eth_dev *eth_dev)
+@@ -4210,6 +4225,18 @@ hns3_init_pf(struct rte_eth_dev *eth_dev)
goto err_cmd_init;
}
More information about the stable
mailing list