[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b4ad6d8e-0760-bcea-56a3-dd8d3ffc8237@huawei.com>
Date: Fri, 21 Aug 2020 11:01:58 +0800
From: "luobin (L)" <luobin9@...wei.com>
To: Jakub Kicinski <kuba@...nel.org>
CC: <davem@...emloft.net>, <linux-kernel@...r.kernel.org>,
<netdev@...r.kernel.org>, <luoxianjun@...wei.com>,
<yin.yinshi@...wei.com>, <cloud.wangxiaoyun@...wei.com>,
<chiqijun@...wei.com>
Subject: Re: [PATCH net-next] hinic: add debugfs support
On 2020/8/21 0:02, Jakub Kicinski wrote:
> On Thu, 20 Aug 2020 20:14:32 +0800 Luo bin wrote:
>> +static int hinic_dbg_help(struct hinic_dev *nic_dev, const char *cmd_buf)
>> +{
>> + netif_info(nic_dev, drv, nic_dev->netdev, "Available commands:\n");
>> + netif_info(nic_dev, drv, nic_dev->netdev, "sq info <queue id>\n");
>> + netif_info(nic_dev, drv, nic_dev->netdev, "sq wqe info <queue id> <wqe id>\n");
>> + netif_info(nic_dev, drv, nic_dev->netdev, "rq info <queue id>\n");
>> + netif_info(nic_dev, drv, nic_dev->netdev, "rq wqe info <queue id> <wqe id>\n");
>> + netif_info(nic_dev, drv, nic_dev->netdev, "sq ci table <queue id>\n");
>> + netif_info(nic_dev, drv, nic_dev->netdev, "rq cqe info <queue id> <cqe id>\n");
>> + netif_info(nic_dev, drv, nic_dev->netdev, "mac table\n");
>> + netif_info(nic_dev, drv, nic_dev->netdev, "global table\n");
>> + netif_info(nic_dev, drv, nic_dev->netdev, "func table\n");
>> + netif_info(nic_dev, drv, nic_dev->netdev, "port table\n");
>> + return 0;
>> +}
>> +
>> +static const struct hinic_dbg_cmd_info g_hinic_dbg_cmd[] = {
>> + {"help", hinic_dbg_help},
>> + {"sq info", hinic_dbg_get_sq_info},
>> + {"sq wqe info", hinic_dbg_get_sq_wqe_info},
>> + {"rq info", hinic_dbg_get_rq_info},
>> + {"rq wqe info", hinic_dbg_get_rq_wqe_info},
>> + {"sq ci table", hinic_dbg_get_ci_table},
>> + {"rq cqe info", hinic_dbg_get_rq_cqe_info},
>> + {"mac table", hinic_dbg_get_mac_table},
>> + {"global table", hinic_dbg_get_global_table},
>> + {"func table", hinic_dbg_get_function_table},
>> + {"port table", hinic_dbg_get_port_table},
>> +};
>
> Please don't create command interfaces like this.
>
> Instead create a read only file for objects you want to expose.
>
> Split addition of each object into a separate patch and provide example
> output in the commit message.
> .
>
Will fix. Thanks for your review.
Powered by blists - more mailing lists