[09/18] app/pipeline: check status of getting link info

Message ID 1568103959-25572-10-git-send-email-arybchenko@solarflare.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series ethdev: change link status get functions return value to int |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Andrew Rybchenko Sept. 10, 2019, 8:25 a.m. UTC
  The return value of rte_eth_link_get_nowait() was changed from void to int.
Update the usage of the function according to the new return type.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 app/test-pipeline/init.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
  

Patch

diff --git a/app/test-pipeline/init.c b/app/test-pipeline/init.c
index 871d9fa2d..67d54ae05 100644
--- a/app/test-pipeline/init.c
+++ b/app/test-pipeline/init.c
@@ -161,10 +161,19 @@  app_ports_check_link(void)
 	for (i = 0; i < app.n_ports; i++) {
 		struct rte_eth_link link;
 		uint16_t port;
+		int ret;
 
 		port = app.ports[i];
 		memset(&link, 0, sizeof(link));
-		rte_eth_link_get_nowait(port, &link);
+		ret = rte_eth_link_get_nowait(port, &link);
+		if (ret < 0) {
+			RTE_LOG(INFO, USER1,
+				"Failed to get port %u link status: %s\n",
+				port, rte_strerror(-ret));
+			all_ports_up = 0;
+			continue;
+		}
+
 		RTE_LOG(INFO, USER1, "Port %u (%u Gbps) %s\n",
 			port,
 			link.link_speed / 1000,