public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH ipsec-next 0/3] xfrm: support collect metadata mode for xfrm interfaces
@ 2022-08-23 15:45 Eyal Birger
  2022-08-23 15:45 ` [PATCH ipsec-next 1/3] net: allow storing xfrm interface metadata in metadata_dst Eyal Birger
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Eyal Birger @ 2022-08-23 15:45 UTC (permalink / raw)
  To: davem, edumazet, kuba, pabeni, steffen.klassert, herbert, pablo,
	contact, dsahern
  Cc: netdev, bpf, devel, Eyal Birger

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.

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/20201121142823.3629805-1-eyal.birger@gmail.com/#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    |  25 +++++
 include/net/xfrm.h            |  11 +-
 include/uapi/linux/if_link.h  |   1 +
 include/uapi/linux/lwtunnel.h |   9 ++
 net/core/lwtunnel.c           |   1 +
 net/xfrm/xfrm_input.c         |   7 +-
 net/xfrm/xfrm_interface.c     | 203 ++++++++++++++++++++++++++++++----
 net/xfrm/xfrm_policy.c        |  10 +-
 8 files changed, 239 insertions(+), 28 deletions(-)

-- 
2.34.1


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

end of thread, other threads:[~2022-08-25 13:04 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-23 15:45 [PATCH ipsec-next 0/3] xfrm: support collect metadata mode for xfrm interfaces Eyal Birger
2022-08-23 15:45 ` [PATCH ipsec-next 1/3] net: allow storing xfrm interface metadata in metadata_dst Eyal Birger
2022-08-23 15:45 ` [PATCH ipsec-next 2/3] xfrm: interface: support collect metadata mode Eyal Birger
2022-08-24 17:06   ` Daniel Borkmann
2022-08-24 18:25     ` Eyal Birger
2022-08-24 21:33       ` Daniel Borkmann
2022-08-23 15:45 ` [PATCH ipsec-next 3/3] xfrm: lwtunnel: add lwtunnel support for xfrm interfaces in collect_md mode Eyal Birger
2022-08-24 15:21   ` Nicolas Dichtel
2022-08-24 18:56     ` Eyal Birger
2022-08-25 10:07       ` Nicolas Dichtel
2022-08-25 13:03         ` Eyal Birger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox