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 642A1A0613 for ; Tue, 27 Aug 2019 16:44:42 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 17BEE1C23C; Tue, 27 Aug 2019 16:44:41 +0200 (CEST) Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by dpdk.org (Postfix) with ESMTP id E46852BE6 for ; Tue, 27 Aug 2019 16:44:39 +0200 (CEST) Received: by mail-pf1-f194.google.com with SMTP id d85so14281697pfd.2 for ; Tue, 27 Aug 2019 07:44:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TprQlQFZRRVaNzj8M3glgRlVQ3caeRnPbHTYzHGFqfc=; b=PluErRQA7BpjZUUOWikNkJWRXC14MwON1b6w/Pt5PM+eJy8hzH3VVWvI7Z+ocG8X4k ME/32rJoVXV3uchrUbe3C6SwTNQhIJCVAsycfZoo3tnWwJuM2dTlpUUlU34KGbtix/n2 GN464mH/DM4hPWtXLGHB6ISeV7WeATjqFttjE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TprQlQFZRRVaNzj8M3glgRlVQ3caeRnPbHTYzHGFqfc=; b=Sjn1IS/CW1jqfbggCnCA9KcyhgFRGc28hrhlJ5jXvGwPj4qH647lrBN1v5occOyYTJ ho49AjFU+2htP6yP9dsKADsGf5yTdeBXVWspCWylnmtHHjTUQRLe7Te1/fBkIbs8WBI0 rW94BBxme6hiL0T5eKxH5gMAicCTx04pDAH2gb52cP9xCydgZXMkDMVhPiEioJI1IKYy AXfU6Jx71MAoBP9gLUeLh1/ElW7eDGtQa2Kf4ZEw7mdCZaJsh1I3ds1MkRKxz1OKjH83 X3zQbtMRWlr0sqLIWGOIZXSEDliGz1+D3/t1OxdrZpYKDiZnwqp25T+q+XL9WON8bUwk rwWA== X-Gm-Message-State: APjAAAVvCqecWFtK8rud0HUPNA+ebXty9L4uXxxVDR3X/s4eSNapfRLN UYSJ8wsC7bN9NRw5HFyGPD9Vp2l1XHbG7Vuwo+CNfQ== X-Google-Smtp-Source: APXvYqxlvyQJ+beKr6e4d5K85oWEsZch5c2Qfp0lcMYqD1m82B1wkKj1ANeSQyPv+g2bHT99MsbELAEw1STYZ7qkGd8= X-Received: by 2002:a62:1b0c:: with SMTP id b12mr26136840pfb.17.1566917078986; Tue, 27 Aug 2019 07:44:38 -0700 (PDT) MIME-Version: 1.0 References: <1566915962-5472-1-git-send-email-arybchenko@solarflare.com> <1566915962-5472-12-git-send-email-arybchenko@solarflare.com> In-Reply-To: <1566915962-5472-12-git-send-email-arybchenko@solarflare.com> From: Somnath Kotur Date: Tue, 27 Aug 2019 20:14:27 +0530 Message-ID: To: Andrew Rybchenko Cc: Ajit Khaparde , dev , Ivan Ilchenko Content-Type: text/plain; charset="UTF-8" Subject: Re: [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" On Tue, Aug 27, 2019 at 7:56 PM Andrew Rybchenko wrote: > > 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; > + } Acked-by: Somnath Kotur > bp = dev->data->dev_private; > > if (!BNXT_PF(bp)) { > -- > 1.8.3.1 >