Commit 73fc9c48 authored by Huazhong Tan's avatar Huazhong Tan Committed by David S. Miller

net: hns3: add interface hclge_tm_bp_setup

Provide a common interface to complete the back pressure settings
of all enabled TCs. So other functions directly call this interface
to complete the corresponding operation.
Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: default avatarYunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 65749f73
...@@ -1228,10 +1228,23 @@ static int hclge_mac_pause_setup_hw(struct hclge_dev *hdev) ...@@ -1228,10 +1228,23 @@ static int hclge_mac_pause_setup_hw(struct hclge_dev *hdev)
return hclge_mac_pause_en_cfg(hdev, tx_en, rx_en); return hclge_mac_pause_en_cfg(hdev, tx_en, rx_en);
} }
static int hclge_tm_bp_setup(struct hclge_dev *hdev)
{
int ret = 0;
int i;
for (i = 0; i < hdev->tm_info.num_tc; i++) {
ret = hclge_bp_setup_hw(hdev, i);
if (ret)
return ret;
}
return ret;
}
int hclge_pause_setup_hw(struct hclge_dev *hdev) int hclge_pause_setup_hw(struct hclge_dev *hdev)
{ {
int ret; int ret;
u8 i;
ret = hclge_pause_param_setup_hw(hdev); ret = hclge_pause_param_setup_hw(hdev);
if (ret) if (ret)
...@@ -1250,13 +1263,7 @@ int hclge_pause_setup_hw(struct hclge_dev *hdev) ...@@ -1250,13 +1263,7 @@ int hclge_pause_setup_hw(struct hclge_dev *hdev)
if (ret) if (ret)
dev_warn(&hdev->pdev->dev, "set pfc pause failed:%d\n", ret); dev_warn(&hdev->pdev->dev, "set pfc pause failed:%d\n", ret);
for (i = 0; i < hdev->tm_info.num_tc; i++) { return hclge_tm_bp_setup(hdev);
ret = hclge_bp_setup_hw(hdev, i);
if (ret)
return ret;
}
return 0;
} }
void hclge_tm_prio_tc_info_update(struct hclge_dev *hdev, u8 *prio_tc) void hclge_tm_prio_tc_info_update(struct hclge_dev *hdev, u8 *prio_tc)
......
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