Skip to content

Add IP-TFS mode to xfrm

Christian Hopps netdev 16 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v14 Latest15 patches 2 repliesIn review
  2. v1315 patches 0 repliesSuperseded
  3. v1216 patches 10 repliesSuperseded
Earlier versions · 13
VersionPostedPatchesRepliesStatus
v1116 patches3 repliesSuperseded
v1016 patches9 repliesSuperseded
v917 patches2 repliesSuperseded
v816 patches23 repliesSuperseded
v716 patches5 repliesSuperseded
v616 patches0 repliesSuperseded
v517 patches26 repliesSuperseded
v418 patches7 repliesSuperseded
v317 patches0 repliesSuperseded
v2 posting 3/30 of 17 patches0 repliesSuperseded
v2 posting 2/317 patches13 repliesSuperseded
v2 RFC posting 1/38 patches24 repliesSuperseded
v1 RFC8 patches12 repliesSuperseded

Changes in v14 from the cover letter

- Fix fix m68k unused function build warning from kernel test robot

Patches in v14 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/15xfrm: config: add CONFIG_XFRM_IPTFSnet/xfrm/Kconfig+16 -00 replies
2/15include: uapi: protocol number and packet structs for AGGFRAG in ESPinclude/uapi/linux/in.h include/uapi/linux/ip.h+18 -00 replies
3/15xfrm: netlink: add config (netlink) optionsinclude/uapi/linux/xfrm.h net/xfrm/xfrm_compat.c net/xfrm/xfrm_user.c+68 -30 replies
4/15xfrm: add mode_cbs module functionalityinclude/net/xfrm.h net/xfrm/xfrm_device.c net/xfrm/xfrm_input.c +4 more+159 -100 replies
5/15xfrm: add generic iptfs defines and functionalityinclude/net/xfrm.h include/uapi/linux/ipsec.h include/uapi/linux/snmp.h +9 more+48 -60 replies
6/15xfrm: iptfs: add new iptfs xfrm mode implnet/xfrm/Makefile net/xfrm/xfrm_iptfs.c+217 -00 replies
7/15xfrm: iptfs: add user packet (tunnel ingress) handlingnet/xfrm/xfrm_iptfs.c+560 -30 replies
8/15xfrm: iptfs: share page fragments of inner packetsnet/xfrm/xfrm_iptfs.c+77 -80 replies
9/15xfrm: iptfs: add fragmenting of larger than MTU user packetsnet/xfrm/xfrm_iptfs.c+315 -280 replies
10/15xfrm: iptfs: add basic receive packet (tunnel egress) handlingnet/xfrm/xfrm_iptfs.c+276 -00 replies
11/15xfrm: iptfs: handle received fragmented inner packetsnet/xfrm/xfrm_iptfs.c+461 -190 replies
12/15xfrm: iptfs: add reusing received skb for the tunnel egress packetnet/xfrm/xfrm_iptfs.c+108 -150 replies
13/15xfrm: iptfs: add skb-fragment sharing codenet/xfrm/xfrm_iptfs.c+290 -60 replies
14/15xfrm: iptfs: handle reordering of received packetsnet/xfrm/xfrm_iptfs.c+484 -130 replies
15/15xfrm: iptfs: add tracepoint functionalitynet/xfrm/trace_iptfs.h net/xfrm/xfrm_iptfs.c+288 -10 replies

Reviews trailers per patch

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

PatchAntony Antony
SeriesT-b
1/15
2/15
3/15
4/15
5/15
6/15
7/15
8/15
9/15
10/15
11/15
12/15
13/15
14/15
15/15

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

Read the v14 thread

Cover letter [PATCH ipsec-next v14 00/15] Add IP-TFS mode to xfrm

* Summary of Changes:

This patchset adds a new xfrm mode implementing on-demand IP-TFS. IP-TFS (AggFrag encapsulation) has been standardized in RFC9347.

This feature supports demand driven (i.e., non-constant send rate) IP-TFS to take advantage of the AGGFRAG ESP payload encapsulation. This payload type supports aggregation and fragmentation of the inner IP packet stream which in turn yields higher small-packet bandwidth as well as reducing MTU/PMTU issues. Congestion control is unimplementated as the send rate is demand driven rather than constant.

In order to allow loading this fucntionality as a module a set of callbacks xfrm_mode_cbs has been added to xfrm as well.

Patchset Structure:
-------------------

The first 5 commits are changes to the net and xfrm infrastructure to support the callbacks as well as more generic IP-TFS additions that may be used outside the actual IP-TFS implementation.

- xfrm: config: add CONFIG_XFRM_IPTFS
- include: uapi: protocol number and packet structs for AGGFRAG in ESP
- xfrm: netlink: add config (netlink) options
- xfrm: add mode_cbs module functionality
- xfrm: add generic iptfs defines and functionality

The last 10 commits constitute the IP-TFS implementation constructed in layers to make review easier. The first 9 commits all apply to a single file net/xfrm/xfrm_iptfs.c, the last commit adds a new tracepoint header file along with the use of these new tracepoint calls.

- xfrm: iptfs: add new iptfs xfrm mode impl
- xfrm: iptfs: add user packet (tunnel ingress) handling
- xfrm: iptfs: share page fragments of inner packets
- xfrm: iptfs: add fragmenting of larger than MTU user packets
- xfrm: iptfs: add basic receive packet (tunnel egress) handling
- xfrm: iptfs: handle received fragmented inner packets
- xfrm: iptfs: add reusing received skb for the tunnel egress packet
- xfrm: iptfs: add skb-fragment sharing code
- xfrm: iptfs: handle reordering of received packets
- xfrm: iptfs: add tracepoint functionality

