cxgb4: collect LE-TCAM and SGE queue contexts
Subsystems (3)
cover cxgb4: collect LE-TCAM and SGE queue contexts
Collect hardware dumps via ethtool --get-dump facility.
Patch 1 collects LE-TCAM dump.
Patch 2 collects SGE queue context dumps.
Thanks,
Rahul
Rahul Lakkireddy (2):
cxgb4: collect LE-TCAM dump
cxgb4: collect SGE queue context dump
drivers/net/ethernet/chelsio/cxgb4/cudbg_entity.h | 38 ++++ drivers/net/ethernet/chelsio/cxgb4/cudbg_if.h | 2 + drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c | 253 ++++++++++++++++++++++ drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.h | 11 + drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | 4 + drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c | 11 + drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 62 ++++++ drivers/net/ethernet/chelsio/cxgb4/t4_hw.h | 7 + drivers/net/ethernet/chelsio/cxgb4/t4_regs.h | 68 ++++++ 9 files changed, 456 insertions(+)
Signature · 1 line
2.14.1
PATCH 1/2 cxgb4: collect LE-TCAM dump
--- drivers/net/ethernet/chelsio/cxgb4/cudbg_entity.h | 30 ++++ drivers/net/ethernet/chelsio/cxgb4/cudbg_if.h | 1 + drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c | 175 ++++++++++++++++++++++ drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.h | 7 + drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c | 7 + drivers/net/ethernet/chelsio/cxgb4/t4_regs.h | 41 +++++ 6 files changed, 261 insertions(+)
drivers/net/ethernet/chelsio/cxgb4/cudbg_entity.h +30 -0
@@ -185,6 +185,36 @@ struct cudbg_vpd_data {u32 vpd_vers; }; +#define CUDBG_MAX_TCAM_TID 0x800 + +enum cudbg_le_entry_types { +LE_ET_UNKNOWN =0 , +LE_ET_TCAM_CON =1 , +LE_ET_TCAM_SERVER =2 , +LE_ET_TCAM_FILTER =3 , +LE_ET_TCAM_CLIP =4 , +LE_ET_TCAM_ROUTING =5 , +LE_ET_HASH_CON =6 , +LE_ET_INVALID_TID =8 , +}; + +struct cudbg_tcam { +u32 filter_start; +u32 server_start; +u32 clip_start; +u32 routing_start; +u32 tid_hash_base; +u32 max_tid; +}; + +struct cudbg_tid_data { +u32 tid; +u32 dbig_cmd; +u32 dbig_conf; +u32 dbig_rsp_stat; +u32 data[NUM_LE_DB_DBGI_RSP_DATA_INSTANCES ]; +}; +#define CUDBG_NUM_ULPTX 11#define CUDBG_NUM_ULPTX_READ 512
drivers/net/ethernet/chelsio/cxgb4/cudbg_if.h +1 -0
@@ -65,6 +65,7 @@ enum cudbg_dbg_entity_type {CUDBG_TID_INFO =54 ,CUDBG_MPS_TCAM =57 ,CUDBG_VPD_DATA =58 , +CUDBG_LE_TCAM =59 ,CUDBG_CCTRL =60 ,CUDBG_MA_INDIRECT =61 , CUDBG_ULPTX_LA = 62,
drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c +175 -0
181 lines not on this page · raw message
drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.h +7 -0
@@ -129,6 +129,9 @@ int cudbg_collect_mps_tcam(struct cudbg_init *pdbg_init,int cudbg_collect_vpd_data (struct cudbg_init *pdbg_init,struct cudbg_buffer *dbg_buff,struct cudbg_error *cudbg_err); +int cudbg_collect_le_tcam (struct cudbg_init *pdbg_init, +struct cudbg_buffer *dbg_buff, +struct cudbg_error *cudbg_err);int cudbg_collect_cctrl (struct cudbg_init *pdbg_init,struct cudbg_buffer *dbg_buff,struct cudbg_error *cudbg_err);
@@ -155,4 +158,8 @@ struct cudbg_entity_hdr *cudbg_get_entity_hdr(void *outbuf, int i);void cudbg_align_debug_buffer (struct cudbg_buffer *dbg_buff,struct cudbg_entity_hdr *entity_hdr);u32 cudbg_cim_obq_size (struct adapter *padap,int qid); + +struct cudbg_tcam ; +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 +7 -0
@@ -62,6 +62,7 @@ static const struct cxgb4_collect_entity cxgb4_collect_hw_dump[] = { { CUDBG_TID_INFO, cudbg_collect_tid }, { CUDBG_MPS_TCAM, cudbg_collect_mps_tcam }, { CUDBG_VPD_DATA, cudbg_collect_vpd_data }, + { CUDBG_LE_TCAM, cudbg_collect_le_tcam }, { CUDBG_CCTRL, cudbg_collect_cctrl }, { CUDBG_MA_INDIRECT, cudbg_collect_ma_indirect }, { CUDBG_ULPTX_LA, cudbg_collect_ulptx_la },
@@ -72,6 +73,7 @@ static const struct cxgb4_collect_entity cxgb4_collect_hw_dump[] = {static u32 cxgb4_get_entity_length (struct adapter *adap,u32 entity) { +struct cudbg_tcam tcam_region = {0 };u32 value, n =0 , len =0 ;switch (entity) {
@@ -223,6 +225,11 @@ static u32 cxgb4_get_entity_length(struct adapter *adap, u32 entity)case CUDBG_VPD_DATA : len =sizeof (struct cudbg_vpd_data );break ; +case CUDBG_LE_TCAM : +cudbg_fill_le_tcam_info (adap, &tcam_region); + len =sizeof (struct cudbg_tcam ) + +sizeof (struct cudbg_tid_data ) * tcam_region.max_tid; +break ;case CUDBG_CCTRL : len =sizeof (u16) *NMTUS *NCCTRL_WIN ;break ;
drivers/net/ethernet/chelsio/cxgb4/t4_regs.h +41 -0
64 lines not on this page · raw message
Signature · 1 line
2.14.1
PATCH 2/2 cxgb4: collect SGE queue context dump
In reply to Rahul LakkireddyCollect SGE freelist queue and congestion manager contexts.
--- drivers/net/ethernet/chelsio/cxgb4/cudbg_entity.h | 8 +++ drivers/net/ethernet/chelsio/cxgb4/cudbg_if.h | 1 + drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c | 78 +++++++++++++++++++++++ drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.h | 4 ++ drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | 4 ++ drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c | 4 ++ drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 62 ++++++++++++++++++ drivers/net/ethernet/chelsio/cxgb4/t4_hw.h | 7 ++ drivers/net/ethernet/chelsio/cxgb4/t4_regs.h | 27 ++++++++ 9 files changed, 195 insertions(+)
drivers/net/ethernet/chelsio/cxgb4/cudbg_entity.h +8 -0
@@ -145,6 +145,14 @@ struct cudbg_tid_info_region_rev1 {u32 reserved[16 ]; }; +#define CUDBG_MAX_FL_QIDS 1024 + +struct cudbg_ch_cntxt { +u32 cntxt_type; +u32 cntxt_id; +u32 data[SGE_CTXT_SIZE /4 ]; +}; +#define CUDBG_MAX_RPLC_SIZE 128struct cudbg_mps_tcam {
drivers/net/ethernet/chelsio/cxgb4/cudbg_if.h +1 -0
@@ -63,6 +63,7 @@ enum cudbg_dbg_entity_type {CUDBG_PCIE_INDIRECT =50 ,CUDBG_PM_INDIRECT =51 ,CUDBG_TID_INFO =54 , +CUDBG_DUMP_CONTEXT =56 ,CUDBG_MPS_TCAM =57 ,CUDBG_VPD_DATA =58 , CUDBG_LE_TCAM = 59,
drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c +78 -0
84 lines not on this page · raw message
drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.h +4 -0
@@ -123,6 +123,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_dump_context (struct cudbg_init *pdbg_init, +struct cudbg_buffer *dbg_buff, +struct cudbg_error *cudbg_err);int cudbg_collect_mps_tcam (struct cudbg_init *pdbg_init,struct cudbg_buffer *dbg_buff,struct cudbg_error *cudbg_err);
@@ -158,6 +161,7 @@ struct cudbg_entity_hdr *cudbg_get_entity_hdr(void *outbuf, int i);void cudbg_align_debug_buffer (struct cudbg_buffer *dbg_buff,struct cudbg_entity_hdr *entity_hdr);u32 cudbg_cim_obq_size (struct adapter *padap,int qid); +int cudbg_dump_context_size (struct adapter *padap);struct cudbg_tcam ; void cudbg_fill_le_tcam_info(struct adapter *padap,
drivers/net/ethernet/chelsio/cxgb4/cxgb4.h +4 -0
@@ -1670,6 +1670,10 @@ int t4_fwaddrspace_write(struct adapter *adap, unsigned int mbox,void t4_read_pace_tbl (struct adapter *adap,unsigned int pace_vals[NTX_SCHED ]);void t4_get_tx_sched (struct adapter *adap,unsigned int sched,unsigned int *kbps,unsigned int *ipg,bool sleep_ok); +int t4_sge_ctxt_rd (struct adapter *adap,unsigned int mbox,unsigned int cid, +enum ctxt_type ctype,u32 *data); +int t4_sge_ctxt_rd_bd (struct adapter *adap,unsigned int cid, +enum ctxt_type ctype,u32 *data);int t4_sched_params (struct adapter *adapter,int type,int level,int mode,int rateunit,int ratemode,int channel,int class,int minrate,int maxrate,int weight,int pktsize);
drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c +4 -0
@@ -60,6 +60,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_DUMP_CONTEXT, cudbg_collect_dump_context }, { CUDBG_MPS_TCAM, cudbg_collect_mps_tcam }, { CUDBG_VPD_DATA, cudbg_collect_vpd_data }, { CUDBG_LE_TCAM, cudbg_collect_le_tcam },
@@ -218,6 +219,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_DUMP_CONTEXT : + len =cudbg_dump_context_size (adap); +break ;case CUDBG_MPS_TCAM : len =sizeof (struct cudbg_mps_tcam ) * adap->params.arch.mps_tcam_size;
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +62 -0
68 lines not on this page · raw message
drivers/net/ethernet/chelsio/cxgb4/t4_hw.h +7 -0
@@ -68,6 +68,12 @@ enum { ULPRX_LA_SIZE = 512, /* # of 256-bit words in ULP_RX LA */ }; +/* SGE context types */ +enum ctxt_type { +CTXT_FLM =2 , +CTXT_CNM , +}; +enum {SF_PAGE_SIZE =256 ,/* serial flash page size */ SF_SEC_SIZE =64 *1024 ,/* serial flash sector size */
@@ -79,6 +85,7 @@ enum { MBOX_OWNER_NONE, MBOX_OWNER_FW, MBOX_OWNER_DRV }; /* mailbox owners */enum {SGE_MAX_WR_LEN =512 ,/* max WR size in bytes */ +SGE_CTXT_SIZE =24 ,/* size of SGE context */ SGE_NTIMERS =6 ,/* # of interrupt holdoff timer values */ SGE_NCOUNTERS =4 ,/* # of interrupt packet counter values */ SGE_MAX_IQ_SIZE =65520 ,
drivers/net/ethernet/chelsio/cxgb4/t4_regs.h +27 -0
@@ -153,6 +153,23 @@#define T6_DBVFIFO_SIZE_M 0x1fffU#define T6_DBVFIFO_SIZE_G (x) (((x) >> T6_DBVFIFO_SIZE_S) & T6_DBVFIFO_SIZE_M) +#define SGE_CTXT_CMD_A 0x11fc + +#define BUSY_S 31 +#define BUSY_V (x) ((x) << BUSY_S) +#define BUSY_F BUSY_V(1U) + +#define CTXTTYPE_S 24 +#define CTXTTYPE_M 0x3U +#define CTXTTYPE_V (x) ((x) << CTXTTYPE_S) + +#define CTXTQID_S 0 +#define CTXTQID_M 0x1ffffU +#define CTXTQID_V (x) ((x) << CTXTQID_S) + +#define SGE_CTXT_DATA0_A 0x1200 +#define SGE_CTXT_DATA5_A 0x1214 +#define GLOBALENABLE_S 0#define GLOBALENABLE_V (x) ((x) << GLOBALENABLE_S)#define GLOBALENABLE_F GLOBALENABLE_V(1U)
@@ -322,6 +339,16 @@#define SGE_IMSG_CTXT_BADDR_A 0x1088#define SGE_FLM_CACHE_BADDR_A 0x108c +#define SGE_FLM_CFG_A 0x1090 + +#define NOHDR_S 18 +#define NOHDR_V (x) ((x) << NOHDR_S) +#define NOHDR_F NOHDR_V(1U) + +#define HDRSTARTFLQ_S 11 +#define HDRSTARTFLQ_M 0x7U +#define HDRSTARTFLQ_G (x) (((x) >> HDRSTARTFLQ_S) & HDRSTARTFLQ_M) +#define SGE_INGRESS_RX_THRESHOLD_A 0x10a0#define THRESHOLD_0_S 24
Signature · 1 line
2.14.1
David Miller
maintainerFrom: Rahul Lakkireddy <[email protected]>
Date: Sat, 11 Nov 2017 19:48:14 +0530
Quoted 5 lines
Collect hardware dumps via ethtool --get-dump facility.
Patch 1 collects LE-TCAM dump.
Patch 2 collects SGE queue context dumps.
Series applied, thanks.