From: Michael Chan <michael.chan@broadcom.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, andrew+netdev@lunn.ch,
andrew.gospodarek@broadcom.com, hongguang.gao@broadcom.com,
shruti.parab@broadcom.com
Subject: [PATCH net-next 02/11] bnxt_en: Add mem_valid bit to struct bnxt_ctx_mem_type
Date: Tue, 12 Nov 2024 21:36:40 -0800 [thread overview]
Message-ID: <20241113053649.405407-3-michael.chan@broadcom.com> (raw)
In-Reply-To: <20241113053649.405407-1-michael.chan@broadcom.com>
From: Shruti Parab <shruti.parab@broadcom.com>
Add a new bit to struct bnxt_ctx_mem_type to indicate that host
memory has been successfully allocated for this context memory type.
In the next patches, we'll be adding some additional context memory
types for FW debugging/logging. If memory cannot be allocated for
any of these new types, we will not abort and the cleared mem_valid
bit will indicate to skip configuring the memory type.
Reviewed-by: Hongguang Gao <hongguang.gao@broadcom.com>
Signed-off-by: Shruti Parab <shruti.parab@broadcom.com>
Signed-of-by: Michael Chan <michael.chan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 5 +++++
drivers/net/ethernet/broadcom/bnxt/bnxt.h | 1 +
2 files changed, 6 insertions(+)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index e9aab2e2840e..2f445a4fbf37 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -8682,6 +8682,8 @@ static int bnxt_setup_ctxm_pg_tbls(struct bnxt *bp,
rc = bnxt_alloc_ctx_pg_tbls(bp, &ctx_pg[i], mem_size, pg_lvl,
ctxm->init_value ? ctxm : NULL);
}
+ if (!rc)
+ ctxm->mem_valid = 1;
return rc;
}
@@ -8752,6 +8754,8 @@ static int bnxt_backing_store_cfg_v2(struct bnxt *bp, u32 ena)
for (type = 0 ; type < BNXT_CTX_V2_MAX; type++) {
ctxm = &ctx->ctx_arr[type];
+ if (!ctxm->mem_valid)
+ continue;
rc = bnxt_hwrm_func_backing_store_cfg_v2(bp, ctxm, ctxm->last);
if (rc)
return rc;
@@ -8781,6 +8785,7 @@ void bnxt_free_ctx_mem(struct bnxt *bp)
kfree(ctx_pg);
ctxm->pg_info = NULL;
+ ctxm->mem_valid = 0;
}
ctx->flags &= ~BNXT_CTX_FLAG_INITED;
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
index 69231e85140b..5b921c57a9f8 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
@@ -1888,6 +1888,7 @@ struct bnxt_ctx_mem_type {
u32 max_entries;
u32 min_entries;
u8 last:1;
+ u8 mem_valid:1;
u8 split_entry_cnt;
#define BNXT_MAX_SPLIT_ENTRY 4
union {
--
2.30.1
next prev parent reply other threads:[~2024-11-13 5:39 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-13 5:36 [PATCH net-next 00/11] bnxt_en: Add context memory dump to coredump Michael Chan
2024-11-13 5:36 ` [PATCH net-next 01/11] bnxt_en: Update firmware interface spec to 1.10.3.85 Michael Chan
2024-11-13 5:36 ` Michael Chan [this message]
2024-11-13 5:36 ` [PATCH net-next 03/11] bnxt_en: Refactor bnxt_free_ctx_mem() Michael Chan
2024-11-13 5:36 ` [PATCH net-next 04/11] bnxt_en: Add a 'force' parameter to bnxt_free_ctx_mem() Michael Chan
2024-11-13 5:36 ` [PATCH net-next 05/11] bnxt_en: Allocate backing store memory for FW trace logs Michael Chan
2024-11-13 5:36 ` [PATCH net-next 06/11] bnxt_en: Manage the FW trace context memory Michael Chan
2024-11-15 4:00 ` Jakub Kicinski
2024-11-13 5:36 ` [PATCH net-next 07/11] bnxt_en: Do not free FW log " Michael Chan
2024-11-13 5:36 ` [PATCH net-next 08/11] bnxt_en: Add functions to copy host " Michael Chan
2024-11-15 3:57 ` Jakub Kicinski
2024-11-13 5:36 ` [PATCH net-next 09/11] bnxt_en: Add 2 parameters to bnxt_fill_coredump_seg_hdr() Michael Chan
2024-11-13 5:36 ` [PATCH net-next 10/11] bnxt_en: Add a new ethtool -W dump flag Michael Chan
2024-11-13 5:36 ` [PATCH net-next 11/11] bnxt_en: Add FW trace coredump segments to the coredump Michael Chan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241113053649.405407-3-michael.chan@broadcom.com \
--to=michael.chan@broadcom.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew.gospodarek@broadcom.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hongguang.gao@broadcom.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shruti.parab@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.