Patchset History:
-----------------

v13->v14 (11/14/2024)
- Fix fix m68k unused function build warning from kernel test robot

v12->v13 (11/5/2024)
- rebase on updated ipsec-next
- remove non-standard WARN_ON usages
- remove non-standard (void) prefix use which indicated ignored return value.
- move 2 structure fields to compact in-core layout
- refactor loop out of iptfs_input_ordered() to improve code readability
- a few format cleanup changes.

v11->v12 (9/14/2024)
- fix for SA migration, dont alloc over top of newly cloned data

v10->v11 (9/6/2024)
- fix double init when xfrm_migrate_state (clone) is called.
- rename create_state, clone, and delete_state callbacks to init_state, clone_state, and destroy_state.
- skb_orphan skbs prior to aggregation

v9->v10 (8/23/2024)
- use relocated skb_copy_seq_read now in skbuff.[ch]
- be thoughtful about skb reserve space in new skbs, use existing #defines and skb meta-data to calculate new skb reserve and alignment.
- only copy dst (on in/out) and dev, ext (on resume input) values from existing skb header to new skb's -- drop use of rejected new ___copy_skb_header() function.
- update other iptfs specific skb function names

v8->v9 (8/7/2024)
- factor common code from skbuff.c:__copy_skb_header into ___copy_skb_header and use in iptfs rather that copying any code.
- change all BUG_ON to WARN_ON_ONCE
- remove unwanted new NOSKB xfrm MIB error counter
- remove unneeded copy or share choice function
- ifdef CONFIG_IPV6 around IPv6 function

v7->v8 (8/4/2024)
- Use lock and rcu to load iptfs module -- copy existing use pattern
- fix 2 warnings from the kernel bot

v6->v7 (8/1/2024)
- Rebased on latest ipsec-next

v5->v6 (7/31/2024)
* sysctl: removed IPTFS sysctl additions
- xfrm: use array of pointers vs structs for mode callbacks
- iptfs: eliminate a memleak during state alloc failure
- iptfs: free send queue content on SA delete
- add some kdoc and comments
- cleanup a couple formatting choices per Steffen

v4->v5 (7/14/2024)
- uapi: add units to doc comments
- iptfs: add MODULE_DESCRIPTION()
- squash nl-direction-update commit

v2->v4 (6/17/2024)

- iptfs: copy only the netlink attributes to user based on the direction of the SA.

- xfrm: stats: in the output path check for skb->dev == NULL prior to setting xfrm statistics on dev_net(skb->dev) as skb->dev may be NULL for locally generated packets.

- xfrm: stats: fix an input use case where dev_net(skb->dev) is used to inc stats after skb is possibly NULL'd earlier. Switch to using existing saved net pointer.

v2->v3
- Git User Glitch

v1 -> v2 (5/19/2024)

Updates based on feedback from Sabrina Dubroca, Simon Horman, Antony.

o Add handling of new netlink SA direction attribute (Antony).
o Split single patch/commit of xfrm_iptfs.c (the actual IP-TFS impl) into 9+1 distinct layered functionality commits for aiding review.
- xfrm: fix return check on clone() callback
- xfrm: add sa_len() callback in xfrm_mode_cbs for copy to user
- iptfs: remove unneeded skb free count variable
- iptfs: remove unused variable and "breadcrumb" for future code.
- iptfs: use do_div() to avoid "__udivd13 missing" link failure.
- iptfs: remove some BUG_ON() assertions questioned in review.

RFCv2 -> v1 (2/19/2024)

Updates based on feedback from Sabrina Dubroca, kernel test robot

RFCv1 -> RFCv2 (11/12/2023)

Updates based on feedback from Simon Horman, Antony, Michael Richardson, and kernel test robot.

RFCv1 (11/10/2023)

Patchset Changes:
-----------------

 include/net/xfrm.h         |   44 +
 include/uapi/linux/in.h    |    2 +
 include/uapi/linux/ip.h    |   16 +
 include/uapi/linux/ipsec.h |    3 +-
 include/uapi/linux/snmp.h  |    2 +
 include/uapi/linux/xfrm.h  |    9 +-
 net/ipv4/esp4.c            |    3 +-
 net/ipv6/esp6.c            |    3 +-
 net/netfilter/nft_xfrm.c   |    3 +-
 net/xfrm/Kconfig           |   16 +
 net/xfrm/Makefile          |    1 +
 net/xfrm/trace_iptfs.h     |  218 ++++
 net/xfrm/xfrm_compat.c     |   10 +-
 net/xfrm/xfrm_device.c     |    4 +-
 net/xfrm/xfrm_input.c      |   18 +-
 net/xfrm/xfrm_iptfs.c      | 2764 ++++++++++++++++++++++++++++++++++++++++++++
 net/xfrm/xfrm_output.c     |    6 +
 net/xfrm/xfrm_policy.c     |   26 +-
 net/xfrm/xfrm_proc.c       |    2 +
 net/xfrm/xfrm_state.c      |   84 ++
 net/xfrm/xfrm_user.c       |   77 ++
 21 files changed, 3292 insertions(+), 19 deletions(-)