[v2] app/procinfo: show all non-owned ports
Checks
Commit Message
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 <subendu@arista.com>
---
app/proc-info/main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
I have updated the v2 of the patch with the explanation.
Kindly advise if it looks ok.
Regards,
Subendu.
On Wed, May 25, 2022 at 11:22 AM Subendu Santra <subendu@arista.com> wrote:
>
> 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 <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
>
@@ -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++) {