From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DE649A054F; Wed, 25 May 2022 09:14:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 96AF1400EF; Wed, 25 May 2022 09:14:31 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id 7C06C400D6 for ; Wed, 25 May 2022 09:14:30 +0200 (CEST) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [PATCH v2] app/procinfo: show all non-owned ports Date: Wed, 25 May 2022 09:14:28 +0200 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D870AD@smartserver.smartshare.dk> In-Reply-To: <20220524230405.5e21cfc8@hermes.local> X-MimeOLE: Produced By Microsoft Exchange V6.5 X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH v2] app/procinfo: show all non-owned ports Thread-Index: Adhv/UJ9OWtPBQX+RUyA3l+dk4UpeQACFxHg References: <20220525054604.16161-1-subendu@arista.com> <20220524230405.5e21cfc8@hermes.local> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Stephen Hemminger" , "Subendu Santra" Cc: "Maryam Tahhan" , "Reshma Pattan" , "Hemant Agrawal" , X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > Sent: Wednesday, 25 May 2022 08.04 >=20 > On Tue, 24 May 2022 22:46:05 -0700 > Subendu Santra wrote: >=20 > > Show all non-owned ports when no port mask is specified > > > > show-port option without the mask option, displays only the last > > non-owned port. Show all the non-owned ports instead. > > > > Fixes: 1dd6cffb6571 ("app/procinfo: provide way to request info on > owned > > ports") > > Cc: stephen@networkplumber.org > > > > Signed-off-by: Subendu Santra > > --- > > app/proc-info/main.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/app/proc-info/main.c b/app/proc-info/main.c > > index 56070a3317..2be24b584e 100644 > > --- a/app/proc-info/main.c > > +++ b/app/proc-info/main.c > > @@ -1504,10 +1504,10 @@ main(int argc, char **argv) > > if (nb_ports =3D=3D 0) > > rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n"); > > > > - /* If no port mask was specified, then show non-owned ports */ > > + /* If no port mask was specified, then show all non-owned ports > */ > > if (enabled_port_mask =3D=3D 0) { > > RTE_ETH_FOREACH_DEV(i) > > - enabled_port_mask =3D 1ul << i; > > + enabled_port_mask |=3D (1ul << i); >=20 > Ok, looks good. parens on that line are unnecessary >=20 > Note: this still will have issues with >32 ports on 32 bit platforms. The default max_ethports value in meson_options.txt is 32, so the = probability is low. > But other tools probably have same problem. It was decided many years ago to extend the port_id type from uint8_t to = uint16_t, mainly to support a high number of virtual ports. So it is not = good that the applications have not been updated accordingly. However, as Stephen also mentions, this is not unique to this tool, so = we'll just ignore it. >=20 > Acked-by: Stephen Hemminger Acked-by: Morten Br=F8rup