Skip to content

xfrm: support collect metadata mode for xfrm interfaces

Eyal Birger bpf netdev 4 versions – Applied

Status from this message: Applied, thanks a lot Eyal!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest3 patches 6 repliesApplied
  2. v33 patches 6 repliesSuperseded
  3. v23 patches 7 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v13 patches7 repliesSuperseded

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/3net: allow storing xfrm interface metadata in metadata_dstinclude/net/dst_metadata.h+20 -01 reply
2/3xfrm: interface: support collect metadata modeinclude/net/xfrm.h include/uapi/linux/if_link.h net/xfrm/xfrm_input.c +2 more+121 -290 replies
3/3xfrm: lwtunnel: add lwtunnel support for xfrm interfaces in collect_md modeinclude/net/dst_metadata.h include/uapi/linux/lwtunnel.h net/core/lwtunnel.c +1 more+107 -04 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchNikolay AleksandrovNicolas Dichtel
1/3R-b R-b
2/3R-b R-b
3/3R-b R-b

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

Read the v4 thread

Cover letter [PATCH ipsec-next,v4 0/3] xfrm: support collect metadata mode for xfrm interfaces

This series adds support for "collect_md" mode in XFRM interfaces.

This feature is useful for maintaining a large number of IPsec connections with the benefits of using a network interface while reducing the overhead of maintaining a large number of devices.

Currently this is possible by having multiple connections share a common interface by sharing the if_id identifier and using some other criteria to distinguish between them - such as different subnets or skb marks. This becomes complex in multi-tenant environments where subnets collide and the mark space is used for other purposes.

Since the xfrm interface uses the if_id as the differentiator when looking for policies, setting the if_id in the dst_metadata framework allows using a single interface for different connections while having the ability to selectively steer traffic to each one. In addition the xfrm interface "link" property can also be specified to affect underlying routing in the context of VRFs.

The series is composed of the following steps:

- Introduce a new METADATA_XFRM metadata type to be used for this purpose. Reuse of the existing "METADATA_IP_TUNNEL" type was rejected in [0] as XFRM does not necessarily represent an IP tunnel.

- Add support for collect metadata mode in xfrm interfaces

- Allow setting the XFRM metadata from the LWT infrastructure

Future additions could allow setting/getting the XFRM metadata from eBPF programs, TC, OVS, NF, etc.

[0] https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/#23824575

Eyal Birger (3):
net: allow storing xfrm interface metadata in metadata_dst
xfrm: interface: support collect metadata mode
xfrm: lwtunnel: add lwtunnel support for xfrm interfaces in collect_md
mode

 include/net/dst_metadata.h    |  31 +++++
 include/net/xfrm.h            |  11 +-
 include/uapi/linux/if_link.h  |   1 +
 include/uapi/linux/lwtunnel.h |  10 ++
 net/core/lwtunnel.c           |   1 +
 net/xfrm/xfrm_input.c         |   7 +-
 net/xfrm/xfrm_interface.c     | 206 ++++++++++++++++++++++++++++++----
 net/xfrm/xfrm_policy.c        |  10 +-
 8 files changed, 248 insertions(+), 29 deletions(-)

----

v4: coding change as suggested by Nicolas Dichtel
v3: coding changes as suggested by Nikolay Aleksandrov and
Nicolas Dichtel
v2: add "link" property as suggested by Nicolas Dichtel

Signature · 1 line
2.34.1