From: Kalesh AP Date: Wed, 17 Jul 2019 10:41:36 +0000 (+0530) Subject: net/bnxt: check invalid VNIC in cleanup path X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=fcaf844e993b5850021a7e54e27d21904b805329;p=dpdk.git net/bnxt: check invalid VNIC in cleanup path The cleanup/rollback operation post rte_eth_dev_start failure might end up invoking an HWRM cmd even on an invalid vNIC resulting in error messages being logged needlessly. Fix to check for the same before issuing the HWRM cmd. Fixes: c09f57b49c13 ("net/bnxt: add start/stop/link update operations") Cc: stable@dpdk.org Signed-off-by: Kalesh AP Signed-off-by: Ajit Khaparde Reviewed-by: Somnath Kotur --- diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index 84cda5e6c0..1a0265f8ae 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -2325,6 +2325,11 @@ void bnxt_free_all_hwrm_resources(struct bnxt *bp) for (i = bp->nr_vnics - 1; i >= 0; i--) { struct bnxt_vnic_info *vnic = &bp->vnic_info[i]; + if (vnic->fw_vnic_id == INVALID_HW_RING_ID) { + PMD_DRV_LOG(DEBUG, "Invalid vNIC ID\n"); + return; + } + bnxt_clear_hwrm_vnic_flows(bp, vnic); bnxt_clear_hwrm_vnic_filters(bp, vnic);