From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <stable-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 5E9E246364
	for <public@inbox.dpdk.org>; Fri,  7 Mar 2025 13:48:00 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 58B3140E3F;
	Fri,  7 Mar 2025 13:48:00 +0100 (CET)
Received: from us-smtp-delivery-124.mimecast.com
 (us-smtp-delivery-124.mimecast.com [170.10.129.124])
 by mails.dpdk.org (Postfix) with ESMTP id 599A340E3B
 for <stable@dpdk.org>; Fri,  7 Mar 2025 13:47:59 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
 s=mimecast20190719; t=1741351678;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=x4qDKe2Yjngs/5wjjnWjhYS4+cy2dyEzOKjVIEhkk+Y=;
 b=Xqu0+9otPHqUpSI2GTyUJ0tSucj/F7Le7eWSlFAka2UvH7xFKiwvJdcfWqhgroxtHYPUib
 vKmPEm7QQW41KXHkxPx4aqunzZsajhbX+gpYivBjQCkGooGdDaG4VyLVABGK2RtORxIW9X
 n1mvuBz1sdhdGYlSF6GLUIwp0yT/6o8=
Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com
 (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by
 relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,
 cipher=TLS_AES_256_GCM_SHA384) id us-mta-391-QRD9de8jNaGm0g4kUTwMkw-1; Fri,
 07 Mar 2025 07:47:54 -0500
X-MC-Unique: QRD9de8jNaGm0g4kUTwMkw-1
X-Mimecast-MFC-AGG-ID: QRD9de8jNaGm0g4kUTwMkw_1741351673
Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com
 (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS
 id 5EA3B195608A; Fri,  7 Mar 2025 12:47:53 +0000 (UTC)
Received: from rh.Home (unknown [10.45.226.25])
 by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP
 id D868F1956095; Fri,  7 Mar 2025 12:47:51 +0000 (UTC)
From: Kevin Traynor <ktraynor@redhat.com>
To: Chengwen Feng <fengchengwen@huawei.com>
Cc: dpdk stable <stable@dpdk.org>
Subject: patch 'app/testpmd: avoid crash in DCB config' has been queued to
 stable release 24.11.2
Date: Fri,  7 Mar 2025 12:46:42 +0000
Message-ID: <20250307124726.475001-9-ktraynor@redhat.com>
In-Reply-To: <20250307124726.475001-1-ktraynor@redhat.com>
References: <20250307124726.475001-1-ktraynor@redhat.com>
MIME-Version: 1.0
X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15
X-Mimecast-Spam-Score: 0
X-Mimecast-MFC-PROC-ID: oh8kyk685ANNTjalkb4QTc86eBAzi8kL-0EiOtjrDKc_1741351673
X-Mimecast-Originator: redhat.com
Content-Transfer-Encoding: 8bit
content-type: text/plain; charset="US-ASCII"; x-default=true
X-BeenThere: stable@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: patches for DPDK stable branches <stable.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/stable>,
 <mailto:stable-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/stable/>
List-Post: <mailto:stable@dpdk.org>
List-Help: <mailto:stable-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/stable>,
 <mailto:stable-request@dpdk.org?subject=subscribe>
Errors-To: stable-bounces@dpdk.org

Hi,

FYI, your patch has been queued to stable release 24.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 03/12/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/kevintraynor/dpdk-stable

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

Thanks.

Kevin

---
>From 399b59e5b45ea86a7b80c915706ad8e276ff1545 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@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@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 7e0666e9f6..93c9fc402d 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -3462,4 +3462,7 @@ cmd_config_dcb_parsed(void *parsed_result,
 	int ret;
 
+	if (port_id_is_invalid(port_id, ENABLED_WARN))
+		return;
+
 	port = &ports[port_id];
 	/** Check if the port is not started **/
@@ -6664,4 +6667,7 @@ cmd_priority_flow_ctrl_set_parsed(void *parsed_result,
 	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
-- 
2.48.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-03-07 11:02:57.236248985 +0000
+++ 0009-app-testpmd-avoid-crash-in-DCB-config.patch	2025-03-07 11:02:56.838335561 +0000
@@ -1 +1 @@
-From d646e219b34ffc4d531f3703fc317e7cff9a25ae Mon Sep 17 00:00:00 2001
+From 399b59e5b45ea86a7b80c915706ad8e276ff1545 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit d646e219b34ffc4d531f3703fc317e7cff9a25ae ]
+
@@ -10 +11,0 @@
-Cc: stable@dpdk.org
@@ -18 +19 @@
-index 6b0d8af4f6..6ca3eedb92 100644
+index 7e0666e9f6..93c9fc402d 100644
@@ -21 +22 @@
-@@ -3463,4 +3463,7 @@ cmd_config_dcb_parsed(void *parsed_result,
+@@ -3462,4 +3462,7 @@ cmd_config_dcb_parsed(void *parsed_result,
@@ -29 +30 @@
-@@ -6665,4 +6668,7 @@ cmd_priority_flow_ctrl_set_parsed(void *parsed_result,
+@@ -6664,4 +6667,7 @@ cmd_priority_flow_ctrl_set_parsed(void *parsed_result,