net: hns3: add support for tc mqprio offload
authorJian Shen <shenjian15@huawei.com>
Thu, 10 Dec 2020 03:42:07 +0000 (11:42 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Dec 2020 04:33:19 +0000 (20:33 -0800)
commit5a5c9091746749d9e16ff807035a940ca0ae4941
tree026f55383fcee49ab9ac932aa92953a2fa749411
parent35244430d62422e96b4c9c9b4c00c0ebece91d73
net: hns3: add support for tc mqprio offload

Currently, the HNS3 driver only supports offload for tc number
and prio_tc. This patch adds support for other qopts, including
queues count and offset for each tc.

When enable tc mqprio offload, it's not allowed to change
queue numbers by ethtool. For hardware limitation, the queue
number of each tc should be power of 2.

For the queues is not assigned to each tc by average, so it's
should return vport->alloc_tqps for hclge_get_max_channels().

Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hnae3.h
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c