Skip to content

Support IPsec crypto offload for IPv6 ESP and IPv4 UDP-encapsulated ESP data paths

Mike Yu netdev 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest4 patches 1 replyIn review
  2. v34 patches 3 repliesSuperseded
  3. v24 patches 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v14 patches2 repliesSuperseded

Changes in v4 from the cover letter

- Change the target tree to ipsec-next.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4xfrm: Support crypto offload for inbound IPv6 ESP packets not in GRO pathnet/xfrm/xfrm_input.c net/xfrm/xfrm_policy.c+5 -20 replies
2/4xfrm: Allow UDP encapsulation in crypto offload control pathnet/xfrm/xfrm_device.c+3 -30 replies
3/4xfrm: Support crypto offload for inbound IPv4 UDP-encapsulated ESP packetnet/xfrm/xfrm_input.c+2 -10 replies
4/4xfrm: Support crypto offload for outbound IPv4 UDP-encapsulated ESP packetnet/ipv4/esp4.c net/ipv4/esp4_offload.c+23 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCH ipsec-next v4 0/4] Support IPsec crypto offload for IPv6 ESP and IPv4 UDP-encapsulated ESP data paths

Currently, IPsec crypto offload is enabled for GRO code path. However, there are other code paths where the XFRM stack is involved; for example, IPv6 ESP packets handled by xfrm6_esp_rcv() in ESP layer, and IPv4 UDP-encapsulated ESP packets handled by udp_rcv() in UDP layer.

This patchset extends the crypto offload support to cover these two cases. This is useful for devices with traffic accounting (e.g., Android), where GRO can lead to inaccurate accounting on the underlying network. For example, VPN traffic might not be counted on the wifi network interface wlan0 if the packets are handled in GRO code path before entering the network stack for accounting.

Below is the RX data path scenario the crypto offload can be applied to.

  +-----------+   +-------+
  | HW Driver |-->| wlan0 |--------+
  +-----------+   +-------+        |
                                   v
                             +---------------+   +------+
                     +------>| Network Stack |-->| Apps |
                     |       +---------------+   +------+
                     |             |
                     |             v
                 +--------+   +------------+
                 | ipsec1 |<--| XFRM Stack |
                 +--------+   +------------+

v3 -> v4:
- Change the target tree to ipsec-next.
v2 -> v3:
- Correct ESP seq in esp_xmit().
v1 -> v2:
- Fix comment style.

Mike Yu (4):
xfrm: Support crypto offload for inbound IPv6 ESP packets not in GRO
path
xfrm: Allow UDP encapsulation in crypto offload control path
xfrm: Support crypto offload for inbound IPv4 UDP-encapsulated ESP
packet
xfrm: Support crypto offload for outbound IPv4 UDP-encapsulated ESP
packet

 net/ipv4/esp4.c         |  8 +++++++-
 net/ipv4/esp4_offload.c | 17 ++++++++++++++++-
 net/xfrm/xfrm_device.c  |  6 +++---
 net/xfrm/xfrm_input.c   |  3 ++-
 net/xfrm/xfrm_policy.c  |  5 ++++-
 5 files changed, 32 insertions(+), 7 deletions(-)
Signature · 1 line
2.45.2.993.g49e7a77208-goog