OSDN Git Service

net/mlx5e: RX, Use indirect calls wrapper for posting descriptors
authorTariq Toukan <tariqt@mellanox.com>
Mon, 27 Jan 2020 11:28:42 +0000 (13:28 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Wed, 26 Feb 2020 01:06:07 +0000 (17:06 -0800)
We can avoid an indirect call per NAPI cycle wrapping the RX descriptors
posting call with the appropriate helper.

Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Reviewed-by: Maxim Mikityanskiy <maximmi@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c

index 257a7c9..267f453 100644 (file)
@@ -31,6 +31,7 @@
  */
 
 #include <linux/irq.h>
+#include <linux/indirect_call_wrapper.h>
 #include "en.h"
 #include "en/xdp.h"
 #include "en/xsk/rx.h"
@@ -99,7 +100,10 @@ static bool mlx5e_napi_xsk_post(struct mlx5e_xdpsq *xsksq, struct mlx5e_rq *xskr
        busy_xsk |= mlx5e_xsk_tx(xsksq, MLX5E_TX_XSK_POLL_BUDGET);
        mlx5e_xsk_update_tx_wakeup(xsksq);
 
-       xsk_rx_alloc_err = xskrq->post_wqes(xskrq);
+       xsk_rx_alloc_err = INDIRECT_CALL_2(xskrq->post_wqes,
+                                          mlx5e_post_rx_mpwqes,
+                                          mlx5e_post_rx_wqes,
+                                          xskrq);
        busy_xsk |= mlx5e_xsk_update_rx_wakeup(xskrq, xsk_rx_alloc_err);
 
        return busy_xsk;
@@ -142,7 +146,10 @@ int mlx5e_napi_poll(struct napi_struct *napi, int budget)
 
        mlx5e_poll_ico_cq(&c->icosq.cq);
 
-       busy |= rq->post_wqes(rq);
+       busy |= INDIRECT_CALL_2(rq->post_wqes,
+                               mlx5e_post_rx_mpwqes,
+                               mlx5e_post_rx_wqes,
+                               rq);
        if (xsk_open) {
                mlx5e_poll_ico_cq(&c->xskicosq.cq);
                busy |= mlx5e_poll_xdpsq_cq(&xsksq->cq);