Commit 1620efa4 authored by Junxin Chen's avatar Junxin Chen Committed by Fengyan
Browse files

UNIC: add support for tc speed limitation

driver inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I850RQ


CVE: NA

---------------------------------------------------

In UB mode, support for 5 TC is required, while alse needing support for
TC-level rate limiting to differentiate between services.

This patch adds support for UB on the basis of originally only supporting
TC speed limit in ROH mode.

Signed-off-by: default avatarJunxin Chen <chenjunxin1@huawei.com>
parent 97d2f809
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -523,7 +523,8 @@ static int hclge_mqprio_qopt_check_rate(struct hclge_dev *hdev, u64 min_rate,
	if (!max_rate)
		return 0;

	if (hnae3_dev_roh_supported(hdev)) {
	if (hnae3_dev_roh_supported(hdev) ||
	    hnae3_dev_ubl_supported(hdev->ae_dev)) {
		if (max_rate < TM_RATE_PORT_RATE_SCALE ||
		    max_speed > hdev->hw.mac.max_speed) {
			dev_err(&hdev->pdev->dev,
@@ -624,7 +625,7 @@ static int hclge_config_tc(struct hclge_dev *hdev,
	if (ret)
		return ret;

	if (hnae3_dev_roh_supported(hdev))
	if (hnae3_dev_roh_supported(hdev) || hnae3_dev_ubl_supported(hdev->ae_dev))
		return hclge_tm_set_tc_rate_limit(hdev, tc_info);

	return 0;
+2 −1
Original line number Diff line number Diff line
@@ -1734,7 +1734,8 @@ int hclge_tm_init_hw(struct hclge_dev *hdev, bool init)
	if (ret)
		return ret;

	if (hnae3_dev_roh_supported(hdev))
	if (hnae3_dev_roh_supported(hdev) ||
	    hnae3_dev_ubl_supported(hdev->ae_dev))
		return hclge_tm_set_tc_rate_limit(hdev, tc_info);

	return 0;