diff options
author | Shradha Gupta <shradhagupta@linux.microsoft.com> | 2024-10-08 10:06:15 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2024-10-09 15:42:04 +0300 |
commit | 6607c17c6c5e029da03a90085db22daf518232bf (patch) | |
tree | bea9086c2f85a1634f6c2d1de5d47c31e25e3037 /include/net/mana | |
parent | 1ffcc8d41306fd2e5f140b276820714a26a11cc4 (diff) | |
download | linux-6607c17c6c5e029da03a90085db22daf518232bf.tar.xz |
net: mana: Enable debugfs files for MANA device
Implement debugfs in MANA driver to be able to view RX,TX,EQ queue
specific attributes and dump their gdma queues.
These dumps can be used by other userspace utilities to improve
debuggability and troubleshooting
Following files are added in debugfs:
/sys/kernel/debug/mana/
|-------------- 1
|--------------- EQs
| |------- eq0
| | |---head
| | |---tail
| | |---eq_dump
| |------- eq1
| .
| .
|
|--------------- adapter-MTU
|--------------- vport0
|------- RX-0
| |---cq_budget
| |---cq_dump
| |---cq_head
| |---cq_tail
| |---rq_head
| |---rq_nbuf
| |---rq_tail
| |---rxq_dump
|------- RX-1
.
.
|------- TX-0
| |---cq_budget
| |---cq_dump
| |---cq_head
| |---cq_tail
| |---sq_head
| |---sq_pend_skb_qlen
| |---sq_tail
| |---txq_dump
|------- TX-1
.
.
Signed-off-by: Shradha Gupta <shradhagupta@linux.microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/mana')
-rw-r--r-- | include/net/mana/gdma.h | 6 | ||||
-rw-r--r-- | include/net/mana/mana.h | 8 |
2 files changed, 13 insertions, 1 deletions
diff --git a/include/net/mana/gdma.h b/include/net/mana/gdma.h index de47fa533b15..90f56656b572 100644 --- a/include/net/mana/gdma.h +++ b/include/net/mana/gdma.h @@ -267,7 +267,8 @@ struct gdma_event { struct gdma_queue; struct mana_eq { - struct gdma_queue *eq; + struct gdma_queue *eq; + struct dentry *mana_eq_debugfs; }; typedef void gdma_eq_callback(void *context, struct gdma_queue *q, @@ -365,6 +366,7 @@ struct gdma_irq_context { struct gdma_context { struct device *dev; + struct dentry *mana_pci_debugfs; /* Per-vPort max number of queues */ unsigned int max_num_queues; @@ -878,5 +880,7 @@ int mana_gd_send_request(struct gdma_context *gc, u32 req_len, const void *req, u32 resp_len, void *resp); int mana_gd_destroy_dma_region(struct gdma_context *gc, u64 dma_region_handle); +void mana_register_debugfs(void); +void mana_unregister_debugfs(void); #endif /* _GDMA_H */ diff --git a/include/net/mana/mana.h b/include/net/mana/mana.h index 9b0faa24b758..0d00b24eacaf 100644 --- a/include/net/mana/mana.h +++ b/include/net/mana/mana.h @@ -350,6 +350,7 @@ struct mana_rxq { int xdp_rc; /* XDP redirect return code */ struct page_pool *page_pool; + struct dentry *mana_rx_debugfs; /* MUST BE THE LAST MEMBER: * Each receive buffer has an associated mana_recv_buf_oob. @@ -363,6 +364,8 @@ struct mana_tx_qp { struct mana_cq tx_cq; mana_handle_t tx_object; + + struct dentry *mana_tx_debugfs; }; struct mana_ethtool_stats { @@ -407,6 +410,7 @@ struct mana_context { u16 num_ports; struct mana_eq *eqs; + struct dentry *mana_eqs_debugfs; struct net_device *ports[MAX_PORTS_IN_MANA_DEV]; }; @@ -468,6 +472,9 @@ struct mana_port_context { bool port_st_save; /* Saved port state */ struct mana_ethtool_stats eth_stats; + + /* Debugfs */ + struct dentry *mana_port_debugfs; }; netdev_tx_t mana_start_xmit(struct sk_buff *skb, struct net_device *ndev); @@ -494,6 +501,7 @@ int mana_pre_alloc_rxbufs(struct mana_port_context *apc, int mtu, int num_queues void mana_pre_dealloc_rxbufs(struct mana_port_context *apc); extern const struct ethtool_ops mana_ethtool_ops; +extern struct dentry *mana_debugfs_root; /* A CQ can be created not associated with any EQ */ #define GDMA_CQ_NO_EQ 0xffff |