net: hns3: add enabled TC numbers and DWRR weight info in debugfs
authorYonglong Liu <liuyonglong@huawei.com>
Wed, 19 Feb 2020 01:23:31 +0000 (09:23 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 20 Feb 2020 00:25:12 +0000 (16:25 -0800)
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 <liuyonglong@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c

index 67fad80035d3a76f6f5f74c95400ad05db81814e..5e94b35b05c09923581ff1969b9c7a6c187dbc5b 100644 (file)
@@ -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);