Skip to content

Commit

Permalink
net/bnxt: check invalid VNIC in cleanup path
Browse files Browse the repository at this point in the history
[ upstream commit fcaf844 ]

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: c09f57b ("net/bnxt: add start/stop/link update operations")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
  • Loading branch information
Kalesh AP authored and kevintraynor committed Aug 28, 2019
1 parent 76685b9 commit 0d1f237
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/net/bnxt/bnxt_hwrm.c
Expand Up @@ -2118,6 +2118,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);
Expand Down

0 comments on commit 0d1f237

Please sign in to comment.