patch 'net/hns3: fix duplicate RSS rule check' has been queued to stable release 20.11.8
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Thu Feb 23 10:36:51 CET 2023
Hi,
FYI, your patch has been queued to stable release 20.11.8
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/23. 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/52655240fdacc2d41cdd820da291509bceb411f1
Thanks.
Luca Boccassi
---
>From 52655240fdacc2d41cdd820da291509bceb411f1 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong at huawei.com>
Date: Tue, 31 Jan 2023 21:03:00 +0800
Subject: [PATCH] net/hns3: fix duplicate RSS rule check
[ upstream commit 150fd8f839e332d68aa7b60646c2033084544cb7 ]
Currently, the interface for verifying duplicate RSS rules has
some problems:
1) If the value of 'func' in configuring RSS rule is default
value, this rule is mistakenly considered as a duplicate rule.
2) If key length is zero or 'key' is NULL in configuring RSS rule
this rule is also mistakenly considered as a duplicate rule.
3) If 'key' or 'queue' in struct rte_flow_action_rss being NULL
is used to memcpy, which may cause segment fault.
Fixes: c37ca66f2b27 ("net/hns3: support RSS")
Signed-off-by: Huisong Li <lihuisong at huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3 at huawei.com>
---
drivers/net/hns3/hns3_flow.c | 63 +++++++++++++++++++++++++++---------
1 file changed, 47 insertions(+), 16 deletions(-)
diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index a0d292db00..400054a9a2 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1251,28 +1251,59 @@ hns3_filterlist_flush(struct rte_eth_dev *dev)
}
}
+static bool
+hns3_flow_rule_key_same(const struct rte_flow_action_rss *comp,
+ const struct rte_flow_action_rss *with)
+{
+ if (comp->key_len != with->key_len)
+ return false;
+
+ if (with->key_len == 0)
+ return true;
+
+ if (comp->key == NULL && with->key == NULL)
+ return true;
+
+ if (!(comp->key != NULL && with->key != NULL))
+ return false;
+
+ return !memcmp(comp->key, with->key, with->key_len);
+}
+
+static bool
+hns3_flow_rule_queues_same(const struct rte_flow_action_rss *comp,
+ const struct rte_flow_action_rss *with)
+{
+ if (comp->queue_num != with->queue_num)
+ return false;
+
+ if (with->queue_num == 0)
+ return true;
+
+ if (comp->queue == NULL && with->queue == NULL)
+ return true;
+
+ if (!(comp->queue != NULL && with->queue != NULL))
+ return false;
+
+ return !memcmp(comp->queue, with->queue, with->queue_num);
+}
+
static bool
hns3_action_rss_same(const struct rte_flow_action_rss *comp,
const struct rte_flow_action_rss *with)
{
- bool rss_key_is_same;
- bool func_is_same;
+ bool same_level;
+ bool same_types;
+ bool same_func;
- func_is_same = (with->func != RTE_ETH_HASH_FUNCTION_DEFAULT) ?
- (comp->func == with->func) : true;
+ same_level = (comp->level == with->level);
+ same_types = (comp->types == with->types);
+ same_func = (comp->func == with->func);
- if (with->key_len == 0 || with->key == NULL)
- rss_key_is_same = 1;
- else
- rss_key_is_same = comp->key_len == with->key_len &&
- !memcmp(comp->key, with->key, with->key_len);
-
- return (func_is_same && rss_key_is_same &&
- comp->types == with->types &&
- comp->level == with->level &&
- comp->queue_num == with->queue_num &&
- !memcmp(comp->queue, with->queue,
- sizeof(*with->queue) * with->queue_num));
+ return same_level && same_types && same_func &&
+ hns3_flow_rule_key_same(comp, with) &&
+ hns3_flow_rule_queues_same(comp, with);
}
/*
--
2.39.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2023-02-23 09:36:30.104099588 +0000
+++ 0047-net-hns3-fix-duplicate-RSS-rule-check.patch 2023-02-23 09:36:28.278170898 +0000
@@ -1 +1 @@
-From 150fd8f839e332d68aa7b60646c2033084544cb7 Mon Sep 17 00:00:00 2001
+From 52655240fdacc2d41cdd820da291509bceb411f1 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 150fd8f839e332d68aa7b60646c2033084544cb7 ]
+
@@ -16 +17,0 @@
-Cc: stable at dpdk.org
@@ -25 +26 @@
-index dd762c02cb..881d70613c 100644
+index a0d292db00..400054a9a2 100644
@@ -28 +29 @@
-@@ -1272,28 +1272,59 @@ hns3_filterlist_flush(struct rte_eth_dev *dev)
+@@ -1251,28 +1251,59 @@ hns3_filterlist_flush(struct rte_eth_dev *dev)
@@ -103 +104 @@
- static bool
+ /*
More information about the stable
mailing list