DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Wei Hu (Xavier)" <huwei013@chinasoftinc.com>
To: <dev@dpdk.org>
Cc: <xavier.huwei@huawei.com>
Subject: [dpdk-dev] [PATCH v2 6/9] net/hns3: set max scheduling rate based on actual board
Date: Tue, 29 Sep 2020 20:01:14 +0800	[thread overview]
Message-ID: <20200929120117.50394-7-huwei013@chinasoftinc.com> (raw)
In-Reply-To: <20200929120117.50394-1-huwei013@chinasoftinc.com>

From: Huisong Li <lihuisong@huawei.com>

Currently, max scheduling rates configuration of pg, pri and port are set
to 100000Mbps, which is the maximum bandwidth of hns3 network engine with
revision_id equals 0x21. However, max scheduling rate configuration should
be set to hardware based on the actual hardware board environment.

The max_tm_rate in struct hns3_hw, meaning the rate, is obtained from
firmware. So we should use the variable to configure the max scheduling
rate.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
---
 drivers/net/hns3/hns3_dcb.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/hns3/hns3_dcb.c b/drivers/net/hns3/hns3_dcb.c
index 857e79e..27ae014 100644
--- a/drivers/net/hns3/hns3_dcb.c
+++ b/drivers/net/hns3/hns3_dcb.c
@@ -62,9 +62,9 @@ hns3_shaper_para_calc(struct hns3_hw *hw, uint32_t ir, uint8_t shaper_level,
 		return -EINVAL;
 	}
 
-	if (ir > HNS3_ETHER_MAX_RATE) {
-		hns3_err(hw, "rate(%d) exceeds the rate driver supported "
-			 "HNS3_ETHER_MAX_RATE(%d)", ir, HNS3_ETHER_MAX_RATE);
+	if (ir > hw->max_tm_rate) {
+		hns3_err(hw, "rate(%d) exceeds the max rate(%d) driver "
+			 "supported.", ir, hw->max_tm_rate);
 		return -EINVAL;
 	}
 
@@ -100,7 +100,7 @@ hns3_shaper_para_calc(struct hns3_hw *hw, uint32_t ir, uint8_t shaper_level,
 		 * ir_calc gets minimum value when tick is the maximum value.
 		 * At the same time, value of ir_u_calc can only be increased up
 		 * to eight after the while loop if the value of ir is equal
-		 * to HNS3_ETHER_MAX_RATE.
+		 * to hw->max_tm_rate.
 		 */
 		uint32_t numerator;
 		do {
@@ -736,7 +736,7 @@ hns3_dcb_info_init(struct hns3_hw *hw)
 		hw->dcb_info.pg_dwrr[i] = i ? 0 : BW_MAX_PERCENT;
 		hw->dcb_info.pg_info[i].pg_id = i;
 		hw->dcb_info.pg_info[i].pg_sch_mode = HNS3_SCH_MODE_DWRR;
-		hw->dcb_info.pg_info[i].bw_limit = HNS3_ETHER_MAX_RATE;
+		hw->dcb_info.pg_info[i].bw_limit = hw->max_tm_rate;
 
 		if (i != 0)
 			continue;
@@ -1405,7 +1405,7 @@ hns3_dcb_info_cfg(struct hns3_adapter *hns)
 	hw->dcb_info.pg_dwrr[0] = BW_MAX_PERCENT;
 	hw->dcb_info.pg_info[0].pg_id = 0;
 	hw->dcb_info.pg_info[0].pg_sch_mode = HNS3_SCH_MODE_DWRR;
-	hw->dcb_info.pg_info[0].bw_limit = HNS3_ETHER_MAX_RATE;
+	hw->dcb_info.pg_info[0].bw_limit = hw->max_tm_rate;
 	hw->dcb_info.pg_info[0].tc_bit_map = hw->hw_tc_map;
 
 	/* Each tc has same bw for valid tc by default */
-- 
2.9.5


  parent reply	other threads:[~2020-09-29 12:03 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-29 11:09 [dpdk-dev] [PATCH 0/9] updates and fixes for hns3 PMD driver Wei Hu (Xavier)
2020-09-29 11:09 ` [dpdk-dev] [PATCH 1/9] net/hns3: expand the number of queues for one TC up to 512 Wei Hu (Xavier)
2020-09-29 11:09 ` [dpdk-dev] [PATCH 2/9] net/hns3: maximize the queue number Wei Hu (Xavier)
2020-09-29 11:09 ` [dpdk-dev] [PATCH 3/9] net/hns3: fix error type when validating RSS flow action Wei Hu (Xavier)
2020-09-29 11:09 ` [dpdk-dev] [PATCH 4/9] net/hns3: set suitable type when initial flow error struct Wei Hu (Xavier)
2020-09-29 11:09 ` [dpdk-dev] [PATCH 5/9] net/hns3: offload calculating the shapping para to firmware Wei Hu (Xavier)
2020-09-29 11:09 ` [dpdk-dev] [PATCH 6/9] net/hns3: set max scheduling rate based on actual board Wei Hu (Xavier)
2020-09-29 11:09 ` [dpdk-dev] [PATCH 7/9] net/hns3: support start and stop Tx or Rx queue Wei Hu (Xavier)
2020-09-29 11:09 ` [dpdk-dev] [PATCH 8/9] net/hns3: check return value when reading PCI config space Wei Hu (Xavier)
2020-09-29 11:09 ` [dpdk-dev] [PATCH 9/9] net/hns3: remove redundant return value assignments Wei Hu (Xavier)
2020-09-29 12:01 ` [dpdk-dev] [PATCH v2 0/9] updates and fixes for hns3 PMD driver Wei Hu (Xavier)
2020-09-29 12:01   ` [dpdk-dev] [PATCH v2 1/9] net/hns3: expand the number of queues for one TC up to 512 Wei Hu (Xavier)
2020-09-29 12:01   ` [dpdk-dev] [PATCH v2 2/9] net/hns3: maximize the queue number Wei Hu (Xavier)
2020-09-29 12:01   ` [dpdk-dev] [PATCH v2 3/9] net/hns3: fix error type when validating RSS flow action Wei Hu (Xavier)
2020-09-29 12:01   ` [dpdk-dev] [PATCH v2 4/9] net/hns3: set suitable type when initial flow error struct Wei Hu (Xavier)
2020-09-29 12:01   ` [dpdk-dev] [PATCH v2 5/9] net/hns3: offload calculating the shapping para to firmware Wei Hu (Xavier)
2020-09-29 12:01   ` Wei Hu (Xavier) [this message]
2020-09-29 12:01   ` [dpdk-dev] [PATCH v2 7/9] net/hns3: support start and stop Tx or Rx queue Wei Hu (Xavier)
2020-09-30 22:49     ` Ferruh Yigit
2020-09-30 22:54       ` Ferruh Yigit
2020-09-29 12:01   ` [dpdk-dev] [PATCH v2 8/9] net/hns3: check return value when reading PCI config space Wei Hu (Xavier)
2020-09-29 12:01   ` [dpdk-dev] [PATCH v2 9/9] net/hns3: remove redundant return value assignments Wei Hu (Xavier)
2020-09-30 22:59   ` [dpdk-dev] [PATCH v2 0/9] updates and fixes for hns3 PMD driver Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200929120117.50394-7-huwei013@chinasoftinc.com \
    --to=huwei013@chinasoftinc.com \
    --cc=dev@dpdk.org \
    --cc=xavier.huwei@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).