Re: [PATCH net-next v4] net: mana: Expose hardware diagnostic info via debugfs
From: Simon Horman
Date: Fri Mar 20 2026 - 05:57:27 EST
On Thu, Mar 19, 2026 at 12:09:13AM -0700, Erni Sri Satya Vennela wrote:
> Add debugfs entries to expose hardware configuration and diagnostic
> information that aids in debugging driver initialization and runtime
> operations without adding noise to dmesg.
>
> The debugfs directory creation and removal for each PCI device is
> integrated into mana_gd_setup() and mana_gd_cleanup_device()
> respectively, so that all callers (probe, remove, suspend, resume,
> shutdown) share a single code path.
>
> Device-level entries (under /sys/kernel/debug/mana/<slot>/):
> - num_msix_usable, max_num_queues: Max resources from hardware
> - gdma_protocol_ver, pf_cap_flags1: VF version negotiation results
> - num_vports, bm_hostmode: Device configuration
>
> Per-vPort entries (under /sys/kernel/debug/mana/<slot>/vportN/):
> - port_handle: Hardware vPort handle
> - max_sq, max_rq: Max queues from vPort config
> - indir_table_sz: Indirection table size
> - steer_rx, steer_rss, steer_update_tab, steer_cqe_coalescing:
> Last applied steering configuration parameters
>
> Signed-off-by: Erni Sri Satya Vennela <ernis@xxxxxxxxxxxxxxxxxxx>
> ---
> Changes in v4:
> * Rebase and fix conflicts.
> Changes in v3:
> * Rename mana_gd_cleanup to mana_gd_cleanup_device.
> * Add creation of debugfs entries in mana_gd_setup.
> * Add removal of debugfs entries in mana_gd_cleanup_device.
> * Remove bm_hostmode and num_vports from debugfs in mana_remove itself,
> because "ac" gets freed before debugfs_remove_recursive, to avoid
> Use-After-Free error.
> * Add "goto out:" in mana_cfg_vport_steering to avoid populating apc
> values when resp.hdr.status is not NULL.
Thanks for the updates.
Reviewed-by: Simon Horman <horms@xxxxxxxxxx>