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 A7129A0471 for ; Thu, 18 Jul 2019 05:38:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9D4E71BDE5; Thu, 18 Jul 2019 05:36:57 +0200 (CEST) Received: from rnd-relay.smtp.broadcom.com (rnd-relay.smtp.broadcom.com [192.19.229.170]) by dpdk.org (Postfix) with ESMTP id DC6A21B9F6; Thu, 18 Jul 2019 05:36:48 +0200 (CEST) Received: from nis-sj1-27.broadcom.com (nis-sj1-27.lvn.broadcom.net [10.75.144.136]) by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id 7D00C30C38E; Wed, 17 Jul 2019 20:36:46 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com 7D00C30C38E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1563421006; bh=snw9PKvTH+gILZG8R3iYj6H/iQOEdiSu8gB1UFdQxes=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XWGsorC306NJ4Fsih9HPn1m2u/rKEwAevRHMxmmtoEWnFLGsWgF/tbn5cWsZOZicq f3rzMgs4paF7RHODeSIkYtOLvXkYDxIcuvq2VwGY49vB50JV9EkDsBiBpdFLMBDKNG 7IF1xqCPZzMCidJ1wyiIzjXDwUCar+NZcnZggiNA= Received: from C02VPB22HTD6.wifi.broadcom.net (c02vpb22htd6.wifi.broadcom.net [10.122.43.105]) by nis-sj1-27.broadcom.com (Postfix) with ESMTP id D706EAC0761; Wed, 17 Jul 2019 20:36:45 -0700 (PDT) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Kalesh AP , stable@dpdk.org, Lance Richardson Date: Thu, 18 Jul 2019 09:06:05 +0530 Message-Id: <20190718033616.37605-12-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20190718033616.37605-1-ajit.khaparde@broadcom.com> References: <20190718033616.37605-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 11/22] net/bnxt: fix error checking of FW commands 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: Kalesh AP HWRM_CHECK_RESULT() checks the return value of HWRM command and returns in case the command fails. There is no need of return value check after HWRM_CHECK_RESULT(). Fixes: 49947a13ba9e ("net/bnxt: support Tx loopback, set VF MAC and queues drop") Cc: stable@dpdk.org Signed-off-by: Kalesh AP Reviewed-by: Lance Richardson Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_hwrm.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index 52b2119a5..9bd2fcb9f 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -1766,8 +1766,6 @@ bnxt_hwrm_vnic_rss_cfg_thor(struct bnxt *bp, struct bnxt_vnic_info *vnic) BNXT_USE_CHIMP_MB); HWRM_CHECK_RESULT(); - if (rc) - break; } HWRM_UNLOCK(); @@ -3778,16 +3776,7 @@ static int bnxt_hwrm_func_vf_vnic_query(struct bnxt *bp, uint16_t vf, return -ENOMEM; } rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB); - if (rc) { - HWRM_UNLOCK(); - PMD_DRV_LOG(ERR, "hwrm_func_vf_vnic_query failed rc:%d\n", rc); - return -1; - } else if (resp->error_code) { - rc = rte_le_to_cpu_16(resp->error_code); - HWRM_UNLOCK(); - PMD_DRV_LOG(ERR, "hwrm_func_vf_vnic_query error %d\n", rc); - return -1; - } + HWRM_CHECK_RESULT(); rc = rte_le_to_cpu_32(resp->vnic_id_cnt); HWRM_UNLOCK(); @@ -4196,8 +4185,6 @@ bnxt_vnic_rss_configure_thor(struct bnxt *bp, struct bnxt_vnic_info *vnic) BNXT_USE_CHIMP_MB); HWRM_CHECK_RESULT(); - if (rc) - break; } HWRM_UNLOCK(); @@ -4275,8 +4262,7 @@ static int bnxt_hwrm_set_coal_params_thor(struct bnxt *bp, HWRM_PREP(req, RING_AGGINT_QCAPS, BNXT_USE_CHIMP_MB); rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB); - if (rc) - goto out; + HWRM_CHECK_RESULT(); agg_req->num_cmpl_dma_aggr = resp->num_cmpl_dma_aggr_max; agg_req->cmpl_aggr_dma_tmr = resp->cmpl_aggr_dma_tmr_min; @@ -4289,8 +4275,6 @@ static int bnxt_hwrm_set_coal_params_thor(struct bnxt *bp, HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_ENABLES_NUM_CMPL_DMA_AGGR; agg_req->enables = rte_cpu_to_le_32(enables); -out: - HWRM_CHECK_RESULT(); HWRM_UNLOCK(); return rc; } @@ -4502,8 +4486,7 @@ int bnxt_hwrm_func_backing_store_cfg(struct bnxt *bp, uint32_t enables) rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB); HWRM_CHECK_RESULT(); HWRM_UNLOCK(); - if (rc) - rc = -EIO; + return rc; } -- 2.20.1 (Apple Git-117)