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 28D4FA0613 for ; Tue, 27 Aug 2019 16:28:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DF7761C1F6; Tue, 27 Aug 2019 16:26:56 +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 3C9421C12A for ; Tue, 27 Aug 2019 16: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-us4.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 8A30AB40068; Tue, 27 Aug 2019 14:26:19 +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, 27 Aug 2019 07:26:15 -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, 27 Aug 2019 07:26:15 -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 x7REQCgC004167; Tue, 27 Aug 2019 15:26:14 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id 898A41613D2; Tue, 27 Aug 2019 15:26:14 +0100 (BST) From: Andrew Rybchenko To: Ajit Khaparde , Somnath Kotur CC: , Ivan Ilchenko Date: Tue, 27 Aug 2019 15:25:22 +0100 Message-ID: <1566915962-5472-12-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1566915962-5472-1-git-send-email-arybchenko@solarflare.com> References: <1566915962-5472-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-24872.005 X-TM-AS-Result: No-0.326400-4.000000-10 X-TMASE-MatchedRID: JJf+xfeHh43DOgXZFRFV8+b3p4cnIXGNAPiR4btCEeYd0WOKRkwsh2hk SwpykoqVSqdra4WWujyPQi9XuOWoOF+1yB6ph7kz+CjwEqX1p7kvV5f7P0HVDKjxqhyDxmYjrJr D1ltfnAbJ+pClJd2LfBhisbxSn4W/86iaSxhmZGpH+PTjR9EWkjVfUuzvrtymk7xD9us8uN+jxY yRBa/qJcFwgTvxipFajoczmuoPCq2aS0l8WxsyxlNCNBsMqeTQG949DoJU6ljM5ePh5YhpuTB7x HhOrv1z0T8uDdn3IIyF0bsTipBdebkc5zjOTF6XLPRSkWPfVDWF15h6/oibNbKsWJ44GuEGPNxa u39/BitFwHZmk+dWMm4j0wYb2y4WlExlQIQeRG0= X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--0.326400-4.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24872.005 X-MDID: 1566915980-FMYPtyXO1q7h Subject: [dpdk-dev] [PATCH 11/51] net/bnxt: 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/bnxt according to its new return type. Signed-off-by: Ivan Ilchenko Signed-off-by: Andrew Rybchenko --- drivers/net/bnxt/rte_pmd_bnxt.c | 122 +++++++++++++++++++++++++++++++++++----- 1 file changed, 109 insertions(+), 13 deletions(-) diff --git a/drivers/net/bnxt/rte_pmd_bnxt.c b/drivers/net/bnxt/rte_pmd_bnxt.c index fbd2dd4..4374034 100644 --- a/drivers/net/bnxt/rte_pmd_bnxt.c +++ b/drivers/net/bnxt/rte_pmd_bnxt.c @@ -145,7 +145,15 @@ int rte_pmd_bnxt_set_vf_mac_addr(uint16_t port, uint16_t vf, if (!is_bnxt_supported(dev)) return -ENOTSUP; - rte_eth_dev_info_get(port, &dev_info); + rc = rte_eth_dev_info_get(port, &dev_info); + if (rc != 0) { + PMD_DRV_LOG(ERR, + "Error during getting device (port %u) info: %s\n", + port, strerror(-rc)); + + return rc; + } + bp = dev->data->dev_private; if (vf >= dev_info.max_vfs || mac_addr == NULL) @@ -179,7 +187,14 @@ int rte_pmd_bnxt_set_vf_rate_limit(uint16_t port, uint16_t vf, if (!is_bnxt_supported(eth_dev)) return -ENOTSUP; - rte_eth_dev_info_get(port, &dev_info); + rc = rte_eth_dev_info_get(port, &dev_info); + if (rc != 0) { + PMD_DRV_LOG(ERR, + "Error during getting device (port %u) info: %s\n", + port, strerror(-rc)); + + return rc; + } bp = eth_dev->data->dev_private; if (!bp->pf.active_vfs) @@ -230,7 +245,14 @@ int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf, uint8_t on) if (!is_bnxt_supported(dev)) return -ENOTSUP; - rte_eth_dev_info_get(port, &dev_info); + rc = rte_eth_dev_info_get(port, &dev_info); + if (rc != 0) { + PMD_DRV_LOG(ERR, + "Error during getting device (port %u) info: %s\n", + port, strerror(-rc)); + + return rc; + } bp = dev->data->dev_private; if (!BNXT_PF(bp)) { @@ -282,7 +304,14 @@ int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf, uint8_t on) if (!is_bnxt_supported(dev)) return -ENOTSUP; - rte_eth_dev_info_get(port, &dev_info); + rc = rte_eth_dev_info_get(port, &dev_info); + if (rc != 0) { + PMD_DRV_LOG(ERR, + "Error during getting device (port %u) info: %s\n", + port, strerror(-rc)); + + return rc; + } bp = dev->data->dev_private; if (!BNXT_PF(bp)) { @@ -332,7 +361,14 @@ int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf, uint8_t on) if (!is_bnxt_supported(dev)) return -ENOTSUP; - rte_eth_dev_info_get(port, &dev_info); + rc = rte_eth_dev_info_get(port, &dev_info); + if (rc != 0) { + PMD_DRV_LOG(ERR, + "Error during getting device (port %u) info: %s\n", + port, strerror(-rc)); + + return rc; + } bp = dev->data->dev_private; if (vf >= dev_info.max_vfs) @@ -369,7 +405,14 @@ int rte_pmd_bnxt_set_vf_rxmode(uint16_t port, uint16_t vf, if (!is_bnxt_supported(dev)) return -ENOTSUP; - rte_eth_dev_info_get(port, &dev_info); + rc = rte_eth_dev_info_get(port, &dev_info); + if (rc != 0) { + PMD_DRV_LOG(ERR, + "Error during getting device (port %u) info: %s\n", + port, strerror(-rc)); + + return rc; + } bp = dev->data->dev_private; if (!bp->pf.vf_info) @@ -545,12 +588,20 @@ int rte_pmd_bnxt_get_vf_stats(uint16_t port, struct rte_eth_dev *dev; struct rte_eth_dev_info dev_info; struct bnxt *bp; + int rc; dev = &rte_eth_devices[port]; if (!is_bnxt_supported(dev)) return -ENOTSUP; - rte_eth_dev_info_get(port, &dev_info); + rc = rte_eth_dev_info_get(port, &dev_info); + if (rc != 0) { + PMD_DRV_LOG(ERR, + "Error during getting device (port %u) info: %s\n", + port, strerror(-rc)); + + return rc; + } bp = dev->data->dev_private; if (vf_id >= dev_info.max_vfs) @@ -572,12 +623,20 @@ int rte_pmd_bnxt_reset_vf_stats(uint16_t port, struct rte_eth_dev *dev; struct rte_eth_dev_info dev_info; struct bnxt *bp; + int rc; dev = &rte_eth_devices[port]; if (!is_bnxt_supported(dev)) return -ENOTSUP; - rte_eth_dev_info_get(port, &dev_info); + rc = rte_eth_dev_info_get(port, &dev_info); + if (rc != 0) { + PMD_DRV_LOG(ERR, + "Error during getting device (port %u) info: %s\n", + port, strerror(-rc)); + + return rc; + } bp = dev->data->dev_private; if (vf_id >= dev_info.max_vfs) @@ -598,12 +657,20 @@ int rte_pmd_bnxt_get_vf_rx_status(uint16_t port, uint16_t vf_id) struct rte_eth_dev *dev; struct rte_eth_dev_info dev_info; struct bnxt *bp; + int rc; dev = &rte_eth_devices[port]; if (!is_bnxt_supported(dev)) return -ENOTSUP; - rte_eth_dev_info_get(port, &dev_info); + rc = rte_eth_dev_info_get(port, &dev_info); + if (rc != 0) { + PMD_DRV_LOG(ERR, + "Error during getting device (port %u) info: %s\n", + port, strerror(-rc)); + + return rc; + } bp = dev->data->dev_private; if (vf_id >= dev_info.max_vfs) @@ -625,12 +692,20 @@ int rte_pmd_bnxt_get_vf_tx_drop_count(uint16_t port, uint16_t vf_id, struct rte_eth_dev *dev; struct rte_eth_dev_info dev_info; struct bnxt *bp; + int rc; dev = &rte_eth_devices[port]; if (!is_bnxt_supported(dev)) return -ENOTSUP; - rte_eth_dev_info_get(port, &dev_info); + rc = rte_eth_dev_info_get(port, &dev_info); + if (rc != 0) { + PMD_DRV_LOG(ERR, + "Error during getting device (port %u) info: %s\n", + port, strerror(-rc)); + + return rc; + } bp = dev->data->dev_private; if (vf_id >= dev_info.max_vfs) @@ -662,7 +737,14 @@ int rte_pmd_bnxt_mac_addr_add(uint16_t port, struct rte_ether_addr *addr, if (!is_bnxt_supported(dev)) return -ENOTSUP; - rte_eth_dev_info_get(port, &dev_info); + rc = rte_eth_dev_info_get(port, &dev_info); + if (rc != 0) { + PMD_DRV_LOG(ERR, + "Error during getting device (port %u) info: %s\n", + port, strerror(-rc)); + + return rc; + } bp = dev->data->dev_private; if (vf_id >= dev_info.max_vfs) @@ -738,7 +820,14 @@ int rte_pmd_bnxt_mac_addr_add(uint16_t port, struct rte_ether_addr *addr, if (!is_bnxt_supported(dev)) return -ENOTSUP; - rte_eth_dev_info_get(port, &dev_info); + rc = rte_eth_dev_info_get(port, &dev_info); + if (rc != 0) { + PMD_DRV_LOG(ERR, + "Error during getting device (port %u) info: %s\n", + port, strerror(-rc)); + + return rc; + } bp = dev->data->dev_private; if (vf >= dev_info.max_vfs) @@ -775,7 +864,14 @@ int rte_pmd_bnxt_set_vf_persist_stats(uint16_t port, uint16_t vf, uint8_t on) return -EINVAL; dev = &rte_eth_devices[port]; - rte_eth_dev_info_get(port, &dev_info); + rc = rte_eth_dev_info_get(port, &dev_info); + if (rc != 0) { + PMD_DRV_LOG(ERR, + "Error during getting device (port %u) info: %s\n", + port, strerror(-rc)); + + return rc; + } bp = dev->data->dev_private; if (!BNXT_PF(bp)) { -- 1.8.3.1