From: Igor Romanov <igor.roma...@oktetlabs.ru>

The return value of rte_eth_link_get() and rte_eth_link_get_nowait()
was changed from void to int. Update the usage of the functions
according to the new return type.

Signed-off-by: Igor Romanov <igor.roma...@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybche...@solarflare.com>
---
 examples/distributor/main.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/examples/distributor/main.c b/examples/distributor/main.c
index 125ee877f..49b4e611f 100644
--- a/examples/distributor/main.c
+++ b/examples/distributor/main.c
@@ -173,12 +173,18 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
                return retval;
 
        struct rte_eth_link link;
-       rte_eth_link_get_nowait(port, &link);
-       while (!link.link_status) {
+       do {
+               retval = rte_eth_link_get_nowait(port, &link);
+               if (retval < 0) {
+                       printf("Failed link get (port %u): %s\n",
+                               port, rte_strerror(-retval));
+                       return retval;
+               } else if (link.link_status)
+                       break;
+
                printf("Waiting for Link up on port %"PRIu16"\n", port);
                sleep(1);
-               rte_eth_link_get_nowait(port, &link);
-       }
+       } while (!link.link_status);
 
        if (!link.link_status) {
                printf("Link down on port %"PRIu16"\n", port);
-- 
2.17.1

Reply via email to