diff options
author | Jian Shen <shenjian15@huawei.com> | 2020-12-10 11:42:07 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-12-09 20:33:19 -0800 |
commit | 5a5c9091746749d9e16ff807035a940ca0ae4941 (patch) | |
tree | 026f55383fcee49ab9ac932aa92953a2fa749411 /drivers/net/ethernet/hisilicon/hns3/hnae3.h | |
parent | net: hns3: refine the struct hane3_tc_info (diff) | |
download | linux-dev-5a5c9091746749d9e16ff807035a940ca0ae4941.tar.xz linux-dev-5a5c9091746749d9e16ff807035a940ca0ae4941.zip |
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>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hns3/hnae3.h')
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns3/hnae3.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h index 0cb80ef4aba5..a7ff9c7dbd2a 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h +++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h @@ -29,7 +29,9 @@ #include <linux/module.h> #include <linux/netdevice.h> #include <linux/pci.h> +#include <linux/pkt_sched.h> #include <linux/types.h> +#include <net/pkt_cls.h> #define HNAE3_MOD_VERSION "1.0" @@ -647,7 +649,8 @@ struct hnae3_dcb_ops { u8 (*getdcbx)(struct hnae3_handle *); u8 (*setdcbx)(struct hnae3_handle *, u8); - int (*setup_tc)(struct hnae3_handle *, u8, u8 *); + int (*setup_tc)(struct hnae3_handle *handle, + struct tc_mqprio_qopt_offload *mqprio_qopt); }; struct hnae3_ae_algo { @@ -667,6 +670,7 @@ struct hnae3_tc_info { u16 tqp_offset[HNAE3_MAX_TC]; unsigned long tc_en; /* bitmap of TC enabled */ u8 num_tc; /* Total number of enabled TCs */ + bool mqprio_active; }; struct hnae3_knic_private_info { |