Files
linux/include/linux
David S. Miller b5cdae3291 net: Generic XDP
This provides a generic SKB based non-optimized XDP path which is used
if either the driver lacks a specific XDP implementation, or the user
requests it via a new IFLA_XDP_FLAGS value named XDP_FLAGS_SKB_MODE.

It is arguable that perhaps I should have required something like
this as part of the initial XDP feature merge.

I believe this is critical for two reasons:

1) Accessibility.  More people can play with XDP with less
   dependencies.  Yes I know we have XDP support in virtio_net, but
   that just creates another depedency for learning how to use this
   facility.

   I wrote this to make life easier for the XDP newbies.

2) As a model for what the expected semantics are.  If there is a pure
   generic core implementation, it serves as a semantic example for
   driver folks adding XDP support.

One thing I have not tried to address here is the issue of
XDP_PACKET_HEADROOM, thanks to Daniel for spotting that.  It seems
incredibly expensive to do a skb_cow(skb, XDP_PACKET_HEADROOM) or
whatever even if the XDP program doesn't try to push headers at all.
I think we really need the verifier to somehow propagate whether
certain XDP helpers are used or not.

v5:
 - Handle both negative and positive offset after running prog
 - Fix mac length in XDP_TX case (Alexei)
 - Use rcu_dereference_protected() in free_netdev (kbuild test robot)

v4:
 - Fix MAC header adjustmnet before calling prog (David Ahern)
 - Disable LRO when generic XDP is installed (Michael Chan)
 - Bypass qdisc et al. on XDP_TX and record the event (Alexei)
 - Do not perform generic XDP on reinjected packets (DaveM)

v3:
 - Make sure XDP program sees packet at MAC header, push back MAC
   header if we do XDP_TX.  (Alexei)
 - Elide GRO when generic XDP is in use.  (Alexei)
 - Add XDP_FLAG_SKB_MODE flag which the user can use to request generic
   XDP even if the driver has an XDP implementation.  (Alexei)
 - Report whether SKB mode is in use in rtnl_xdp_fill() via XDP_FLAGS
   attribute.  (Daniel)

v2:
 - Add some "fall through" comments in switch statements based
   upon feedback from Andrew Lunn
 - Use RCU for generic xdp_prog, thanks to Johannes Berg.

Tested-by: Andy Gospodarek <andy@greyhouse.net>
Tested-by: Jesper Dangaard Brouer <brouer@redhat.com>
Tested-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-04-25 13:33:49 -04:00
..
2017-03-07 14:30:38 +01:00
2017-01-24 12:37:43 -08:00
2017-04-17 11:08:31 -04:00
2016-12-22 22:58:37 -05:00
2016-10-19 14:34:36 -04:00
2017-02-10 15:52:24 -05:00
2017-01-25 13:17:47 -05:00
2017-04-11 14:38:43 -04:00
2016-12-08 16:37:33 -08:00
2017-02-24 17:46:55 -08:00
2017-02-04 00:47:59 +01:00
2016-12-05 19:01:16 -05:00
2016-10-28 08:48:16 -06:00
2017-02-27 10:07:47 -08:00
2016-12-05 19:01:16 -05:00
2016-12-25 17:21:22 +01:00
2017-03-22 00:18:22 -07:00
2017-02-11 20:59:41 -05:00
2017-03-22 16:16:17 +01:00
2017-01-05 15:01:55 -06:00
2017-02-01 09:13:45 +01:00
2016-12-12 18:55:06 -08:00
2016-12-25 17:21:23 +01:00
2017-02-24 17:46:57 -08:00
2016-12-06 11:05:46 +01:00
2017-04-24 14:30:46 -04:00
2017-01-12 16:48:26 -05:00
2017-04-25 13:33:49 -04:00
2016-11-16 18:32:02 -05:00
2016-12-12 18:55:07 -08:00
2016-12-06 10:17:03 +02:00
2017-04-11 11:16:03 -04:00
2017-04-24 12:40:24 -04:00
2016-10-31 16:18:30 -04:00
2016-10-14 11:36:59 -07:00
2016-11-15 16:34:27 -08:00
2017-02-13 21:44:09 -05:00
2017-02-27 18:43:46 -08:00
2017-04-14 10:05:36 +02:00
2017-01-09 16:07:38 -05:00
2017-03-22 12:15:15 -07:00
2016-12-25 17:21:22 +01:00
2017-01-10 18:31:55 -08:00
2017-02-03 10:17:02 +01:00
2017-02-10 16:34:17 +00:00
2016-12-12 18:55:08 -08:00
2017-01-11 09:21:41 +01:00
2017-02-02 15:22:18 -05:00