patch 'ethdev: fix GENEVE option item conversion' has been queued to stable release 23.11.2
Xueming Li
xuemingl at nvidia.com
Mon Aug 12 14:50:08 CEST 2024
Hi,
FYI, your patch has been queued to stable release 23.11.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/14/24. 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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging
This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=e8746659b2e038bfbf6b5891a33dbe35acca3e99
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From e8746659b2e038bfbf6b5891a33dbe35acca3e99 Mon Sep 17 00:00:00 2001
From: Michael Baum <michaelba at nvidia.com>
Date: Mon, 15 Jul 2024 15:13:16 +0300
Subject: [PATCH] ethdev: fix GENEVE option item conversion
Cc: Xueming Li <xuemingl at nvidia.com>
[ upstream commit 841a0445442de154441ac2b4700658a9eb83c986 ]
The "rte_flow_conv()" function, enables, among other things, to copy
item list.
For GENEVE option item, the function copies it without considering deep
copy. It copies the "data" pointer without copying the pointed values.
This patch adds deep copy for after regular copy.
Fixes: 2b4c72b4d10d ("ethdev: introduce GENEVE header TLV option item")
Signed-off-by: Michael Baum <michaelba at nvidia.com>
Acked-by: Ferruh Yigit <ferruh.yigit at amd.com>
---
lib/ethdev/rte_flow.c | 29 +++++++++++++++++++++++++----
1 file changed, 25 insertions(+), 4 deletions(-)
diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c
index 04348e0243..fa2a8fedce 100644
--- a/lib/ethdev/rte_flow.c
+++ b/lib/ethdev/rte_flow.c
@@ -616,6 +616,7 @@ rte_flow_conv_item_spec(void *buf, const size_t size,
switch (item->type) {
union {
const struct rte_flow_item_raw *raw;
+ const struct rte_flow_item_geneve_opt *geneve_opt;
} spec;
union {
const struct rte_flow_item_raw *raw;
@@ -625,10 +626,13 @@ rte_flow_conv_item_spec(void *buf, const size_t size,
} mask;
union {
const struct rte_flow_item_raw *raw;
+ const struct rte_flow_item_geneve_opt *geneve_opt;
} src;
union {
struct rte_flow_item_raw *raw;
+ struct rte_flow_item_geneve_opt *geneve_opt;
} dst;
+ void *deep_src;
size_t tmp;
case RTE_FLOW_ITEM_TYPE_RAW:
@@ -657,13 +661,30 @@ rte_flow_conv_item_spec(void *buf, const size_t size,
tmp = last.raw->length & mask.raw->length;
if (tmp) {
off = RTE_ALIGN_CEIL(off, sizeof(*dst.raw->pattern));
- if (size >= off + tmp)
- dst.raw->pattern = rte_memcpy
- ((void *)((uintptr_t)dst.raw + off),
- src.raw->pattern, tmp);
+ if (size >= off + tmp) {
+ deep_src = (void *)((uintptr_t)dst.raw + off);
+ dst.raw->pattern = rte_memcpy(deep_src,
+ src.raw->pattern,
+ tmp);
+ }
off += tmp;
}
break;
+ case RTE_FLOW_ITEM_TYPE_GENEVE_OPT:
+ off = rte_flow_conv_copy(buf, data, size,
+ rte_flow_desc_item, item->type);
+ spec.geneve_opt = item->spec;
+ src.geneve_opt = data;
+ dst.geneve_opt = buf;
+ tmp = spec.geneve_opt->option_len << 2;
+ if (size > 0 && src.geneve_opt->data) {
+ deep_src = (void *)((uintptr_t)(dst.geneve_opt + 1));
+ dst.geneve_opt->data = rte_memcpy(deep_src,
+ src.geneve_opt->data,
+ tmp);
+ }
+ off += tmp;
+ break;
default:
off = rte_flow_conv_copy(buf, data, size,
rte_flow_desc_item, item->type);
--
2.34.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2024-08-12 20:44:06.678581268 +0800
+++ 0131-ethdev-fix-GENEVE-option-item-conversion.patch 2024-08-12 20:44:02.535069381 +0800
@@ -1 +1 @@
-From 841a0445442de154441ac2b4700658a9eb83c986 Mon Sep 17 00:00:00 2001
+From e8746659b2e038bfbf6b5891a33dbe35acca3e99 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 841a0445442de154441ac2b4700658a9eb83c986 ]
@@ -15 +17,0 @@
-Cc: stable at dpdk.org
@@ -24 +26 @@
-index ca2f85c3fa..4076ae4ee1 100644
+index 04348e0243..fa2a8fedce 100644
@@ -27 +29 @@
-@@ -623,6 +623,7 @@ rte_flow_conv_item_spec(void *buf, const size_t size,
+@@ -616,6 +616,7 @@ rte_flow_conv_item_spec(void *buf, const size_t size,
@@ -35 +37 @@
-@@ -632,10 +633,13 @@ rte_flow_conv_item_spec(void *buf, const size_t size,
+@@ -625,10 +626,13 @@ rte_flow_conv_item_spec(void *buf, const size_t size,
@@ -49 +51 @@
-@@ -664,13 +668,30 @@ rte_flow_conv_item_spec(void *buf, const size_t size,
+@@ -657,13 +661,30 @@ rte_flow_conv_item_spec(void *buf, const size_t size,
More information about the stable
mailing list