OSDN Git Service

net: hns3: optimize converting dscp to priority process of hns3_nic_select_queue()
authorGuangbin Huang <huangguangbin2@huawei.com>
Fri, 16 Sep 2022 02:38:01 +0000 (10:38 +0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 21 Sep 2022 21:32:21 +0000 (14:32 -0700)
commitdfea275e06c26690b1ef27399fd84ce50372b85c
tree843897ef95fedb5164335b0e23227cedaa67da38
parent04b6ba143521f4485b7f2c36c655b262a79dae97
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>
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_debugfs.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c