Skip to content

Commit b63fcaa

Browse files
Guangbin Huangdavem330
authored andcommitted
net: hns3: reset DWRR of unused tc to zero
Currently, DWRR of tc will be initialized to a fixed value when this tc is enabled, but it is not been reset to 0 when this tc is disabled. It cause a problem that the DWRR of unused tc is not 0 after using tc tool to add and delete multi-tc parameters. For examples, after enabling 4 TCs and restoring to 1 TC by follow tc commands: $ tc qdisc add dev eth0 root mqprio num_tc 4 map 0 1 2 3 0 1 2 3 queues \ 8@0 8@8 8@16 8@24 hw 1 mode channel $ tc qdisc del dev eth0 root Now there is just one TC is enabled for eth0, but the tc info querying by debugfs is shown as follow: $ cat /mnt/hns3/0000:7d:00.0/tm/tc_sch_info enabled tc number: 1 weight_offset: 14 TC MODE WEIGHT 0 dwrr 100 1 dwrr 100 2 dwrr 100 3 dwrr 100 4 dwrr 0 5 dwrr 0 6 dwrr 0 7 dwrr 0 This patch fixes it by resetting DWRR of tc to 0 when tc is disabled. Fixes: 8484405 ("net: hns3: Add support of TX Scheduler & Shaper to HNS3 driver") Signed-off-by: Guangbin Huang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 6048410 commit b63fcaa

File tree

1 file changed

+2
-0
lines changed
  • drivers/net/ethernet/hisilicon/hns3/hns3pf

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,8 @@ static void hclge_tm_pg_info_init(struct hclge_dev *hdev)
752752
hdev->tm_info.pg_info[i].tc_bit_map = hdev->hw_tc_map;
753753
for (k = 0; k < hdev->tm_info.num_tc; k++)
754754
hdev->tm_info.pg_info[i].tc_dwrr[k] = BW_PERCENT;
755+
for (; k < HNAE3_MAX_TC; k++)
756+
hdev->tm_info.pg_info[i].tc_dwrr[k] = 0;
755757
}
756758
}
757759

0 commit comments

Comments
 (0)