• Huy Nguyen's avatar
    net/mlx5: Fix checksum issue of VXLAN and IPsec crypto offload · f1267798
    Huy Nguyen authored
    The packet is VXLAN packet over IPsec transport mode tunnel
    which has the following format: [IP1 | ESP | UDP | VXLAN | IP2 | TCP]
    NVIDIA ConnectX card cannot do checksum offload for two L4 headers.
    The solution is using the checksum partial offload similar to
    VXLAN | TCP packet. Hardware calculates IP1, IP2 and TCP checksums and
    software calculates UDP checksum. However, unlike VXLAN | TCP case,
    IPsec's mlx5 driver cannot access the inner plaintext IP protocol type.
    Therefore, inner_ipproto is added in the sec_path structure
    to provide this information. Also, utilize the skb's csum_start to
    program L4 inner checksum offset.
    
    While at it, remove the call to mlx5e_set_eseg_swp and setup software parser
    fields directly in mlx5e_ipsec_set_swp. mlx5e_set_eseg_swp is not
    needed as the two features (GENEVE and IPsec) are different and adding
    this sharing layer creates unnecessary complexity and affect
    performance.
    
    For the case VXLAN packet over IPsec tunnel mode tunnel, checksum offload
    is disabled because the hardware does not support checksum offload for
    three L3 (IP) headers.
    Signed-off-by: default avatarRaed Salem <raeds@nvidia.com>
    Signed-off-by: default avatarHuy Nguyen <huyn@nvidia.com>
    Cc: Steffen Klassert <steffen.klassert@secunet.com>
    Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
    f1267798
ipsec_rxtx.c 15.5 KB