From patchwork Tue Sep 10 08:25:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Rybchenko X-Patchwork-Id: 59074 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F41731EE1C; Tue, 10 Sep 2019 10:26:56 +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 C19CF1ED01 for ; Tue, 10 Sep 2019 10:26:23 +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 72D2C1C005F; Tue, 10 Sep 2019 08:26:22 +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:19 -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:19 -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 x8A8QIOI002342; Tue, 10 Sep 2019 09:26:18 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id 4AA2C1613D1; Tue, 10 Sep 2019 09:26:18 +0100 (BST) From: Andrew Rybchenko To: Cristian Dumitrescu , Jasvinder Singh CC: , Igor Romanov Date: Tue, 10 Sep 2019 09:25:57 +0100 Message-ID: <1568103959-25572-18-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 X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.5.1010-24898.005 X-TM-AS-Result: No-2.835300-4.000000-10 X-TMASE-MatchedRID: b9G8HiAV2WLDOgXZFRFV83CO70QAsBdCWw/S0HB7eoMHZBaLwEXlKGb6 PphVtfZg5luGXrVipbqvnk7fmgYwv857K+zzVwU2nIGynr5ObIZ9LQinZ4QefPcjNeVeWlqY+gt Hj7OwNO2W79Uq8KMo9Y+jXYg23jZNUdx9VOVmL2xzojB+PF22ZZRDtJQDdNvBjcce2mbV4S26BK jQdymAoVA3iYM+9nxaVF6qC0aCCIcQCrRxRjVv9tpAu0sLxpSoQ8G+yYJYYdZRZDsGiXQioBjm2 8f1HLY3 X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--2.835300-4.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24898.005 X-MDID: 1568103983-imHr3Z1LoIgm Subject: [dpdk-dev] [PATCH 17/18] examples/qos_sched: 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/qos_sched/init.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c index dbdbdefea..32e6e1ba2 100644 --- a/examples/qos_sched/init.c +++ b/examples/qos_sched/init.c @@ -154,7 +154,12 @@ app_init_port(uint16_t portid, struct rte_mempool *mp) printf("done: "); /* get link status */ - rte_eth_link_get(portid, &link); + ret = rte_eth_link_get(portid, &link); + if (ret < 0) + rte_exit(EXIT_FAILURE, + "rte_eth_link_get: err=%d, port=%u: %s\n", + ret, portid, rte_strerror(-ret)); + if (link.link_status) { printf(" Link Up - speed %u Mbps - %s\n", (uint32_t) link.link_speed, @@ -295,7 +300,11 @@ app_init_sched_port(uint32_t portid, uint32_t socketid) uint32_t pipe, subport; int err; - rte_eth_link_get(portid, &link); + err = rte_eth_link_get(portid, &link); + if (err < 0) + rte_exit(EXIT_FAILURE, + "rte_eth_link_get: err=%d, port=%u: %s\n", + err, portid, rte_strerror(-err)); port_params.socket = socketid; port_params.rate = (uint64_t) link.link_speed * 1000 * 1000 / 8;