app/procinfo: show all non-owned ports

Message ID 20220510132118.22688-1-subendu@arista.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series app/procinfo: show all non-owned ports |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed

Commit Message

Subendu Santra May 10, 2022, 1:21 p.m. UTC
  Show all non-owned ports when no port mask is specified

Fixes: 1dd6cffb6571 ("app/procinfo: provide way to request info on owned
ports")
Cc: stephen@networkplumber.org

Signed-off-by: Subendu Santra <subendu@arista.com>
---
 app/proc-info/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Subendu Santra May 23, 2022, 10:53 a.m. UTC | #1
Hi Reshma, Thomas,

What do you think about this patch?

Regards,
Subendu.


On Tue, May 10, 2022 at 6:52 PM Subendu Santra <subendu@arista.com> wrote:
>
> Show all non-owned ports when no port mask is specified
>
> Fixes: 1dd6cffb6571 ("app/procinfo: provide way to request info on owned
> ports")
> Cc: stephen@networkplumber.org
>
> Signed-off-by: Subendu Santra <subendu@arista.com>
> ---
>  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 == 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 == 0) {
>                 RTE_ETH_FOREACH_DEV(i)
> -                       enabled_port_mask = 1ul << i;
> +                       enabled_port_mask |= (1ul << i);
>         }
>
>         for (i = 0; i < RTE_MAX_ETHPORTS; i++) {
> --
> 2.28.0
>
  
Thomas Monjalon May 23, 2022, 2:41 p.m. UTC | #2
23/05/2022 12:53, Subendu Santra:
> Hi Reshma, Thomas,
> 
> What do you think about this patch?

It looks to be a fix, right?
Please add a sentence about the previous behaviour,
explaining what is fixed.

Ideally you should show the commit doing the mistake
with the syntax "Fixes:" as in other commits of this tree.

Thanks


> On Tue, May 10, 2022 at 6:52 PM Subendu Santra <subendu@arista.com> wrote:
> >
> > Show all non-owned ports when no port mask is specified
> >
> > Fixes: 1dd6cffb6571 ("app/procinfo: provide way to request info on owned
> > ports")
> > Cc: stephen@networkplumber.org
> >
> > Signed-off-by: Subendu Santra <subendu@arista.com>
> > ---
> >  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 == 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 == 0) {
> >                 RTE_ETH_FOREACH_DEV(i)
> > -                       enabled_port_mask = 1ul << i;
> > +                       enabled_port_mask |= (1ul << i);
> >         }
> >
> >         for (i = 0; i < RTE_MAX_ETHPORTS; i++) {
> > --
> > 2.28.0
> >
>
  
Subendu Santra May 23, 2022, 4:10 p.m. UTC | #3
Sure. Will add a sentence about the issue which is getting fixed.
However, I have already added Fixes: 1dd6cffb6571 in the patch.
Is there anything else that needs to be done apart from this w.r.to
"Fixes:" comment?

Regards,
Subendu.


On Mon, May 23, 2022 at 8:12 PM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> 23/05/2022 12:53, Subendu Santra:
> > Hi Reshma, Thomas,
> >
> > What do you think about this patch?
>
> It looks to be a fix, right?
> Please add a sentence about the previous behaviour,
> explaining what is fixed.
>
> Ideally you should show the commit doing the mistake
> with the syntax "Fixes:" as in other commits of this tree.
>
> Thanks
>
>
> > On Tue, May 10, 2022 at 6:52 PM Subendu Santra <subendu@arista.com> wrote:
> > >
> > > Show all non-owned ports when no port mask is specified
> > >
> > > Fixes: 1dd6cffb6571 ("app/procinfo: provide way to request info on owned
> > > ports")
> > > Cc: stephen@networkplumber.org
> > >
> > > Signed-off-by: Subendu Santra <subendu@arista.com>
> > > ---
> > >  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 == 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 == 0) {
> > >                 RTE_ETH_FOREACH_DEV(i)
> > > -                       enabled_port_mask = 1ul << i;
> > > +                       enabled_port_mask |= (1ul << i);
> > >         }
> > >
> > >         for (i = 0; i < RTE_MAX_ETHPORTS; i++) {
> > > --
> > > 2.28.0
> > >
> >
>
>
>
>
>
  
Thomas Monjalon May 23, 2022, 6 p.m. UTC | #4
23/05/2022 18:10, Subendu Santra:
> Sure. Will add a sentence about the issue which is getting fixed.
> However, I have already added Fixes: 1dd6cffb6571 in the patch.

Sorry I missed it.

> Is there anything else that needs to be done apart from this w.r.to
> "Fixes:" comment?

No that's fine, thanks.

> 
> Regards,
> Subendu.
> 
> 
> On Mon, May 23, 2022 at 8:12 PM Thomas Monjalon <thomas@monjalon.net> wrote:
> >
> > 23/05/2022 12:53, Subendu Santra:
> > > Hi Reshma, Thomas,
> > >
> > > What do you think about this patch?
> >
> > It looks to be a fix, right?
> > Please add a sentence about the previous behaviour,
> > explaining what is fixed.
> >
> > Ideally you should show the commit doing the mistake
> > with the syntax "Fixes:" as in other commits of this tree.
> >
> > Thanks
> >
> >
> > > On Tue, May 10, 2022 at 6:52 PM Subendu Santra <subendu@arista.com> wrote:
> > > >
> > > > Show all non-owned ports when no port mask is specified
> > > >
> > > > Fixes: 1dd6cffb6571 ("app/procinfo: provide way to request info on owned
> > > > ports")
> > > > Cc: stephen@networkplumber.org
> > > >
> > > > Signed-off-by: Subendu Santra <subendu@arista.com>
> > > > ---
> > > >  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 == 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 == 0) {
> > > >                 RTE_ETH_FOREACH_DEV(i)
> > > > -                       enabled_port_mask = 1ul << i;
> > > > +                       enabled_port_mask |= (1ul << i);
> > > >         }
> > > >
> > > >         for (i = 0; i < RTE_MAX_ETHPORTS; i++) {
> > > > --
> > > > 2.28.0
> > > >
> > >
> >
> >
> >
> >
> >
>
  

Patch

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 == 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 == 0) {
 		RTE_ETH_FOREACH_DEV(i)
-			enabled_port_mask = 1ul << i;
+			enabled_port_mask |= (1ul << i);
 	}
 
 	for (i = 0; i < RTE_MAX_ETHPORTS; i++) {