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 1FC08A2EDB for ; Fri, 6 Sep 2019 09:33:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 608AE1F1BB; Fri, 6 Sep 2019 09:32:30 +0200 (CEST) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [67.231.154.164]) by dpdk.org (Postfix) with ESMTP id 411DD1F174 for ; Fri, 6 Sep 2019 09:31:56 +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 7957F340058; Fri, 6 Sep 2019 07:31:55 +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; Fri, 6 Sep 2019 00:31:51 -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; Fri, 6 Sep 2019 00:31:50 -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 x867Vnnk027675; Fri, 6 Sep 2019 08:31:49 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id DE4E01613D1; Fri, 6 Sep 2019 08:31:49 +0100 (BST) From: Andrew Rybchenko To: Chas Williams CC: , Ivan Ilchenko Date: Fri, 6 Sep 2019 08:30:25 +0100 Message-ID: <1567755066-31389-14-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1567755066-31389-1-git-send-email-arybchenko@solarflare.com> References: <1566915962-5472-1-git-send-email-arybchenko@solarflare.com> <1567755066-31389-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-24892.005 X-TM-AS-Result: No-0.733600-4.000000-10 X-TMASE-MatchedRID: W3Uy/33lI/nDOgXZFRFV8+b3p4cnIXGNAPiR4btCEeYd0WOKRkwsh0kx APClfhN02tmoqiGUvaLMdHm3E7kFwCHhSBQfglfsA9lly13c/gGosxQx1ZmPo7qln+jYe7ZhHqA yb6BowiPLA2f0FmjbMPqz71BPK7DL/MSiuOz98mVH+PTjR9EWkqNeL/tbjwkHxzfbZxx4F4QJPa iDyaVQOzieMbqU4l6zwXEUZG+W8revvxILmKK/HBRFJJyf5BJe3QfwsVk0UbsIoUKaF27lxVhIR EkMj+r1HGVDdqVrnIYmGTqKaTCxzQ+/wq/1KFezZf2wJ3nHhQNQkf/0nLQMBUPzKjaldp2GUIml rcdOIghrcPDSmdHmwA9cvEd/Et5dVEc5IqztENReYfSkFq6uAb7jE6+wkCSenqg/VrSZEiM= X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--0.733600-4.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24892.005 X-MDID: 1567755116-IG9q1WZ5dsl0 Subject: [dpdk-dev] [PATCH v3 13/54] net/bonding: check status of getting ethdev 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: Ivan Ilchenko rte_eth_dev_info_get() return value was changed from void to int, so this patch modify rte_eth_dev_info_get() usage across net/bonding according to its new return type. Signed-off-by: Ivan Ilchenko Signed-off-by: Andrew Rybchenko --- drivers/net/bonding/rte_eth_bond_api.c | 10 ++++++- drivers/net/bonding/rte_eth_bond_pmd.c | 36 +++++++++++++++++++++++--- 2 files changed, 41 insertions(+), 5 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c index 0fc4c5eda5..e2e27e9f24 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -452,6 +452,7 @@ __eth_bond_slave_add_lock_free(uint16_t bonded_port_id, uint16_t slave_port_id) struct bond_dev_private *internals; struct rte_eth_link link_props; struct rte_eth_dev_info dev_info; + int ret; bonded_eth_dev = &rte_eth_devices[bonded_port_id]; internals = bonded_eth_dev->data->dev_private; @@ -465,7 +466,14 @@ __eth_bond_slave_add_lock_free(uint16_t bonded_port_id, uint16_t slave_port_id) return -1; } - rte_eth_dev_info_get(slave_port_id, &dev_info); + ret = rte_eth_dev_info_get(slave_port_id, &dev_info); + if (ret != 0) { + RTE_BOND_LOG(ERR, + "%s: Error during getting device (port %u) info: %s\n", + __func__, slave_port_id, strerror(-ret)); + + return ret; + } if (dev_info.max_rx_pktlen < internals->max_rx_pktlen) { RTE_BOND_LOG(ERR, "Slave (port %u) max_rx_pktlen too small", slave_port_id); diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 97ab3f29f3..a1b50141f9 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -186,7 +186,15 @@ bond_ethdev_8023ad_flow_verify(struct rte_eth_dev *bond_dev, return -1; } - rte_eth_dev_info_get(slave_port, &slave_info); + ret = rte_eth_dev_info_get(slave_port, &slave_info); + if (ret != 0) { + RTE_BOND_LOG(ERR, + "%s: Error during getting device (port %u) info: %s\n", + __func__, slave_port, strerror(-ret)); + + return ret; + } + if (slave_info.max_rx_queues < bond_dev->data->nb_rx_queues || slave_info.max_tx_queues < bond_dev->data->nb_tx_queues) { RTE_BOND_LOG(ERR, @@ -204,10 +212,19 @@ bond_8023ad_slow_pkt_hw_filter_supported(uint16_t port_id) { struct bond_dev_private *internals = bond_dev->data->dev_private; struct rte_eth_dev_info bond_info; uint16_t idx; + int ret; /* Verify if all slaves in bonding supports flow director and */ if (internals->slave_count > 0) { - rte_eth_dev_info_get(bond_dev->data->port_id, &bond_info); + ret = rte_eth_dev_info_get(bond_dev->data->port_id, &bond_info); + if (ret != 0) { + RTE_BOND_LOG(ERR, + "%s: Error during getting device (port %u) info: %s\n", + __func__, bond_dev->data->port_id, + strerror(-ret)); + + return ret; + } internals->mode4.dedicated_queues.rx_qid = bond_info.nb_rx_queues; internals->mode4.dedicated_queues.tx_qid = bond_info.nb_tx_queues; @@ -2102,6 +2119,8 @@ static void bond_ethdev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { struct bond_dev_private *internals = dev->data->dev_private; + struct bond_slave_details slave; + int ret; uint16_t max_nb_rx_queues = UINT16_MAX; uint16_t max_nb_tx_queues = UINT16_MAX; @@ -2123,8 +2142,17 @@ bond_ethdev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) uint16_t idx; for (idx = 0; idx < internals->slave_count; idx++) { - rte_eth_dev_info_get(internals->slaves[idx].port_id, - &slave_info); + slave = internals->slaves[idx]; + ret = rte_eth_dev_info_get(slave.port_id, &slave_info); + if (ret != 0) { + RTE_BOND_LOG(ERR, + "%s: Error during getting device (port %u) info: %s\n", + __func__, + slave.port_id, + strerror(-ret)); + + return; + } if (slave_info.max_rx_queues < max_nb_rx_queues) max_nb_rx_queues = slave_info.max_rx_queues; -- 2.17.1