app/procinfo: show all non-owned ports
PATCH v2 1/1 app/procinfo: show all non-owned ports
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.
ports")
Cc: [email protected]
--- app/proc-info/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
app/proc-info/main.c +2 -2
@@ -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++) {
Signature · 1 line
2.28.0
Quoted 19 lines · On Tue, 24 May 2022 22:46:05 -0700 Subendu Santra <[email protected]> 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 ownedports")
Cc: [email protected]Signed-off-by Subendu Santra <[email protected]>--- app/proc-info/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)app/proc-info/main.c +0
-0
app/proc-info/main.c main(int argc, char **argv) · line 1510
Quoted 9 lines
app/proc-info/main.c +2
-2@@ -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);
Ok, looks good. parens on that line are unnecessary
Note: this still will have issues with >32 ports on 32 bit platforms. But other tools probably have same problem.
Morten Brørup
Acked-byQuoted 32 lines
From: Stephen Hemminger [mailto:[email protected]]
Sent: Wednesday, 25 May 2022 08.04Quoted 6 lines · On Tue, 24 May 2022 22:46:05 -0700 Subendu Santra <[email protected]> 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 onowned
Quoted 13 lines
ports")
Cc: [email protected]Signed-off-by Subendu Santra <[email protected]>--- app/proc-info/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)app/proc-info/main.c +0
-0app/proc-info/main.c main(int argc, char **argv) · line 1507
Quoted 5 lines
app/proc-info/main.c +1
-1@@ -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 */
Quoted 8 lines
app/proc-info/main.c main(int argc, char **argv) · line 1510
Quoted 4 lines
app/proc-info/main.c +1
-1if (enabled_port_mask ==0 ) {RTE_ETH_FOREACH_DEV (i) - enabled_port_mask =1ul << i; + enabled_port_mask |= (1ul << i);Ok, looks good. parens on that line are unnecessary
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.
Quoted 1 line
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.
Quoted 2 lines
Hi Thomas,
How does this patch look? Is there anything that needs to be done from my side?
Regards,
Subendu.
Quoted 55 lines · Morten Brørup
Quoted 33 lines
From: Stephen Hemminger [mailto:[email protected]]
Sent: Wednesday, 25 May 2022 08.04Quoted 6 lines · On Tue, 24 May 2022 22:46:05 -0700 Subendu Santra <[email protected]> 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 onowned
Quoted 13 lines
ports")
Cc: [email protected]Signed-off-by Subendu Santra <[email protected]>--- app/proc-info/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)app/proc-info/main.c +0
-0app/proc-info/main.c main(int argc, char **argv) · line 1507
Quoted 5 lines
app/proc-info/main.c +1
-1@@ -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 */
Quoted 8 lines
app/proc-info/main.c main(int argc, char **argv) · line 1510
Quoted 4 lines
app/proc-info/main.c +1
-1if (enabled_port_mask ==0 ) {RTE_ETH_FOREACH_DEV (i) - enabled_port_mask =1ul << i; + enabled_port_mask |= (1ul << i);Ok, looks good. parens on that line are unnecessary
Note: this still will have issues with >32 ports on 32 bit platforms.
The default
max_ethportsvalue in meson_options.txt is 32, so the probability is low.Quoted 1 line
But other tools probably have same problem.
It was decided many years ago to extend the
port_idtype fromuint8_ttouint16_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.
Quoted 2 lines
Acked-by Morten Brørup <[email protected]>
25/05/2022 09:14, Morten Brørup:
Quoted 10 lines
Quoted 10 lines
From: Stephen Hemminger [mailto:[email protected]]
Sent: Wednesday, 25 May 2022 08.04Quoted 4 lines · On Tue, 24 May 2022 22:46:05 -0700 Subendu Santra <[email protected]> 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.
I think it is easier to understand if using past tense for the previous behaviour. I reword it like this:
The show-port option, without the mask option, was showing only the last non-owned port. Show all the non-owned ports instead.
Quoted 4 lines
Quoted 4 lines
Quoted 1 line
Fixes 1dd6cffb6571 ("app/procinfo: provide way to request info onowned
Quoted 2 lines
ports")
Cc: [email protected]
+ Cc: [email protected]
Quoted 17 lines
Quoted 17 lines
Quoted 11 lines
Signed-off-by Subendu Santra <[email protected]>--- app/proc-info/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)app/proc-info/main.c +0
-0app/proc-info/main.c main(int argc, char **argv) · line 1507
Quoted 5 lines
app/proc-info/main.c +1
-1@@ -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 */
Quoted 6 lines
Quoted 6 lines
app/proc-info/main.c main(int argc, char **argv) · line 1510
Quoted 4 lines
app/proc-info/main.c +1
-1if (enabled_port_mask ==0 ) {RTE_ETH_FOREACH_DEV (i) - enabled_port_mask =1ul << i; + enabled_port_mask |= (1ul << i);Ok, looks good. parens on that line are unnecessary
parens removed
Quoted 7 lines
Quoted 2 lines
Note: this still will have issues with >32 ports on 32 bit platforms.
The default
max_ethportsvalue in meson_options.txt is 32, so the probability is low.Quoted 1 line
But other tools probably have same problem.
Quoted 8 lines
It was decided many years ago to extend the
port_idtype fromuint8_ttouint16_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.
Quoted 2 lines
Acked-by Morten Brørup <[email protected]>
Applied with small changes, thanks.