DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Min Hu (Connor)" <humin29@huawei.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: Thomas Monjalon <thomas@monjalon.net>, <dev@dpdk.org>,
	<ferruh.yigit@intel.com>, <maryam.tahhan@intel.com>,
	<reshma.pattan@intel.com>
Subject: Re: [PATCH] app/procinfo: add device private info dump
Date: Tue, 22 Feb 2022 08:40:39 +0800	[thread overview]
Message-ID: <c424e007-c78a-b02c-2fee-86ba731a8a07@huawei.com> (raw)
In-Reply-To: <20220221090457.3d6e6152@hermes.local>


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.
> .
> 

  reply	other threads:[~2022-02-22  0:40 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-19  1:59 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) [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c424e007-c78a-b02c-2fee-86ba731a8a07@huawei.com \
    --to=humin29@huawei.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=maryam.tahhan@intel.com \
    --cc=reshma.pattan@intel.com \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).