2020-02-19 01:24:42

by Huazhong Tan

[permalink] [raw]
Subject: [PATCH net-next 0/4] net: hns3: misc updates for -net-next

This series includes some misc updates for the HNS3
ethernet driver.

[patch 1] modifies an unsuitable print when setting dulex mode.
[patch 2] adds some debugfs info for TC and DWRR.
[patch 3] adds some debugfs info for loopback.
[patch 4] adds a missing help info for QS shaper in debugfs.

Guangbin Huang (1):
net: hns3: modify an unsuitable print when setting unknown duplex to
fibre

Yonglong Liu (2):
net: hns3: add enabled TC numbers and DWRR weight info in debugfs
net: hns3: add missing help info for QS shaper in debugfs

Yufeng Mo (1):
net: hns3: add support for dump MAC ID and loopback status in debugfs

drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c | 2 +
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 2 +-
.../ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c | 63 ++++++++++++++++++++--
.../ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 3 ++
.../ethernet/hisilicon/hns3/hns3pf/hclge_main.h | 1 +
5 files changed, 67 insertions(+), 4 deletions(-)

--
2.7.4


2020-02-19 01:24:50

by Huazhong Tan

[permalink] [raw]
Subject: [PATCH net-next 2/4] net: hns3: add enabled TC numbers and DWRR weight info in debugfs

From: Yonglong Liu <[email protected]>

The actual enabled TC numbers and the DWRR weight of each
TC may be helpful for debugging, so adds them into debugfs.

Signed-off-by: Yonglong Liu <[email protected]>
Signed-off-by: Huazhong Tan <[email protected]>
---
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c
index 67fad80..5e94b35 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c
@@ -310,8 +310,9 @@ static void hclge_title_idx_print(struct hclge_dev *hdev, bool flag, int index,
char *false_buf)
{
if (flag)
- dev_info(&hdev->pdev->dev, "%s(%d): %s\n", title_buf, index,
- true_buf);
+ dev_info(&hdev->pdev->dev, "%s(%d): %s weight: %u\n",
+ title_buf, index, true_buf,
+ hdev->tm_info.pg_info[0].tc_dwrr[index]);
else
dev_info(&hdev->pdev->dev, "%s(%d): %s\n", title_buf, index,
false_buf);
@@ -339,7 +340,8 @@ static void hclge_dbg_dump_tc(struct hclge_dev *hdev)

ets_weight = (struct hclge_ets_tc_weight_cmd *)desc.data;

- dev_info(&hdev->pdev->dev, "dump tc\n");
+ dev_info(&hdev->pdev->dev, "dump tc: %u tc enabled\n",
+ hdev->tm_info.num_tc);
dev_info(&hdev->pdev->dev, "weight_offset: %u\n",
ets_weight->weight_offset);

--
2.7.4

2020-02-19 01:25:20

by Huazhong Tan

[permalink] [raw]
Subject: [PATCH net-next 1/4] net: hns3: modify an unsuitable print when setting unknown duplex to fibre

From: Guangbin Huang <[email protected]>

Currently, if device is in link down status and user uses
'ethtool -s' command to set speed but not specify duplex
mode, the duplex mode passed from ethtool to driver is
unknown value(255), and the fibre port will identify this
value as half duplex mode and print "only copper port
supports half duplex!". This message is confusing.

So for fibre port, only the setting duplex is half, prints
error and returns.

Signed-off-by: Guangbin Huang <[email protected]>
Signed-off-by: Huazhong Tan <[email protected]>
---
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
index c03856e..3f59a19 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
@@ -736,7 +736,7 @@ static int hns3_check_ksettings_param(const struct net_device *netdev,
if (ops->get_media_type)
ops->get_media_type(handle, &media_type, &module_type);

- if (cmd->base.duplex != DUPLEX_FULL &&
+ if (cmd->base.duplex == DUPLEX_HALF &&
media_type != HNAE3_MEDIA_TYPE_COPPER) {
netdev_err(netdev,
"only copper port supports half duplex!");
--
2.7.4

2020-02-19 01:25:44

by Huazhong Tan

[permalink] [raw]
Subject: [PATCH net-next 4/4] net: hns3: add missing help info for QS shaper in debugfs

From: Yonglong Liu <[email protected]>

HNS3 driver can dump QS shaper configs via debugfs, but missing
help info in debugfs for this operation.

Signed-off-by: Yonglong Liu <[email protected]>
Signed-off-by: Huazhong Tan <[email protected]>
---
drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
index 345a84b..e1d8809 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
@@ -261,6 +261,7 @@ static void hns3_dbg_help(struct hnae3_handle *h)
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");

memset(printf_buf, 0, HNS3_DBG_BUF_LEN);
strncat(printf_buf, "dump reg [[bios common] [ssu <port_id>]",
--
2.7.4

2020-02-20 00:26:03

by David Miller

[permalink] [raw]
Subject: Re: [PATCH net-next 0/4] net: hns3: misc updates for -net-next

From: Huazhong Tan <[email protected]>
Date: Wed, 19 Feb 2020 09:23:29 +0800

> This series includes some misc updates for the HNS3
> ethernet driver.
>
> [patch 1] modifies an unsuitable print when setting dulex mode.
> [patch 2] adds some debugfs info for TC and DWRR.
> [patch 3] adds some debugfs info for loopback.
> [patch 4] adds a missing help info for QS shaper in debugfs.

Applied, thanks.