All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] app/procinfo: add device private info dump
@ 2022-02-19  1:59 Min Hu (Connor)
  2022-02-20  1:04 ` Stephen Hemminger
                   ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Min Hu (Connor) @ 2022-02-19  1:59 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, thomas, maryam.tahhan, reshma.pattan

This patch adds support for dump the device private info from a running
application. It can help developers locate the problem.

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 app/proc-info/main.c | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/app/proc-info/main.c b/app/proc-info/main.c
index 56070a3317..62a8b83bf5 100644
--- a/app/proc-info/main.c
+++ b/app/proc-info/main.c
@@ -84,6 +84,8 @@ static char bdr_str[MAX_STRING_LEN];
 
 /**< Enable show port. */
 static uint32_t enable_shw_port;
+/**< Enable show port. */
+static uint32_t enable_shw_port_priv;
 /**< Enable show tm. */
 static uint32_t enable_shw_tm;
 /**< Enable show crypto. */
@@ -123,6 +125,7 @@ proc_info_usage(const char *prgname)
 		"  --collectd-format: to print statistics to STDOUT in expected by collectd format\n"
 		"  --host-id STRING: host id used to identify the system process is running on\n"
 		"  --show-port: to display ports information\n"
+		"  --show-port-private: to display ports private information\n"
 		"  --show-tm: to display traffic manager information for ports\n"
 		"  --show-crypto: to display crypto information\n"
 		"  --show-ring[=name]: to display ring information\n"
@@ -232,6 +235,7 @@ proc_info_parse_args(int argc, char **argv)
 		{"xstats-ids", 1, NULL, 1},
 		{"host-id", 0, NULL, 0},
 		{"show-port", 0, NULL, 0},
+		{"show-port-private", 0, NULL, 0},
 		{"show-tm", 0, NULL, 0},
 		{"show-crypto", 0, NULL, 0},
 		{"show-ring", optional_argument, NULL, 0},
@@ -284,6 +288,9 @@ proc_info_parse_args(int argc, char **argv)
 			else if (!strncmp(long_option[option_index].name,
 					"show-port", MAX_LONG_OPT_SZ))
 				enable_shw_port = 1;
+			else if (!strncmp(long_option[option_index].name,
+					"show-port-private", MAX_LONG_OPT_SZ))
+				enable_shw_port_priv = 1;
 			else if (!strncmp(long_option[option_index].name,
 					"show-tm", MAX_LONG_OPT_SZ))
 				enable_shw_tm = 1;
@@ -887,6 +894,29 @@ show_port(void)
 	}
 }
 
+static void
+show_port_private_info(void)
+{
+	int i;
+
+	snprintf(bdr_str, MAX_STRING_LEN, " show - Port PMD Private ");
+	STATS_BDR_STR(10, bdr_str);
+
+	for (i = 0; i < RTE_MAX_ETHPORTS; i++) {
+		/* Skip if port is not in mask */
+		if ((enabled_port_mask & (1ul << i)) == 0)
+			continue;
+
+		/* Skip if port is unused */
+		if (!rte_eth_dev_is_valid_port(i))
+			continue;
+
+		snprintf(bdr_str, MAX_STRING_LEN, " Port %u ", i);
+		STATS_BDR_STR(5, bdr_str);
+		rte_eth_dev_priv_dump(i, stdout);
+	}
+}
+
 static void
 display_nodecap_info(int is_leaf, struct rte_tm_node_capabilities *cap)
 {
@@ -1549,6 +1579,8 @@ main(int argc, char **argv)
 	/* show information for PMD */
 	if (enable_shw_port)
 		show_port();
+	if (enable_shw_port_priv)
+		show_port_private_info();
 	if (enable_shw_tm)
 		show_tm();
 	if (enable_shw_crypto)
-- 
2.33.0


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

* Re: [PATCH] app/procinfo: add device private info dump
  2022-02-19  1:59 [PATCH] app/procinfo: add device private info dump Min Hu (Connor)
@ 2022-02-20  1:04 ` Stephen Hemminger
  2022-02-20  8:56   ` Thomas Monjalon
  2022-02-21  2:24 ` [PATCH v2] app/procinfo: add devcie " Min Hu (Connor)
  2022-06-02  6:22 ` Min Hu (Connor)
  2 siblings, 1 reply; 21+ messages in thread
From: Stephen Hemminger @ 2022-02-20  1:04 UTC (permalink / raw)
  To: Min Hu (Connor); +Cc: dev, ferruh.yigit, thomas, maryam.tahhan, reshma.pattan

On Sat, 19 Feb 2022 09:59:16 +0800
"Min Hu (Connor)" <humin29@huawei.com> wrote:

> +static void
> +show_port_private_info(void)
> +{
> +	int i;
> +
> +	snprintf(bdr_str, MAX_STRING_LEN, " show - Port PMD Private ");
> +	STATS_BDR_STR(10, bdr_str);
> +
> +	for (i = 0; i < RTE_MAX_ETHPORTS; i++) {
> +		/* Skip if port is not in mask */
> +		if ((enabled_port_mask & (1ul << i)) == 0)
> +			continue;
> +
> +		/* Skip if port is unused */
> +		if (!rte_eth_dev_is_valid_port(i))
> +			continue;

Maybe use RTE_ETH_FOREACH_DEV(i) here?

Procinfo is somewhat inconsistent, some code uses, and some does not.
The difference is that FOREACH skips ports that are "owned" i.e
associated with another port.

There probably should be a clear policy in the comments about
how this command should handle ports.  My preference would be
that it shows all valid ports, all the time since this is a diagnostic
command used to debug misconfiguration. 

There is RTE_ETH_FOREACH_VALID_DEV but it is marked internal?

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

* Re: [PATCH] app/procinfo: add device private info dump
  2022-02-20  1:04 ` Stephen Hemminger
@ 2022-02-20  8:56   ` Thomas Monjalon
  2022-02-21  2:26     ` Min Hu (Connor)
  0 siblings, 1 reply; 21+ messages in thread
From: Thomas Monjalon @ 2022-02-20  8:56 UTC (permalink / raw)
  To: Min Hu (Connor), Stephen Hemminger
  Cc: dev, ferruh.yigit, maryam.tahhan, reshma.pattan

