Skip to content

Commit b30459c

Browse files
Guangbin Huanggregkh
authored andcommitted
net: hns3: allow configure ETS bandwidth of all TCs
[ Upstream commit 688db0c ] 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: 330baff ("net: hns3: add ETS TC weight setting in SSU module") Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent ee11f16 commit b30459c

2 files changed

Lines changed: 2 additions & 9 deletions

File tree

‎drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ static int hclge_ets_validate(struct hclge_dev *hdev, struct ieee_ets *ets,
126126
if (ret)
127127
return ret;
128128

129-
for (i = 0; i < hdev->tc_max; i++) {
129+
for (i = 0; i < HNAE3_MAX_TC; i++) {
130130
switch (ets->tc_tsa[i]) {
131131
case IEEE_8021QAZ_TSA_STRICT:
132132
if (hdev->tm_info.tc_info[i].tc_sch_mode !=

‎drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,6 @@ static int hclge_tm_pri_tc_base_dwrr_cfg(struct hclge_dev *hdev)
10391039

10401040
static int hclge_tm_ets_tc_dwrr_cfg(struct hclge_dev *hdev)
10411041
{
1042-
#define DEFAULT_TC_WEIGHT 1
10431042
#define DEFAULT_TC_OFFSET 14
10441043

10451044
struct hclge_ets_tc_weight_cmd *ets_weight;
@@ -1052,13 +1051,7 @@ static int hclge_tm_ets_tc_dwrr_cfg(struct hclge_dev *hdev)
10521051
for (i = 0; i < HNAE3_MAX_TC; i++) {
10531052
struct hclge_pg_info *pg_info;
10541053

1055-
ets_weight->tc_weight[i] = DEFAULT_TC_WEIGHT;
1056-
1057-
if (!(hdev->hw_tc_map & BIT(i)))
1058-
continue;
1059-
1060-
pg_info =
1061-
&hdev->tm_info.pg_info[hdev->tm_info.tc_info[i].pgid];
1054+
pg_info = &hdev->tm_info.pg_info[hdev->tm_info.tc_info[i].pgid];
10621055
ets_weight->tc_weight[i] = pg_info->tc_dwrr[i];
10631056
}
10641057

0 commit comments

Comments
 (0)