]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net/mlx5e: IPsec: Fix tunnel mode crypto offload for non TCP/UDP traffic
authorRaed Salem <raeds@nvidia.com>
Thu, 2 Dec 2021 15:49:01 +0000 (17:49 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 5 Feb 2022 11:39:55 +0000 (12:39 +0100)
commit15184af88d8ab02cd34bc4b18c83b6cd798079c6
treecf371de8093c859b8d81ae8a92a5d5b520e740c0
parent95dde75d5207a66f18e6e7e0b995c152579dd7fe
net/mlx5e: IPsec: Fix tunnel mode crypto offload for non TCP/UDP traffic

commit de47db0cf7f4a9c555ad204e06baa70b50a70d08 upstream.

IPsec Tunnel mode crypto offload software parser (SWP) setting in data
path currently always set the inner L4 offset regardless of the
encapsulated L4 header type and whether it exists in the first place,
this breaks non TCP/UDP traffic as such.

Set the SWP inner L4 offset only when the IPsec tunnel encapsulated L4
header protocol is TCP/UDP.

While at it fix inner ip protocol read for setting MLX5_ETH_WQE_SWP_INNER_L4_UDP
flag to address the case where the ip header protocol is IPv6.

Fixes: f1267798c980 ("net/mlx5: Fix checksum issue of VXLAN and IPsec crypto offload")
Signed-off-by: Raed Salem <raeds@nvidia.com>
Reviewed-by: Maor Dickman <maord@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.c