From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rnd-relay.smtp.broadcom.com (rnd-relay.smtp.broadcom.com [192.19.229.170]) by dpdk.org (Postfix) with ESMTP id EEAF71B062 for ; Tue, 19 Jun 2018 23:31:09 +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 64CAE30C051; Tue, 19 Jun 2018 14:31:08 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com 64CAE30C051 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1529443868; bh=C9hzDFOZgkcxOBWqLVCjEaLfXwLClki8bY98ZIXRco0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uUX+A9LXMqHbqryAy9EgdQg3AnQ7zHAfmK/dg0nJq2F0AXO8m2Ax87ashQXwH/RRi upaLMZrgB+SNooTI4USdCXnMS1nwmp0brgS1/z3UZ7aRgtPngs78Jqr8mNp5xzlb3J YFdDQRkemxiYfDd7Ouz76fxmsEsG8qqXCmN//18o= Received: from C02VPB22HTD6.dhcp.broadcom.net (c02vpb22htd6.dhcp.broadcom.net [10.136.50.120]) by nis-sj1-27.broadcom.com (Postfix) with ESMTP id 9030FAC06AD; Tue, 19 Jun 2018 14:31:08 -0700 (PDT) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Jay Ding Date: Tue, 19 Jun 2018 14:30:50 -0700 Message-Id: <20180619213058.12273-24-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.15.1 (Apple Git-101) In-Reply-To: <20180619213058.12273-1-ajit.khaparde@broadcom.com> References: <20180619213058.12273-1-ajit.khaparde@broadcom.com> Subject: [dpdk-dev] [PATCH 23/31] net/bnxt: check for invalid vnic id 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: , X-List-Received-Date: Tue, 19 Jun 2018 21:31:10 -0000 From: Jay Ding Add checking for VNIC id before sending message to firmware in bnxt_hwrm_vnic_plcmode_cfg(). Signed-off-by: Jay Ding Reviewed-by: Randy Schacher Reviewed-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 64687a69b..910129f12 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -1560,6 +1560,11 @@ int bnxt_hwrm_vnic_plcmode_cfg(struct bnxt *bp, struct hwrm_vnic_plcmodes_cfg_output *resp = bp->hwrm_cmd_resp_addr; uint16_t size; + 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); req.flags = rte_cpu_to_le_32( -- 2.15.1 (Apple Git-101)