From: Jay Ding Date: Thu, 28 Jun 2018 20:15:38 +0000 (-0700) Subject: net/bnxt: check for invalid vNIC id X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=e9950366d08f20e4d968fd76dcd0d5bc8afc09a0;p=dpdk.git net/bnxt: check for invalid vNIC id Passing an invalid fw_vnic_id to the firmware will cause the bnxt_hwrm_vnic_plcmode_cfg command to fail. Add a check for VNIC id before sending message to firmware. Fixes: daef48efe5e5 ("net/bnxt: support set MTU") Cc: stable@dpdk.org Signed-off-by: Jay Ding Reviewed-by: Randy Schacher Reviewed-by: Ajit Khaparde --- diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index 64687a69b3..910129f122 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(