• Mike Yu's avatar
    xfrm: Support crypto offload for inbound IPv6 ESP packets not in GRO path · f7e8542d
    Mike Yu authored
    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: default avatarMike Yu <yumike@google.com>
    Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
    f7e8542d
xfrm_policy.c 112 KB