DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 0/2] fix testpmd DCB command
@ 2025-02-20  7:06 Chengwen Feng
  2025-02-20  7:06 ` [PATCH 1/2] app/testpmd: support display DCB all priority's TC map Chengwen Feng
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Chengwen Feng @ 2025-02-20  7:06 UTC (permalink / raw)
  To: thomas, stephen, aman.deep.singh; +Cc: dev

This patchset contains two commit which found when debug DCB module.

Chengwen Feng (2):
  app/testpmd: support display DCB all priority's TC map
  app/testpmd: fix segment fault when config DCB

 app/test-pmd/cmdline.c | 6 ++++++
 app/test-pmd/config.c  | 4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] app/testpmd: support display DCB all priority's TC map
  2025-02-20  7:06 [PATCH 0/2] fix testpmd DCB command Chengwen Feng
@ 2025-02-20  7:06 ` Chengwen Feng
  2025-02-20  7:06 ` [PATCH 2/2] app/testpmd: fix segment fault when config DCB Chengwen Feng
  2025-02-20 20:54 ` [PATCH 0/2] fix testpmd DCB command Stephen Hemminger
  2 siblings, 0 replies; 4+ messages in thread
From: Chengwen Feng @ 2025-02-20  7:06 UTC (permalink / raw)
  To: thomas, stephen, aman.deep.singh; +Cc: dev

Currently, the "show port dcb_tc" command displays only the mapping
in the number of TCs. This patch fixes it by show all priority's TC
mapping.

Cc: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
---
 app/test-pmd/config.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 08a8ab02ea..e89af21cec 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -7273,8 +7273,8 @@ port_dcb_info_display(portid_t port_id)
 	printf("\n  TC :        ");
 	for (i = 0; i < dcb_info.nb_tcs; i++)
 		printf("\t%4d", i);
-	printf("\n  Priority :  ");
-	for (i = 0; i < dcb_info.nb_tcs; i++)
+	printf("\n  Prio2TC :  ");
+	for (i = 0; i < RTE_ETH_DCB_NUM_USER_PRIORITIES; i++)
 		printf("\t%4d", dcb_info.prio_tc[i]);
 	printf("\n  BW percent :");
 	for (i = 0; i < dcb_info.nb_tcs; i++)
-- 
2.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/2] app/testpmd: fix segment fault when config DCB
  2025-02-20  7:06 [PATCH 0/2] fix testpmd DCB command Chengwen Feng
  2025-02-20  7:06 ` [PATCH 1/2] app/testpmd: support display DCB all priority's TC map Chengwen Feng
@ 2025-02-20  7:06 ` Chengwen Feng
  2025-02-20 20:54 ` [PATCH 0/2] fix testpmd DCB command Stephen Hemminger
  2 siblings, 0 replies; 4+ messages in thread
From: Chengwen Feng @ 2025-02-20  7:06 UTC (permalink / raw)
  To: thomas, stephen, aman.deep.singh; +Cc: dev

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")
Cc: stable@dpdk.org

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 86d763b66a..56031fbd4e 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -3462,6 +3462,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) {
@@ -6664,6 +6667,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.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] fix testpmd DCB command
  2025-02-20  7:06 [PATCH 0/2] fix testpmd DCB command Chengwen Feng
  2025-02-20  7:06 ` [PATCH 1/2] app/testpmd: support display DCB all priority's TC map Chengwen Feng
  2025-02-20  7:06 ` [PATCH 2/2] app/testpmd: fix segment fault when config DCB Chengwen Feng
@ 2025-02-20 20:54 ` Stephen Hemminger
  2 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2025-02-20 20:54 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: thomas, aman.deep.singh, dev

On Thu, 20 Feb 2025 15:06:49 +0800
Chengwen Feng <fengchengwen@huawei.com> wrote:

> This patchset contains two commit which found when debug DCB module.
> 
> Chengwen Feng (2):
>   app/testpmd: support display DCB all priority's TC map
>   app/testpmd: fix segment fault when config DCB
> 
>  app/test-pmd/cmdline.c | 6 ++++++
>  app/test-pmd/config.c  | 4 ++--
>  2 files changed, 8 insertions(+), 2 deletions(-)
> 

Applied to next-net.  Added Fixes tag to the first patch (since cc to stable)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-02-20 20:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-20  7:06 [PATCH 0/2] fix testpmd DCB command Chengwen Feng
2025-02-20  7:06 ` [PATCH 1/2] app/testpmd: support display DCB all priority's TC map Chengwen Feng
2025-02-20  7:06 ` [PATCH 2/2] app/testpmd: fix segment fault when config DCB Chengwen Feng
2025-02-20 20:54 ` [PATCH 0/2] fix testpmd DCB command Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).