OSDN Git Service

net: hns3: refactor queue info of debugfs
authorHao Chen <chenhao288@hisilicon.com>
Thu, 20 May 2021 02:21:33 +0000 (10:21 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 20 May 2021 22:01:03 +0000 (15:01 -0700)
commite44c495d95e0dd3a5513f72a830639a72b4c14f1
tree27655f8202ba76c6bb023e1754d85c1fb299c9c3
parentd2f737cf21b87d4239987da69a3b14730c6a57ad
net: hns3: refactor queue info of debugfs

Currently, the debugfs command for queue info is implemented by
"echo xxxx > cmd", and record the information in dmesg. It's
unnecessary and heavy. To improve it, create two files
"rx_queue_info" and "tx_queue_info" for it, and query it
by command "cat rx_queue_info" and "cat tx_queue_info",
return the result to userspace, rather than record in dmesg.

The display style is below:
$ cat rx_queue_info
QUEUE_ID  BD_NUM  BD_LEN  TAIL  HEAD  FBDNUM  PKTNUM   ...
0           0       0     0     0       0       0      ...
1           0       0     0     0       0       0      ...
2           0       0     0     0       0       0      ...

$ cat tx_queue_info
QUEUE_ID  BD_NUM  TC  TAIL  HEAD  FBDNUM  OFFSET  PKTNUM  ...
0           0     0     0     0       0       0        0  ...
1           0     0     0     0       0       0        0  ...
2           0     0     0     0       0       0        0  ...

Signed-off-by: Hao Chen <chenhao288@hisilicon.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/hns3_debugfs.h