patch 'app/testpmd: fix error handling in flow API commands' has been queued to stable release 25.11.5

Kevin Traynor ktraynor at redhat.com
Thu Dec 3 13:59:42 CET 2026


Hi,

FYI, your patch has been queued to stable release 25.11.5

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

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/28292c18b095606d802a78a3d95349bd6b08abcc

Thanks.

Kevin

---
>From 28292c18b095606d802a78a3d95349bd6b08abcc Mon Sep 17 00:00:00 2001
From: Kiran Kumar K <kirankumark at marvell.com>
Date: Mon, 7 Sep 2026 09:18:31 +0530
Subject: [PATCH] app/testpmd: fix error handling in flow API commands

[ upstream commit f713f8f0217f7b5cd1eb98027f88a64ebc5176be ]

Fix two robustness issues in the flow API command paths

- port_flow_configure() committed the new queue attributes and job list
  before rte_flow_configure() succeeded, leaving the port state
  inconsistent on failure. Build the job list locally, free it on error,
  and update the port only after configure succeeds.

- port_flow_create() and port_queue_flow_create() indexed ports[port_id]
  without validating the port id. Add an rte_eth_dev_is_valid_port()
  check before accessing the array.

Fixes: 9ad3a41ab2a1 ("app/testpmd: add flow engine configuration")
Fixes: 938a184a1870 ("app/testpmd: implement basic support for flow API")
Fixes: ecdc927b99f2 ("app/testpmd: add async flow create/destroy operations")

Signed-off-by: Kiran Kumar K <kirankumark at marvell.com>
---
 app/test-pmd/config.c | 35 ++++++++++++++++++++++++++++-------
 1 file changed, 28 insertions(+), 7 deletions(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 32c885de0b..bdbe6551c9 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1825,4 +1825,5 @@ port_flow_configure(portid_t port_id,
 	struct rte_port *port;
 	struct rte_flow_error error;
+	struct queue_job_list *job_list;
 	const struct rte_flow_queue_attr **attr_list =
 	    alloca(sizeof(struct rte_flow_queue_attr *) * nb_queue);
@@ -1833,11 +1834,10 @@ port_flow_configure(portid_t port_id,
 		return -EINVAL;
 	port = &ports[port_id];
-	port->queue_nb = nb_queue;
-	port->queue_sz = queue_attr->size;
 	for (std_queue = 0; std_queue < nb_queue; std_queue++)
 		attr_list[std_queue] = queue_attr;
-	free(port->job_list);
-	port->job_list = calloc(nb_queue, sizeof(*port->job_list));
-	if (port->job_list == NULL) {
+
+	/* Build the new job list before touching the device or port state. */
+	job_list = calloc(nb_queue, sizeof(*job_list));
+	if (job_list == NULL) {
 		TESTPMD_LOG(ERR, "Failed to allocate memory for operations tracking on port %u\n",
 			    port_id);
@@ -1845,9 +1845,18 @@ port_flow_configure(portid_t port_id,
 	}
 	for (unsigned int i = 0; i < nb_queue; i++)
-		LIST_INIT(&port->job_list[i]);
+		LIST_INIT(&job_list[i]);
+
 	/* Poisoning to make sure PMDs update it in case of error. */
 	memset(&error, 0x66, sizeof(error));
-	if (rte_flow_configure(port_id, port_attr, nb_queue, attr_list, &error))
+	if (rte_flow_configure(port_id, port_attr, nb_queue, attr_list, &error)) {
+		free(job_list);
 		return port_flow_complain(&error);
+	}
+
+	/* Commit new state only after configure and allocation succeed. */
+	free(port->job_list);
+	port->job_list = job_list;
+	port->queue_nb = nb_queue;
+	port->queue_sz = queue_attr->size;
 	printf("Configure flows on port %u: "
 	       "number of queues %d with %d elements\n",
@@ -2862,4 +2871,10 @@ port_queue_flow_create(portid_t port_id, queueid_t queue_id,
 	struct queue_job *job;
 
+	if (!rte_eth_dev_is_valid_port(port_id)) {
+		rte_flow_error_set(&error, ENODEV, RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
+				   NULL, rte_strerror(ENODEV));
+		return port_flow_complain(&error);
+	}
+
 	port = &ports[port_id];
 	if (port->flow_list) {
@@ -3839,4 +3854,10 @@ port_flow_create(portid_t port_id,
 	struct rte_flow_action_age *age = age_action_get(actions);
 
+	if (!rte_eth_dev_is_valid_port(port_id)) {
+		rte_flow_error_set(&error, ENODEV, RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
+				   NULL, rte_strerror(ENODEV));
+		return port_flow_complain(&error);
+	}
+
 	port = &ports[port_id];
 	if (port->flow_list) {
-- 
2.56.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-12-03 12:52:40.913705047 +0000
+++ 0056-app-testpmd-fix-error-handling-in-flow-API-commands.patch	2026-12-03 12:52:39.055938595 +0000
@@ -1 +1 @@
-From f713f8f0217f7b5cd1eb98027f88a64ebc5176be Mon Sep 17 00:00:00 2001
+From 28292c18b095606d802a78a3d95349bd6b08abcc Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit f713f8f0217f7b5cd1eb98027f88a64ebc5176be ]
+
@@ -20 +21,0 @@
-Cc: stable at dpdk.org
@@ -28 +29 @@
-index aa03eb99cc..9d1fa2f4d1 100644
+index 32c885de0b..bdbe6551c9 100644
@@ -31 +32 @@
-@@ -1845,4 +1845,5 @@ port_flow_configure(portid_t port_id,
+@@ -1825,4 +1825,5 @@ port_flow_configure(portid_t port_id,
@@ -37 +38 @@
-@@ -1853,11 +1854,10 @@ port_flow_configure(portid_t port_id,
+@@ -1833,11 +1834,10 @@ port_flow_configure(portid_t port_id,
@@ -53 +54 @@
-@@ -1865,9 +1865,18 @@ port_flow_configure(portid_t port_id,
+@@ -1845,9 +1845,18 @@ port_flow_configure(portid_t port_id,
@@ -74 +75 @@
-@@ -2882,4 +2891,10 @@ port_queue_flow_create(portid_t port_id, queueid_t queue_id,
+@@ -2862,4 +2871,10 @@ port_queue_flow_create(portid_t port_id, queueid_t queue_id,
@@ -85 +86 @@
-@@ -3859,4 +3874,10 @@ port_flow_create(portid_t port_id,
+@@ -3839,4 +3854,10 @@ port_flow_create(portid_t port_id,



More information about the stable mailing list