Add usage of rte_eth_link_to_str function to example
applications

Signed-off-by: Ivan Dyukov <i.dyu...@samsung.com>
---
 examples/ioat/ioatfwd.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/examples/ioat/ioatfwd.c b/examples/ioat/ioatfwd.c
index b66ee73bc..bb8cff7c1 100644
--- a/examples/ioat/ioatfwd.c
+++ b/examples/ioat/ioatfwd.c
@@ -700,6 +700,7 @@ check_link_status(uint32_t port_mask)
        uint16_t portid;
        struct rte_eth_link link;
        int ret, link_status = 0;
+       char link_status_text[ETH_LINK_MAX_STR_LEN];
 
        printf("\nChecking link status\n");
        RTE_ETH_FOREACH_DEV(portid) {
@@ -715,15 +716,12 @@ check_link_status(uint32_t port_mask)
                }
 
                /* Print link status */
-               if (link.link_status) {
-                       printf(
-                               "Port %d Link Up. Speed %u Mbps - %s\n",
-                               portid, link.link_speed,
-                               (link.link_duplex == ETH_LINK_FULL_DUPLEX) ?
-                               ("full-duplex") : ("half-duplex"));
+               rte_eth_link_to_str(link_status_text,
+                       sizeof(link_status_text), NULL, &link);
+               printf("Port %d %s\n", portid, link_status_text);
+
+               if (link.link_status)
                        link_status = 1;
-               } else
-                       printf("Port %d Link Down\n", portid);
        }
        return link_status;
 }
-- 
2.17.1

Reply via email to