@@ -32,6 +32,7 @@
#include <linux/bpf_trace.h>
#include <net/xdp_sock.h>
+#include <linux/xdp_call.h>
#include "en/xdp.h"
#include "en/params.h"
@@ -117,6 +118,8 @@ mlx5e_xmit_xdp_buff(struct mlx5e_xdpsq *sq, struct mlx5e_rq *rq,
return sq->xmit_xdp_frame(sq, &xdptxd, &xdpi, 0);
}
+DECLARE_XDP_CALL(mlx5e_xdp_call);
+
/* returns true if packet was consumed by xdp */
bool mlx5e_xdp_handle(struct mlx5e_rq *rq, struct mlx5e_dma_info *di,
void *va, u16 *rx_headroom, u32 *len, bool xsk)
@@ -138,7 +141,7 @@ bool mlx5e_xdp_handle(struct mlx5e_rq *rq, struct mlx5e_dma_info *di,
xdp.handle = di->xsk.handle;
xdp.rxq = &rq->xdp_rxq;
- act = bpf_prog_run_xdp(prog, &xdp);
+ act = xdp_call_run(mlx5e_xdp_call, prog, &xdp);
if (xsk) {
u64 off = xdp.data - xdp.data_hard_start;
@@ -39,6 +39,7 @@
#include <linux/if_bridge.h>
#include <net/page_pool.h>
#include <net/xdp_sock.h>
+#include <linux/xdp_call.h>
#include "eswitch.h"
#include "en.h"
#include "en/txrx.h"
@@ -4384,6 +4385,8 @@ static int mlx5e_xdp_update_state(struct mlx5e_priv *priv)
return 0;
}
+DEFINE_XDP_CALL(mlx5e_xdp_call);
+
static int mlx5e_xdp_set(struct net_device *netdev, struct bpf_prog *prog)
{
struct mlx5e_priv *priv = netdev_priv(netdev);
@@ -4428,6 +4431,8 @@ static int mlx5e_xdp_set(struct net_device *netdev, struct bpf_prog *prog)
old_prog = xchg(&priv->channels.params.xdp_prog, prog);
}
+ xdp_call_update(mlx5e_xdp_call, old_prog, prog);
+
if (old_prog)
bpf_prog_put(old_prog);