net: hns3: refactor dump intr of debugfs
authorJiaran Zhang <zhangjiaran@huawei.com>
Fri, 14 May 2021 03:25:17 +0000 (11:25 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 14 May 2021 22:07:34 +0000 (15:07 -0700)
commit9149ca0f115acf44f8473c0a1e464e716c4ca83b
tree52675a77200749b9a1c109400321fa3907dd0cdd
parentd658ff34dd7ff9ccf13c59a7c464b55ca122977d
net: hns3: refactor dump intr of debugfs

Currently, the debugfs command for intr is implemented by
"echo xxxx > cmd", and record the information in dmesg. It's
unnecessary and heavy. To improve it, create a single file
"interrupt_info" for it, and query it by command "cat interrupt_info",
return the result to userspace, rather than record in dmesg.

The display style is below:
$cat interrupt_info
num_nic_msi: 65
num_roce_msi: 65
num_msi_used: 2
num_msi_left: 128

Signed-off-by: Jiaran Zhang <zhangjiaran@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hnae3.h
drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c