20/02/2022 02:04, Stephen Hemminger:
> On Sat, 19 Feb 2022 09:59:16 +0800
> "Min Hu (Connor)" <humin29@huawei.com> wrote:
> 
> > +static void
> > +show_port_private_info(void)
> > +{
> > +	int i;
> > +
> > +	snprintf(bdr_str, MAX_STRING_LEN, " show - Port PMD Private ");
> > +	STATS_BDR_STR(10, bdr_str);
> > +
> > +	for (i = 0; i < RTE_MAX_ETHPORTS; i++) {
> > +		/* Skip if port is not in mask */
> > +		if ((enabled_port_mask & (1ul << i)) == 0)
> > +			continue;
> > +
> > +		/* Skip if port is unused */
> > +		if (!rte_eth_dev_is_valid_port(i))
> > +			continue;
> 
> Maybe use RTE_ETH_FOREACH_DEV(i) here?
> 
> Procinfo is somewhat inconsistent, some code uses, and some does not.
> The difference is that FOREACH skips ports that are "owned" i.e
> associated with another port.

Yes RTE_ETH_FOREACH_DEV is for general usage,
you get only the ports you are supposed to manage.

> There probably should be a clear policy in the comments about
> how this command should handle ports.  My preference would be
> that it shows all valid ports, all the time since this is a diagnostic
> command used to debug misconfiguration. 
> 
> There is RTE_ETH_FOREACH_VALID_DEV but it is marked internal?

Yes, you get it right, RTE_ETH_FOREACH_VALID_DEV gets all ports
and that should be used only internally or for debugging.
If we expose it for debugging purpose, there is a risk of confusion.
The goal was to "force" applications to adopt good behaviour,
using RTE_ETH_FOREACH_DEV.
It means RTE_MAX_ETHPORTS must be used for debugging.
Is it a good decision?



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

* [PATCH v2] app/procinfo: add devcie private info dump
  2022-02-19  1:59 [PATCH] app/procinfo: add device private info dump Min Hu (Connor)
  2022-02-20  1:04 ` Stephen Hemminger
@ 2022-02-21  2:24 ` Min Hu (Connor)
  2022-04-07  8:09   ` Min Hu (Connor)
                     ` (3 more replies)
  2022-06-02  6:22 ` Min Hu (Connor)
  2 siblings, 4 replies; 21+ messages in thread
From: Min Hu (Connor) @ 2022-02-21  2:24 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, stephen, thomas, maryam.tahhan, reshma.pattan

This patch adds support for dump the device private info from a running
application. It can help developers locate the problem.

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
v2:
* fix way of handling ports.
---
 app/proc-info/main.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/app/proc-info/main.c b/app/proc-info/main.c
index 56070a3317..accb5e716d 100644
--- a/app/proc-info/main.c
+++ b/app/proc-info/main.c
@@ -84,6 +84,8 @@ static char bdr_str[MAX_STRING_LEN];
 
 /**< Enable show port. */
 static uint32_t enable_shw_port;
+/**< Enable show port private info. */
+static uint32_t enable_shw_port_priv;
 /**< Enable show tm. */
 static uint32_t enable_shw_tm;
 /**< Enable show crypto. */
@@ -123,6 +125,7 @@ proc_info_usage(const char *prgname)
 		"  --collectd-format: to print statistics to STDOUT in expected by collectd format\n"
 		"  --host-id STRING: host id used to identify the system process is running on\n"
 		"  --show-port: to display ports information\n"
+		"  --show-port-private: to display ports private information\n"
 		"  --show-tm: to display traffic manager information for ports\n"
 		"  --show-crypto: to display crypto information\n"
 		"  --show-ring[=name]: to display ring information\n"
@@ -232,6 +235,7 @@ proc_info_parse_args(int argc, char **argv)
 		{"xstats-ids", 1, NULL, 1},
 		{"host-id", 0, NULL, 0},
 		{"show-port", 0, NULL, 0},
+		{"show-port-private", 0, NULL, 0},
 		{"show-tm", 0, NULL, 0},
 		{"show-crypto", 0, NULL, 0},
 		{"show-ring", optional_argument, NULL, 0},
@@ -284,6 +288,9 @@ proc_info_parse_args(int argc, char **argv)
 			else if (!strncmp(long_option[option_index].name,
 					"show-port", MAX_LONG_OPT_SZ))
 				enable_shw_port = 1;
+			else if (!strncmp(long_option[option_index].name,
+					"show-port-private", MAX_LONG_OPT_SZ))
+				enable_shw_port_priv = 1;
 			else if (!strncmp(long_option[option_index].name,
 					"show-tm", MAX_LONG_OPT_SZ))
 				enable_shw_tm = 1;
@@ -887,6 +894,25 @@ show_port(void)
 	}
 }
 
+static void
+show_port_private_info(void)
+{
+	int i;
+
+	snprintf(bdr_str, MAX_STRING_LEN, " show - Port PMD Private ");
+	STATS_BDR_STR(10, bdr_str);
+
+	RTE_ETH_FOREACH_DEV(i) {
+		/* Skip if port is not in mask */
+		if ((enabled_port_mask & (1ul << i)) == 0)
+			continue;
+
+		snprintf(bdr_str, MAX_STRING_LEN, " Port %u ", i);
+		STATS_BDR_STR(5, bdr_str);
+		rte_eth_dev_priv_dump(i, stdout);
+	}
+}
+
 static void
 display_nodecap_info(int is_leaf, struct rte_tm_node_capabilities *cap)
 {
@@ -1549,6 +1575,8 @@ main(int argc, char **argv)
 	/* show information for PMD */
 	if (enable_shw_port)
 		show_port();
+	if (enable_shw_port_priv)
+		show_port_private_info();
 	if (enable_shw_tm)
 		show_tm();
 	if (enable_shw_crypto)
-- 
2.33.0


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

* Re: [PATCH] app/procinfo: add device private info dump
  2022-02-20  8:56   ` Thomas Monjalon
@ 2022-02-21  2:26     ` Min Hu (Connor)
  2022-02-21 17:04       ` Stephen Hemminger
  0 siblings, 1 reply; 21+ messages in thread
From: Min Hu (Connor) @ 2022-02-21  2:26 UTC (permalink / raw)
  To: Thomas Monjalon, Stephen Hemminger
  Cc: dev, ferruh.yigit, maryam.tahhan, reshma.pattan

Hi,

在 2022/2/20 16:56, Thomas Monjalon 写道:
> 20/02/2022 02:04, Stephen Hemminger:
>> On Sat, 19 Feb 2022 09:59:16 +0800
>> "Min Hu (Connor)" <humin29@huawei.com> wrote:
>>
>>> +static void
>>> +show_port_private_info(void)
>>> +{
>>> +	int i;
>>> +
>>> +	snprintf(bdr_str, MAX_STRING_LEN, " show - Port PMD Private ");
>>> +	STATS_BDR_STR(10, bdr_str);
>>> +
>>> +	for (i = 0; i < RTE_MAX_ETHPORTS; i++) {
>>> +		/* Skip if port is not in mask */
>>> +		if ((enabled_port_mask & (1ul << i)) == 0)
>>> +			continue;
>>> +
>>> +		/* Skip if port is unused */
>>> +		if (!rte_eth_dev_is_valid_port(i))
>>> +			continue;
>>
>> Maybe use RTE_ETH_FOREACH_DEV(i) here?
>>
>> Procinfo is somewhat inconsistent, some code uses, and some does not.
>> The difference is that FOREACH skips ports that are "owned" i.e
>> associated with another port.
> 
> Yes RTE_ETH_FOREACH_DEV is for general usage,
> you get only the ports you are supposed to manage.
> 
>> There probably should be a clear policy in the comments about
>> how this command should handle ports.  My preference would be
>> that it shows all valid ports, all the time since this is a diagnostic
>> command used to debug misconfiguration.
>>
>> There is RTE_ETH_FOREACH_VALID_DEV but it is marked internal?
> 
> Yes, you get it right, RTE_ETH_FOREACH_VALID_DEV gets all ports
> and that should be used only internally or for debugging.
> If we expose it for debugging purpose, there is a risk of confusion.
> The goal was to "force" applications to adopt good behaviour,
> using RTE_ETH_FOREACH_DEV.
Agree with using RTE_ETH_FOREACH_DEV, v2 has been sent out.

> It means RTE_MAX_ETHPORTS must be used for debugging.
> Is it a good decision?
> 
> 
> .
> 

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

* Re: [PATCH] app/procinfo: add device private info dump
  2022-02-21  2:26     ` Min Hu (Connor)
@ 2022-02-21 17:04       ` Stephen Hemminger
  2022-02-22  0:40         ` Min Hu (Connor)
  0 siblings, 1 reply; 21+ messages in thread
From: Stephen Hemminger @ 2022-02-21 17:04 UTC (permalink / raw)
  To: Min Hu (Connor)
  Cc: Thomas Monjalon, dev, ferruh.yigit, maryam.tahhan, reshma.pattan

On Mon, 21 Feb 2022 10:26:38 +0800
"Min Hu (Connor)" <humin29@huawei.com> wrote:

> Hi,
> 
> 在 2022/2/20 16:56, Thomas Monjalon 写道:
> > 20/02/2022 02:04, Stephen Hemminger:  
> >> On Sat, 19 Feb 2022 09:59:16 +0800
> >> "Min Hu (Connor)" <humin29@huawei.com> wrote:
> >>  
> >>> +static void
> >>> +show_port_private_info(void)
> >>> +{
> >>> +	int i;
> >>> +
> >>> +	snprintf(bdr_str, MAX_STRING_LEN, " show - Port PMD Private ");
> >>> +	STATS_BDR_STR(10, bdr_str);
> >>> +
> >>> +	for (i = 0; i < RTE_MAX_ETHPORTS; i++) {
> >>> +		/* Skip if port is not in mask */
> >>> +		if ((enabled_port_mask & (1ul << i)) == 0)
> >>> +			continue;
> >>> +
> >>> +		/* Skip if port is unused */
> >>> +		if (!rte_eth_dev_is_valid_port(i))
> >>> +			continue;  
> >>
> >> Maybe use RTE_ETH_FOREACH_DEV(i) here?
> >>
> >> Procinfo is somewhat inconsistent, some code uses, and some does not.
> >> The difference is that FOREACH skips ports that are "owned" i.e
> >> associated with another port.  
> > 
> > Yes RTE_ETH_FOREACH_DEV is for general usage,
> > you get only the ports you are supposed to manage.
> >   
> >> There probably should be a clear policy in the comments about
> >> how this command should handle ports.  My preference would be
> >> that it shows all valid ports, all the time since this is a diagnostic
> >> command used to debug misconfiguration.
> >>
> >> There is RTE_ETH_FOREACH_VALID_DEV but it is marked internal?  
> > 
> > Yes, you get it right, RTE_ETH_FOREACH_VALID_DEV gets all ports
> > and that should be used only internally or for debugging.
> > If we expose it for debugging purpose, there is a risk of confusion.
> > The goal was to "force" applications to adopt good behaviour,
> > using RTE_ETH_FOREACH_DEV.  
> Agree with using RTE_ETH_FOREACH_DEV, v2 has been sent out.
> 
> > It means RTE_MAX_ETHPORTS must be used for debugging.
> > Is it a good decision?
> > 
> > 
> > .
> >   

Maybe procinfo should have a flag (--all) to show all devices.

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

* Re: [PATCH] app/procinfo: add device private info dump
  2022-02-21 17:04       ` Stephen Hemminger
@ 2022-02-22  0:40         ` Min Hu (Connor)
  0 siblings, 0 replies; 21+ messages in thread
From: Min Hu (Connor) @ 2022-02-22  0:40 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: Thomas Monjalon, dev, ferruh.yigit, maryam.tahhan, reshma.pattan


HI,

在 2022/2/22 1:04, Stephen Hemminger 写道:
> On Mon, 21 Feb 2022 10:26:38 +0800
> "Min Hu (Connor)" <humin29@huawei.com> wrote:
> 
>> Hi,
>>
>> 在 2022/2/20 16:56, Thomas Monjalon 写道:
>>> 20/02/2022 02:04, Stephen Hemminger:
>>>> On Sat, 19 Feb 2022 09:59:16 +0800
>>>> "Min Hu (Connor)" <humin29@huawei.com> wrote:
>>>>   
>>>>> +static void
>>>>> +show_port_private_info(void)
>>>>> +{
>>>>> +	int i;
>>>>> +
>>>>> +	snprintf(bdr_str, MAX_STRING_LEN, " show - Port PMD Private ");
>>>>> +	STATS_BDR_STR(10, bdr_str);
>>>>> +
>>>>> +	for (i = 0; i < RTE_MAX_ETHPORTS; i++) {
>>>>> +		/* Skip if port is not in mask */
>>>>> +		if ((enabled_port_mask & (1ul << i)) == 0)
>>>>> +			continue;
>>>>> +
>>>>> +		/* Skip if port is unused */
>>>>> +		if (!rte_eth_dev_is_valid_port(i))
>>>>> +			continue;
>>>>
>>>> Maybe use RTE_ETH_FOREACH_DEV(i) here?
>>>>
>>>> Procinfo is somewhat inconsistent, some code uses, and some does not.
>>>> The difference is that FOREACH skips ports that are "owned" i.e
>>>> associated with another port.
>>>
>>> Yes RTE_ETH_FOREACH_DEV is for general usage,
>>> you get only the ports you are supposed to manage.
>>>    
>>>> There probably should be a clear policy in the comments about
>>>> how this command should handle ports.  My preference would be
>>>> that it shows all valid ports, all the time since this is a diagnostic
>>>> command used to debug misconfiguration.
>>>>
>>>> There is RTE_ETH_FOREACH_VALID_DEV but it is marked internal?
>>>
>>> Yes, you get it right, RTE_ETH_FOREACH_VALID_DEV gets all ports
>>> and that should be used only internally or for debugging.
>>> If we expose it for debugging purpose, there is a risk of confusion.
>>> The goal was to "force" applications to adopt good behaviour,
>>> using RTE_ETH_FOREACH_DEV.
>> Agree with using RTE_ETH_FOREACH_DEV, v2 has been sent out.
>>
>>> It means RTE_MAX_ETHPORTS must be used for debugging.
>>> Is it a good decision?
>>>
>>>
>>> .
>>>    
> 
> Maybe procinfo should have a flag (--all) to show all devices.
How about keep the patch as v1 shows, like that:
+	for (i = 0; i < RTE_MAX_ETHPORTS; i++) {
+		/* Skip if port is not in mask */
+		if ((enabled_port_mask & (1ul << i)) == 0)
+			continue;
+
+		/* Skip if port is unused */
+		if (!rte_eth_dev_is_valid_port(i))
+			continue;

This can show all devices.
> .
> 

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

* Re: [PATCH v2] app/procinfo: add devcie private info dump
  2022-02-21  2:24 ` [PATCH v2] app/procinfo: add devcie " Min Hu (Connor)
@ 2022-04-07  8:09   ` Min Hu (Connor)
  2022-04-18  1:11     ` Min Hu (Connor)
  2022-04-25  6:44     ` Min Hu (Connor)
  2022-05-21  6:54   ` Min Hu (Connor)
                     ` (2 subsequent siblings)
  3 siblings, 2 replies; 21+ messages in thread
From: Min Hu (Connor) @ 2022-04-07  8:09 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, stephen, thomas, maryam.tahhan, reshma.pattan

Hi, all,
	any comments for this patch?

在 2022/2/21 10:24, Min Hu (Connor) 写道:
> This patch adds support for dump the device private info from a running
> application. It can help developers locate the problem.
> 
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> ---
> v2:
> * fix way of handling ports.
> ---
>   app/proc-info/main.c | 28 ++++++++++++++++++++++++++++
>   1 file changed, 28 insertions(+)
> 
> diff --git a/app/proc-info/main.c b/app/proc-info/main.c
> index 56070a3317..accb5e716d 100644
> --- a/app/proc-info/main.c
> +++ b/app/proc-info/main.c
> @@ -84,6 +84,8 @@ static char bdr_str[MAX_STRING_LEN];
>   
>   /**< Enable show port. */
>   static uint32_t enable_shw_port;
> +/**< Enable show port private info. */
> +static uint32_t enable_shw_port_priv;
>   /**< Enable show tm. */
>   static uint32_t enable_shw_tm;
>   /**< Enable show crypto. */
> @@ -123,6 +125,7 @@ proc_info_usage(const char *prgname)
>   		"  --collectd-format: to print statistics to STDOUT in expected by collectd format\n"
>   		"  --host-id STRING: host id used to identify the system process is running on\n"
>   		"  --show-port: to display ports information\n"
> +		"  --show-port-private: to display ports private information\n"
>   		"  --show-tm: to display traffic manager information for ports\n"
>   		"  --show-crypto: to display crypto information\n"
>   		"  --show-ring[=name]: to display ring information\n"
> @@ -232,6 +235,7 @@ proc_info_parse_args(int argc, char **argv)
>   		{"xstats-ids", 1, NULL, 1},
>   		{"host-id", 0, NULL, 0},
>   		{"show-port", 0, NULL, 0},
> +		{"show-port-private", 0, NULL, 0},
>   		{"show-tm", 0, NULL, 0},
>   		{"show-crypto", 0, NULL, 0},
>   		{"show-ring", optional_argument, NULL, 0},
> @@ -284,6 +288,9 @@ proc_info_parse_args(int argc, char **argv)
>   			else if (!strncmp(long_option[option_index].name,
>   					"show-port", MAX_LONG_OPT_SZ))
>   				enable_shw_port = 1;
> +			else if (!strncmp(long_option[option_index].name,
> +					"show-port-private", MAX_LONG_OPT_SZ))
> +				enable_shw_port_priv = 1;
>   			else if (!strncmp(long_option[option_index].name,
>   					"show-tm", MAX_LONG_OPT_SZ))
>   				enable_shw_tm = 1;
> @@ -887,6 +894,25 @@ show_port(void)
>   	}
>   }
>   
> +static void
> +show_port_private_info(void)
> +{
> +	int i;
> +
> +	snprintf(bdr_str, MAX_STRING_LEN, " show - Port PMD Private ");
> +	STATS_BDR_STR(10, bdr_str);
> +
> +	RTE_ETH_FOREACH_DEV(i) {
> +		/* Skip if port is not in mask */
> +		if ((enabled_port_mask & (1ul << i)) == 0)
> +			continue;
> +
> +		snprintf(bdr_str, MAX_STRING_LEN, " Port %u ", i);
> +		STATS_BDR_STR(5, bdr_str);
> +		rte_eth_dev_priv_dump(i, stdout);
> +	}
> +}
> +
>   static void
>   display_nodecap_info(int is_leaf, struct rte_tm_node_capabilities *cap)
>   {
> @@ -1549,6 +1575,8 @@ main(int argc, char **argv)
>   	/* show information for PMD */
>   	if (enable_shw_port)
>   		show_port();
> +	if (enable_shw_port_priv)
> +		show_port_private_info();
>   	if (enable_shw_tm)
>   		show_tm();
>   	if (enable_shw_crypto)
> 

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

* Re: [PATCH v2] app/procinfo: add devcie private info dump
  2022-04-07  8:09   ` Min Hu (Connor)
@ 2022-04-18  1:11     ` Min Hu (Connor)
  2022-04-25  6:44     ` Min Hu (Connor)
  1 sibling, 0 replies; 21+ messages in thread
From: Min Hu (Connor) @ 2022-04-18  1:11 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, stephen, thomas, maryam.tahhan, reshma.pattan

Hi, all,
     any comments for this patch?

在 2022/4/7 16:09, Min Hu (Connor) 写道:
> Hi, all,
>      any comments for this patch?

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

* Re: [PATCH v2] app/procinfo: add devcie private info dump
  2022-04-07  8:09   ` Min Hu (Connor)
  2022-04-18  1:11     ` Min Hu (Connor)
@ 2022-04-25  6:44     ` Min Hu (Connor)
  1 sibling, 0 replies; 21+ messages in thread
From: Min Hu (Connor) @ 2022-04-25  6:44 UTC (permalink / raw)
  To: dev
  Cc: ferruh.yigit, stephen, thomas, maryam.tahhan, reshma.pattan,
	ferruh.yigit

Hi, Ferruh,
	what do you think of this patch?

在 2022/4/7 16:09, Min Hu (Connor) 写道:
> Hi, all,
>      any comments for this patch?
> 
> 在 2022/2/21 10:24, Min Hu (Connor) 写道:
>> This patch adds support for dump the device private info from a running
>> application. It can help developers locate the problem.
>>
>> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
>> ---
>> v2:
>> * fix way of handling ports.
>> ---
>>   app/proc-info/main.c | 28 ++++++++++++++++++++++++++++
>>   1 file changed, 28 insertions(+)
>>
>> diff --git a/app/proc-info/main.c b/app/proc-info/main.c
>> index 56070a3317..accb5e716d 100644
>> --- a/app/proc-info/main.c
>> +++ b/app/proc-info/main.c
>> @@ -84,6 +84,8 @@ static char bdr_str[MAX_STRING_LEN];
>>   /**< Enable show port. */
>>   static uint32_t enable_shw_port;
>> +/**< Enable show port private info. */
>> +static uint32_t enable_shw_port_priv;
>>   /**< Enable show tm. */
>>   static uint32_t enable_shw_tm;
>>   /**< Enable show crypto. */
>> @@ -123,6 +125,7 @@ proc_info_usage(const char *prgname)
>>           "  --collectd-format: to print statistics to STDOUT in 
>> expected by collectd format\n"
>>           "  --host-id STRING: host id used to identify the system 
>> process is running on\n"
>>           "  --show-port: to display ports information\n"
>> +        "  --show-port-private: to display ports private information\n"
>>           "  --show-tm: to display traffic manager information for 
>> ports\n"
>>           "  --show-crypto: to display crypto information\n"
>>           "  --show-ring[=name]: to display ring information\n"
>> @@ -232,6 +235,7 @@ proc_info_parse_args(int argc, char **argv)
>>           {"xstats-ids", 1, NULL, 1},
>>           {"host-id", 0, NULL, 0},
>>           {"show-port", 0, NULL, 0},
>> +        {"show-port-private", 0, NULL, 0},
>>           {"show-tm", 0, NULL, 0},
>>           {"show-crypto", 0, NULL, 0},
>>           {"show-ring", optional_argument, NULL, 0},
>> @@ -284,6 +288,9 @@ proc_info_parse_args(int argc, char **argv)
>>               else if (!strncmp(long_option[option_index].name,
>>                       "show-port", MAX_LONG_OPT_SZ))
>>                   enable_shw_port = 1;
>> +            else if (!strncmp(long_option[option_index].name,
>> +                    "show-port-private", MAX_LONG_OPT_SZ))
>> +                enable_shw_port_priv = 1;
>>               else if (!strncmp(long_option[option_index].name,
>>                       "show-tm", MAX_LONG_OPT_SZ))
>>                   enable_shw_tm = 1;
>> @@ -887,6 +894,25 @@ show_port(void)
>>       }
>>   }
>> +static void
>> +show_port_private_info(void)
>> +{
>> +    int i;
>> +
>> +    snprintf(bdr_str, MAX_STRING_LEN, " show - Port PMD Private ");
>> +    STATS_BDR_STR(10, bdr_str);
>> +
>> +    RTE_ETH_FOREACH_DEV(i) {
>> +        /* Skip if port is not in mask */
>> +        if ((enabled_port_mask & (1ul << i)) == 0)
>> +            continue;
>> +
>> +        snprintf(bdr_str, MAX_STRING_LEN, " Port %u ", i);
>> +        STATS_BDR_STR(5, bdr_str);
>> +        rte_eth_dev_priv_dump(i, stdout);
>> +    }
>> +}
>> +
>>   static void
>>   display_nodecap_info(int is_leaf, struct rte_tm_node_capabilities *cap)
>>   {
>> @@ -1549,6 +1575,8 @@ main(int argc, char **argv)
>>       /* show information for PMD */
>>       if (enable_shw_port)
>>           show_port();
>> +    if (enable_shw_port_priv)
>> +        show_port_private_info();
>>       if (enable_shw_tm)
>>           show_tm();
>>       if (enable_shw_crypto)
>>
> .

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

* Re: [PATCH v2] app/procinfo: add devcie private info dump
  2022-02-21  2:24 ` [PATCH v2] app/procinfo: add devcie " Min Hu (Connor)
  2022-04-07  8:09   ` Min Hu (Connor)
@ 2022-05-21  6:54   ` Min Hu (Connor)
  2022-05-23  8:43     ` Ferruh Yigit
  2022-05-25 14:33   ` Pattan, Reshma
  2022-05-26  1:10   ` [PATCH v3] app/procinfo: add device " Min Hu (Connor)
  3 siblings, 1 reply; 21+ messages in thread
From: Min Hu (Connor) @ 2022-05-21  6:54 UTC (permalink / raw)
  To: dev
  Cc: ferruh.yigit, stephen, thomas, maryam.tahhan, reshma.pattan,
	Ferruh Yigit

Hi, Ferruh,
     what do you think of this patch?


在 2022/2/21 10:24, Min Hu (Connor) 写道:
> This patch adds support for dump the device private info from a running
> application. It can help developers locate the problem.
> 
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> ---
> v2:
> * fix way of handling ports.
> ---
>   app/proc-info/main.c | 28 ++++++++++++++++++++++++++++
>   1 file changed, 28 insertions(+)
> 
> diff --git a/app/proc-info/main.c b/app/proc-info/main.c
> index 56070a3317..accb5e716d 100644
> --- a/app/proc-info/main.c
> +++ b/app/proc-info/main.c
> @@ -84,6 +84,8 @@ static char bdr_str[MAX_STRING_LEN];
>   
>   /**< Enable show port. */
>   static uint32_t enable_shw_port;
> +/**< Enable show port private info. */
> +static uint32_t enable_shw_port_priv;
>   /**< Enable show tm. */
>   static uint32_t enable_shw_tm;
>   /**< Enable show crypto. */
> @@ -123,6 +125,7 @@ proc_info_usage(const char *prgname)
>   		"  --collectd-format: to print statistics to STDOUT in expected by collectd format\n"
>   		"  --host-id STRING: host id used to identify the system process is running on\n"
>   		"  --show-port: to display ports information\n"
> +		"  --show-port-private: to display ports private information\n"
>   		"  --show-tm: to display traffic manager information for ports\n"
>   		"  --show-crypto: to display crypto information\n"
>   		"  --show-ring[=name]: to display ring information\n"
> @@ -232,6 +235,7 @@ proc_info_parse_args(int argc, char **argv)
>   		{"xstats-ids", 1, NULL, 1},
>   		{"host-id", 0, NULL, 0},
>   		{"show-port", 0, NULL, 0},
> +		{"show-port-private", 0, NULL, 0},
>   		{"show-tm", 0, NULL, 0},
>   		{"show-crypto", 0, NULL, 0},
>   		{"show-ring", optional_argument, NULL, 0},
> @@ -284,6 +288,9 @@ proc_info_parse_args(int argc, char **argv)
>   			else if (!strncmp(long_option[option_index].name,
>   					"show-port", MAX_LONG_OPT_SZ))
>   				enable_shw_port = 1;
> +			else if (!strncmp(long_option[option_index].name,
> +					"show-port-private", MAX_LONG_OPT_SZ))
> +				enable_shw_port_priv = 1;
>   			else if (!strncmp(long_option[option_index].name,
>   					"show-tm", MAX_LONG_OPT_SZ))
>   				enable_shw_tm = 1;
> @@ -887,6 +894,25 @@ show_port(void)
>   	}
>   }
>   
> +static void
> +show_port_private_info(void)
> +{
> +	int i;
> +
> +	snprintf(bdr_str, MAX_STRING_LEN, " show - Port PMD Private ");
> +	STATS_BDR_STR(10, bdr_str);
> +
> +	RTE_ETH_FOREACH_DEV(i) {
> +		/* Skip if port is not in mask */
> +		if ((enabled_port_mask & (1ul << i)) == 0)
> +			continue;
> +
> +		snprintf(bdr_str, MAX_STRING_LEN, " Port %u ", i);
> +		STATS_BDR_STR(5, bdr_str);
> +		rte_eth_dev_priv_dump(i, stdout);
> +	}
> +}
> +
>   static void
>   display_nodecap_info(int is_leaf, struct rte_tm_node_capabilities *cap)
>   {
> @@ -1549,6 +1575,8 @@ main(int argc, char **argv)
>   	/* show information for PMD */
>   	if (enable_shw_port)
>   		show_port();
> +	if (enable_shw_port_priv)
> +		show_port_private_info();
>   	if (enable_shw_tm)
>   		show_tm();
>   	if (enable_shw_crypto)
> 

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

* Re: [PATCH v2] app/procinfo: add devcie private info dump
  2022-05-21  6:54   ` Min Hu (Connor)
@ 2022-05-23  8:43     ` Ferruh Yigit
  0 siblings, 0 replies; 21+ messages in thread
From: Ferruh Yigit @ 2022-05-23  8:43 UTC (permalink / raw)
  To: reshma.pattan, Maryam Tahhan; +Cc: stephen, thomas, dev, Min Hu (Connor)

On 5/21/2022 7:54 AM, Min Hu (Connor) wrote:
> CAUTION: This message has originated from an External Source. Please use 
> proper judgment and caution when opening attachments, clicking links, or 
> responding to this email.
> 
> 
> Hi, Ferruh,
>      what do you think of this patch?
> 

Hi Connor,

Maryam & Reshma are maintainers of the tool, both are cc'ed.

> 
> 在 2022/2/21 10:24, Min Hu (Connor) 写道:
>> This patch adds support for dump the device private info from a running
>> application. It can help developers locate the problem.
>>
>> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
>> ---
>> v2:
>> * fix way of handling ports.
>> ---
>>   app/proc-info/main.c | 28 ++++++++++++++++++++++++++++
>>   1 file changed, 28 insertions(+)
>>
>> diff --git a/app/proc-info/main.c b/app/proc-info/main.c
>> index 56070a3317..accb5e716d 100644
>> --- a/app/proc-info/main.c
>> +++ b/app/proc-info/main.c
>> @@ -84,6 +84,8 @@ static char bdr_str[MAX_STRING_LEN];
>>
>>   /**< Enable show port. */
>>   static uint32_t enable_shw_port;
>> +/**< Enable show port private info. */
>> +static uint32_t enable_shw_port_priv;
>>   /**< Enable show tm. */
>>   static uint32_t enable_shw_tm;
>>   /**< Enable show crypto. */
>> @@ -123,6 +125,7 @@ proc_info_usage(const char *prgname)
>>               "  --collectd-format: to print statistics to STDOUT in 
>> expected by collectd format\n"
>>               "  --host-id STRING: host id used to identify the system 
>> process is running on\n"
>>               "  --show-port: to display ports information\n"
>> +             "  --show-port-private: to display ports private 
>> information\n"
>>               "  --show-tm: to display traffic manager information for 
>> ports\n"
>>               "  --show-crypto: to display crypto information\n"
>>               "  --show-ring[=name]: to display ring information\n"
>> @@ -232,6 +235,7 @@ proc_info_parse_args(int argc, char **argv)
>>               {"xstats-ids", 1, NULL, 1},
>>               {"host-id", 0, NULL, 0},
>>               {"show-port", 0, NULL, 0},
>> +             {"show-port-private", 0, NULL, 0},
>>               {"show-tm", 0, NULL, 0},
>>               {"show-crypto", 0, NULL, 0},
>>               {"show-ring", optional_argument, NULL, 0},
>> @@ -284,6 +288,9 @@ proc_info_parse_args(int argc, char **argv)
>>                       else if (!strncmp(long_option[option_index].name,
>>                                       "show-port", MAX_LONG_OPT_SZ))
>>                               enable_shw_port = 1;
>> +                     else if (!strncmp(long_option[option_index].name,
>> +                                     "show-port-private", 
>> MAX_LONG_OPT_SZ))
>> +                             enable_shw_port_priv = 1;
>>                       else if (!strncmp(long_option[option_index].name,
>>                                       "show-tm", MAX_LONG_OPT_SZ))
>>                               enable_shw_tm = 1;
>> @@ -887,6 +894,25 @@ show_port(void)
>>       }
>>   }
>>
>> +static void
>> +show_port_private_info(void)
>> +{
>> +     int i;
>> +
>> +     snprintf(bdr_str, MAX_STRING_LEN, " show - Port PMD Private ");
>> +     STATS_BDR_STR(10, bdr_str);
>> +
>> +     RTE_ETH_FOREACH_DEV(i) {
>> +             /* Skip if port is not in mask */
>> +             if ((enabled_port_mask & (1ul << i)) == 0)
>> +                     continue;
>> +
>> +             snprintf(bdr_str, MAX_STRING_LEN, " Port %u ", i);
>> +             STATS_BDR_STR(5, bdr_str);
>> +             rte_eth_dev_priv_dump(i, stdout);
>> +     }
>> +}
>> +
>>   static void
>>   display_nodecap_info(int is_leaf, struct rte_tm_node_capabilities *cap)
>>   {
>> @@ -1549,6 +1575,8 @@ main(int argc, char **argv)
>>       /* show information for PMD */
>>       if (enable_shw_port)
>>               show_port();
>> +     if (enable_shw_port_priv)
>> +             show_port_private_info();
>>       if (enable_shw_tm)
>>               show_tm();
>>       if (enable_shw_crypto)
>>


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

* RE: [PATCH v2] app/procinfo: add devcie private info dump
  2022-02-21  2:24 ` [PATCH v2] app/procinfo: add devcie " Min Hu (Connor)
  2022-04-07  8:09   ` Min Hu (Connor)
  2022-05-21  6:54   ` Min Hu (Connor)
@ 2022-05-25 14:33   ` Pattan, Reshma
  2022-05-26  6:01     ` Min Hu (Connor)
  2022-05-26  1:10   ` [PATCH v3] app/procinfo: add device " Min Hu (Connor)
  3 siblings, 1 reply; 21+ messages in thread
From: Pattan, Reshma @ 2022-05-25 14:33 UTC (permalink / raw)
  To: Min Hu (Connor), dev; +Cc: Yigit, Ferruh, stephen, thomas, maryam.tahhan




> -----Original Message-----
> From: Min Hu (Connor) <humin29@huawei.com>
> Subject: [PATCH v2] app/procinfo: add devcie private info dump

Typo: device*

> +static void
> +show_port_private_info(void)
> +{
> +	int i;
> +
> +	snprintf(bdr_str, MAX_STRING_LEN, " show - Port PMD Private ");

Better to have header message to be "Dump - Ports private information"

Looks ok to me. 

Acked-by: Reshma Pattan <reshma.pattan@intel.com>


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

* [PATCH v3] app/procinfo: add device private info dump
  2022-02-21  2:24 ` [PATCH v2] app/procinfo: add devcie " Min Hu (Connor)
                     ` (2 preceding siblings ...)
  2022-05-25 14:33   ` Pattan, Reshma
@ 2022-05-26  1:10   ` Min Hu (Connor)
  3 siblings, 0 replies; 21+ messages in thread
From: Min Hu (Connor) @ 2022-05-26  1:10 UTC (permalink / raw)
  To: dev

This patch adds support for dump the device private info from a running
application. It can help developers locate the problem.

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
v3:
* fix wrong spelling.

v2:
* fix way of handling ports.
---
 app/proc-info/main.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/app/proc-info/main.c b/app/proc-info/main.c
index 56070a3317..1d350291b9 100644
--- a/app/proc-info/main.c
+++ b/app/proc-info/main.c
@@ -84,6 +84,8 @@ static char bdr_str[MAX_STRING_LEN];
 
 /**< Enable show port. */
 static uint32_t enable_shw_port;
+/**< Enable show port private info. */
+static uint32_t enable_shw_port_priv;
 /**< Enable show tm. */
 static uint32_t enable_shw_tm;
 /**< Enable show crypto. */
@@ -123,6 +125,7 @@ proc_info_usage(const char *prgname)
 		"  --collectd-format: to print statistics to STDOUT in expected by collectd format\n"
 		"  --host-id STRING: host id used to identify the system process is running on\n"
 		"  --show-port: to display ports information\n"
+		"  --show-port-private: to display ports private information\n"
 		"  --show-tm: to display traffic manager information for ports\n"
 		"  --show-crypto: to display crypto information\n"
 		"  --show-ring[=name]: to display ring information\n"
@@ -232,6 +235,7 @@ proc_info_parse_args(int argc, char **argv)
 		{"xstats-ids", 1, NULL, 1},
 		{"host-id", 0, NULL, 0},
 		{"show-port", 0, NULL, 0},
+		{"show-port-private", 0, NULL, 0},
 		{"show-tm", 0, NULL, 0},
 		{"show-crypto", 0, NULL, 0},
 		{"show-ring", optional_argument, NULL, 0},
@@ -284,6 +288,9 @@ proc_info_parse_args(int argc, char **argv)
 			else if (!strncmp(long_option[option_index].name,
 					"show-port", MAX_LONG_OPT_SZ))
 				enable_shw_port = 1;
+			else if (!strncmp(long_option[option_index].name,
+					"show-port-private", MAX_LONG_OPT_SZ))
+				enable_shw_port_priv = 1;
 			else if (!strncmp(long_option[option_index].name,
 					"show-tm", MAX_LONG_OPT_SZ))
 				enable_shw_tm = 1;
@@ -887,6 +894,25 @@ show_port(void)
 	}
 }
 
+static void
+show_port_private_info(void)
+{
+	int i;
+
+	snprintf(bdr_str, MAX_STRING_LEN, " Dump - Ports private information");
+	STATS_BDR_STR(10, bdr_str);
+
+	RTE_ETH_FOREACH_DEV(i) {
+		/* Skip if port is not in mask */
+		if ((enabled_port_mask & (1ul << i)) == 0)
+			continue;
+
+		snprintf(bdr_str, MAX_STRING_LEN, " Port %u ", i);
+		STATS_BDR_STR(5, bdr_str);
+		rte_eth_dev_priv_dump(i, stdout);
+	}
+}
+
 static void
 display_nodecap_info(int is_leaf, struct rte_tm_node_capabilities *cap)
 {
@@ -1549,6 +1575,8 @@ main(int argc, char **argv)
 	/* show information for PMD */
 	if (enable_shw_port)
 		show_port();
+	if (enable_shw_port_priv)
+		show_port_private_info();
 	if (enable_shw_tm)
 		show_tm();
 	if (enable_shw_crypto)
-- 
2.33.0


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

* Re: [PATCH v2] app/procinfo: add devcie private info dump
  2022-05-25 14:33   ` Pattan, Reshma
@ 2022-05-26  6:01     ` Min Hu (Connor)
  0 siblings, 0 replies; 21+ messages in thread
From: Min Hu (Connor) @ 2022-05-26  6:01 UTC (permalink / raw)
  To: Pattan, Reshma, dev; +Cc: Yigit, Ferruh, stephen, thomas, maryam.tahhan

Hi, Pattan,
	V3 has been sent, thanks

在 2022/5/25 22:33, Pattan, Reshma 写道:
> 
> 
> 
>> -----Original Message-----
>> From: Min Hu (Connor) <humin29@huawei.com>
>> Subject: [PATCH v2] app/procinfo: add devcie private info dump
> 
> Typo: device*
> 
>> +static void
>> +show_port_private_info(void)
>> +{
>> +	int i;
>> +
>> +	snprintf(bdr_str, MAX_STRING_LEN, " show - Port PMD Private ");
> 
> Better to have header message to be "Dump - Ports private information"
> 
> Looks ok to me.
> 
> Acked-by: Reshma Pattan <reshma.pattan@intel.com>
> 
> .
> 

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

* [PATCH v3] app/procinfo: add device private info dump
  2022-02-19  1:59 [PATCH] app/procinfo: add device private info dump Min Hu (Connor)
  2022-02-20  1:04 ` Stephen Hemminger
  2022-02-21  2:24 ` [PATCH v2] app/procinfo: add devcie " Min Hu (Connor)
@ 2022-06-02  6:22 ` Min Hu (Connor)
  2022-06-06 14:39   ` [PATCH v4] " Dongdong Liu
  2 siblings, 1 reply; 21+ messages in thread
From: Min Hu (Connor) @ 2022-06-02  6:22 UTC (permalink / raw)
  To: dev

This patch adds support for dump the device private info from a running
application. It can help developers locate the problem.

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
v3:
* fix wrong spelling.

v2:
* fix way of handling ports.
---
 app/proc-info/main.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/app/proc-info/main.c b/app/proc-info/main.c
index 56070a3317..1d350291b9 100644
--- a/app/proc-info/main.c
+++ b/app/proc-info/main.c
@@ -84,6 +84,8 @@ static char bdr_str[MAX_STRING_LEN];
 
 /**< Enable show port. */
 static uint32_t enable_shw_port;
+/**< Enable show port private info. */
+static uint32_t enable_shw_port_priv;
 /**< Enable show tm. */
 static uint32_t enable_shw_tm;
 /**< Enable show crypto. */
@@ -123,6 +125,7 @@ proc_info_usage(const char *prgname)
 		"  --collectd-format: to print statistics to STDOUT in expected by collectd format\n"
 		"  --host-id STRING: host id used to identify the system process is running on\n"
 		"  --show-port: to display ports information\n"
+		"  --show-port-private: to display ports private information\n"
 		"  --show-tm: to display traffic manager information for ports\n"
 		"  --show-crypto: to display crypto information\n"
 		"  --show-ring[=name]: to display ring information\n"
@@ -232,6 +235,7 @@ proc_info_parse_args(int argc, char **argv)
 		{"xstats-ids", 1, NULL, 1},
 		{"host-id", 0, NULL, 0},
 		{"show-port", 0, NULL, 0},
+		{"show-port-private", 0, NULL, 0},
 		{"show-tm", 0, NULL, 0},
 		{"show-crypto", 0, NULL, 0},
 		{"show-ring", optional_argument, NULL, 0},
@@ -284,6 +288,9 @@ proc_info_parse_args(int argc, char **argv)
 			else if (!strncmp(long_option[option_index].name,
 					"show-port", MAX_LONG_OPT_SZ))
 				enable_shw_port = 1;
+			else if (!strncmp(long_option[option_index].name,
+					"show-port-private", MAX_LONG_OPT_SZ))
+				enable_shw_port_priv = 1;
 			else if (!strncmp(long_option[option_index].name,
 					"show-tm", MAX_LONG_OPT_SZ))
 				enable_shw_tm = 1;
@@ -887,6 +894,25 @@ show_port(void)
 	}
 }
 
+static void
+show_port_private_info(void)
+{
+	int i;
+
+	snprintf(bdr_str, MAX_STRING_LEN, " Dump - Ports private information");
+	STATS_BDR_STR(10, bdr_str);
+
+	RTE_ETH_FOREACH_DEV(i) {
+		/* Skip if port is not in mask */
+		if ((enabled_port_mask & (1ul << i)) == 0)
+			continue;
+
+		snprintf(bdr_str, MAX_STRING_LEN, " Port %u ", i);
+		STATS_BDR_STR(5, bdr_str);
+		rte_eth_dev_priv_dump(i, stdout);
+	}
+}
+
 static void
 display_nodecap_info(int is_leaf, struct rte_tm_node_capabilities *cap)
 {
@@ -1549,6 +1575,8 @@ main(int argc, char **argv)
 	/* show information for PMD */
 	if (enable_shw_port)
 		show_port();
+	if (enable_shw_port_priv)
+		show_port_private_info();
 	if (enable_shw_tm)
 		show_tm();
 	if (enable_shw_crypto)
-- 
2.33.0


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

* [PATCH v4] app/procinfo: add device private info dump
  2022-06-02  6:22 ` Min Hu (Connor)
@ 2022-06-06 14:39   ` Dongdong Liu
  2022-06-13 12:45     ` Dongdong Liu
  2022-06-26 15:50     ` Thomas Monjalon
  0 siblings, 2 replies; 21+ messages in thread
From: Dongdong Liu @ 2022-06-06 14:39 UTC (permalink / raw)
  To: dev
  Cc: stephen, thomas, ferruh.yigit, reshma.pattan, mtahhan,
	Min Hu (Connor),
	Dongdong Liu, Maryam Tahhan

From: "Min Hu (Connor)" <humin29@huawei.com>

This patch adds support for dump the device private info from a running
application. It can help developers locate the problem.

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
---
v3->v4:
- add Acked-by Reshma.

v2->v3:
- fix wrong spelling.

v1->v2:
- fix way of handling ports.
---
 app/proc-info/main.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/app/proc-info/main.c b/app/proc-info/main.c
index 56070a3317..1d350291b9 100644
--- a/app/proc-info/main.c
+++ b/app/proc-info/main.c
@@ -84,6 +84,8 @@ static char bdr_str[MAX_STRING_LEN];
 
 /**< Enable show port. */
 static uint32_t enable_shw_port;
+/**< Enable show port private info. */
+static uint32_t enable_shw_port_priv;
 /**< Enable show tm. */
 static uint32_t enable_shw_tm;
 /**< Enable show crypto. */
@@ -123,6 +125,7 @@ proc_info_usage(const char *prgname)
 		"  --collectd-format: to print statistics to STDOUT in expected by collectd format\n"
 		"  --host-id STRING: host id used to identify the system process is running on\n"
 		"  --show-port: to display ports information\n"
+		"  --show-port-private: to display ports private information\n"
 		"  --show-tm: to display traffic manager information for ports\n"
 		"  --show-crypto: to display crypto information\n"
 		"  --show-ring[=name]: to display ring information\n"
@@ -232,6 +235,7 @@ proc_info_parse_args(int argc, char **argv)
 		{"xstats-ids", 1, NULL, 1},
 		{"host-id", 0, NULL, 0},
 		{"show-port", 0, NULL, 0},
+		{"show-port-private", 0, NULL, 0},
 		{"show-tm", 0, NULL, 0},
 		{"show-crypto", 0, NULL, 0},
 		{"show-ring", optional_argument, NULL, 0},
@@ -284,6 +288,9 @@ proc_info_parse_args(int argc, char **argv)
 			else if (!strncmp(long_option[option_index].name,
 					"show-port", MAX_LONG_OPT_SZ))
 				enable_shw_port = 1;
+			else if (!strncmp(long_option[option_index].name,
+					"show-port-private", MAX_LONG_OPT_SZ))
+				enable_shw_port_priv = 1;
 			else if (!strncmp(long_option[option_index].name,
 					"show-tm", MAX_LONG_OPT_SZ))
 				enable_shw_tm = 1;
@@ -887,6 +894,25 @@ show_port(void)
 	}
 }
 
+static void
+show_port_private_info(void)
+{
+	int i;
+
+	snprintf(bdr_str, MAX_STRING_LEN, " Dump - Ports private information");
+	STATS_BDR_STR(10, bdr_str);
+
+	RTE_ETH_FOREACH_DEV(i) {
+		/* Skip if port is not in mask */
+		if ((enabled_port_mask & (1ul << i)) == 0)
+			continue;
+
+		snprintf(bdr_str, MAX_STRING_LEN, " Port %u ", i);
+		STATS_BDR_STR(5, bdr_str);
+		rte_eth_dev_priv_dump(i, stdout);
+	}
+}
+
 static void
 display_nodecap_info(int is_leaf, struct rte_tm_node_capabilities *cap)
 {
@@ -1549,6 +1575,8 @@ main(int argc, char **argv)
 	/* show information for PMD */
 	if (enable_shw_port)
 		show_port();
+	if (enable_shw_port_priv)
+		show_port_private_info();
 	if (enable_shw_tm)
 		show_tm();
 	if (enable_shw_crypto)
-- 
2.22.0


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

* Re: [PATCH v4] app/procinfo: add device private info dump
  2022-06-06 14:39   ` [PATCH v4] " Dongdong Liu
@ 2022-06-13 12:45     ` Dongdong Liu
  2022-06-13 12:51       ` Dongdong Liu
  2022-06-26 15:50     ` Thomas Monjalon
  1 sibling, 1 reply; 21+ messages in thread
From: Dongdong Liu @ 2022-06-13 12:45 UTC (permalink / raw)
  To: dev, ferruh.yigit, Maryam Tahhan
  Cc: stephen, thomas, reshma.pattan, mtahhan, Min Hu (Connor)

Hi Maryam, ferruh

kind ping...

If there are no other comments, could you help to
apply this patch.

Thanks,
Dongdong
On 2022/6/6 22:39, Dongdong Liu wrote:
> From: "Min Hu (Connor)" <humin29@huawei.com>
>
> This patch adds support for dump the device private info from a running
> application. It can help developers locate the problem.
>
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
> Acked-by: Reshma Pattan <reshma.pattan@intel.com>
> ---
> v3->v4:
> - add Acked-by Reshma.
>
> v2->v3:
> - fix wrong spelling.
>
> v1->v2:
> - fix way of handling ports.
> ---
>  app/proc-info/main.c | 28 ++++++++++++++++++++++++++++
>  1 file changed, 28 insertions(+)
>
> diff --git a/app/proc-info/main.c b/app/proc-info/main.c
> index 56070a3317..1d350291b9 100644
> --- a/app/proc-info/main.c
> +++ b/app/proc-info/main.c
> @@ -84,6 +84,8 @@ static char bdr_str[MAX_STRING_LEN];
>
>  /**< Enable show port. */
>  static uint32_t enable_shw_port;
> +/**< Enable show port private info. */
> +static uint32_t enable_shw_port_priv;
>  /**< Enable show tm. */
>  static uint32_t enable_shw_tm;
>  /**< Enable show crypto. */
> @@ -123,6 +125,7 @@ proc_info_usage(const char *prgname)
>  		"  --collectd-format: to print statistics to STDOUT in expected by collectd format\n"
>  		"  --host-id STRING: host id used to identify the system process is running on\n"
>  		"  --show-port: to display ports information\n"
> +		"  --show-port-private: to display ports private information\n"
>  		"  --show-tm: to display traffic manager information for ports\n"
>  		"  --show-crypto: to display crypto information\n"
>  		"  --show-ring[=name]: to display ring information\n"
> @@ -232,6 +235,7 @@ proc_info_parse_args(int argc, char **argv)
>  		{"xstats-ids", 1, NULL, 1},
>  		{"host-id", 0, NULL, 0},
>  		{"show-port", 0, NULL, 0},
> +		{"show-port-private", 0, NULL, 0},
>  		{"show-tm", 0, NULL, 0},
>  		{"show-crypto", 0, NULL, 0},
>  		{"show-ring", optional_argument, NULL, 0},
> @@ -284,6 +288,9 @@ proc_info_parse_args(int argc, char **argv)
>  			else if (!strncmp(long_option[option_index].name,
>  					"show-port", MAX_LONG_OPT_SZ))
>  				enable_shw_port = 1;
> +			else if (!strncmp(long_option[option_index].name,
> +					"show-port-private", MAX_LONG_OPT_SZ))
> +				enable_shw_port_priv = 1;
>  			else if (!strncmp(long_option[option_index].name,
>  					"show-tm", MAX_LONG_OPT_SZ))
>  				enable_shw_tm = 1;
> @@ -887,6 +894,25 @@ show_port(void)
>  	}
>  }
>
> +static void
> +show_port_private_info(void)
> +{
> +	int i;
> +
> +	snprintf(bdr_str, MAX_STRING_LEN, " Dump - Ports private information");
> +	STATS_BDR_STR(10, bdr_str);
> +
> +	RTE_ETH_FOREACH_DEV(i) {
> +		/* Skip if port is not in mask */
> +		if ((enabled_port_mask & (1ul << i)) == 0)
> +			continue;
> +
> +		snprintf(bdr_str, MAX_STRING_LEN, " Port %u ", i);
> +		STATS_BDR_STR(5, bdr_str);
> +		rte_eth_dev_priv_dump(i, stdout);
> +	}
> +}
> +
>  static void
>  display_nodecap_info(int is_leaf, struct rte_tm_node_capabilities *cap)
>  {
> @@ -1549,6 +1575,8 @@ main(int argc, char **argv)
>  	/* show information for PMD */
>  	if (enable_shw_port)
>  		show_port();
> +	if (enable_shw_port_priv)
> +		show_port_private_info();
>  	if (enable_shw_tm)
>  		show_tm();
>  	if (enable_shw_crypto)
>

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

* Re: [PATCH v4] app/procinfo: add device private info dump
  2022-06-13 12:45     ` Dongdong Liu
@ 2022-06-13 12:51       ` Dongdong Liu
  0 siblings, 0 replies; 21+ messages in thread
From: Dongdong Liu @ 2022-06-13 12:51 UTC (permalink / raw)
  To: dev, ferruh.yigit, Maryam Tahhan, Ferruh Yigit

+cc Ferruh (ferruh.yigit@xilinx.com).

It seems this email could not be delivered to maryam.tahhan@intel.com.

Thanks,
Dongdong
On 2022/6/13 20:45, Dongdong Liu wrote:
> Hi Maryam, ferruh
>
> kind ping...
>
> If there are no other comments, could you help to
> apply this patch.
>
> Thanks,
> Dongdong
> On 2022/6/6 22:39, Dongdong Liu wrote:
>> From: "Min Hu (Connor)" <humin29@huawei.com>
>>
>> This patch adds support for dump the device private info from a running
>> application. It can help developers locate the problem.
>>
>> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
>> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
>> Acked-by: Reshma Pattan <reshma.pattan@intel.com>
>> ---
>> v3->v4:
>> - add Acked-by Reshma.
>>
>> v2->v3:
>> - fix wrong spelling.
>>
>> v1->v2:
>> - fix way of handling ports.
>> ---
>>  app/proc-info/main.c | 28 ++++++++++++++++++++++++++++
>>  1 file changed, 28 insertions(+)
>>
>> diff --git a/app/proc-info/main.c b/app/proc-info/main.c
>> index 56070a3317..1d350291b9 100644
>> --- a/app/proc-info/main.c
>> +++ b/app/proc-info/main.c
>> @@ -84,6 +84,8 @@ static char bdr_str[MAX_STRING_LEN];
>>
>>  /**< Enable show port. */
>>  static uint32_t enable_shw_port;
>> +/**< Enable show port private info. */
>> +static uint32_t enable_shw_port_priv;
>>  /**< Enable show tm. */
>>  static uint32_t enable_shw_tm;
>>  /**< Enable show crypto. */
>> @@ -123,6 +125,7 @@ proc_info_usage(const char *prgname)
>>          "  --collectd-format: to print statistics to STDOUT in
>> expected by collectd format\n"
>>          "  --host-id STRING: host id used to identify the system
>> process is running on\n"
>>          "  --show-port: to display ports information\n"
>> +        "  --show-port-private: to display ports private information\n"
>>          "  --show-tm: to display traffic manager information for
>> ports\n"
>>          "  --show-crypto: to display crypto information\n"
>>          "  --show-ring[=name]: to display ring information\n"
>> @@ -232,6 +235,7 @@ proc_info_parse_args(int argc, char **argv)
>>          {"xstats-ids", 1, NULL, 1},
>>          {"host-id", 0, NULL, 0},
>>          {"show-port", 0, NULL, 0},
>> +        {"show-port-private", 0, NULL, 0},
>>          {"show-tm", 0, NULL, 0},
>>          {"show-crypto", 0, NULL, 0},
>>          {"show-ring", optional_argument, NULL, 0},
>> @@ -284,6 +288,9 @@ proc_info_parse_args(int argc, char **argv)
>>              else if (!strncmp(long_option[option_index].name,
>>                      "show-port", MAX_LONG_OPT_SZ))
>>                  enable_shw_port = 1;
>> +            else if (!strncmp(long_option[option_index].name,
>> +                    "show-port-private", MAX_LONG_OPT_SZ))
>> +                enable_shw_port_priv = 1;
>>              else if (!strncmp(long_option[option_index].name,
>>                      "show-tm", MAX_LONG_OPT_SZ))
>>                  enable_shw_tm = 1;
>> @@ -887,6 +894,25 @@ show_port(void)
>>      }
>>  }
>>
>> +static void
>> +show_port_private_info(void)
>> +{
>> +    int i;
>> +
>> +    snprintf(bdr_str, MAX_STRING_LEN, " Dump - Ports private
>> information");
>> +    STATS_BDR_STR(10, bdr_str);
>> +
>> +    RTE_ETH_FOREACH_DEV(i) {
>> +        /* Skip if port is not in mask */
>> +        if ((enabled_port_mask & (1ul << i)) == 0)
>> +            continue;
>> +
>> +        snprintf(bdr_str, MAX_STRING_LEN, " Port %u ", i);
>> +        STATS_BDR_STR(5, bdr_str);
>> +        rte_eth_dev_priv_dump(i, stdout);
>> +    }
>> +}
>> +
>>  static void
>>  display_nodecap_info(int is_leaf, struct rte_tm_node_capabilities *cap)
>>  {
>> @@ -1549,6 +1575,8 @@ main(int argc, char **argv)
>>      /* show information for PMD */
>>      if (enable_shw_port)
>>          show_port();
>> +    if (enable_shw_port_priv)
>> +        show_port_private_info();
>>      if (enable_shw_tm)
>>          show_tm();
>>      if (enable_shw_crypto)
>>
> .
>

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

* Re: [PATCH v4] app/procinfo: add device private info dump
  2022-06-06 14:39   ` [PATCH v4] " Dongdong Liu
  2022-06-13 12:45     ` Dongdong Liu
@ 2022-06-26 15:50     ` Thomas Monjalon
  2022-07-02  8:22       ` Dongdong Liu
  1 sibling, 1 reply; 21+ messages in thread
From: Thomas Monjalon @ 2022-06-26 15:50 UTC (permalink / raw)
  To: Min Hu (Connor), Dongdong Liu
  Cc: dev, stephen, ferruh.yigit, reshma.pattan, mtahhan, Maryam Tahhan

06/06/2022 16:39, Dongdong Liu:
> From: "Min Hu (Connor)" <humin29@huawei.com>
> 
> This patch adds support for dump the device private info from a running
> application. It can help developers locate the problem.
> 
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
> Acked-by: Reshma Pattan <reshma.pattan@intel.com>

Applied, thanks.

[...]
>  /**< Enable show port. */
>  static uint32_t enable_shw_port;
> +/**< Enable show port private info. */
> +static uint32_t enable_shw_port_priv;

That's very strange this file is using some (wrong) doxygen syntax.
I'll fix this one when applying.
A cleanup may be needed for other comments in the file.

>  /**< Enable show tm. */
>  static uint32_t enable_shw_tm;
>  /**< Enable show crypto. */




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

* Re: [PATCH v4] app/procinfo: add device private info dump
  2022-06-26 15:50     ` Thomas Monjalon
@ 2022-07-02  8:22       ` Dongdong Liu
  0 siblings, 0 replies; 21+ messages in thread
From: Dongdong Liu @ 2022-07-02  8:22 UTC (permalink / raw)
  To: Thomas Monjalon, Min Hu (Connor)
  Cc: dev, stephen, ferruh.yigit, reshma.pattan, mtahhan, Maryam Tahhan

Hi Thomas

On 2022/6/26 23:50, Thomas Monjalon wrote:
> 06/06/2022 16:39, Dongdong Liu:
>> From: "Min Hu (Connor)" <humin29@huawei.com>
>>
>> This patch adds support for dump the device private info from a running
>> application. It can help developers locate the problem.
>>
>> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
>> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
>> Acked-by: Reshma Pattan <reshma.pattan@intel.com>
>
> Applied, thanks.
>
> [...]
>>  /**< Enable show port. */
>>  static uint32_t enable_shw_port;
>> +/**< Enable show port private info. */
>> +static uint32_t enable_shw_port_priv;
>
> That's very strange this file is using some (wrong) doxygen syntax.
> I'll fix this one when applying.
Many thanks for fixing it.
> A cleanup may be needed for other comments in the file.
Will do.

Thanks,
Dongdong
>
>>  /**< Enable show tm. */
>>  static uint32_t enable_shw_tm;
>>  /**< Enable show crypto. */
>
>
>
> .
>

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

end of thread, other threads:[~2022-07-02  8:22 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-19  1:59 [PATCH] app/procinfo: add device private info dump Min Hu (Connor)
2022-02-20  1:04 ` Stephen Hemminger
2022-02-20  8:56   ` Thomas Monjalon
2022-02-21  2:26     ` Min Hu (Connor)
2022-02-21 17:04       ` Stephen Hemminger
2022-02-22  0:40         ` Min Hu (Connor)
2022-02-21  2:24 ` [PATCH v2] app/procinfo: add devcie " Min Hu (Connor)
2022-04-07  8:09   ` Min Hu (Connor)
2022-04-18  1:11     ` Min Hu (Connor)
2022-04-25  6:44     ` Min Hu (Connor)
2022-05-21  6:54   ` Min Hu (Connor)
2022-05-23  8:43     ` Ferruh Yigit
2022-05-25 14:33   ` Pattan, Reshma
2022-05-26  6:01     ` Min Hu (Connor)
2022-05-26  1:10   ` [PATCH v3] app/procinfo: add device " Min Hu (Connor)
2022-06-02  6:22 ` Min Hu (Connor)
2022-06-06 14:39   ` [PATCH v4] " Dongdong Liu
2022-06-13 12:45     ` Dongdong Liu
2022-06-13 12:51       ` Dongdong Liu
2022-06-26 15:50     ` Thomas Monjalon
2022-07-02  8:22       ` Dongdong Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.