[dpdk-stable] patch 'net/hns3: clear residual flow rules on init' has been queued to stable release 19.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue May 19 15:03:29 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.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 05/21/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 50daf2acc9b7057ba21ac1d21a49c71f2e8cb36e Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen at huawei.com>
Date: Fri, 10 Apr 2020 19:09:26 +0800
Subject: [PATCH] net/hns3: clear residual flow rules on init

[ upstream commit 31cdde02f0be730fc1b9b12a8b53f8a04fa423fc ]

This patch fixes that the flow director rules are not cleared during
initialization, which lead to remaining flow director rules after upper
application (such as testpmd) restarted.

Fixes: fcba820d9b9e ("net/hns3: support flow director")

Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei at huawei.com>
---
 drivers/net/hns3/hns3_fdir.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/drivers/net/hns3/hns3_fdir.c b/drivers/net/hns3/hns3_fdir.c
index ca3c78e1ce..53c6448cdd 100644
--- a/drivers/net/hns3/hns3_fdir.c
+++ b/drivers/net/hns3/hns3_fdir.c
@@ -772,6 +772,20 @@ static int hns3_config_action(struct hns3_hw *hw, struct hns3_fdir_rule *rule)
 	return hns3_fd_ad_config(hw, ad_data.ad_id, &ad_data);
 }
 
+static int hns3_fd_clear_all_rules(struct hns3_hw *hw, uint32_t rule_num)
+{
+	uint32_t i;
+	int ret;
+
+	for (i = 0; i < rule_num; i++) {
+		ret = hns3_fd_tcam_config(hw, true, i, NULL, false);
+		if (ret)
+			return ret;
+	}
+
+	return 0;
+}
+
 int hns3_fdir_filter_init(struct hns3_adapter *hns)
 {
 	struct hns3_pf *pf = &hns->pf;
@@ -785,6 +799,13 @@ int hns3_fdir_filter_init(struct hns3_adapter *hns)
 		.hash_func = rte_hash_crc,
 		.hash_func_init_val = 0,
 	};
+	int ret;
+
+	ret = hns3_fd_clear_all_rules(&hns->hw, rule_num);
+	if (ret) {
+		PMD_INIT_LOG(ERR, "Clear all fd rules fail! ret = %d", ret);
+		return ret;
+	}
 
 	fdir_hash_params.socket_id = rte_socket_id();
 	TAILQ_INIT(&fdir_info->fdir_list);
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-05-19 14:04:47.482647590 +0100
+++ 0074-net-hns3-clear-residual-flow-rules-on-init.patch	2020-05-19 14:04:44.236648735 +0100
@@ -1,14 +1,15 @@
-From 31cdde02f0be730fc1b9b12a8b53f8a04fa423fc Mon Sep 17 00:00:00 2001
+From 50daf2acc9b7057ba21ac1d21a49c71f2e8cb36e Mon Sep 17 00:00:00 2001
 From: Chengwen Feng <fengchengwen at huawei.com>
 Date: Fri, 10 Apr 2020 19:09:26 +0800
 Subject: [PATCH] net/hns3: clear residual flow rules on init
 
+[ upstream commit 31cdde02f0be730fc1b9b12a8b53f8a04fa423fc ]
+
 This patch fixes that the flow director rules are not cleared during
 initialization, which lead to remaining flow director rules after upper
 application (such as testpmd) restarted.
 
 Fixes: fcba820d9b9e ("net/hns3: support flow director")
-Cc: stable at dpdk.org
 
 Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
 Signed-off-by: Wei Hu (Xavier) <xavier.huwei at huawei.com>
@@ -17,7 +18,7 @@
  1 file changed, 21 insertions(+)
 
 diff --git a/drivers/net/hns3/hns3_fdir.c b/drivers/net/hns3/hns3_fdir.c
-index a395eb1f83..26c3117580 100644
+index ca3c78e1ce..53c6448cdd 100644
 --- a/drivers/net/hns3/hns3_fdir.c
 +++ b/drivers/net/hns3/hns3_fdir.c
 @@ -772,6 +772,20 @@ static int hns3_config_action(struct hns3_hw *hw, struct hns3_fdir_rule *rule)


More information about the stable mailing list