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 4BD73A0471 for ; Wed, 17 Jul 2019 12:44:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7A4251BDF9; Wed, 17 Jul 2019 12:42:40 +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 ED6D01B9E9; Wed, 17 Jul 2019 12:42:18 +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 BBC4330C0A6; Wed, 17 Jul 2019 03:42:17 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com BBC4330C0A6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1563360137; bh=sFmml4Bz7LTPfwf46yCJ2npFi1oJKTPqj+16iwN0oS0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KnrU+GTZg/rP2Tvhh6F8sOLT+mcPhScrFbM+2I+/G8JyPoxlIEeqi0dOTeGf4dIhY 7TCZo7HggOpsBtxBfqV7t6fWIAtkgeBIhCOLnyl7wDLUbaf8mopQEalY976n+4dd7k Kwn7dnO5sjsxy5Roq309Msd6lUUNenJGSDy1b/r0= Received: from C02VPB22HTD6.wifi.broadcom.net (c02vpb22htd6.wifi.broadcom.net [10.122.43.105]) by nis-sj1-27.broadcom.com (Postfix) with ESMTP id CA5DCAC0749; Wed, 17 Jul 2019 03:42:15 -0700 (PDT) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Jay Ding , stable@dpdk.org, Randy Schacher Date: Wed, 17 Jul 2019 16:11:39 +0530 Message-Id: <20190717104139.21155-16-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20190717104139.21155-1-ajit.khaparde@broadcom.com> References: <0c1b327c-2c36-652f-c88d-cbca8f873c13@intel.com> <20190717104139.21155-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 15/15] net/bnxt: fix to avoid sending invalid VNIC id to firmware 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: Jay Ding Add checking for vinc id before sending message to chimp in bnxt_hwrm_vnic_plcmode_cfg(). Fixes: db678d5c2b54 ("net/bnxt: add HWRM VNIC configure") Cc: stable@dpdk.org Reviewed-by: Ajit Khaparde Reviewed-by: Randy Schacher Signed-off-by: Jay Ding Signed-off-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_hwrm.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index a4e0c2e0c..313459aaf 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -1497,6 +1497,11 @@ static int bnxt_hwrm_vnic_plcmodes_cfg(struct bnxt *bp, struct hwrm_vnic_plcmodes_cfg_input req = {.req_type = 0 }; struct hwrm_vnic_plcmodes_cfg_output *resp = bp->hwrm_cmd_resp_addr; + if (vnic->fw_vnic_id == INVALID_HW_RING_ID) { + PMD_DRV_LOG(DEBUG, "VNIC ID %x\n", vnic->fw_vnic_id); + return rc; + } + HWRM_PREP(req, VNIC_PLCMODES_CFG, BNXT_USE_CHIMP_MB); req.vnic_id = rte_cpu_to_le_16(vnic->fw_vnic_id); -- 2.20.1 (Apple Git-117)