net/bnxt: fix handling interface change status
authorKalesh AP <kalesh-anakkur.purayil@broadcom.com>
Thu, 10 Oct 2019 01:41:51 +0000 (18:41 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 23 Oct 2019 14:43:08 +0000 (16:43 +0200)
Driver issues hwrm_if_change when the port is started and stopped.
This command returns whether the fw has undergone a reset while port
was down. Fix to handle hwrm_if_change status during port start only.

Fixes: 0b533591238f ("net/bnxt: inform firmware about IF state changes")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
drivers/net/bnxt/bnxt_hwrm.c

index 5e3117f..f94fdde 100644 (file)
@@ -4858,6 +4858,9 @@ int bnxt_hwrm_if_change(struct bnxt *bp, bool up)
        flags = rte_le_to_cpu_32(resp->flags);
        HWRM_UNLOCK();
 
+       if (!up)
+               return 0;
+
        if (flags & HWRM_FUNC_DRV_IF_CHANGE_OUTPUT_FLAGS_HOT_FW_RESET_DONE) {
                PMD_DRV_LOG(INFO, "FW reset happened while port was down\n");
                bp->flags |= BNXT_FLAG_IF_CHANGE_HOT_FW_RESET_DONE;