cxgb4: collect hardware logs via ethtool
Subsystems (3)
v2 cover cxgb4: collect hardware logs via ethtool
Collect more hardware logs via ethtool --get-dump facility.
Patch 1 collects on-chip memory layout information.
Patch 2 collects on-chip MC memory dumps.
Patch 3 collects HMA memory dump.
Patch 4 evaluates and skips TX and RX payload regions in memory dumps.
Patch 5 collects egress and ingress SGE queue contexts.
Patch 6 collects PCIe configuration logs
Thanks,
Rahul
---
v2:
- Fix uninitialized variable "size" build warning in Patch 1.
Rahul Lakkireddy (6):
cxgb4: collect on-chip memory information
cxgb4: collect MC memory dump
cxgb4: collect HMA memory dump
cxgb4: skip TX and RX payload regions in memory dumps
cxgb4: collect egress and ingress SGE queue contexts
cxgb4: collect PCIe configuration logs
drivers/net/ethernet/chelsio/cxgb4/cudbg_entity.h | 76 +- drivers/net/ethernet/chelsio/cxgb4/cudbg_if.h | 5 + drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c | 822 +++++++++++++++++++-- drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.h | 18 +- drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | 5 +- drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c | 39 +- drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.h | 1 + drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c | 278 +------ drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 2 +- drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 14 +- drivers/net/ethernet/chelsio/cxgb4/t4_hw.h | 4 +- drivers/net/ethernet/chelsio/cxgb4/t4_regs.h | 4 + 12 files changed, 944 insertions(+), 324 deletions(-)
Signature · 1 line
2.14.1
PATCH v2 1/6 cxgb4: collect on-chip memory information
Collect memory layout of various on-chip memory regions. Move code for collecting on-chip memory information to cudbg_lib.c and update cxgb4_debugfs.c to use the common function. Also include cudbg_entity.h before cudbg_lib.h to avoid adding cudbg entity structure forward declarations in cudbg_lib.h.
---
v2:
- Fix uninitialized variable "size" build warning in Patch 1.
drivers/net/ethernet/chelsio/cxgb4/cudbg_entity.h | 35 +++ drivers/net/ethernet/chelsio/cxgb4/cudbg_if.h | 1 + drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c | 289 ++++++++++++++++++++- drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.h | 6 +- drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c | 5 +- drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.h | 1 + drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c | 278 +++----------------- 7 files changed, 374 insertions(+), 241 deletions(-)
drivers/net/ethernet/chelsio/cxgb4/cudbg_entity.h +35 -0
@@ -87,6 +87,41 @@ struct cudbg_tp_la {u8 data[0 ]; }; +static const char *const cudbg_region[] = { +"DBQ contexts:" ,"IMSG contexts:" ,"FLM cache:" ,"TCBs:" , +"Pstructs:" ,"Timers:" ,"Rx FL:" ,"Tx FL:" ,"Pstruct FL:" , +"Tx payload:" ,"Rx payload:" ,"LE hash:" ,"iSCSI region:" , +"TDDP region:" ,"TPT region:" ,"STAG region:" ,"RQ region:" , +"RQUDP region:" ,"PBL region:" ,"TXPBL region:" , +"DBVFIFO region:" ,"ULPRX state:" ,"ULPTX state:" , +"On-chip queues:" +}; + +struct cudbg_mem_desc { +u32 base; +u32 limit; +u32 idx; +}; + +struct cudbg_meminfo { +struct cudbg_mem_desc avail[4 ]; +struct cudbg_mem_desc mem[ARRAY_SIZE (cudbg_region) +3 ]; +u32 avail_c; +u32 mem_c; +u32 up_ram_lo; +u32 up_ram_hi; +u32 up_extmem2_lo; +u32 up_extmem2_hi; +u32 rx_pages_data[3 ]; +u32 tx_pages_data[4 ]; +u32 p_structs; +u32 reserved[12 ]; +u32 port_used[4 ]; +u32 port_alloc[4 ]; +u32 loopback_used[NCHAN ]; +u32 loopback_alloc[NCHAN ]; +}; +struct cudbg_cim_pif_la {int size;u8 data[0 ];
drivers/net/ethernet/chelsio/cxgb4/cudbg_if.h +1 -0
@@ -56,6 +56,7 @@ enum cudbg_dbg_entity_type {CUDBG_SGE_INDIRECT =37 ,CUDBG_ULPRX_LA =41 ,CUDBG_TP_LA =43 , +CUDBG_MEMINFO =44 ,CUDBG_CIM_PIF_LA =45 ,CUDBG_CLK =46 , CUDBG_CIM_OBQ_RXQ0 = 47,
drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c +288 -1
312 lines not on this page · raw message
drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.h +5 -1
@@ -102,6 +102,9 @@ int cudbg_collect_ulprx_la(struct cudbg_init *pdbg_init,int cudbg_collect_tp_la (struct cudbg_init *pdbg_init,struct cudbg_buffer *dbg_buff,struct cudbg_error *cudbg_err); +int cudbg_collect_meminfo (struct cudbg_init *pdbg_init, +struct cudbg_buffer *dbg_buff, +struct cudbg_error *cudbg_err);int cudbg_collect_cim_pif_la (struct cudbg_init *pdbg_init,struct cudbg_buffer *dbg_buff,struct cudbg_error *cudbg_err);
@@ -163,7 +166,8 @@ void cudbg_align_debug_buffer(struct cudbg_buffer *dbg_buff,u32 cudbg_cim_obq_size (struct adapter *padap,int qid);int cudbg_dump_context_size (struct adapter *padap); -struct cudbg_tcam ; +int cudbg_fill_meminfo (struct adapter *padap, +struct cudbg_meminfo *meminfo_buff);void cudbg_fill_le_tcam_info (struct adapter *padap,struct cudbg_tcam *tcam_region);#endif /* __CUDBG_LIB_H__ */
drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c +4 -1
@@ -18,7 +18,6 @@#include "t4_regs.h" #include "cxgb4.h" #include "cxgb4_cudbg.h" -#include "cudbg_entity.h" static const struct cxgb4_collect_entity cxgb4_collect_mem_dump[] = { {CUDBG_EDC0 , cudbg_collect_edc0_meminfo },
@@ -53,6 +52,7 @@ static const struct cxgb4_collect_entity cxgb4_collect_hw_dump[] = { { CUDBG_SGE_INDIRECT, cudbg_collect_sge_indirect }, { CUDBG_ULPRX_LA, cudbg_collect_ulprx_la }, { CUDBG_TP_LA, cudbg_collect_tp_la }, + { CUDBG_MEMINFO, cudbg_collect_meminfo }, { CUDBG_CIM_PIF_LA, cudbg_collect_cim_pif_la }, { CUDBG_CLK, cudbg_collect_clk_info }, { CUDBG_CIM_OBQ_RXQ0, cudbg_collect_obq_sge_rx_q0 },
@@ -201,6 +201,9 @@ static u32 cxgb4_get_entity_length(struct adapter *adap, u32 entity)case CUDBG_TP_LA : len =sizeof (struct cudbg_tp_la ) +TPLA_SIZE *sizeof (u64);break ; +case CUDBG_MEMINFO : + len =sizeof (struct cudbg_meminfo ); +break ;case CUDBG_CIM_PIF_LA : len =sizeof (struct cudbg_cim_pif_la ); len +=2 *CIM_PIFLA_SIZE *6 *sizeof (u32);
drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.h +1 -0
@@ -20,6 +20,7 @@#include "cudbg_if.h" #include "cudbg_lib_common.h" +#include "cudbg_entity.h" #include "cudbg_lib.h" typedef int (*cudbg_collect_callback_t)(struct cudbg_init *pdbg_init,
drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c +40 -238
314 lines not on this page · raw message
Signature · 1 line
2.14.1
PATCH v2 2/6 cxgb4: collect MC memory dump
In reply to Rahul LakkireddyUse meminfo to get base address and size of MC memory. Also use same meminfo for EDC memory dumps.
---
v2:
- No changes.
drivers/net/ethernet/chelsio/cxgb4/cudbg_entity.h | 13 +-- drivers/net/ethernet/chelsio/cxgb4/cudbg_if.h | 2 + drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c | 125 +++++++++++++--------- drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.h | 6 ++ drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c | 18 ++++ 5 files changed, 108 insertions(+), 56 deletions(-)
drivers/net/ethernet/chelsio/cxgb4/cudbg_entity.h +5 -8
@@ -18,17 +18,14 @@ #ifndef __CUDBG_ENTITY_H__ #define __CUDBG_ENTITY_H__ -#define EDC0_FLAG 3 -#define EDC1_FLAG 4 +#define EDC0_FLAG 0 +#define EDC1_FLAG 1 +#define MC_FLAG 2 +#define MC0_FLAG 3 +#define MC1_FLAG 4 #define CUDBG_ENTITY_SIGNATURE 0xCCEDB001 -struct card_mem { - u16 size_edc0; - u16 size_edc1; - u16 mem_flag; -}; - struct cudbg_mbox_log { struct mbox_cmd entry; u32 hi[MBOX_LEN / 8];
drivers/net/ethernet/chelsio/cxgb4/cudbg_if.h +2 -0
@@ -47,6 +47,8 @@ enum cudbg_dbg_entity_type {CUDBG_CIM_OBQ_NCSI =17 ,CUDBG_EDC0 =18 ,CUDBG_EDC1 =19 , +CUDBG_MC0 =20 , +CUDBG_MC1 =21 ,CUDBG_RSS =22 ,CUDBG_RSS_VF_CONF =25 , CUDBG_PATH_MTU = 27,
drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c +77 -48
163 lines not on this page · raw message
drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.h +6 -0
@@ -75,6 +75,12 @@ int cudbg_collect_edc0_meminfo(struct cudbg_init *pdbg_init,int cudbg_collect_edc1_meminfo (struct cudbg_init *pdbg_init,struct cudbg_buffer *dbg_buff,struct cudbg_error *cudbg_err); +int cudbg_collect_mc0_meminfo (struct cudbg_init *pdbg_init, +struct cudbg_buffer *dbg_buff, +struct cudbg_error *cudbg_err); +int cudbg_collect_mc1_meminfo (struct cudbg_init *pdbg_init, +struct cudbg_buffer *dbg_buff, +struct cudbg_error *cudbg_err);int cudbg_collect_rss (struct cudbg_init *pdbg_init,struct cudbg_buffer *dbg_buff,struct cudbg_error *cudbg_err);
drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c +18 -0
@@ -22,6 +22,8 @@static const struct cxgb4_collect_entity cxgb4_collect_mem_dump[] = { {CUDBG_EDC0 , cudbg_collect_edc0_meminfo }, {CUDBG_EDC1 , cudbg_collect_edc1_meminfo }, + {CUDBG_MC0 , cudbg_collect_mc0_meminfo }, + {CUDBG_MC1 , cudbg_collect_mc1_meminfo }, };static const struct cxgb4_collect_entity cxgb4_collect_hw_dump[] = {
@@ -158,6 +160,22 @@ static u32 cxgb4_get_entity_length(struct adapter *adap, u32 entity) } len =cudbg_mbytes_to_bytes (len);break ; +case CUDBG_MC0 : + value =t4_read_reg (adap,MA_TARGET_MEM_ENABLE_A ); +if (value &EXT_MEM0_ENABLE_F ) { + value =t4_read_reg (adap,MA_EXT_MEMORY0_BAR_A ); + len =EXT_MEM0_SIZE_G (value); + } + len =cudbg_mbytes_to_bytes (len); +break ; +case CUDBG_MC1 : + value =t4_read_reg (adap,MA_TARGET_MEM_ENABLE_A ); +if (value &EXT_MEM1_ENABLE_F ) { + value =t4_read_reg (adap,MA_EXT_MEMORY1_BAR_A ); + len =EXT_MEM1_SIZE_G (value); + } + len =cudbg_mbytes_to_bytes (len); +break ;case CUDBG_RSS : len =RSS_NENTRIES *sizeof (u16);break ;
Signature · 1 line
2.14.1
PATCH v2 3/6 cxgb4: collect HMA memory dump
In reply to Rahul Lakkireddy---
v2:
- No changes.
drivers/net/ethernet/chelsio/cxgb4/cudbg_entity.h | 1 + drivers/net/ethernet/chelsio/cxgb4/cudbg_if.h | 1 + drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c | 22 ++++++++++++++++++++++ drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.h | 3 +++ drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | 3 ++- drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c | 12 ++++++++++++ drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c | 2 +- drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 7 +++++-- drivers/net/ethernet/chelsio/cxgb4/t4_regs.h | 4 ++++ 9 files changed, 51 insertions(+), 4 deletions(-)
drivers/net/ethernet/chelsio/cxgb4/cudbg_entity.h +1 -0
@@ -23,6 +23,7 @@#define MC_FLAG 2#define MC0_FLAG 3#define MC1_FLAG 4 +#define HMA_FLAG 5#define CUDBG_ENTITY_SIGNATURE 0xCCEDB001
drivers/net/ethernet/chelsio/cxgb4/cudbg_if.h +1 -0
@@ -77,6 +77,7 @@ enum cudbg_dbg_entity_type {CUDBG_PBT_TABLE =65 ,CUDBG_MBOX_LOG =66 ,CUDBG_HMA_INDIRECT =67 , +CUDBG_HMA =68 , CUDBG_MAX_ENTITY = 70, };
drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c +22 -0
@@ -169,6 +169,17 @@ int cudbg_fill_meminfo(struct adapter *padap, meminfo_buff->avail[i].idx =2 ; i++; } + +if (lo &HMA_MUX_F ) { + hi =t4_read_reg (padap,MA_EXT_MEMORY1_BAR_A ); + meminfo_buff->avail[i].base = +cudbg_mbytes_to_bytes (EXT_MEM1_BASE_G (hi)); + meminfo_buff->avail[i].limit = + meminfo_buff->avail[i].base + +cudbg_mbytes_to_bytes (EXT_MEM1_SIZE_G (hi)); + meminfo_buff->avail[i].idx =5 ; + i++; + } }if (!i)/* no memory available */
@@ -702,6 +713,9 @@ static int cudbg_meminfo_get_mem_index(struct adapter *padap,case MEM_MC1 : flag =MC1_FLAG ;break ; +case MEM_HMA : + flag =HMA_FLAG ; +break ;default :return CUDBG_STATUS_ENTITY_NOT_FOUND ; }
@@ -835,6 +849,14 @@ int cudbg_collect_mc1_meminfo(struct cudbg_init *pdbg_init, MEM_MC1); } +int cudbg_collect_hma_meminfo (struct cudbg_init *pdbg_init, +struct cudbg_buffer *dbg_buff, +struct cudbg_error *cudbg_err) +{ +return cudbg_collect_mem_region (pdbg_init, dbg_buff, cudbg_err, +MEM_HMA ); +} +int cudbg_collect_rss (struct cudbg_init *pdbg_init,struct cudbg_buffer *dbg_buff,struct cudbg_error *cudbg_err)
drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.h +3 -0
@@ -165,6 +165,9 @@ int cudbg_collect_mbox_log(struct cudbg_init *pdbg_init,int cudbg_collect_hma_indirect (struct cudbg_init *pdbg_init,struct cudbg_buffer *dbg_buff,struct cudbg_error *cudbg_err); +int cudbg_collect_hma_meminfo (struct cudbg_init *pdbg_init, +struct cudbg_buffer *dbg_buff, +struct cudbg_error *cudbg_err);struct cudbg_entity_hdr *cudbg_get_entity_hdr (void *outbuf,int i); void cudbg_align_debug_buffer(struct cudbg_buffer *dbg_buff,
drivers/net/ethernet/chelsio/cxgb4/cxgb4.h +2 -1
@@ -77,7 +77,8 @@ enum {MEM_EDC1 ,MEM_MC ,MEM_MC0 =MEM_MC , -MEM_MC1 +MEM_MC1 , + MEM_HMA, }; enum {
drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c +12 -0
@@ -24,6 +24,7 @@ static const struct cxgb4_collect_entity cxgb4_collect_mem_dump[] = { { CUDBG_EDC1, cudbg_collect_edc1_meminfo }, { CUDBG_MC0, cudbg_collect_mc0_meminfo }, { CUDBG_MC1, cudbg_collect_mc1_meminfo }, + { CUDBG_HMA, cudbg_collect_hma_meminfo }, }; static const struct cxgb4_collect_entity cxgb4_collect_hw_dump[] = {
@@ -285,6 +286,17 @@ static u32 cxgb4_get_entity_length(struct adapter *adap, u32 entity) len =sizeof (struct ireg_buf ) * n; }break ; +case CUDBG_HMA : + value =t4_read_reg (adap,MA_TARGET_MEM_ENABLE_A ); +if (value &HMA_MUX_F ) { +/* In T6, there's no MC1. So, HMA shares MC1 +* address space. +*/ + value =t4_read_reg (adap,MA_EXT_MEMORY1_BAR_A ); + len =EXT_MEM1_SIZE_G (value); + } + len =cudbg_mbytes_to_bytes (len); +break ;default :break ; }
drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c +1 -1
@@ -2811,7 +2811,7 @@ static void mem_region_show(struct seq_file *seq, const char *name,static int meminfo_show (struct seq_file *seq,void *v) {static const char *const memory[] = {"EDC0:" ,"EDC1:" ,"MC:" , -"MC0:" ,"MC1:" }; +"MC0:" ,"MC1:" ,"HMA:" };struct adapter *adap = seq->private;struct cudbg_meminfo meminfo;int i, rc;
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +5 -2
@@ -524,11 +524,14 @@ int t4_memory_rw(struct adapter *adap, int win, int mtype, u32 addr,* MEM_EDC1 = 1 * MEM_MC = 2 -- MEM_MC for chips with only 1 memory controller * MEM_MC1 = 3 -- for chips with 2 memory controllers (e.g. T5) +* MEM_HMA = 4 */ edc_size =EDRAM0_SIZE_G (t4_read_reg (adap,MA_EDRAM0_BAR_A )); -if (mtype !=MEM_MC1 ) +if (mtype ==MEM_HMA ) { + memoffset =2 * (edc_size *1024 *1024 ); + }else if (mtype !=MEM_MC1 ) { memoffset = (mtype * (edc_size *1024 *1024 )); -else { + }else { mc_size =EXT_MEM0_SIZE_G (t4_read_reg (adap,MA_EXT_MEMORY0_BAR_A )); memoffset = (MEM_MC0 * edc_size + mc_size) *1024 *1024 ;
drivers/net/ethernet/chelsio/cxgb4/t4_regs.h +4 -0
@@ -961,6 +961,10 @@#define MA_EXT_MEMORY1_BAR_A 0x7808 +#define HMA_MUX_S 5 +#define HMA_MUX_V (x) ((x) << HMA_MUX_S) +#define HMA_MUX_F HMA_MUX_V(1U) +#define EXT_MEM1_BASE_S 16#define EXT_MEM1_BASE_M 0xfffU#define EXT_MEM1_BASE_G (x) (((x) >> EXT_MEM1_BASE_S) & EXT_MEM1_BASE_M)
Signature · 1 line
2.14.1
PATCH v2 4/6 cxgb4: skip TX and RX payload regions in memory dumps
In reply to Rahul LakkireddyUse meminfo to identify TX and RX payload regions and skip them in collection of EDC, MC, and HMA.
---
v2:
- No changes.
drivers/net/ethernet/chelsio/cxgb4/cudbg_entity.h | 7 ++ drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c | 141 ++++++++++++++++++++++ 2 files changed, 148 insertions(+)
drivers/net/ethernet/chelsio/cxgb4/cudbg_entity.h +7 -0
@@ -95,6 +95,13 @@ static const char * const cudbg_region[] = {"On-chip queues:" }; +/* Memory region info relative to current memory (i.e. wrt 0). */ +struct cudbg_region_info { +bool exist;/* Does region exists in current memory? */ +u32 start;/* Start wrt 0 */ +u32 end;/* End wrt 0 */ +}; +struct cudbg_mem_desc {u32 base;u32 limit;
drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c +141 -0
170 lines not on this page · raw message
Signature · 1 line
2.14.1
PATCH v2 5/6 cxgb4: collect egress and ingress SGE queue contexts
In reply to Rahul LakkireddyUse meminfo to identify the egress and ingress context regions and fetch all valid contexts from those regions. Also flush all contexts before attempting collection to prevent stale information.
---
v2:
- No changes.
drivers/net/ethernet/chelsio/cxgb4/cudbg_entity.h | 1 + drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c | 218 ++++++++++++++++++++-- drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | 2 +- drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 2 +- drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 7 +- drivers/net/ethernet/chelsio/cxgb4/t4_hw.h | 4 +- 6 files changed, 210 insertions(+), 24 deletions(-)
drivers/net/ethernet/chelsio/cxgb4/cudbg_entity.h +1 -0
@@ -185,6 +185,7 @@ struct cudbg_tid_info_region_rev1 {u32 reserved[16 ]; }; +#define CUDBG_LOWMEM_MAX_CTXT_QIDS 256#define CUDBG_MAX_FL_QIDS 1024struct cudbg_ch_cntxt {
drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c +199 -19
260 lines not on this page · raw message
drivers/net/ethernet/chelsio/cxgb4/cxgb4.h +1 -1
@@ -1654,7 +1654,7 @@ int t4_ctrl_eq_free(struct adapter *adap, unsigned int mbox, unsigned int pf, unsigned int vf, unsigned int eqid);int t4_ofld_eq_free (struct adapter *adap,unsigned int mbox,unsigned int pf,unsigned int vf,unsigned int eqid); -int t4_sge_ctxt_flush (struct adapter *adap,unsigned int mbox); +int t4_sge_ctxt_flush (struct adapter *adap,unsigned int mbox,int ctxt_type);void t4_handle_get_port_info (struct port_info *pi,const __be64 *rpl);int t4_update_port_info (struct port_info *pi); int t4_get_link_params(struct port_info *pi, unsigned int *link_okp,
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +1 -1
@@ -1673,7 +1673,7 @@ int cxgb4_flush_eq_cache(struct net_device *dev) {struct adapter *adap =netdev2adap (dev); -return t4_sge_ctxt_flush (adap, adap->mbox); +return t4_sge_ctxt_flush (adap, adap->mbox,CTXT_EGRESS ); }EXPORT_SYMBOL (cxgb4_flush_eq_cache);
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +5 -2
@@ -6530,18 +6530,21 @@ void t4_sge_decode_idma_state(struct adapter *adapter, int state)* t4_sge_ctxt_flush - flush the SGE context cache * @adap: the adapter * @mbox: mailbox to use for the FW command +* @ctx_type: Egress or Ingress * * Issues a FW command through the given mailbox to flush the * SGE context cache. */ -int t4_sge_ctxt_flush (struct adapter *adap,unsigned int mbox) +int t4_sge_ctxt_flush (struct adapter *adap,unsigned int mbox,int ctxt_type) {int ret;u32 ldst_addrspace;struct fw_ldst_cmd c;memset (&c,0 ,sizeof (c)); - ldst_addrspace =FW_LDST_CMD_ADDRSPACE_V (FW_LDST_ADDRSPC_SGE_EGRC ); + ldst_addrspace =FW_LDST_CMD_ADDRSPACE_V (ctxt_type ==CTXT_EGRESS ? +FW_LDST_ADDRSPC_SGE_EGRC : +FW_LDST_ADDRSPC_SGE_INGC ); c.op_to_addrspace =cpu_to_be32 (FW_CMD_OP_V (FW_LDST_CMD ) |FW_CMD_REQUEST_F |FW_CMD_READ_F | ldst_addrspace);
drivers/net/ethernet/chelsio/cxgb4/t4_hw.h +3 -1
@@ -70,7 +70,9 @@ enum {/* SGE context types */ enum ctxt_type { -CTXT_FLM =2 , +CTXT_EGRESS , +CTXT_INGRESS , +CTXT_FLM ,CTXT_CNM , };
Signature · 1 line
2.14.1
PATCH v2 6/6 cxgb4: collect PCIe configuration logs
In reply to Rahul Lakkireddy---
v2:
- No changes.
drivers/net/ethernet/chelsio/cxgb4/cudbg_entity.h | 19 ++++++++++++++++ drivers/net/ethernet/chelsio/cxgb4/cudbg_if.h | 1 + drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c | 27 +++++++++++++++++++++++ drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.h | 3 +++ drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c | 4 ++++ 5 files changed, 54 insertions(+)
drivers/net/ethernet/chelsio/cxgb4/cudbg_entity.h +19 -0
@@ -375,6 +375,25 @@ static const u32 t5_pm_tx_array[][IREG_NUM_ELEM] = { {0x8FF0, 0x8FF4, 0x10021, 0x1D}, /* t5_pm_tx_regs_10021_to_1003c */ }; +#define CUDBG_NUM_PCIE_CONFIG_REGS 0x61 + +static const u32 t5_pcie_config_array[][2 ] = { + {0x0 ,0x34 }, + {0x3c ,0x40 }, + {0x50 ,0x64 }, + {0x70 ,0x80 }, + {0x94 ,0xa0 }, + {0xb0 ,0xb8 }, + {0xd0 ,0xd4 }, + {0x100 ,0x128 }, + {0x140 ,0x148 }, + {0x150 ,0x164 }, + {0x170 ,0x178 }, + {0x180 ,0x194 }, + {0x1a0 ,0x1b8 }, + {0x1c0 ,0x208 }, +}; +static const u32 t6_ma_ireg_array[][IREG_NUM_ELEM ] = { {0x78f8 ,0x78fc ,0xa000 ,23 },/* t6_ma_regs_a000_to_a016 */ {0x78f8, 0x78fc, 0xa400, 30}, /* t6_ma_regs_a400_to_a41e */
drivers/net/ethernet/chelsio/cxgb4/cudbg_if.h +1 -0
@@ -66,6 +66,7 @@ enum cudbg_dbg_entity_type {CUDBG_PCIE_INDIRECT =50 ,CUDBG_PM_INDIRECT =51 ,CUDBG_TID_INFO =54 , +CUDBG_PCIE_CONFIG =55 ,CUDBG_DUMP_CONTEXT =56 ,CUDBG_MPS_TCAM =57 , CUDBG_VPD_DATA = 58,
drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c +27 -0
@@ -1594,6 +1594,33 @@ int cudbg_collect_tid(struct cudbg_init *pdbg_init,return rc; } +int cudbg_collect_pcie_config (struct cudbg_init *pdbg_init, +struct cudbg_buffer *dbg_buff, +struct cudbg_error *cudbg_err) +{ +struct adapter *padap = pdbg_init->adap; +struct cudbg_buffer temp_buff = {0 }; +u32 size, *value, j; +int i, rc, n; + + size =sizeof (u32) *CUDBG_NUM_PCIE_CONFIG_REGS ; + n =sizeof (t5_pcie_config_array) / (2 *sizeof (u32)); + rc =cudbg_get_buff (dbg_buff, size, &temp_buff); +if (rc) +return rc; + + value = (u32 *)temp_buff.data; +for (i =0 ; i < n; i++) { +for (j = t5_pcie_config_array[i][0 ]; + j <= t5_pcie_config_array[i][1 ]; j +=4 ) { +t4_hw_pci_read_cfg4 (padap, j, value); + value++; + } + } +cudbg_write_and_release_buff (&temp_buff, dbg_buff); +return rc; +} +static int cudbg_sge_ctxt_check_valid (u32 *buf,int type) {int index, bit, bit_pos =0 ;
drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.h +3 -0
@@ -132,6 +132,9 @@ int cudbg_collect_pm_indirect(struct cudbg_init *pdbg_init,int cudbg_collect_tid (struct cudbg_init *pdbg_init,struct cudbg_buffer *dbg_buff,struct cudbg_error *cudbg_err); +int cudbg_collect_pcie_config (struct cudbg_init *pdbg_init, +struct cudbg_buffer *dbg_buff, +struct cudbg_error *cudbg_err);int cudbg_collect_dump_context (struct cudbg_init *pdbg_init,struct cudbg_buffer *dbg_buff,struct cudbg_error *cudbg_err);
drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c +4 -0
@@ -63,6 +63,7 @@ static const struct cxgb4_collect_entity cxgb4_collect_hw_dump[] = { { CUDBG_PCIE_INDIRECT, cudbg_collect_pcie_indirect }, { CUDBG_PM_INDIRECT, cudbg_collect_pm_indirect }, { CUDBG_TID_INFO, cudbg_collect_tid }, + { CUDBG_PCIE_CONFIG, cudbg_collect_pcie_config }, { CUDBG_DUMP_CONTEXT, cudbg_collect_dump_context }, { CUDBG_MPS_TCAM, cudbg_collect_mps_tcam }, { CUDBG_VPD_DATA, cudbg_collect_vpd_data },
@@ -241,6 +242,9 @@ static u32 cxgb4_get_entity_length(struct adapter *adap, u32 entity)case CUDBG_TID_INFO : len =sizeof (struct cudbg_tid_info_region_rev1 );break ; +case CUDBG_PCIE_CONFIG : + len =sizeof (u32) *CUDBG_NUM_PCIE_CONFIG_REGS ; +break ;case CUDBG_DUMP_CONTEXT : len =cudbg_dump_context_size (adap);break ;
Signature · 1 line
2.14.1
David Miller
maintainerFrom: Rahul Lakkireddy <[email protected]>
Date: Fri, 8 Dec 2017 09:48:35 +0530
Quoted 13 lines
Collect more hardware logs via ethtool --get-dump facility.
Patch 1 collects on-chip memory layout information.
Patch 2 collects on-chip MC memory dumps.
Patch 3 collects HMA memory dump.
Patch 4 evaluates and skips TX and RX payload regions in memory dumps.
Patch 5 collects egress and ingress SGE queue contexts.
Patch 6 collects PCIe configuration logs
...
Quoted 3 lines
---
v2:
- Fix uninitialized variable "size" build warning in Patch 1.
That looks better, series applied, thanks.