.buf_len = HNS3_DBG_READ_LEN_128KB,
                .init = hns3_dbg_common_file_init,
        },
+       {
+               .name = "mac_tnl_status",
+               .cmd = HNAE3_DBG_CMD_MAC_TNL_STATUS,
+               .dentry = HNS3_DBG_DENTRY_COMMON,
+               .buf_len = HNS3_DBG_READ_LEN,
+               .init = hns3_dbg_common_file_init,
+       },
        {
                .name = "bios_common",
                .cmd = HNAE3_DBG_CMD_REG_BIOS_COMMON,
 static void hns3_dbg_help(struct hnae3_handle *h)
 {
        dev_info(&h->pdev->dev, "available commands\n");
-
-       if (!hns3_is_phys_func(h->pdev))
-               return;
-
-       dev_info(&h->pdev->dev, "dump mac tnl status\n");
 }
 
 static void
 
 /* hclge_dbg_dump_mac_tnl_status: print message about mac tnl interrupt
  * @hdev: pointer to struct hclge_dev
  */
-static void hclge_dbg_dump_mac_tnl_status(struct hclge_dev *hdev)
+static int
+hclge_dbg_dump_mac_tnl_status(struct hclge_dev *hdev, char *buf, int len)
 {
 #define HCLGE_BILLION_NANO_SECONDS 1000000000
 
        struct hclge_mac_tnl_stats stats;
        unsigned long rem_nsec;
+       int pos = 0;
 
-       dev_info(&hdev->pdev->dev, "Recently generated mac tnl interruption:\n");
+       pos += scnprintf(buf + pos, len - pos,
+                        "Recently generated mac tnl interruption:\n");
 
        while (kfifo_get(&hdev->mac_tnl_log, &stats)) {
                rem_nsec = do_div(stats.time, HCLGE_BILLION_NANO_SECONDS);
-               dev_info(&hdev->pdev->dev, "[%07lu.%03lu] status = 0x%x\n",
-                        (unsigned long)stats.time, rem_nsec / 1000,
-                        stats.status);
+
+               pos += scnprintf(buf + pos, len - pos,
+                                "[%07lu.%03lu] status = 0x%x\n",
+                                (unsigned long)stats.time, rem_nsec / 1000,
+                                stats.status);
        }
+
+       return 0;
 }
 
 
 
        if (strncmp(cmd_buf, "dump serv info", 14) == 0) {
                hclge_dbg_dump_serv_info(hdev);
-       } else if (strncmp(cmd_buf, "dump mac tnl status", 19) == 0) {
-               hclge_dbg_dump_mac_tnl_status(hdev);
        } else {
                dev_info(&hdev->pdev->dev, "unknown command\n");
                return -EINVAL;
                .cmd = HNAE3_DBG_CMD_FD_TCAM,
                .dbg_dump = hclge_dbg_dump_fd_tcam,
        },
+       {
+               .cmd = HNAE3_DBG_CMD_MAC_TNL_STATUS,
+               .dbg_dump = hclge_dbg_dump_mac_tnl_status,
+       },
 };
 
 int hclge_dbg_read_cmd(struct hnae3_handle *handle, enum hnae3_dbg_cmd cmd,