patch 'app/testpmd: avoid crash in DCB config' has been queued to stable release 22.11.8

luca.boccassi at gmail.com luca.boccassi at gmail.com
Fri Mar 7 13:24:04 CET 2025


Hi,

FYI, your patch has been queued to stable release 22.11.8

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

Thanks.

Luca Boccassi

---
>From 9502cde78b96b713f43d68055964d0b5c0747033 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen at huawei.com>
Date: Thu, 20 Feb 2025 15:06:51 +0800
Subject: [PATCH] app/testpmd: avoid crash in DCB config

[ upstream commit d646e219b34ffc4d531f3703fc317e7cff9a25ae ]

The "port config dcb ..." command will segment fault when input with
invalid port id, this patch fixes it.

Fixes: 9b53e542e9e1 ("app/testpmd: add priority flow control")

Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
---
 app/test-pmd/cmdline.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 5336df528b..90b501863c 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -3046,6 +3046,9 @@ cmd_config_dcb_parsed(void *parsed_result,
 	uint8_t pfc_en;
 	int ret;
 
+	if (port_id_is_invalid(port_id, ENABLED_WARN))
+		return;
+
 	port = &ports[port_id];
 	/** Check if the port is not started **/
 	if (port->port_status != RTE_PORT_STOPPED) {
@@ -6237,6 +6240,9 @@ cmd_priority_flow_ctrl_set_parsed(void *parsed_result,
 	int rx_fc_enable, tx_fc_enable;
 	int ret;
 
+	if (port_id_is_invalid(res->port_id, ENABLED_WARN))
+		return;
+
 	/*
 	 * Rx on/off, flow control is enabled/disabled on RX side. This can indicate
 	 * the RTE_ETH_FC_TX_PAUSE, Transmit pause frame at the Rx side.
-- 
2.47.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-03-07 12:23:38.215920937 +0000
+++ 0005-app-testpmd-avoid-crash-in-DCB-config.patch	2025-03-07 12:23:37.990837825 +0000
@@ -1 +1 @@
-From d646e219b34ffc4d531f3703fc317e7cff9a25ae Mon Sep 17 00:00:00 2001
+From 9502cde78b96b713f43d68055964d0b5c0747033 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit d646e219b34ffc4d531f3703fc317e7cff9a25ae ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -18 +19 @@
-index 6b0d8af4f6..6ca3eedb92 100644
+index 5336df528b..90b501863c 100644
@@ -21 +22 @@
-@@ -3462,6 +3462,9 @@ cmd_config_dcb_parsed(void *parsed_result,
+@@ -3046,6 +3046,9 @@ cmd_config_dcb_parsed(void *parsed_result,
@@ -31 +32 @@
-@@ -6664,6 +6667,9 @@ cmd_priority_flow_ctrl_set_parsed(void *parsed_result,
+@@ -6237,6 +6240,9 @@ cmd_priority_flow_ctrl_set_parsed(void *parsed_result,


More information about the stable mailing list