[PATCH 27/54] net/bnxt/tf_core: thor2 hot upgrade ungraceful quit crash
Manish Kurup
manish.kurup at broadcom.com
Tue Sep 30 02:35:37 CEST 2025
From: Farah Smith <farah.smith at broadcom.com>
Change table scope shutdown sequence in DPDK to remove the function
from the scope prior to requesting the memory being freed. The
firmware will delete the scope when the last fid is removed so
there is no need to issue the table scope deconfig HWRM.
Signed-off-by: Farah Smith <farah.smith at broadcom.com>
Reviewed-by: Kishore Padmanabha <kishore.padmanabha at broadcom.com>
---
drivers/net/bnxt/tf_core/v3/tfc_tbl_scope.c | 24 ++++++++-------------
drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c | 20 +++++++++++------
2 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/drivers/net/bnxt/tf_core/v3/tfc_tbl_scope.c b/drivers/net/bnxt/tf_core/v3/tfc_tbl_scope.c
index 60b8289805..ac805916cc 100644
--- a/drivers/net/bnxt/tf_core/v3/tfc_tbl_scope.c
+++ b/drivers/net/bnxt/tf_core/v3/tfc_tbl_scope.c
@@ -1284,7 +1284,7 @@ int tfc_tbl_scope_mem_alloc(struct tfc *tfcp, uint16_t fid, uint8_t tsid,
tsid,
dir,
CFA_REGION_TYPE_LKUP,
- true,
+ parms->local,
&lkup_mem_cfg[dir]);
if (rc)
goto cleanup;
@@ -1293,7 +1293,7 @@ int tfc_tbl_scope_mem_alloc(struct tfc *tfcp, uint16_t fid, uint8_t tsid,
tsid,
dir,
CFA_REGION_TYPE_ACT,
- true,
+ parms->local,
&act_mem_cfg[dir]);
if (rc)
goto cleanup;
@@ -1388,9 +1388,13 @@ int tfc_tbl_scope_mem_free(struct tfc *tfcp, uint16_t fid, uint8_t tsid)
PMD_DRV_LOG_LINE(ERR, "tfc_vf2pf_mem_free failed");
/* continue cleanup regardless */
}
- PMD_DRV_LOG_LINE(DEBUG, "tsid: %d, status %d", resp.tsid, resp.status);
- if (shared)
+ PMD_DRV_LOG_LINE(DEBUG, "%s: tsid: %d, status %d",
+ __func__, resp.tsid, resp.status);
+ if (shared) {
+ /* reset scope */
+ tfo_ts_set(tfcp->tfo, tsid, false, CFA_APP_TYPE_INVALID, false, 0);
return rc;
+ }
}
if (shared && is_pf) {
@@ -1495,11 +1499,9 @@ int tfc_tbl_scope_fid_add(struct tfc *tfcp, uint16_t fid, uint8_t tsid,
int tfc_tbl_scope_fid_rem(struct tfc *tfcp, uint16_t fid, uint8_t tsid,
uint16_t *fid_cnt)
{
- struct tfc_ts_mem_cfg mem_cfg;
struct tfc_cpm *cpm_lkup;
struct tfc_cpm *cpm_act;
int rc = 0;
- bool local;
if (tfcp == NULL) {
PMD_DRV_LOG_LINE(ERR, "Invalid tfcp pointer");
@@ -1536,15 +1538,7 @@ int tfc_tbl_scope_fid_rem(struct tfc *tfcp, uint16_t fid, uint8_t tsid,
if (rc == 0 && (cpm_lkup != NULL || cpm_act != NULL))
(void)tfc_tbl_scope_cpm_free(tfcp, tsid);
- /*
- * Check if any table has memory configured and, if so, free it.
- */
- (void)tfo_ts_get_mem_cfg(tfcp->tfo, tsid, CFA_DIR_RX,
- CFA_REGION_TYPE_LKUP, &local, &mem_cfg);
-
- rc = tfo_ts_set(tfcp->tfo, tsid, false, CFA_APP_TYPE_INVALID,
- false, 0);
-
+ /* tbl_scope_mem_free() will reset the remaining tsid state */
return rc;
}
diff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c b/drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c
index 385dd742d5..084a3db92d 100644
--- a/drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c
+++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c
@@ -320,20 +320,21 @@ ulp_tfc_tbl_scope_deinit(struct bnxt *bp)
else
BNXT_DRV_DBG(DEBUG, "Freed CPM TSID:%d FID: %d\n", tsid, fid);
- rc = tfc_tbl_scope_mem_free(tfcp, fid, tsid);
+
+ rc = tfc_tbl_scope_fid_rem(tfcp, fid, tsid, &fid_cnt);
if (rc)
- BNXT_DRV_DBG(ERR, "Failed freeing tscope mem TSID:%d FID:%d\n",
+ BNXT_DRV_DBG(ERR, "Failed removing FID from TSID:%d FID:%d",
tsid, fid);
else
- BNXT_DRV_DBG(DEBUG, "Freed tscope mem TSID:%d FID:%d\n",
+ BNXT_DRV_DBG(DEBUG, "Removed FID from TSID:%d FID:%d",
tsid, fid);
- rc = tfc_tbl_scope_fid_rem(tfcp, fid, tsid, &fid_cnt);
+ rc = tfc_tbl_scope_mem_free(tfcp, fid, tsid);
if (rc)
- BNXT_DRV_DBG(ERR, "Failed removing FID from TSID:%d FID:%d\n",
+ BNXT_DRV_DBG(ERR, "Failed freeing tscope mem TSID:%d FID:%d",
tsid, fid);
else
- BNXT_DRV_DBG(DEBUG, "Removed FID from TSID:%d FID:%d\n",
+ BNXT_DRV_DBG(DEBUG, "Freed tscope mem TSID:%d FID:%d",
tsid, fid);
}
@@ -456,7 +457,12 @@ ulp_tfc_tbl_scope_init(struct bnxt *bp)
qparms.act_pool_sz_exp[CFA_DIR_RX];
mem_parms.act_pool_sz_exp[CFA_DIR_TX] =
qparms.act_pool_sz_exp[CFA_DIR_TX];
- mem_parms.local = true;
+
+ if (shared)
+ mem_parms.local = false;
+ else
+ mem_parms.local = true;
+
rc = tfc_tbl_scope_mem_alloc(tfcp, fid, tsid, &mem_parms);
if (rc) {
BNXT_DRV_DBG(ERR,
--
2.39.5 (Apple Git-154)
More information about the dev
mailing list