patch 'app/testpmd: fix auto-completion for indirect action list' has been queued to stable release 23.11.1

Xueming Li xuemingl at nvidia.com
Sat Apr 13 14:49:53 CEST 2024


Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/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=f7d1b5cff39f423c2afcb4f8a12c9e2abb63bd50

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From f7d1b5cff39f423c2afcb4f8a12c9e2abb63bd50 Mon Sep 17 00:00:00 2001
From: Shani Peretz <shperetz at nvidia.com>
Date: Mon, 18 Mar 2024 11:21:09 +0200
Subject: [PATCH] app/testpmd: fix auto-completion for indirect action list
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit aaa5b54d3890cf32fa1eabbcb3e306ebdc4f938c ]

In the process of auto completion of a command in testpmd,
the parser splits the command into tokens, where each token
represents an argument and defines a parsing function.
The parsing function of the indirect_list action argument was returning
before having the opportunity to handle the argument.

The fix ensures that the function appropriately handles
the argument before finishing.

Fixes: 72a3dec7126f ("ethdev: add indirect flow list action")

Signed-off-by: Shani Peretz <shperetz at nvidia.com>
Tested-by: Ferruh Yigit <ferruh.yigit at amd.com>
---
 .mailmap                    |  1 +
 app/test-pmd/cmdline_flow.c | 46 ++++++++++++++++++++-----------------
 2 files changed, 26 insertions(+), 21 deletions(-)

diff --git a/.mailmap b/.mailmap
index 3b32923fef..57e72894c0 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1281,6 +1281,7 @@ Shahed Shaikh <shshaikh at marvell.com> <shahed.shaikh at cavium.com>
 Shai Brandes <shaibran at amazon.com>
 Shailendra Bhatnagar <shailendra.bhatnagar at intel.com>
 Shally Verma <shallyv at marvell.com> <shally.verma at caviumnetworks.com>
+Shani Peretz <shperetz at nvidia.com>
 Shannon Nelson <snelson at pensando.io>
 Shannon Zhao <zhaoshenglong at huawei.com>
 Shaopeng He <shaopeng.he at intel.com>
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index b19b3205f0..681924b379 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -7395,11 +7395,13 @@ static const struct token token_list[] = {
 		.type = "UNSIGNED",
 		.help = "unsigned integer value",
 		.call = parse_indlst_id2ptr,
+		.comp = comp_none,
 	},
 	[INDIRECT_LIST_ACTION_ID2PTR_CONF] = {
 		.type = "UNSIGNED",
 		.help = "unsigned integer value",
 		.call = parse_indlst_id2ptr,
+		.comp = comp_none,
 	},
 	[ACTION_SHARED_INDIRECT] = {
 		.name = "shared_indirect",
@@ -11334,34 +11336,36 @@ parse_indlst_id2ptr(struct context *ctx, const struct token *token,
 	uint32_t id;
 	int ret;
 
-	if (!action)
-		return -1;
 	ctx->objdata = 0;
 	ctx->object = &id;
 	ctx->objmask = NULL;
 	ret = parse_int(ctx, token, str, len, ctx->object, sizeof(id));
+	ctx->object = action;
 	if (ret != (int)len)
 		return ret;
-	ctx->object = action;
-	action_conf = (void *)(uintptr_t)action->conf;
-	action_conf->conf = NULL;
-	switch (ctx->curr) {
-	case INDIRECT_LIST_ACTION_ID2PTR_HANDLE:
-	action_conf->handle = (typeof(action_conf->handle))
-				port_action_handle_get_by_id(ctx->port, id);
-		if (!action_conf->handle) {
-			printf("no indirect list handle for id %u\n", id);
-			return -1;
+
+	/* set handle and conf */
+	if (action) {
+		action_conf = (void *)(uintptr_t)action->conf;
+		action_conf->conf = NULL;
+		switch (ctx->curr) {
+		case INDIRECT_LIST_ACTION_ID2PTR_HANDLE:
+		action_conf->handle = (typeof(action_conf->handle))
+					port_action_handle_get_by_id(ctx->port, id);
+			if (!action_conf->handle) {
+				printf("no indirect list handle for id %u\n", id);
+				return -1;
+			}
+			break;
+		case INDIRECT_LIST_ACTION_ID2PTR_CONF:
+			indlst_conf = indirect_action_list_conf_get(id);
+			if (!indlst_conf)
+				return -1;
+			action_conf->conf = (const void **)indlst_conf->conf;
+			break;
+		default:
+			break;
 		}
-		break;
-	case INDIRECT_LIST_ACTION_ID2PTR_CONF:
-		indlst_conf = indirect_action_list_conf_get(id);
-		if (!indlst_conf)
-			return -1;
-		action_conf->conf = (const void **)indlst_conf->conf;
-		break;
-	default:
-		break;
 	}
 	return ret;
 }
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:08.477437587 +0800
+++ 0113-app-testpmd-fix-auto-completion-for-indirect-action-.patch	2024-04-13 20:43:05.137753749 +0800
@@ -1 +1 @@
-From aaa5b54d3890cf32fa1eabbcb3e306ebdc4f938c Mon Sep 17 00:00:00 2001
+From f7d1b5cff39f423c2afcb4f8a12c9e2abb63bd50 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit aaa5b54d3890cf32fa1eabbcb3e306ebdc4f938c ]
@@ -16 +18,0 @@
-Cc: stable at dpdk.org
@@ -26 +28 @@
-index e189477a2f..a0b19832b5 100644
+index 3b32923fef..57e72894c0 100644
@@ -29 +31 @@
-@@ -1293,6 +1293,7 @@ Shahed Shaikh <shshaikh at marvell.com> <shahed.shaikh at cavium.com>
+@@ -1281,6 +1281,7 @@ Shahed Shaikh <shshaikh at marvell.com> <shahed.shaikh at cavium.com>
@@ -38 +40 @@
-index fd6c51f72d..60ee9337cf 100644
+index b19b3205f0..681924b379 100644
@@ -41 +43 @@
-@@ -7839,11 +7839,13 @@ static const struct token token_list[] = {
+@@ -7395,11 +7395,13 @@ static const struct token token_list[] = {
@@ -55 +57 @@
-@@ -11912,34 +11914,36 @@ parse_indlst_id2ptr(struct context *ctx, const struct token *token,
+@@ -11334,34 +11336,36 @@ parse_indlst_id2ptr(struct context *ctx, const struct token *token,


More information about the stable mailing list