aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
diff options
context:
space:
mode:
authorYufeng Mo <moyufeng@huawei.com>2021-05-14 11:25:16 +0800
committerDavid S. Miller <davem@davemloft.net>2021-05-14 15:07:34 -0700
commitd658ff34dd7ff9ccf13c59a7c464b55ca122977d (patch)
treea0e536b59e7ca73adeed315cb868873bfbc9d461 /drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
parentnet: hns3: refactor dump mng tbl of debugfs (diff)
downloadlinux-dev-d658ff34dd7ff9ccf13c59a7c464b55ca122977d.tar.xz
linux-dev-d658ff34dd7ff9ccf13c59a7c464b55ca122977d.zip
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>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c')
-rw-r--r--drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
index 4af997d6bd59..d2e3965c66d4 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
@@ -97,6 +97,13 @@ static struct hns3_dbg_cmd_info hns3_dbg_cmd[] = {
.buf_len = HNS3_DBG_READ_LEN,
.init = hns3_dbg_common_file_init,
},
+ {
+ .name = "loopback",
+ .cmd = HNAE3_DBG_CMD_LOOPBACK,
+ .dentry = HNS3_DBG_DENTRY_COMMON,
+ .buf_len = HNS3_DBG_READ_LEN,
+ .init = hns3_dbg_common_file_init,
+ },
};
static struct hns3_dbg_cap_info hns3_dbg_cap[] = {
@@ -495,7 +502,6 @@ static void hns3_dbg_help(struct hnae3_handle *h)
dev_info(&h->pdev->dev, "dump m7 info\n");
dev_info(&h->pdev->dev, "dump ncl_config <offset> <length>(in hex)\n");
dev_info(&h->pdev->dev, "dump mac tnl status\n");
- dev_info(&h->pdev->dev, "dump loopback\n");
dev_info(&h->pdev->dev, "dump qs shaper [qs id]\n");
dev_info(&h->pdev->dev, "dump intr\n");