#ifdef CONFIG_DEBUG_FS
#include <linux/fs.h>
#include <linux/debugfs.h>
#include <linux/module.h>
#include <linux/pci.h>
#include "rvu_struct.h"
#include "rvu_reg.h"
#include "rvu.h"
#include "cgx.h"
#include "lmac_common.h"
#include "npc.h"
#include "rvu_npc_hash.h"
#include "mcs.h"
#define DEBUGFS_DIR_NAME …
enum { … };
enum nix_stat_lf_tx { … };
enum nix_stat_lf_rx { … };
static char *cgx_rx_stats_fields[] = …;
static char *cgx_tx_stats_fields[] = …;
static char *rpm_rx_stats_fields[] = …;
static char *rpm_tx_stats_fields[] = …;
enum cpt_eng_type { … };
#define rvu_dbg_NULL …
#define rvu_dbg_open_NULL …
#define RVU_DEBUG_SEQ_FOPS(name, read_op, write_op) …
#define RVU_DEBUG_FOPS(name, read_op, write_op) …
static void print_nix_qsize(struct seq_file *filp, struct rvu_pfvf *pfvf);
static int rvu_dbg_mcs_port_stats_display(struct seq_file *filp, void *unused, int dir)
{ … }
static int rvu_dbg_mcs_rx_port_stats_display(struct seq_file *filp, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static int rvu_dbg_mcs_tx_port_stats_display(struct seq_file *filp, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static int rvu_dbg_mcs_sa_stats_display(struct seq_file *filp, void *unused, int dir)
{ … }
static int rvu_dbg_mcs_rx_sa_stats_display(struct seq_file *filp, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static int rvu_dbg_mcs_tx_sa_stats_display(struct seq_file *filp, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static int rvu_dbg_mcs_tx_sc_stats_display(struct seq_file *filp, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static int rvu_dbg_mcs_rx_sc_stats_display(struct seq_file *filp, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static int rvu_dbg_mcs_flowid_stats_display(struct seq_file *filp, void *unused, int dir)
{ … }
static int rvu_dbg_mcs_tx_flowid_stats_display(struct seq_file *filp, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static int rvu_dbg_mcs_rx_flowid_stats_display(struct seq_file *filp, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static int rvu_dbg_mcs_tx_secy_stats_display(struct seq_file *filp, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static int rvu_dbg_mcs_rx_secy_stats_display(struct seq_file *filp, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static void rvu_dbg_mcs_init(struct rvu *rvu)
{ … }
#define LMT_MAPTBL_ENTRY_SIZE …
static ssize_t rvu_dbg_lmtst_map_table_display(struct file *filp,
char __user *buffer,
size_t count, loff_t *ppos)
{ … }
RVU_DEBUG_FOPS(…);
static void get_lf_str_list(struct rvu_block block, int pcifunc,
char *lfs)
{ … }
static int get_max_column_width(struct rvu *rvu)
{ … }
static ssize_t rvu_dbg_rsrc_attach_status(struct file *filp,
char __user *buffer,
size_t count, loff_t *ppos)
{ … }
RVU_DEBUG_FOPS(…);
static int rvu_dbg_rvu_pf_cgx_map_display(struct seq_file *filp, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static bool rvu_dbg_is_valid_lf(struct rvu *rvu, int blkaddr, int lf,
u16 *pcifunc)
{ … }
static void print_npa_qsize(struct seq_file *m, struct rvu_pfvf *pfvf)
{ … }
static int rvu_dbg_qsize_display(struct seq_file *filp, void *unsused,
int blktype)
{ … }
static ssize_t rvu_dbg_qsize_write(struct file *filp,
const char __user *buffer, size_t count,
loff_t *ppos, int blktype)
{ … }
static ssize_t rvu_dbg_npa_qsize_write(struct file *filp,
const char __user *buffer,
size_t count, loff_t *ppos)
{ … }
static int rvu_dbg_npa_qsize_display(struct seq_file *filp, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static void print_npa_aura_ctx(struct seq_file *m, struct npa_aq_enq_rsp *rsp)
{ … }
static void print_npa_pool_ctx(struct seq_file *m, struct npa_aq_enq_rsp *rsp)
{ … }
static int rvu_dbg_npa_ctx_display(struct seq_file *m, void *unused, int ctype)
{ … }
static int write_npa_ctx(struct rvu *rvu, bool all,
int npalf, int id, int ctype)
{ … }
static int parse_cmd_buffer_ctx(char *cmd_buf, size_t *count,
const char __user *buffer, int *npalf,
int *id, bool *all)
{ … }
static ssize_t rvu_dbg_npa_ctx_write(struct file *filp,
const char __user *buffer,
size_t count, loff_t *ppos, int ctype)
{ … }
static ssize_t rvu_dbg_npa_aura_ctx_write(struct file *filp,
const char __user *buffer,
size_t count, loff_t *ppos)
{ … }
static int rvu_dbg_npa_aura_ctx_display(struct seq_file *filp, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static ssize_t rvu_dbg_npa_pool_ctx_write(struct file *filp,
const char __user *buffer,
size_t count, loff_t *ppos)
{ … }
static int rvu_dbg_npa_pool_ctx_display(struct seq_file *filp, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static void ndc_cache_stats(struct seq_file *s, int blk_addr,
int ctype, int transaction)
{ … }
static int ndc_blk_cache_stats(struct seq_file *s, int idx, int blk_addr)
{ … }
static int rvu_dbg_npa_ndc_cache_display(struct seq_file *filp, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static int ndc_blk_hits_miss_stats(struct seq_file *s, int idx, int blk_addr)
{ … }
static int rvu_dbg_nix_ndc_rx_cache_display(struct seq_file *filp, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static int rvu_dbg_nix_ndc_tx_cache_display(struct seq_file *filp, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static int rvu_dbg_npa_ndc_hits_miss_display(struct seq_file *filp,
void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static int rvu_dbg_nix_ndc_rx_hits_miss_display(struct seq_file *filp,
void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static int rvu_dbg_nix_ndc_tx_hits_miss_display(struct seq_file *filp,
void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static void print_nix_cn10k_sq_ctx(struct seq_file *m,
struct nix_cn10k_sq_ctx_s *sq_ctx)
{ … }
static void print_tm_tree(struct seq_file *m,
struct nix_aq_enq_rsp *rsp, u64 sq)
{ … }
static int rvu_dbg_nix_tm_tree_display(struct seq_file *m, void *unused)
{ … }
static ssize_t rvu_dbg_nix_tm_tree_write(struct file *filp,
const char __user *buffer,
size_t count, loff_t *ppos)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static void print_tm_topo(struct seq_file *m, u64 schq, u32 lvl)
{ … }
static int rvu_dbg_nix_tm_topo_display(struct seq_file *m, void *unused)
{ … }
static ssize_t rvu_dbg_nix_tm_topo_write(struct file *filp,
const char __user *buffer,
size_t count, loff_t *ppos)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static void print_nix_sq_ctx(struct seq_file *m, struct nix_aq_enq_rsp *rsp)
{ … }
static void print_nix_cn10k_rq_ctx(struct seq_file *m,
struct nix_cn10k_rq_ctx_s *rq_ctx)
{ … }
static void print_nix_rq_ctx(struct seq_file *m, struct nix_aq_enq_rsp *rsp)
{ … }
static void print_nix_cq_ctx(struct seq_file *m, struct nix_aq_enq_rsp *rsp)
{ … }
static int rvu_dbg_nix_queue_ctx_display(struct seq_file *filp,
void *unused, int ctype)
{ … }
static int write_nix_queue_ctx(struct rvu *rvu, bool all, int nixlf,
int id, int ctype, char *ctype_string,
struct seq_file *m)
{ … }
static ssize_t rvu_dbg_nix_queue_ctx_write(struct file *filp,
const char __user *buffer,
size_t count, loff_t *ppos,
int ctype)
{ … }
static ssize_t rvu_dbg_nix_sq_ctx_write(struct file *filp,
const char __user *buffer,
size_t count, loff_t *ppos)
{ … }
static int rvu_dbg_nix_sq_ctx_display(struct seq_file *filp, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static ssize_t rvu_dbg_nix_rq_ctx_write(struct file *filp,
const char __user *buffer,
size_t count, loff_t *ppos)
{ … }
static int rvu_dbg_nix_rq_ctx_display(struct seq_file *filp, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static ssize_t rvu_dbg_nix_cq_ctx_write(struct file *filp,
const char __user *buffer,
size_t count, loff_t *ppos)
{ … }
static int rvu_dbg_nix_cq_ctx_display(struct seq_file *filp, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static void print_nix_qctx_qsize(struct seq_file *filp, int qsize,
unsigned long *bmap, char *qtype)
{ … }
static void print_nix_qsize(struct seq_file *filp, struct rvu_pfvf *pfvf)
{ … }
static ssize_t rvu_dbg_nix_qsize_write(struct file *filp,
const char __user *buffer,
size_t count, loff_t *ppos)
{ … }
static int rvu_dbg_nix_qsize_display(struct seq_file *filp, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static void print_band_prof_ctx(struct seq_file *m,
struct nix_bandprof_s *prof)
{ … }
static int rvu_dbg_nix_band_prof_ctx_display(struct seq_file *m, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static int rvu_dbg_nix_band_prof_rsrc_display(struct seq_file *m, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static void rvu_dbg_nix_init(struct rvu *rvu, int blkaddr)
{ … }
static void rvu_dbg_npa_init(struct rvu *rvu)
{ … }
#define PRINT_CGX_CUML_NIXRX_STATUS(idx, name) …
#define PRINT_CGX_CUML_NIXTX_STATUS(idx, name) …
static int cgx_print_stats(struct seq_file *s, int lmac_id)
{ … }
static int rvu_dbg_derive_lmacid(struct seq_file *filp, int *lmac_id)
{ … }
static int rvu_dbg_cgx_stat_display(struct seq_file *filp, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static int cgx_print_dmac_flt(struct seq_file *s, int lmac_id)
{ … }
static int rvu_dbg_cgx_dmac_flt_display(struct seq_file *filp, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static void rvu_dbg_cgx_init(struct rvu *rvu)
{ … }
static void rvu_print_npc_mcam_info(struct seq_file *s,
u16 pcifunc, int blkaddr)
{ … }
static int rvu_dbg_npc_mcam_info_display(struct seq_file *filp, void *unsued)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static int rvu_dbg_npc_rx_miss_stats_display(struct seq_file *filp,
void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
#define RVU_DBG_PRINT_MPLS_TTL(pkt, mask) … \
#define RVU_DBG_PRINT_MPLS_LBTCBOS(_pkt, _mask) … \
static void rvu_dbg_npc_mcam_show_flows(struct seq_file *s,
struct rvu_npc_mcam_rule *rule)
{ … }
static void rvu_dbg_npc_mcam_show_action(struct seq_file *s,
struct rvu_npc_mcam_rule *rule)
{ … }
static const char *rvu_dbg_get_intf_name(int intf)
{ … }
static int rvu_dbg_npc_mcam_show_rules(struct seq_file *s, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static int rvu_dbg_npc_exact_show_entries(struct seq_file *s, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static int rvu_dbg_npc_exact_show_info(struct seq_file *s, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static int rvu_dbg_npc_exact_drop_cnt(struct seq_file *s, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static void rvu_dbg_npc_init(struct rvu *rvu)
{ … }
static int cpt_eng_sts_display(struct seq_file *filp, u8 eng_type)
{ … }
static int rvu_dbg_cpt_ae_sts_display(struct seq_file *filp, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static int rvu_dbg_cpt_se_sts_display(struct seq_file *filp, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static int rvu_dbg_cpt_ie_sts_display(struct seq_file *filp, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static int rvu_dbg_cpt_engines_info_display(struct seq_file *filp, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static int rvu_dbg_cpt_lfs_info_display(struct seq_file *filp, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static int rvu_dbg_cpt_err_info_display(struct seq_file *filp, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static int rvu_dbg_cpt_pc_display(struct seq_file *filp, void *unused)
{ … }
RVU_DEBUG_SEQ_FOPS(…);
static void rvu_dbg_cpt_init(struct rvu *rvu, int blkaddr)
{ … }
static const char *rvu_get_dbg_dir_name(struct rvu *rvu)
{ … }
void rvu_dbg_init(struct rvu *rvu)
{ … }
void rvu_dbg_exit(struct rvu *rvu)
{ … }
#endif