Skip to content

Commit c053174

Browse files
author
Shruti Parab
committed
bnxt_en: Add support for a new ethtool dump flag 3
JIRA: https://issues.redhat.com/browse/RHEL-76565 commit b54b249 Author: Vasuthevan Maheswaran <vasuthevan.maheswaran@broadcom.com> Date: Mon Mar 10 11:31:23 2025 -0700 bnxt_en: Add support for a new ethtool dump flag 3 When doing a live coredump with ethtool -w, the context data cached in the NIC is not dumped by the FW by default. The reason is that retrieving this cached context data with traffic running may cause problems. Add a new dump flag 3 to allow the option to include this cached context data which may be useful in some debug scenarios. Reviewed-by: Hongguang Gao <hongguang.gao@broadcom.com> Reviewed-by: Selvin Xavier <selvin.xavier@broadcom.com> Reviewed-by: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com> Signed-off-by: Vasuthevan Maheswaran <vasuthevan.maheswaran@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Link: https://patch.msgid.link/20250310183129.3154117-2-michael.chan@broadcom.com Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Shruti Parab <shruti.parab@broadcom.com>
1 parent 8285d3f commit c053174

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2692,6 +2692,7 @@ struct bnxt {
26922692
#define BNXT_DUMP_LIVE 0
26932693
#define BNXT_DUMP_CRASH 1
26942694
#define BNXT_DUMP_DRIVER 2
2695+
#define BNXT_DUMP_LIVE_WITH_CTX_L1_CACHE 3
26952696

26962697
struct bpf_prog *xdp_prog;
26972698

drivers/net/ethernet/broadcom/bnxt/bnxt_coredump.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ static int bnxt_hwrm_dbg_coredump_list(struct bnxt *bp,
159159
return rc;
160160
}
161161

162-
static int bnxt_hwrm_dbg_coredump_initiate(struct bnxt *bp, u16 component_id,
163-
u16 segment_id)
162+
static int bnxt_hwrm_dbg_coredump_initiate(struct bnxt *bp, u16 dump_type,
163+
u16 component_id, u16 segment_id)
164164
{
165165
struct hwrm_dbg_coredump_initiate_input *req;
166166
int rc;
@@ -172,6 +172,8 @@ static int bnxt_hwrm_dbg_coredump_initiate(struct bnxt *bp, u16 component_id,
172172
hwrm_req_timeout(bp, req, bp->hwrm_cmd_max_timeout);
173173
req->component_id = cpu_to_le16(component_id);
174174
req->segment_id = cpu_to_le16(segment_id);
175+
if (dump_type == BNXT_DUMP_LIVE_WITH_CTX_L1_CACHE)
176+
req->seg_flags = DBG_COREDUMP_INITIATE_REQ_SEG_FLAGS_COLLECT_CTX_L1_CACHE;
175177

176178
return hwrm_req_send(bp, req);
177179
}
@@ -450,7 +452,8 @@ static int __bnxt_get_coredump(struct bnxt *bp, u16 dump_type, void *buf,
450452

451453
start = jiffies;
452454

453-
rc = bnxt_hwrm_dbg_coredump_initiate(bp, comp_id, seg_id);
455+
rc = bnxt_hwrm_dbg_coredump_initiate(bp, dump_type, comp_id,
456+
seg_id);
454457
if (rc) {
455458
netdev_err(bp->dev,
456459
"Failed to initiate coredump for seg = %d\n",

drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5086,8 +5086,9 @@ static int bnxt_set_dump(struct net_device *dev, struct ethtool_dump *dump)
50865086
{
50875087
struct bnxt *bp = netdev_priv(dev);
50885088

5089-
if (dump->flag > BNXT_DUMP_DRIVER) {
5090-
netdev_info(dev, "Supports only Live(0), Crash(1), Driver(2) dumps.\n");
5089+
if (dump->flag > BNXT_DUMP_LIVE_WITH_CTX_L1_CACHE) {
5090+
netdev_info(dev,
5091+
"Supports only Live(0), Crash(1), Driver(2), Live with cached context(3) dumps.\n");
50915092
return -EINVAL;
50925093
}
50935094

0 commit comments

Comments
 (0)