gtp: fixes and support multiple VRF's per GTP socket

Submitted by Andreas Schultz on Jan. 23, 2017, 11:56 a.m.


Reviewer None
Submitted Jan. 23, 2017, 11:56 a.m.
Last Updated Jan. 24, 2017, 3:32 p.m.
Revision 2

Cover Letter

The current linking of GTP network devices and GTP enabled sockets means that
we can not have multiple VRF's per GTP socket. This series seperates the
sockets from network device, makes sockets attached to GTP network device
optional and adds a API function to enable GTP encapsulation on socket
without having to create a new GTP device.

It is still possible to use the old API. The network device attached socket is
then used when no socket is specified on PDP context creation.

During that work some smaller problems where found and fixes for them are

v2 changes:

 * the socket that is hold by the pdp context has to be release in a rcu
   callback. Otherwise a stray GTP rx could end uo with an invalid socket.
 * accessing the skb->sk field in gtp_rx is invalid, that field has no
   been populated at that point
 * add dst_cache to speed up the routing

Andreas Schultz (18):
  gtp: add genl family modules alias
  gtp: clear DF bit on GTP packet tx
  gtp: make GTP sockets in gtp_newlink optional
  gtp: return error ptr in find pdp helpers
  gtp: unify genl_find_pdp and prepare for per socket lookup
  gtp: fix cross netns recv on gtp socket
  gtp: remove unnecessary rcu_read_lock
  gtp: consolidate pdp context destruction into helper
  gtp: use addr_hash when traversing pdp contexts
  gtp: add socket to pdp context
  gtp: consolidate gtp socket rx path
  gtp: let userspace handle packets for invalid tunnels
  gtp: replace netdev_dbg and KERN_DEBUG printk with pr_debug
  gtp: move TEID hash to per socket structure
  gtp: rename gtp hashtable helpers
  gtp: add genl cmd to enable GTP encapsulation on UDP socket
  gtp: add support to select a GTP socket during PDP context creation
  gtp: add dst_cache support

 drivers/net/gtp.c        | 714 +++++++++++++++++++++++++++--------------------
 include/uapi/linux/gtp.h |   4 +
 2 files changed, 422 insertions(+), 296 deletions(-)