Skip to content

Commit a0f1def

Browse files
author
Shruti Parab
committed
bnxt_en: Flush FW trace before copying to the coredump
JIRA: https://issues.redhat.com/browse/RHEL-76565 commit 100c08c Author: Shruti Parab <shruti.parab@broadcom.com> Date: Thu Jul 10 14:39:37 2025 -0700 bnxt_en: Flush FW trace before copying to the coredump bnxt_fill_drv_seg_record() calls bnxt_dbg_hwrm_log_buffer_flush() to flush the FW trace buffer. This needs to be done before we call bnxt_copy_ctx_mem() to copy the trace data. Without this fix, the coredump may not contain all the FW traces. Fixes: 3c2179e ("bnxt_en: Add FW trace coredump segments to the coredump") Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Signed-off-by: Shruti Parab <shruti.parab@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Link: https://patch.msgid.link/20250710213938.1959625-3-michael.chan@broadcom.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Shruti Parab <shruti.parab@broadcom.com>
1 parent 0e98fcc commit a0f1def

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -368,23 +368,27 @@ static u32 bnxt_get_ctx_coredump(struct bnxt *bp, void *buf, u32 offset,
368368
if (!ctxm->mem_valid || !seg_id)
369369
continue;
370370

371-
if (trace)
371+
if (trace) {
372372
extra_hlen = BNXT_SEG_RCD_LEN;
373+
if (buf) {
374+
u16 trace_type = bnxt_bstore_to_trace[type];
375+
376+
bnxt_fill_drv_seg_record(bp, &record, ctxm,
377+
trace_type);
378+
}
379+
}
380+
373381
if (buf)
374382
data = buf + BNXT_SEG_HDR_LEN + extra_hlen;
383+
375384
seg_len = bnxt_copy_ctx_mem(bp, ctxm, data, 0) + extra_hlen;
376385
if (buf) {
377386
bnxt_fill_coredump_seg_hdr(bp, &seg_hdr, NULL, seg_len,
378387
0, 0, 0, comp_id, seg_id);
379388
memcpy(buf, &seg_hdr, BNXT_SEG_HDR_LEN);
380389
buf += BNXT_SEG_HDR_LEN;
381-
if (trace) {
382-
u16 trace_type = bnxt_bstore_to_trace[type];
383-
384-
bnxt_fill_drv_seg_record(bp, &record, ctxm,
385-
trace_type);
390+
if (trace)
386391
memcpy(buf, &record, BNXT_SEG_RCD_LEN);
387-
}
388392
buf += seg_len;
389393
}
390394
len += BNXT_SEG_HDR_LEN + seg_len;

0 commit comments

Comments
 (0)