From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6D1FEA2EEB for ; Tue, 10 Sep 2019 10:27:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 420981EDE1; Tue, 10 Sep 2019 10:26:43 +0200 (CEST) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [148.163.129.52]) by dpdk.org (Postfix) with ESMTP id 189F51ECFA for ; Tue, 10 Sep 2019 10:26:22 +0200 (CEST) X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (webmail.solarflare.com [12.187.104.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us2.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 27DDD1C005F; Tue, 10 Sep 2019 08:26:21 +0000 (UTC) Received: from ocex03.SolarFlarecom.com (10.20.40.36) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 10 Sep 2019 01:26:18 -0700 Received: from opal.uk.solarflarecom.com (10.17.10.1) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Tue, 10 Sep 2019 01:26:18 -0700 Received: from ukv-loginhost.uk.solarflarecom.com (ukv-loginhost.uk.solarflarecom.com [10.17.10.39]) by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id x8A8QGHH002285; Tue, 10 Sep 2019 09:26:16 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id D96C11613D1; Tue, 10 Sep 2019 09:26:16 +0100 (BST) From: Andrew Rybchenko To: Nicolas Chautru CC: , Igor Romanov Date: Tue, 10 Sep 2019 09:25:51 +0100 Message-ID: <1568103959-25572-12-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1568103959-25572-1-git-send-email-arybchenko@solarflare.com> References: <1568103959-25572-1-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.5.1010-24898.005 X-TM-AS-Result: No-2.648700-4.000000-10 X-TMASE-MatchedRID: vdeff2Q33gXDOgXZFRFV83CO70QAsBdCWw/S0HB7eoM7FE26mju9O7ny O1e9qRizrdoLblq9S5rMJYD0aRF0RV/b0/1cTOafFyv3UWjlpb0txMagbN9/PIpLyz8UyqY4Pl0 9xg2LPPP2Y7i50sDX+EVXxsfqi11sNyl1nd9CIt0URSScn+QSXt0H8LFZNFG76sBnwpOylLPT7v w5HIV9LlGeyDURAZSSJThO9rNWyQIwsLyiDqALuPc75DZHoUtBrRopBnHRVSNR19YoLS1LYgAfj IYhKfaMLIuhItrFRYEPXLxHfxLeXVRHOSKs7RDUXmH0pBaurgG+4xOvsJAknn7cGd19dSFd X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--2.648700-4.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24898.005 X-MDID: 1568103981-NqfJCcaVVcBR Subject: [dpdk-dev] [PATCH 11/18] examples/bbdev_app: check status of getting link info X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Igor Romanov 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 Signed-off-by: Andrew Rybchenko --- examples/bbdev_app/main.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c index 3d36629a1..349876589 100644 --- a/examples/bbdev_app/main.c +++ b/examples/bbdev_app/main.c @@ -312,6 +312,7 @@ check_port_link_status(uint16_t port_id) #define MAX_CHECK_TIME 90 /* 9s (90 * 100ms) in total */ uint8_t count; struct rte_eth_link link; + int link_get_err = -EINVAL; printf("\nChecking link status."); fflush(stdout); @@ -319,9 +320,9 @@ check_port_link_status(uint16_t port_id) for (count = 0; count <= MAX_CHECK_TIME && !rte_atomic16_read(&global_exit_flag); count++) { memset(&link, 0, sizeof(link)); - rte_eth_link_get_nowait(port_id, &link); + link_get_err = rte_eth_link_get_nowait(port_id, &link); - if (link.link_status) { + if (link_get_err >= 0 && link.link_status) { const char *dp = (link.link_duplex == ETH_LINK_FULL_DUPLEX) ? "full-duplex" : "half-duplex"; @@ -334,7 +335,12 @@ check_port_link_status(uint16_t port_id) rte_delay_ms(CHECK_INTERVAL); } - printf("\nPort %d Link Down\n", port_id); + if (link_get_err >= 0) + printf("\nPort %d Link Down\n", port_id); + else + printf("\nGet link failed (port %d): %s\n", port_id, + rte_strerror(-link_get_err)); + return 0; } -- 2.17.1