Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 72aca95f authored by Guangbin Huang's avatar Guangbin Huang Committed by Greg Kroah-Hartman
Browse files

net: hns3: allow configure ETS bandwidth of all TCs



[ Upstream commit 688db0c7a4a69ddc8b8143a1cac01eb20082a3aa ]

Currently, driver only allow configuring ETS bandwidth of TCs according
to the max TC number queried from firmware. However, the hardware actually
supports 8 TCs and users may need to configure ETS bandwidth of all TCs,
so remove the restriction.

Fixes: 330baff5 ("net: hns3: add ETS TC weight setting in SSU module")
Signed-off-by: default avatarGuangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 07b218db
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -124,7 +124,7 @@ static int hclge_ets_validate(struct hclge_dev *hdev, struct ieee_ets *ets,
	if (ret)
	if (ret)
		return ret;
		return ret;


	for (i = 0; i < hdev->tc_max; i++) {
	for (i = 0; i < HNAE3_MAX_TC; i++) {
		switch (ets->tc_tsa[i]) {
		switch (ets->tc_tsa[i]) {
		case IEEE_8021QAZ_TSA_STRICT:
		case IEEE_8021QAZ_TSA_STRICT:
			if (hdev->tm_info.tc_info[i].tc_sch_mode !=
			if (hdev->tm_info.tc_info[i].tc_sch_mode !=
+1 −8
Original line number Original line Diff line number Diff line
@@ -974,7 +974,6 @@ static int hclge_tm_pri_tc_base_dwrr_cfg(struct hclge_dev *hdev)


static int hclge_tm_ets_tc_dwrr_cfg(struct hclge_dev *hdev)
static int hclge_tm_ets_tc_dwrr_cfg(struct hclge_dev *hdev)
{
{
#define DEFAULT_TC_WEIGHT	1
#define DEFAULT_TC_OFFSET	14
#define DEFAULT_TC_OFFSET	14


	struct hclge_ets_tc_weight_cmd *ets_weight;
	struct hclge_ets_tc_weight_cmd *ets_weight;
@@ -987,13 +986,7 @@ static int hclge_tm_ets_tc_dwrr_cfg(struct hclge_dev *hdev)
	for (i = 0; i < HNAE3_MAX_TC; i++) {
	for (i = 0; i < HNAE3_MAX_TC; i++) {
		struct hclge_pg_info *pg_info;
		struct hclge_pg_info *pg_info;


		ets_weight->tc_weight[i] = DEFAULT_TC_WEIGHT;
		pg_info = &hdev->tm_info.pg_info[hdev->tm_info.tc_info[i].pgid];

		if (!(hdev->hw_tc_map & BIT(i)))
			continue;

		pg_info =
			&hdev->tm_info.pg_info[hdev->tm_info.tc_info[i].pgid];
		ets_weight->tc_weight[i] = pg_info->tc_dwrr[i];
		ets_weight->tc_weight[i] = pg_info->tc_dwrr[i];
	}
	}