diff options
author | Yonglong Liu <liuyonglong@huawei.com> | 2019-11-14 10:32:41 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-12-13 08:48:46 +0100 |
commit | e2caaa11cbc1d931c5b8f6ccdf76cd7544f741c0 (patch) | |
tree | 7c66b8ad533e3b5d6e0fcb1950ef15f610c14c7d /drivers/net | |
parent | 8e5e98f908c687d309b7de8ae295e03de977d40a (diff) | |
download | linux-stable-e2caaa11cbc1d931c5b8f6ccdf76cd7544f741c0.tar.gz linux-stable-e2caaa11cbc1d931c5b8f6ccdf76cd7544f741c0.tar.bz2 linux-stable-e2caaa11cbc1d931c5b8f6ccdf76cd7544f741c0.zip |
net: hns3: fix ETS bandwidth validation bug
[ Upstream commit c2d56897819338eb0ba8b93184f7d10329b36653 ]
Some device only support 4 TCs, but the driver check the total
bandwidth of 8 TCs, so may cause wrong configurations write to
the hw.
This patch uses hdev->tc_max to instead HNAE3_MAX_TC to fix it.
Fixes: e432abfb99e5 ("net: hns3: add common validation in hclge_dcb")
Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c index d9136a199d8d..f5c323e79834 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c @@ -124,7 +124,7 @@ static int hclge_ets_validate(struct hclge_dev *hdev, struct ieee_ets *ets, if (ret) return ret; - for (i = 0; i < HNAE3_MAX_TC; i++) { + for (i = 0; i < hdev->tc_max; i++) { switch (ets->tc_tsa[i]) { case IEEE_8021QAZ_TSA_STRICT: if (hdev->tm_info.tc_info[i].tc_sch_mode != |