net: hns3: refactor dump loopback of debugfs
authorYufeng Mo <moyufeng@huawei.com>
Fri, 14 May 2021 03:25:16 +0000 (11:25 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 14 May 2021 22:07:34 +0000 (15:07 -0700)
commitd658ff34dd7ff9ccf13c59a7c464b55ca122977d
treea0e536b59e7ca73adeed315cb868873bfbc9d461
parent8ddfd9c46ef49ed75abc745c1f90532a2abb8f01
net: hns3: refactor dump loopback of debugfs

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

The display style is below:
$ cat loopback
mac id: 0
app loopback: off
serdes serial loopback: off
serdes parallel loopback: off

Signed-off-by: Yufeng Mo <moyufeng@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