Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

bnxt_en: Improve bnxt_backing_store_cfg_v2()

Improve the logic that determines the last_type in this function.
The different context memory types are configured in a loop. The
last_type signals the last context memory type to be configured
which requires the ALL_DONE flag to be set for the FW.

The existing logic makes some assumptions that TIM is the last_type
when RDMA is enabled or FTQM is the last_type when only L2 is
enabled. Improve it to just search for the last_type so that we
don't need to make these assumptions that won't necessary be true
for future devices.

Reviewed-by: Shruti Parab <shruti.parab@broadcom.com>
Reviewed-by: Hongguang Gao <hongguang.gao@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Link: https://patch.msgid.link/20250917040839.1924698-5-michael.chan@broadcom.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Michael Chan and committed by
Paolo Abeni
de676875 21b6b8e8

+8 -7
+8 -7
drivers/net/ethernet/broadcom/bnxt/bnxt.c
··· 9150 9150 return rc; 9151 9151 } 9152 9152 9153 - static int bnxt_backing_store_cfg_v2(struct bnxt *bp, u32 ena) 9153 + static int bnxt_backing_store_cfg_v2(struct bnxt *bp) 9154 9154 { 9155 9155 struct bnxt_ctx_mem_info *ctx = bp->ctx; 9156 9156 struct bnxt_ctx_mem_type *ctxm; ··· 9176 9176 } 9177 9177 9178 9178 if (last_type == BNXT_CTX_INV) { 9179 - if (!ena) 9179 + for (type = 0; type < BNXT_CTX_MAX; type++) { 9180 + ctxm = &ctx->ctx_arr[type]; 9181 + if (ctxm->mem_valid) 9182 + last_type = type; 9183 + } 9184 + if (last_type == BNXT_CTX_INV) 9180 9185 return 0; 9181 - else if (ena & FUNC_BACKING_STORE_CFG_REQ_ENABLES_TIM) 9182 - last_type = BNXT_CTX_MAX - 1; 9183 - else 9184 - last_type = BNXT_CTX_L2_MAX - 1; 9185 9186 } 9186 9187 ctx->ctx_arr[last_type].last = 1; 9187 9188 ··· 9412 9411 ena |= FUNC_BACKING_STORE_CFG_REQ_DFLT_ENABLES; 9413 9412 9414 9413 if (bp->fw_cap & BNXT_FW_CAP_BACKING_STORE_V2) 9415 - rc = bnxt_backing_store_cfg_v2(bp, ena); 9414 + rc = bnxt_backing_store_cfg_v2(bp); 9416 9415 else 9417 9416 rc = bnxt_hwrm_func_backing_store_cfg(bp, ena); 9418 9417 if (rc) {