Commit 00577c8b authored by Yufeng Mo's avatar Yufeng Mo Committed by David S. Miller

net: hns3: refactor the function for dumping tc information in debugfs

Remove some unnecessary parameters of hclge_title_idx_print(),
and rename this function for readability.
Signed-off-by: default avatarYufeng Mo <moyufeng@huawei.com>
Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 77d0cab9
...@@ -428,17 +428,13 @@ static void hclge_dbg_dump_reg_cmd(struct hclge_dev *hdev, const char *cmd_buf) ...@@ -428,17 +428,13 @@ static void hclge_dbg_dump_reg_cmd(struct hclge_dev *hdev, const char *cmd_buf)
} }
} }
static void hclge_title_idx_print(struct hclge_dev *hdev, bool flag, int index, static void hclge_print_tc_info(struct hclge_dev *hdev, bool flag, int index)
char *title_buf, char *true_buf,
char *false_buf)
{ {
if (flag) if (flag)
dev_info(&hdev->pdev->dev, "%s(%d): %s weight: %u\n", dev_info(&hdev->pdev->dev, "tc(%d): no sp mode weight: %u\n",
title_buf, index, true_buf, index, hdev->tm_info.pg_info[0].tc_dwrr[index]);
hdev->tm_info.pg_info[0].tc_dwrr[index]);
else else
dev_info(&hdev->pdev->dev, "%s(%d): %s\n", title_buf, index, dev_info(&hdev->pdev->dev, "tc(%d): sp mode\n", index);
false_buf);
} }
static void hclge_dbg_dump_tc(struct hclge_dev *hdev) static void hclge_dbg_dump_tc(struct hclge_dev *hdev)
...@@ -469,8 +465,7 @@ static void hclge_dbg_dump_tc(struct hclge_dev *hdev) ...@@ -469,8 +465,7 @@ static void hclge_dbg_dump_tc(struct hclge_dev *hdev)
ets_weight->weight_offset); ets_weight->weight_offset);
for (i = 0; i < HNAE3_MAX_TC; i++) for (i = 0; i < HNAE3_MAX_TC; i++)
hclge_title_idx_print(hdev, ets_weight->tc_weight[i], i, hclge_print_tc_info(hdev, ets_weight->tc_weight[i], i);
"tc", "no sp mode", "sp mode");
} }
static void hclge_dbg_dump_tm_pg(struct hclge_dev *hdev) static void hclge_dbg_dump_tm_pg(struct hclge_dev *hdev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment