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 F00F3A2EEB for ; Tue, 10 Sep 2019 10:28:06 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 713211EDF2; Tue, 10 Sep 2019 10:26:46 +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 90E2D1ECC1 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 5196C1C005F; 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 x8A8QHie002295; Tue, 10 Sep 2019 09:26:17 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id 134E81613D1; Tue, 10 Sep 2019 09:26:17 +0100 (BST) From: Andrew Rybchenko To: Cristian Dumitrescu CC: , Igor Romanov Date: Tue, 10 Sep 2019 09:25:52 +0100 Message-ID: <1568103959-25572-13-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.951000-4.000000-10 X-TMASE-MatchedRID: b9G8HiAV2WLDOgXZFRFV83CO70QAsBdCWw/S0HB7eoMGmHr1eMxt2UAc 6DyoS2rI2lO9wdJIjwWKGUoOUuWu8kgMxOkBoMP0U9ht8cPjV459LQinZ4QefPcjNeVeWlqY+gt Hj7OwNO2W79Uq8KMo9bcuXXkiU33CCu7i//gJOIHH+0bHvNGr2vsNTmPX05uVNH9TJ0G6KVH4sx hA236J5hnQEgrb3gkrFsMCCABgmQbMQrcaswZ6hNpAu0sLxpSoQ8G+yYJYYdZRZDsGiXQioBjm2 8f1HLY3 X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--2.951000-4.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24898.005 X-MDID: 1568103981-LXPHS3eH_v7I Subject: [dpdk-dev] [PATCH 12/18] examples/ip_pipeline: 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/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, ð_link); + ret = rte_eth_link_get(link->port_id, ð_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