]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Aug 2023 08:22:34 +0000 (10:22 +0200)
commit96dbc68b7f86b453be6ab11fee728f2704f24e61
treeea308ad378cbc913fd82234cf3f735d0978f6575
parent9755714d238c622a70f1e5fbbb642b091dfadd47
net: hns3: fix wrong bw weight of disabled tc issue

[ Upstream commit 882481b1c55fc44861d7e2d54b4e0936b1b39f2c ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c