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/ip_pipeline/cli.c  | 9 ++++++++-
 examples/ip_pipeline/link.c | 3 ++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/examples/ip_pipeline/cli.c b/examples/ip_pipeline/cli.c
index c6cf4204e..4930310cc 100644
--- a/examples/ip_pipeline/cli.c
+++ b/examples/ip_pipeline/cli.c
@@ -248,12 +248,19 @@ print_link_info(struct link *link, char *out, size_t 
out_size)
        struct rte_ether_addr mac_addr;
        struct rte_eth_link eth_link;
        uint16_t mtu;
+       int ret;
 
        memset(&stats, 0, sizeof(stats));
        rte_eth_stats_get(link->port_id, &stats);
 
        rte_eth_macaddr_get(link->port_id, &mac_addr);
-       rte_eth_link_get(link->port_id, &eth_link);
+       ret = rte_eth_link_get(link->port_id, &eth_link);
+       if (ret < 0) {
+               snprintf(out, out_size, "\n%s: link get failed: %s",
+                        link->name, rte_strerror(-ret));
+               return;
+       }
+
        rte_eth_dev_get_mtu(link->port_id, &mtu);
 
        snprintf(out, out_size,
diff --git a/examples/ip_pipeline/link.c b/examples/ip_pipeline/link.c
index 744abf394..16bcffe35 100644
--- a/examples/ip_pipeline/link.c
+++ b/examples/ip_pipeline/link.c
@@ -264,7 +264,8 @@ link_is_up(const char *name)
                return 0;
 
        /* Resource */
-       rte_eth_link_get(link->port_id, &link_params);
+       if (rte_eth_link_get(link->port_id, &link_params) < 0)
+               return 0;
 
        return (link_params.link_status == ETH_LINK_DOWN) ? 0 : 1;
 }
-- 
2.17.1

Reply via email to