net: hns3: fix "tc qdisc del" failed issue
authorYonglong Liu <liuyonglong@huawei.com>
Thu, 12 Mar 2020 07:11:03 +0000 (15:11 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Apr 2020 09:01:55 +0000 (11:01 +0200)
commite5ea0d970f33969c0b1e6dbf1e862faed1ec5e3b
tree57349a69c506c46735b00fb068e59b84e9bddf08
parent24e72d55bc0b2bf45eeebdd43ff1b18f0db04bbc
net: hns3: fix "tc qdisc del" failed issue

[ Upstream commit 5eb01ddfcfb25e6ebc404a41deae946bde776731 ]

The HNS3 driver supports to configure TC numbers and TC to priority
map via "tc" tool. But when delete the rule, will fail, because
the HNS3 driver needs at least one TC, but the "tc" tool sets TC
number to zero when delete.

This patch makes sure that the TC number is at least one.

Fixes: 30d240dfa2e8 ("net: hns3: Add mqprio hardware offload support in hns3 driver")
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>
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c