bnxt_en: Query FW parameters when the CAPS_CHANGE bit is set
authorshantiprasad shettar <shantiprasad.shettar@broadcom.com>
Mon, 10 Mar 2025 18:31:26 +0000 (11:31 -0700)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 18 Mar 2025 09:25:22 +0000 (10:25 +0100)
Newer FW can set the CAPS_CHANGE flag during ifup if some capabilities
or configurations have changed.  For example, the CoS queue
configurations may have changed.  Support this new flag by treating it
almost like FW reset.  The driver will essentially rediscover all
features and capabilities, reconfigure all backing store context memory,
reset everything to default, and reserve all resources.

Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: shantiprasad shettar <shantiprasad.shettar@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Link: https://patch.msgid.link/20250310183129.3154117-5-michael.chan@broadcom.com
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/broadcom/bnxt/bnxt.c

index 869bdde09c730f315986ec2d8ad8975489e4b41b..08a41e9c25ff185ab0334aa8daad62ad4cb218cb 100644 (file)
@@ -12309,6 +12309,7 @@ static int bnxt_hwrm_if_change(struct bnxt *bp, bool up)
        struct hwrm_func_drv_if_change_input *req;
        bool fw_reset = !bp->irq_tbl;
        bool resc_reinit = false;
+       bool caps_change = false;
        int rc, retry = 0;
        u32 flags = 0;
 
@@ -12364,8 +12365,11 @@ static int bnxt_hwrm_if_change(struct bnxt *bp, bool up)
                set_bit(BNXT_STATE_ABORT_ERR, &bp->state);
                return -ENODEV;
        }
-       if (resc_reinit || fw_reset) {
-               if (fw_reset) {
+       if (flags & FUNC_DRV_IF_CHANGE_RESP_FLAGS_CAPS_CHANGE)
+               caps_change = true;
+
+       if (resc_reinit || fw_reset || caps_change) {
+               if (fw_reset || caps_change) {
                        set_bit(BNXT_STATE_FW_RESET_DET, &bp->state);
                        if (!test_bit(BNXT_STATE_IN_FW_RESET, &bp->state))
                                bnxt_ulp_irq_stop(bp);