diff options
author | Guangbin Huang <huangguangbin2@huawei.com> | 2022-09-16 10:38:01 +0800 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-09-21 14:32:21 -0700 |
commit | dfea275e06c26690b1ef27399fd84ce50372b85c (patch) | |
tree | 843897ef95fedb5164335b0e23227cedaa67da38 /drivers/net/ethernet/hisilicon/hns3/hnae3.h | |
parent | net: hns3: add support for external loopback test (diff) | |
download | linux-dev-dfea275e06c26690b1ef27399fd84ce50372b85c.tar.xz linux-dev-dfea275e06c26690b1ef27399fd84ce50372b85c.zip |
net: hns3: optimize converting dscp to priority process of hns3_nic_select_queue()
Currently, when function hns3_nic_select_queue() converts dscp to priority,
it calls an indirect callback ae_algo->ops->get_dscp_prio to get priority.
However as function hns3_nic_select_queue() is in fast path, the indirect
call may cause degradation of performance. For optimization, this patch
moves dscp_app_cnt and dscp_prio from struct hclge_tm_info to struct
hnae3_knic_private_info, so they can be used in both hclge and hns3 layers.
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hns3/hnae3.h')
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns3/hnae3.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h index 30a76f44a819..0179fc288f5f 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h +++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h @@ -798,6 +798,8 @@ struct hnae3_tc_info { bool mqprio_active; }; +#define HNAE3_MAX_DSCP 64 +#define HNAE3_PRIO_ID_INVALID 0xff struct hnae3_knic_private_info { struct net_device *netdev; /* Set by KNIC client when init instance */ u16 rss_size; /* Allocated RSS queues */ @@ -809,6 +811,8 @@ struct hnae3_knic_private_info { struct hnae3_tc_info tc_info; u8 tc_map_mode; + u8 dscp_app_cnt; + u8 dscp_prio[HNAE3_MAX_DSCP]; u16 num_tqps; /* total number of TQPs in this handle */ struct hnae3_queue **tqp; /* array base of all TQPs in this instance */ |