]> www.infradead.org Git - users/jedix/linux-maple.git/commit
xfrm: Support crypto offload for inbound IPv6 ESP packets not in GRO path
authorMike Yu <yumike@google.com>
Fri, 12 Jul 2024 02:51:22 +0000 (10:51 +0800)
committerSteffen Klassert <steffen.klassert@secunet.com>
Fri, 12 Jul 2024 06:43:28 +0000 (08:43 +0200)
commitf7e8542d71e908706855a9f3e9e7844fea1feea0
tree18a02cf831246960135592002b7bb7acd7f7a3aa
parentf531d13bdfe3f4f084aaa8acae2cb0f02295f5ae
xfrm: Support crypto offload for inbound IPv6 ESP packets not in GRO path

IPsec crypt offload supports outbound IPv6 ESP packets, but it doesn't
support inbound IPv6 ESP packets.

This change enables the crypto offload for inbound IPv6 ESP packets
that are not handled through GRO code path. If HW drivers add the
offload information to the skb, the packet will be handled in the
crypto offload rx code path.

Apart from the change in crypto offload rx code path, the change
in xfrm_policy_check is also needed.

Exampe of RX data path:

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

Test: Enabled both in/out IPsec crypto offload, and verified IPv6
      ESP packets on Android device on both wifi/cellular network
Signed-off-by: Mike Yu <yumike@google.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/xfrm/xfrm_input.c
net/xfrm/xfrm_policy.c