]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net/mlx5e: xsk: Include XSK skb_from_cqe callbacks in INDIRECT_CALL
authorMaxim Mikityanskiy <maximmi@nvidia.com>
Sun, 2 Oct 2022 04:56:20 +0000 (21:56 -0700)
committerJakub Kicinski <kuba@kernel.org>
Mon, 3 Oct 2022 23:55:27 +0000 (16:55 -0700)
XSK is a performance-critical data path. To avoid an indirect function
call with a retpoline, include XSK callbacks in the INDIRECT_CALL macro,
so that they are called directly in XSK flows.

Signed-off-by: Maxim Mikityanskiy <maximmi@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c

index 36eda4c958a0b9c514affe38ea323e5d137bbbef..5835d86be8d865e1c75b6e4ea773ce2ec4864ec0 100644 (file)
@@ -1709,9 +1709,10 @@ static void mlx5e_handle_rx_cqe(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe)
                goto free_wqe;
        }
 
-       skb = INDIRECT_CALL_2(rq->wqe.skb_from_cqe,
+       skb = INDIRECT_CALL_3(rq->wqe.skb_from_cqe,
                              mlx5e_skb_from_cqe_linear,
                              mlx5e_skb_from_cqe_nonlinear,
+                             mlx5e_xsk_skb_from_cqe_linear,
                              rq, wi, cqe_bcnt);
        if (!skb) {
                /* probably for XDP */
@@ -2180,9 +2181,10 @@ static void mlx5e_handle_rx_cqe_mpwrq(struct mlx5e_rq *rq, struct mlx5_cqe64 *cq
 
        cqe_bcnt = mpwrq_get_cqe_byte_cnt(cqe);
 
-       skb = INDIRECT_CALL_2(rq->mpwqe.skb_from_cqe_mpwrq,
+       skb = INDIRECT_CALL_3(rq->mpwqe.skb_from_cqe_mpwrq,
                              mlx5e_skb_from_cqe_mpwrq_linear,
                              mlx5e_skb_from_cqe_mpwrq_nonlinear,
+                             mlx5e_xsk_skb_from_cqe_mpwrq_linear,
                              rq, wi, cqe_bcnt, head_offset, page_idx);
        if (!skb)
                goto mpwrq_cqe_out;