Skip to content

net: consolidate IPv4 route lookup for UDP tunnels

Beniamino Galvani lkml netdev 2 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest7 patches 0 repliesApplied 7/7
  2. v17 patches 4 repliesSuperseded

Changelog from the cover letter

v2
- fix compilation with IPv6 disabled

Patches in v2 All 7 applied

#Subject and filesSizeRepliesApplied
1/7ipv4: rename and move ip_route_output_tunnel()drivers/net/bareudp.c include/net/route.h include/net/udp_tunnel.h +2 more+58 -580 repliesApplied
2/7ipv4: remove "proto" argument from udp_tunnel_dst_lookup()drivers/net/bareudp.c include/net/udp_tunnel.h net/ipv4/udp_tunnel_core.c+5 -50 repliesApplied
3/7ipv4: add new arguments to udp_tunnel_dst_lookup()drivers/net/bareudp.c include/net/udp_tunnel.h net/ipv4/udp_tunnel_core.c+25 -200 repliesApplied
4/7ipv4: use tunnel flow flags for tunnel route lookupsnet/ipv4/udp_tunnel_core.c+1 -00 repliesApplied
5/7geneve: add dsfield helper functiondrivers/net/geneve.c+18 -110 repliesApplied
6/7geneve: use generic function for tunnel IPv4 route lookupdrivers/net/geneve.c+32 -660 repliesApplied
7/7vxlan: use generic function for tunnel IPv4 route lookupdrivers/net/vxlan/vxlan_core.c+41 -730 repliesApplied

Reviews trailers per patch

4 of 7 patches have a Reviewed-by or Acked-by.

PatchDavid Ahern
1/7R-b
2/7R-b
3/7R-b
4/7R-b
5/7
6/7
7/7

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH net-next v2 0/7] net: consolidate IPv4 route lookup for UDP tunnels

At the moment different UDP tunnels rely on different functions for IPv4 route lookup, and those functions all implement the same logic. Only bareudp uses the generic ip_route_output_tunnel(), while geneve and vxlan basically duplicate it slightly differently.

This series first extends the generic lookup function so that it is suitable for all UDP tunnel implementations. Then, bareudp, geneve and vxlan are adapted to use them.

This results in code with less duplication and hopefully better maintainability.

After this series is merged, IPv6 will be converted in a similar way.

Changelog:
v2
- fix compilation with IPv6 disabled

Beniamino Galvani (7):
ipv4: rename and move ip_route_output_tunnel()
ipv4: remove "proto" argument from udp_tunnel_dst_lookup()
ipv4: add new arguments to udp_tunnel_dst_lookup()
ipv4: use tunnel flow flags for tunnel route lookups
geneve: add dsfield helper function
geneve: use generic function for tunnel IPv4 route lookup
vxlan: use generic function for tunnel IPv4 route lookup

 drivers/net/bareudp.c          |  11 ++--
 drivers/net/geneve.c           | 111 ++++++++++++--------------------
 drivers/net/vxlan/vxlan_core.c | 114 ++++++++++++---------------------
 include/net/route.h            |   6 --
 include/net/udp_tunnel.h       |   8 +++
 net/ipv4/route.c               |  48 --------------
 net/ipv4/udp_tunnel_core.c     |  49 ++++++++++++++
 7 files changed, 147 insertions(+), 200 deletions(-)
Signature · 1 line
2.40.1