patch 'net/iavf: fix RSS rule overwriting an existing one' has been queued to stable release 24.11.9
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Thu Nov 5 17:42:27 CET 2026
Hi,
FYI, your patch has been queued to stable release 24.11.9
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/07/26. 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/3fef7db8e2788ad9f54484e69d19bb8fe0b6e7a1
Thanks.
Luca Boccassi
---
>From 3fef7db8e2788ad9f54484e69d19bb8fe0b6e7a1 Mon Sep 17 00:00:00 2001
From: Anurag Mandal <anurag.mandal at intel.com>
Date: Mon, 26 Oct 2026 10:47:11 +0000
Subject: [PATCH] net/iavf: fix RSS rule overwriting an existing one
[ upstream commit d9ef24d60ad1cc6c40ee00aec3864e1fa78f0b5d ]
An RSS flow rule only selects the hash input set of a packet type, and
the PF keeps a single configuration per packet type for the VF VSI.
When a second rule is created for a packet type already used by another
rule, the PF silently replaces the first configuration, while both flow
handles remain valid.
For example,:
flow create 0 ingress pattern eth / vlan vid is 1500 / ipv6 / end
actions rss types ipv6 l3-dst-only end queues end / end
flow create 0 ingress pattern eth / vlan vid is 2640 / ipv6 / end
actions rss types ipv6 l3-src-only end queues end / end
Only the second rule is applied, whatever the VLAN ID of the packet, and
destroying it leaves the first rule without any hardware configuration.
Reject the creation of an RSS rule when another RSS rule of the port
already uses the same protocol header stack. The existing rule has to
be destroyed first to change the hash input set of that packet type.
Raw pattern rules are not checked, as their packet type is only known
by the PF parser.
Fixes: 7be10c3004be ("net/iavf: add RSS configuration for VF")
Signed-off-by: Anurag Mandal <anurag.mandal at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
drivers/net/iavf/iavf_hash.c | 48 ++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c
index 35b68cc8a98..8bbb9cbc339 100644
--- a/drivers/net/iavf/iavf_hash.c
+++ b/drivers/net/iavf/iavf_hash.c
@@ -1570,6 +1570,44 @@ error:
return ret;
}
+/* Check duplicate packet type RSS rule in same VSI */
+static bool
+iavf_hash_ptype_in_use(struct iavf_adapter *ad,
+ const struct virtchnl_proto_hdrs *hdrs)
+{
+ struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(ad);
+ const struct virtchnl_rss_cfg *cfg;
+ struct rte_flow *flow;
+ bool found = false;
+ int i;
+
+ /* the packet type of a raw pattern is only known by the PF parser */
+ if (hdrs->count == 0)
+ return false;
+
+ rte_spinlock_lock(&vf->flow_ops_lock);
+ TAILQ_FOREACH(flow, &vf->flow_list, node) {
+ cfg = flow->rule;
+ if (flow->engine != &iavf_hash_engine || cfg == NULL ||
+ cfg->proto_hdrs.tunnel_level != hdrs->tunnel_level ||
+ cfg->proto_hdrs.count != hdrs->count)
+ continue;
+
+ for (i = 0; i < hdrs->count; i++) {
+ if (cfg->proto_hdrs.proto_hdr[i].type != hdrs->proto_hdr[i].type)
+ break;
+ }
+
+ if (i == hdrs->count) {
+ found = true;
+ break;
+ }
+ }
+ rte_spinlock_unlock(&vf->flow_ops_lock);
+
+ return found;
+}
+
static int
iavf_hash_create(__rte_unused struct iavf_adapter *ad,
__rte_unused struct rte_flow *flow, void *meta,
@@ -1579,6 +1617,16 @@ iavf_hash_create(__rte_unused struct iavf_adapter *ad,
struct virtchnl_rss_cfg *rss_cfg;
int ret = 0;
+ /* Reject duplicate packet type rule in same VSI */
+ if (iavf_hash_ptype_in_use(ad, &rss_meta->proto_hdrs)) {
+ PMD_DRV_LOG(ERR, "RSS rule for this packet type already exists");
+ rte_flow_error_set(error, EEXIST,
+ RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
+ "RSS rule for this packet type already exists");
+ rte_free(meta);
+ return -rte_errno;
+ }
+
rss_cfg = rte_zmalloc("iavf rss rule",
sizeof(struct virtchnl_rss_cfg), 0);
if (!rss_cfg) {
--
2.47.3
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-11-05 16:42:47.287014046 +0000
+++ 0060-net-iavf-fix-RSS-rule-overwriting-an-existing-one.patch 2026-11-05 16:42:44.989062818 +0000
@@ -1 +1 @@
-From d9ef24d60ad1cc6c40ee00aec3864e1fa78f0b5d Mon Sep 17 00:00:00 2001
+From 3fef7db8e2788ad9f54484e69d19bb8fe0b6e7a1 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit d9ef24d60ad1cc6c40ee00aec3864e1fa78f0b5d ]
+
@@ -28 +29,0 @@
-Cc: stable at dpdk.org
@@ -33,2 +34,2 @@
- drivers/net/intel/iavf/iavf_hash.c | 47 ++++++++++++++++++++++++++++++
- 1 file changed, 47 insertions(+)
+ drivers/net/iavf/iavf_hash.c | 48 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 48 insertions(+)
@@ -36,5 +37,5 @@
-diff --git a/drivers/net/intel/iavf/iavf_hash.c b/drivers/net/intel/iavf/iavf_hash.c
-index fe5d725064..c079511898 100644
---- a/drivers/net/intel/iavf/iavf_hash.c
-+++ b/drivers/net/intel/iavf/iavf_hash.c
-@@ -1571,6 +1571,44 @@ error:
+diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c
+index 35b68cc8a98..8bbb9cbc339 100644
+--- a/drivers/net/iavf/iavf_hash.c
++++ b/drivers/net/iavf/iavf_hash.c
+@@ -1570,6 +1570,44 @@ error:
@@ -83,4 +84,4 @@
- iavf_hash_create(struct iavf_adapter *ad,
- struct rte_flow *flow, void *meta,
-@@ -1579,6 +1617,15 @@ iavf_hash_create(struct iavf_adapter *ad,
- struct virtchnl_rss_cfg *rss_cfg = meta;
+ iavf_hash_create(__rte_unused struct iavf_adapter *ad,
+ __rte_unused struct rte_flow *flow, void *meta,
+@@ -1579,6 +1617,16 @@ iavf_hash_create(__rte_unused struct iavf_adapter *ad,
+ struct virtchnl_rss_cfg *rss_cfg;
@@ -90 +91 @@
-+ if (iavf_hash_ptype_in_use(ad, &rss_cfg->proto_hdrs)) {
++ if (iavf_hash_ptype_in_use(ad, &rss_meta->proto_hdrs)) {
@@ -94,0 +96 @@
++ rte_free(meta);
@@ -98,3 +100,3 @@
- ret = iavf_add_del_rss_cfg(ad, rss_cfg, true);
- if (!ret) {
- flow->rule = rss_cfg;
+ rss_cfg = rte_zmalloc("iavf rss rule",
+ sizeof(struct virtchnl_rss_cfg), 0);
+ if (!rss_cfg) {
More information about the stable
mailing list