net/mlx5e: IPsec: Fix Software parser inner l3 type setting in case of encapsulation
authorRaed Salem <raeds@nvidia.com>
Wed, 17 Nov 2021 11:33:57 +0000 (13:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Dec 2021 08:04:47 +0000 (09:04 +0100)
commitb762b3e28c926fe24c63fb97f48d506b31aa1cb4
treea403d2ca62b2d08ff16b5b792fbf4f57d9076340
parent3f837fefa59d7df5ea54653cea5a1c1bc47e63af
net/mlx5e: IPsec: Fix Software parser inner l3 type setting in case of encapsulation

commit c65d638ab39034cbaa36773b980d28106cfc81fa upstream.

Current code wrongly uses the skb->protocol field which reflects the
outer l3 protocol to set the inner l3 type in Software Parser (SWP)
fields settings in the ethernet segment (eseg) in flows where inner
l3 exists like in Vxlan over ESP flow, the above method wrongly use
the outer protocol type instead of the inner one. thus breaking cases
where inner and outer headers have different protocols.

Fix by setting the inner l3 type in SWP according to the inner l3 ip
header version.

Fixes: 2ac9cfe78223 ("net/mlx5e: IPSec, Add Innova IPSec offload TX data path")
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