]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commite7216bee1661a848f583d5845cb0b577fa754e57
tree57349a69c506c46735b00fb068e59b84e9bddf08
parent7f63f6080ba863013140b27abe4a30d4424dac06
net: hns3: fix "tc qdisc del" failed issue

[ Upstream commit 3164e91c59af85f4c413ca0c7a72afe75d8b4a96 ]

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: 8a99e015dde2 ("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