Commit 6f115863 authored by Kashyap Desai's avatar Kashyap Desai Committed by Paolo Abeni
Browse files

bnxt_en: Add err_qpc backing store handling



New backing store component err_qpc is added to the existing host
logging interface for FW traces.

Allocate the backing store memory if this memory type is supported.
Copy this memory when collecting the coredump.

Reviewed-by: default avatarShruti Parab <shruti.parab@broadcom.com>
Signed-off-by: default avatarKashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
Link: https://patch.msgid.link/20250917040839.1924698-7-michael.chan@broadcom.com


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent ba1aefee
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -266,6 +266,7 @@ const u16 bnxt_bstore_to_trace[] = {
	[BNXT_CTX_CA2]		= DBG_LOG_BUFFER_FLUSH_REQ_TYPE_CA2_TRACE,
	[BNXT_CTX_RIGP1]	= DBG_LOG_BUFFER_FLUSH_REQ_TYPE_RIGP1_TRACE,
	[BNXT_CTX_KONG]		= DBG_LOG_BUFFER_FLUSH_REQ_TYPE_AFM_KONG_HWRM_TRACE,
	[BNXT_CTX_QPC]		= DBG_LOG_BUFFER_FLUSH_REQ_TYPE_ERR_QPC_TRACE,
};

static struct workqueue_struct *bnxt_pf_wq;
@@ -9159,7 +9160,7 @@ static int bnxt_backing_store_cfg_v2(struct bnxt *bp)
	int rc = 0;
	u16 type;

	for (type = BNXT_CTX_SRT; type <= BNXT_CTX_KONG; type++) {
	for (type = BNXT_CTX_SRT; type <= BNXT_CTX_QPC; type++) {
		ctxm = &ctx->ctx_arr[type];
		if (!bnxt_bs_trace_avail(bp, type))
			continue;
+2 −1
Original line number Diff line number Diff line
@@ -1969,10 +1969,11 @@ struct bnxt_ctx_mem_type {
#define BNXT_CTX_CA2	FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_CA2_TRACE
#define BNXT_CTX_RIGP1	FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_RIGP1_TRACE
#define BNXT_CTX_KONG	FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_AFM_KONG_HWRM_TRACE
#define BNXT_CTX_QPC	FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_ERR_QPC_TRACE

#define BNXT_CTX_MAX	(BNXT_CTX_TIM + 1)
#define BNXT_CTX_L2_MAX	(BNXT_CTX_FTQM + 1)
#define BNXT_CTX_V2_MAX	(BNXT_CTX_KONG + 1)
#define BNXT_CTX_V2_MAX (BNXT_CTX_QPC + 1)
#define BNXT_CTX_INV	((u16)-1)

struct bnxt_ctx_mem_info {
+2 −1
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ static const u16 bnxt_bstore_to_seg_id[] = {
	[BNXT_CTX_CA2]			= BNXT_CTX_MEM_SEG_CA2,
	[BNXT_CTX_RIGP1]		= BNXT_CTX_MEM_SEG_RIGP1,
	[BNXT_CTX_KONG]			= BNXT_CTX_MEM_SEG_KONG,
	[BNXT_CTX_QPC]			= BNXT_CTX_MEM_SEG_QPC,
};

static int bnxt_dbg_hwrm_log_buffer_flush(struct bnxt *bp, u16 type, u32 flags,
@@ -360,7 +361,7 @@ static u32 bnxt_get_ctx_coredump(struct bnxt *bp, void *buf, u32 offset,

	if (buf)
		buf += offset;
	for (type = 0; type <= BNXT_CTX_KONG; type++) {
	for (type = 0; type < BNXT_CTX_V2_MAX; type++) {
		struct bnxt_ctx_mem_type *ctxm = &ctx->ctx_arr[type];
		bool trace = bnxt_bs_trace_avail(bp, type);
		u32 seg_id = bnxt_bstore_to_seg_id[type];
+1 −0
Original line number Diff line number Diff line
@@ -102,6 +102,7 @@ struct bnxt_driver_segment_record {
#define BNXT_CTX_MEM_SEG_CA1	0x9
#define BNXT_CTX_MEM_SEG_CA2	0xa
#define BNXT_CTX_MEM_SEG_RIGP1	0xb
#define BNXT_CTX_MEM_SEG_QPC	0xc
#define BNXT_CTX_MEM_SEG_KONG	0xd

#define BNXT_CRASH_DUMP_LEN	(8 << 20)