Skip to content

net: unify dst caching for tunnel devices

Paolo Abeni netdev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest7 patches 3 repliesIn review
  2. v17 patches 3 repliesSuperseded

Changes in v2 from the cover letter

- move the vxlan dst_cache usage inside the device lookup functions
- fix usage after free for lwt tunnel moving the dst cache storage inside the dst_metadata,
- sparse codying style cleanup

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7net: add dst_cache supportinclude/net/dst_cache.h net/Kconfig net/core/Makefile +1 more+270 -00 replies
2/7net: replace dst_cache ip6_tunnel implementation with the generic oneinclude/net/ip6_tunnel.h net/ipv6/Kconfig net/ipv6/ip6_gre.c +2 more+16 -1160 replies
3/7ip_tunnel: replace dst_cache with generic implementationinclude/net/ip_tunnels.h net/ipv4/Kconfig net/ipv4/ip_tunnel.c +1 more+25 -800 replies
4/7net: use dst_cache for vxlan devicedrivers/net/vxlan.c include/net/vxlan.h+48 -80 replies
5/7net: add dst_cache to ovs vxlan lwtunneldrivers/net/vxlan.c include/net/dst_metadata.h include/net/ip_tunnels.h +3 more+28 -80 replies
6/7geneve: add dst caching supportdrivers/net/geneve.c+39 -00 replies
7/7net/ipv4: add dst cache support for gre lwtunnelsnet/ipv4/ip_gre.c+10 -30 replies

Reviews trailers per patch

None of the 7 patches has a Reviewed-by or Acked-by.

PatchHannes Frederic Sowa
1/7Suggested-and-acked-by
2/7Suggested-and-acked-by
3/7Suggested-and-acked-by
4/7Suggested-and-acked-by
5/7Suggested-and-acked-by
6/7Suggested-and-Acked-by
7/7Suggested-and-Acked-by

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: unify dst caching for tunnel devices

This patch series try to unify the dst cache implementations currently present in the kernel, namely in ip_tunnel.c and ip6_tunnel.c, introducing a new generic implementation, replacing the existing ones, and then using the new implementation in other tunnel devices which currently lack it.

The new dst implementation is compiled, as built-in, only if any device using it is enabled.

Caching the dst for the tunnel remote address gives small, but measurable, performance improvement when tunneling over ipv4 (in the 2%-4% range) and significant ones when tunneling over ipv6 (roughly 60% when no fragmentation/segmentation take place and the tunnel local address is not specified).

v2:
- move the vxlan dst_cache usage inside the device lookup functions
- fix usage after free for lwt tunnel moving the dst cache storage inside the dst_metadata,
- sparse codying style cleanup

Paolo Abeni (7):
net: add dst_cache support
net: replace dst_cache ip6_tunnel implementation with the generic one
ip_tunnel: replace dst_cache with generic implementation
net: use dst_cache for vxlan device
net: add dst_cache to ovs vxlan lwtunnel
geneve: add dst caching support
net/ipv4: add dst cache support for gre lwtunnels

 drivers/net/geneve.c           |  39 ++++++++++
 drivers/net/vxlan.c            |  56 ++++++++++++--
 include/net/dst_cache.h        |  97 ++++++++++++++++++++++++
 include/net/dst_metadata.h     |   1 +
 include/net/ip6_tunnel.h       |  14 +---
 include/net/ip_tunnels.h       |  12 ++-
 include/net/vxlan.h            |   1 +
 net/Kconfig                    |   4 +
 net/core/Makefile              |   1 +
 net/core/dst.c                 |  10 ++-
 net/core/dst_cache.c           | 168 +++++++++++++++++++++++++++++++++++++++++
 net/ipv4/Kconfig               |   1 +
 net/ipv4/ip_gre.c              |  13 +++-
 net/ipv4/ip_tunnel.c           |  78 ++++---------------
 net/ipv6/Kconfig               |   1 +
 net/ipv6/ip6_gre.c             |  12 +--
 net/ipv6/ip6_tunnel.c          | 103 ++-----------------------
 net/ipv6/ip6_vti.c             |   2 +-
 net/ipv6/sit.c                 |  17 +++--
 net/openvswitch/Kconfig        |   1 +
 net/openvswitch/flow_netlink.c |   6 ++
 21 files changed, 429 insertions(+), 208 deletions(-)
 create mode 100644 include/net/dst_cache.h
 create mode 100644 net/core/dst_cache.c
Signature · 1 line
1.8.3.1