diff mbox series

[bpf-next,v2,4/6] ixgbe: start using xdp_call.h

Message ID 20191123071226.6501-5-bjorn.topel@gmail.com
State Changes Requested
Delegated to: BPF Maintainers
Headers show
Series Introduce the BPF dispatcher and xdp_call.h | expand

Commit Message

Björn Töpel Nov. 23, 2019, 7:12 a.m. UTC
From: Björn Töpel <bjorn.topel@intel.com>

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@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff mbox series

Patch

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);