OSDN Git Service

net: hns3: fix wrong bw weight of disabled tc issue
authorJijie Shao <shaojijie@huawei.com>
Thu, 20 Jul 2023 02:05:10 +0000 (10:05 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 Jul 2023 08:36:23 +0000 (09:36 +0100)
commit882481b1c55fc44861d7e2d54b4e0936b1b39f2c
tree97cec04f320fbd826e5881c494953fc757033eae
parent116d9f732eef634abbd871f2c6f613a5b4677742
net: hns3: fix wrong bw weight of disabled tc issue

In dwrr mode, the default bandwidth weight of disabled tc is set to 0.
If the bandwidth weight is 0, the mode will change to sp.
Therefore, disabled tc default bandwidth weight need changed to 1,
and 0 is returned when query the bandwidth weight of disabled tc.
In addition, driver need stop configure bandwidth weight if tc is disabled.

Fixes: 848440544b41 ("net: hns3: Add support of TX Scheduler & Shaper to HNS3 driver")
Signed-off-by: Jie Wang <wangjie125@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c