[v11,11/24] examples/ip_pipeline: new link status print format

Message ID 20200915190728.18143-12-i.dyukov@samsung.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series ethdev: allow unknown link speed |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Ivan Dyukov Sept. 15, 2020, 7:07 p.m. UTC
  Add usage of rte_eth_link_speed_to_str function to example
applications

Signed-off-by: Ivan Dyukov <i.dyukov@samsung.com>
---
 examples/ip_pipeline/cli.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Ferruh Yigit Sept. 18, 2020, 5:54 p.m. UTC | #1
On 9/15/2020 8:07 PM, Ivan Dyukov wrote:
> Add usage of rte_eth_link_speed_to_str function to example
> applications
> 
> Signed-off-by: Ivan Dyukov <i.dyukov@samsung.com>
> ---
>   examples/ip_pipeline/cli.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/examples/ip_pipeline/cli.c b/examples/ip_pipeline/cli.c
> index d79699e2e..cf3d7d462 100644
> --- a/examples/ip_pipeline/cli.c
> +++ b/examples/ip_pipeline/cli.c
> @@ -273,7 +273,7 @@ print_link_info(struct link *link, char *out, size_t out_size)
>   		"\n"
>   		"%s: flags=<%s> mtu %u\n"
>   		"\tether %02X:%02X:%02X:%02X:%02X:%02X rxqueues %u txqueues %u\n"
> -		"\tport# %u  speed %u Mbps\n"
> +		"\tport# %u  speed %s Mbps\n"

Same here, " Mbps" can be dropped.

>   		"\tRX packets %" PRIu64"  bytes %" PRIu64"\n"
>   		"\tRX errors %" PRIu64"  missed %" PRIu64"  no-mbuf %" PRIu64"\n"
>   		"\tTX packets %" PRIu64"  bytes %" PRIu64"\n"
> @@ -287,7 +287,7 @@ print_link_info(struct link *link, char *out, size_t out_size)
>   		link->n_rxq,
>   		link->n_txq,
>   		link->port_id,
> -		eth_link.link_speed,
> +		rte_eth_link_speed_to_str(eth_link.link_speed),
>   		stats.ipackets,
>   		stats.ibytes,
>   		stats.ierrors,
>
  

Patch

diff --git a/examples/ip_pipeline/cli.c b/examples/ip_pipeline/cli.c
index d79699e2e..cf3d7d462 100644
--- a/examples/ip_pipeline/cli.c
+++ b/examples/ip_pipeline/cli.c
@@ -273,7 +273,7 @@  print_link_info(struct link *link, char *out, size_t out_size)
 		"\n"
 		"%s: flags=<%s> mtu %u\n"
 		"\tether %02X:%02X:%02X:%02X:%02X:%02X rxqueues %u txqueues %u\n"
-		"\tport# %u  speed %u Mbps\n"
+		"\tport# %u  speed %s Mbps\n"
 		"\tRX packets %" PRIu64"  bytes %" PRIu64"\n"
 		"\tRX errors %" PRIu64"  missed %" PRIu64"  no-mbuf %" PRIu64"\n"
 		"\tTX packets %" PRIu64"  bytes %" PRIu64"\n"
@@ -287,7 +287,7 @@  print_link_info(struct link *link, char *out, size_t out_size)
 		link->n_rxq,
 		link->n_txq,
 		link->port_id,
-		eth_link.link_speed,
+		rte_eth_link_speed_to_str(eth_link.link_speed),
 		stats.ipackets,
 		stats.ibytes,
 		stats.ierrors,