From: Björn Töpel <bjorn.topel@xxxxxxxxx> This commit starts using xdp_call.h and the BPF dispatcher to avoid the retpoline overhead. Signed-off-by: Björn Töpel <bjorn.topel@xxxxxxxxx> --- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index 25c097cd8100..9c5cea239258 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c @@ -37,6 +37,7 @@ #include <net/mpls.h> #include <net/xdp_sock.h> #include <net/xfrm.h> +#include <linux/xdp_call.h> #include "ixgbe.h" #include "ixgbe_common.h" @@ -2193,6 +2194,8 @@ static struct sk_buff *ixgbe_build_skb(struct ixgbe_ring *rx_ring, return skb; } +DEFINE_XDP_CALL(ixgbe_xdp_call); + static struct sk_buff *ixgbe_run_xdp(struct ixgbe_adapter *adapter, struct ixgbe_ring *rx_ring, struct xdp_buff *xdp) @@ -2210,7 +2213,7 @@ static struct sk_buff *ixgbe_run_xdp(struct ixgbe_adapter *adapter, prefetchw(xdp->data_hard_start); /* xdp_frame write */ - act = bpf_prog_run_xdp(xdp_prog, xdp); + act = xdp_call_run(ixgbe_xdp_call, xdp_prog, xdp); switch (act) { case XDP_PASS: break; @@ -10273,6 +10276,8 @@ static int ixgbe_xdp_setup(struct net_device *dev, struct bpf_prog *prog) adapter->xdp_prog); } + xdp_call_update(ixgbe_xdp_call, old_prog, prog); + if (old_prog) bpf_prog_put(old_prog); -- 2.20.1