[dpdk-stable] patch 'mbuf: enforce no option for dynamic fields and flags' has been queued to stable release 20.11.4
Xueming Li
xuemingl at nvidia.com
Wed Nov 10 07:30:11 CET 2021
Hi,
FYI, your patch has been queued to stable release 20.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 11/12/21. 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/steevenlee/dpdk
This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/c24b889037a2852b55fb03e90797afa7c2f5bafa
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From c24b889037a2852b55fb03e90797afa7c2f5bafa Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand at redhat.com>
Date: Tue, 12 Oct 2021 21:39:57 +0200
Subject: [PATCH] mbuf: enforce no option for dynamic fields and flags
Cc: Xueming Li <xuemingl at nvidia.com>
[ upstream commit e9123c467dbb471a2d41ea896423a81886ef89d7 ]
As stated in the API, dynamic field and flags should be created with no
additional flag (simply in the API for future changes).
Fix the dynamic flag register helper which was not enforcing it and add
unit tests.
Fixes: 4958ca3a443a ("mbuf: support dynamic fields and flags")
Signed-off-by: David Marchand <david.marchand at redhat.com>
Acked-by: Stephen Hemminger <stephen at networkplumber.org>
Acked-by: Andrew Rybchenko <andrew.rybchenko at oktetlabs.ru>
Acked-by: Ray Kinsella <mdr at ashroe.eu>
---
app/test/test_mbuf.c | 18 ++++++++++++++++++
lib/librte_mbuf/rte_mbuf_dyn.c | 4 ++++
2 files changed, 22 insertions(+)
diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
index 5bb4786e5a..2bccaa03b1 100644
--- a/app/test/test_mbuf.c
+++ b/app/test/test_mbuf.c
@@ -2577,6 +2577,16 @@ test_mbuf_dyn(struct rte_mempool *pktmbuf_pool)
.align = 3,
.flags = 0,
};
+ const struct rte_mbuf_dynfield dynfield_fail_flag = {
+ .name = "test-dynfield",
+ .size = sizeof(uint8_t),
+ .align = __alignof__(uint8_t),
+ .flags = 1,
+ };
+ const struct rte_mbuf_dynflag dynflag_fail_flag = {
+ .name = "test-dynflag",
+ .flags = 1,
+ };
const struct rte_mbuf_dynflag dynflag = {
.name = "test-dynflag",
.flags = 0,
@@ -2638,6 +2648,14 @@ test_mbuf_dyn(struct rte_mempool *pktmbuf_pool)
if (ret != -1)
GOTO_FAIL("dynamic field creation should fail (not avail)");
+ ret = rte_mbuf_dynfield_register(&dynfield_fail_flag);
+ if (ret != -1)
+ GOTO_FAIL("dynamic field creation should fail (invalid flag)");
+
+ ret = rte_mbuf_dynflag_register(&dynflag_fail_flag);
+ if (ret != -1)
+ GOTO_FAIL("dynamic flag creation should fail (invalid flag)");
+
flag = rte_mbuf_dynflag_register(&dynflag);
if (flag == -1)
GOTO_FAIL("failed to register dynamic flag, flag=%d: %s",
diff --git a/lib/librte_mbuf/rte_mbuf_dyn.c b/lib/librte_mbuf/rte_mbuf_dyn.c
index ca46eb279e..d55e162a68 100644
--- a/lib/librte_mbuf/rte_mbuf_dyn.c
+++ b/lib/librte_mbuf/rte_mbuf_dyn.c
@@ -498,6 +498,10 @@ rte_mbuf_dynflag_register_bitnum(const struct rte_mbuf_dynflag *params,
{
int ret;
+ if (params->flags != 0) {
+ rte_errno = EINVAL;
+ return -1;
+ }
if (req >= RTE_SIZEOF_FIELD(struct rte_mbuf, ol_flags) * CHAR_BIT &&
req != UINT_MAX) {
rte_errno = EINVAL;
--
2.33.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2021-11-10 14:17:07.594619788 +0800
+++ 0127-mbuf-enforce-no-option-for-dynamic-fields-and-flags.patch 2021-11-10 14:17:01.887412621 +0800
@@ -1 +1 @@
-From e9123c467dbb471a2d41ea896423a81886ef89d7 Mon Sep 17 00:00:00 2001
+From c24b889037a2852b55fb03e90797afa7c2f5bafa Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit e9123c467dbb471a2d41ea896423a81886ef89d7 ]
@@ -19,2 +22,2 @@
- app/test/test_mbuf.c | 18 ++++++++++++++++++
- lib/mbuf/rte_mbuf_dyn.c | 4 ++++
+ app/test/test_mbuf.c | 18 ++++++++++++++++++
+ lib/librte_mbuf/rte_mbuf_dyn.c | 4 ++++
@@ -24 +27 @@
-index 9a248dfaea..82777109dc 100644
+index 5bb4786e5a..2bccaa03b1 100644
@@ -59 +62 @@
-diff --git a/lib/mbuf/rte_mbuf_dyn.c b/lib/mbuf/rte_mbuf_dyn.c
+diff --git a/lib/librte_mbuf/rte_mbuf_dyn.c b/lib/librte_mbuf/rte_mbuf_dyn.c
@@ -61,2 +64,2 @@
---- a/lib/mbuf/rte_mbuf_dyn.c
-+++ b/lib/mbuf/rte_mbuf_dyn.c
+--- a/lib/librte_mbuf/rte_mbuf_dyn.c
++++ b/lib/librte_mbuf/rte_mbuf_dyn.c
More information about the stable
mailing list