[v11,08/24] examples/bbdev_app: new link status print format
diff mbox series

Message ID 20200915190728.18143-9-i.dyukov@samsung.com
State Accepted
Delegated to: Ferruh Yigit
Headers show
Series
  • ethdev: allow unknown link speed
Related show

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_to_str function to example
applications

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

Comments

Ferruh Yigit Sept. 18, 2020, 5:53 p.m. UTC | #1
On 9/15/2020 8:07 PM, Ivan Dyukov wrote:
> Add usage of rte_eth_link_to_str function to example
> applications
> 
> Signed-off-by: Ivan Dyukov <i.dyukov@samsung.com>
> ---
>   examples/bbdev_app/main.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c
> index 68a46050c..fe9d8e0a5 100644
> --- a/examples/bbdev_app/main.c
> +++ b/examples/bbdev_app/main.c
> @@ -326,8 +326,10 @@ check_port_link_status(uint16_t port_id)
>   			const char *dp = (link.link_duplex ==
>   				ETH_LINK_FULL_DUPLEX) ?
>   				"full-duplex" : "half-duplex";
> -			printf("\nPort %u Link Up - speed %u Mbps - %s\n",
> -				port_id, link.link_speed, dp);
> +			printf("\nPort %u Link Up - speed %s Mbps - %s\n",
> +				port_id,
> +				rte_eth_link_speed_to_str(link.link_speed),
> +				dp);

Can drop " Mbps" part since 'rte_eth_link_speed_to_str()' returns string 
with it.

If the the required changes are minor changes like this, I can update 
them while merging, let me comment on them first.

Patch
diff mbox series

diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c
index 68a46050c..fe9d8e0a5 100644
--- a/examples/bbdev_app/main.c
+++ b/examples/bbdev_app/main.c
@@ -326,8 +326,10 @@  check_port_link_status(uint16_t port_id)
 			const char *dp = (link.link_duplex ==
 				ETH_LINK_FULL_DUPLEX) ?
 				"full-duplex" : "half-duplex";
-			printf("\nPort %u Link Up - speed %u Mbps - %s\n",
-				port_id, link.link_speed, dp);
+			printf("\nPort %u Link Up - speed %s Mbps - %s\n",
+				port_id,
+				rte_eth_link_speed_to_str(link.link_speed),
+				dp);
 			return 0;
 		}
 		printf(".");