netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC 0/9] udp: GRO in UDP sockets and fast encap_rcv
@ 2016-03-23 22:36 Tom Herbert
  2016-03-23 22:36 ` [PATCH RFC 1/9] net: Check skb_dst for NULL in inet_iif Tom Herbert
                   ` (8 more replies)
  0 siblings, 9 replies; 15+ messages in thread
From: Tom Herbert @ 2016-03-23 22:36 UTC (permalink / raw)
  To: davem, netdev; +Cc: kernel-team

This patch set does two things:

- Add GRO functions (gro_receive and gro_complete) to UDP sockets.
- Implement "fast receive encapsulation".

Add GRO functions (gro_receive and gro_complete) to UDP sockets. In
udp_gro_receive and udp_gro_complete a socket lookup is done instead of
looking up the port number in udp_offloads.  If a socket is found and
there is are gro functions for it then those are called. This feature
allows binding GRO functions to more than just a port number.
Eventually, we will be able to use this technique to allow application
defined GRO for an application protocol by attaching BPF porgrams to UDP
sockets for doing GRO.

Fast receive encapsulation allows encap_rcv to be called for a socket
without taking the reference to the socket.  The callee can assume it
was called under rcu_read_lock, but must assume that no reference to the
socket is held (so the socket structures should not be written to and
pointer not saved).

In order to implement these function, no socket reference lookup
functions were added in ipv4/udp.c and ipv6/udp.c. Also, inet_iif and
references to skb_dst() were changed to check that dst is set in skbuf
before derefencing.  In the GRO path there is now a UDP socket lookup
performed before dst is set, to the get the device in that case we
simply use skb->dev.

Tested:

Ran various combinations of VXLAN and GUE TCP_STREAM and TCP_RR tests.
DId not see any regressions. perf shows a that the atomic opertions in
taking a reference to UDP sockets in lookup is eliminated for
encapsulation.

Also ran plain UDP_RR. DId not see any regression there.

Tom Herbert (9):
  net: Check skb_dst for NULL in inet_iif
  udp: Add noreference lookup functions
  net: Add fast receive encapsulation
  udp: Add GRO functions to UDP socket
  udp: Add socket based GRO and fast receive encap to tunnel config
  vxlan: change vxlan to use UDP socket GRO
  fou: change to use UDP socket GRO and fast rcv encap
  geneve: change to use UDP socket GRO
  udp: Remove udp_offloads

 drivers/net/geneve.c      |  29 ++----
 drivers/net/vxlan.c       |  31 ++----
 include/linux/netdevice.h |  17 ----
 include/linux/udp.h       |  13 ++-
 include/net/protocol.h    |   3 -
 include/net/route.h       |   7 +-
 include/net/udp.h         |  19 +++-
 include/net/udp_tunnel.h  |   8 ++
 include/net/vxlan.h       |   1 -
 net/ipv4/fou.c            |  49 ++++------
 net/ipv4/udp.c            | 237 +++++++++++++++++++++++++++++-----------------
 net/ipv4/udp_offload.c    | 113 ++++------------------
 net/ipv4/udp_tunnel.c     |   3 +
 net/ipv6/Makefile         |   5 +-
 net/ipv6/af_inet6.c       |   8 ++
 net/ipv6/ip6_offload.c    |   2 -
 net/ipv6/ip6_offload.h    |   3 +-
 net/ipv6/udp.c            | 166 +++++++++++++++++---------------
 net/ipv6/udp_offload.c    |  11 ++-
 19 files changed, 360 insertions(+), 365 deletions(-)

-- 
2.8.0.rc2

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2016-03-25 22:31 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-23 22:36 [PATCH RFC 0/9] udp: GRO in UDP sockets and fast encap_rcv Tom Herbert
2016-03-23 22:36 ` [PATCH RFC 1/9] net: Check skb_dst for NULL in inet_iif Tom Herbert
2016-03-23 22:36 ` [PATCH RFC 2/9] udp: Add noreference lookup functions Tom Herbert
2016-03-23 22:59   ` Eric Dumazet
2016-03-23 23:17     ` Tom Herbert
2016-03-23 23:28       ` Eric Dumazet
2016-03-23 22:36 ` [PATCH RFC 3/9] net: Add fast receive encapsulation Tom Herbert
2016-03-25 20:40   ` David Miller
2016-03-25 22:31     ` Joe Perches
2016-03-23 22:36 ` [PATCH RFC 4/9] udp: Add GRO functions to UDP socket Tom Herbert
2016-03-23 22:36 ` [PATCH RFC 5/9] udp: Add socket based GRO and fast receive encap to tunnel config Tom Herbert
2016-03-23 22:36 ` [PATCH RFC 6/9] vxlan: change vxlan to use UDP socket GRO Tom Herbert
2016-03-23 22:36 ` [PATCH RFC 7/9] fou: change to use UDP socket GRO and fast rcv encap Tom Herbert
2016-03-23 22:36 ` [PATCH RFC 8/9] geneve: change to use UDP socket GRO Tom Herbert
2016-03-23 22:36 ` [PATCH RFC 9/9] udp: Remove udp_offloads Tom Herbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).