diff options
| author | Ivan Dyukov <[email protected]> | 2020-09-15 22:07:02 +0300 |
|---|---|---|
| committer | Ferruh Yigit <[email protected]> | 2020-09-21 18:05:38 +0200 |
| commit | db4e81351fb85ff623bd0438d1b5a8fb55fe9fee (patch) | |
| tree | bd38f436fe6e8d9c5938401d17d7a4a4a1e16eb9 /examples/server_node_efd | |
| parent | ba5509a6a80f25088d092c4320fd8ed12b73cfd7 (diff) | |
examples: use new link status print format
Add usage of rte_eth_link_to_str function to example
applications.
Signed-off-by: Ivan Dyukov <[email protected]>
Reviewed-by: Ferruh Yigit <[email protected]>
Diffstat (limited to 'examples/server_node_efd')
| -rw-r--r-- | examples/server_node_efd/server/init.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/examples/server_node_efd/server/init.c b/examples/server_node_efd/server/init.c index 378a74fa5c..347737cb98 100644 --- a/examples/server_node_efd/server/init.c +++ b/examples/server_node_efd/server/init.c @@ -247,6 +247,7 @@ check_all_ports_link_status(uint16_t port_num, uint32_t port_mask) uint16_t portid; struct rte_eth_link link; int ret; + char link_status_text[RTE_ETH_LINK_MAX_STR_LEN]; printf("\nChecking link status"); fflush(stdout); @@ -266,16 +267,10 @@ check_all_ports_link_status(uint16_t port_num, uint32_t port_mask) } /* print link status if flag set */ if (print_flag == 1) { - if (link.link_status) - printf( - "Port%d Link Up. Speed %u Mbps - %s\n", - info->id[portid], - link.link_speed, - (link.link_duplex == ETH_LINK_FULL_DUPLEX) ? - ("full-duplex") : ("half-duplex")); - else - printf("Port %d Link Down\n", - info->id[portid]); + rte_eth_link_to_str(link_status_text, + sizeof(link_status_text), &link); + printf("Port %d %s\n", info->id[portid], + link_status_text); continue; } /* clear all_ports_up flag if any link down */ |
