Skip to content

Commit 688db0c

Browse files
Guangbin Huangdavem330
authored andcommitted
net: hns3: allow configure ETS bandwidth of all TCs
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>
1 parent 91fcc79 commit 688db0c

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
@@ -129,7 +129,7 @@ static int hclge_ets_sch_mode_validate(struct hclge_dev *hdev,
129129
u32 total_ets_bw = 0;
130130
u8 i;
131131

132-
for (i = 0; i < hdev->tc_max; i++) {
132+
for (i = 0; i < HNAE3_MAX_TC; i++) {
133133
switch (ets->tc_tsa[i]) {
134134
case IEEE_8021QAZ_TSA_STRICT:
135135
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
@@ -1123,7 +1123,6 @@ static int hclge_tm_pri_tc_base_dwrr_cfg(struct hclge_dev *hdev)
11231123

11241124
static int hclge_tm_ets_tc_dwrr_cfg(struct hclge_dev *hdev)
11251125
{
1126-
#define DEFAULT_TC_WEIGHT 1
11271126
#define DEFAULT_TC_OFFSET 14
11281127

11291128
struct hclge_ets_tc_weight_cmd *ets_weight;
@@ -1136,13 +1135,7 @@ static int hclge_tm_ets_tc_dwrr_cfg(struct hclge_dev *hdev)
11361135
for (i = 0; i < HNAE3_MAX_TC; i++) {
11371136
struct hclge_pg_info *pg_info;
11381137

1139-
ets_weight->tc_weight[i] = DEFAULT_TC_WEIGHT;
1140-
1141-
if (!(hdev->hw_tc_map & BIT(i)))
1142-
continue;
1143-
1144-
pg_info =
1145-
&hdev->tm_info.pg_info[hdev->tm_info.tc_info[i].pgid];
1138+
pg_info = &hdev->tm_info.pg_info[hdev->tm_info.tc_info[i].pgid];
11461139
ets_weight->tc_weight[i] = pg_info->tc_dwrr[i];
11471140
}
11481141

0 commit comments

Comments
 (0)