From: Kalesh AP Date: Tue, 10 Dec 2019 15:05:26 +0000 (+0530) Subject: net/bnxt: fix request for hot reset support X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=596bbea4e76f118f8665f275fca9f2ab66dc145f;p=dpdk.git net/bnxt: fix request for hot reset support During the registration process, the drivers must publish "HOT_RESET_SUPPORTED" capability to the core firmware only if core firmware is capable of Hot Reset. Fixes: df6cd7c1f73a ("net/bnxt: handle reset notify async event from FW") Cc: stable@dpdk.org Signed-off-by: Kalesh AP Reviewed-by: Ajit Khaparde Reviewed-by: Somnath Kotur --- diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index e259c8239d..f9e4d76e47 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -517,6 +517,7 @@ struct bnxt { #define BNXT_FLAG_INIT_DONE BIT(24) #define BNXT_FLAG_FW_CAP_ONE_STEP_TX_TS BIT(25) #define BNXT_FLAG_ADV_FLOW_MGMT BIT(26) +#define BNXT_FLAG_FW_CAP_HOT_RESET BIT(27) #define BNXT_PF(bp) (!((bp)->flags & BNXT_FLAG_VF)) #define BNXT_VF(bp) ((bp)->flags & BNXT_FLAG_VF) #define BNXT_NPAR(bp) ((bp)->port_partition_type) diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index b1f908ee40..d30da9b87c 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -672,6 +672,11 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp) else bp->flags &= ~BNXT_FLAG_FW_CAP_ERR_RECOVER_RELOAD; + if (flags & HWRM_FUNC_QCAPS_OUTPUT_FLAGS_HOT_RESET_CAPABLE) + bp->flags |= BNXT_FLAG_FW_CAP_HOT_RESET; + else + bp->flags &= ~BNXT_FLAG_FW_CAP_HOT_RESET; + HWRM_UNLOCK(); return rc; @@ -756,7 +761,8 @@ int bnxt_hwrm_func_driver_register(struct bnxt *bp) if (bp->flags & BNXT_FLAG_REGISTERED) return 0; - flags = HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_HOT_RESET_SUPPORT; + if (bp->flags & BNXT_FLAG_FW_CAP_HOT_RESET) + flags = HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_HOT_RESET_SUPPORT; if (bp->flags & BNXT_FLAG_FW_CAP_ERROR_RECOVERY) flags |= HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_ERROR_RECOVERY_SUPPORT;