]> git.droids-corp.org - dpdk.git/commitdiff
net/bnxt: check for VNIC ID in rollback
authorSomnath Kotur <somnath.kotur@broadcom.com>
Wed, 2 Oct 2019 23:25:54 +0000 (16:25 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 8 Oct 2019 10:14:31 +0000 (12:14 +0200)
If driver init/probe fails as part of cleanup/rollback, we may end
up invoking this HWRM cmd even on an invalid vNIC which will
unnecessarily log an error message as the cmd will fail.
Check for invalid ID before issuing the HWRM cmd

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
drivers/net/bnxt/bnxt_hwrm.c

index 89697b83ac867bd10b1030b2fc1cda1269b88eab..e5f8fda9a34ba12e3c8ed9ebbf0665a2029eab58 100644 (file)
@@ -1965,6 +1965,11 @@ int bnxt_hwrm_vnic_tpa_cfg(struct bnxt *bp,
        if (BNXT_CHIP_THOR(bp))
                return 0;
 
+       if (vnic->fw_vnic_id == INVALID_HW_RING_ID) {
+               PMD_DRV_LOG(DEBUG, "Invalid vNIC ID\n");
+               return 0;
+       }
+
        HWRM_PREP(req, VNIC_TPA_CFG, BNXT_USE_CHIMP_MB);
 
        if (enable) {