net/mlx5: IPSec, Fix the SA context hash key
authorRaed Salem <raeds@mellanox.com>
Thu, 18 Oct 2018 05:55:21 +0000 (08:55 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Nov 2018 07:17:05 +0000 (08:17 +0100)
commit7962f000f596c537b563a99bb6c88482a5f6396a
treea32bafa05d75747bc12badd5792fefab89afa88a
parent79272fc2c124166ea9c0960241fc60cd47712ef3
net/mlx5: IPSec, Fix the SA context hash key

[ Upstream commit f2b18732ee9863ac036759baf616ffa03c252ed5 ]

The commit "net/mlx5: Refactor accel IPSec code" introduced a
bug where asynchronous short time change in hash key value
by create/release SA context might happen during an asynchronous
hash resize operation this could cause a subsequent remove SA
context operation to fail as the key value used during resize is
not the same key value used when remove SA context operation is
invoked.

This commit fixes the bug by defining the SA context hash key
such that it includes only fields that never change during the
lifetime of the SA context object.

Fixes: d6c4f0298cec ("net/mlx5: Refactor accel IPSec code")
Signed-off-by: Raed Salem <raeds@mellanox.com>
Reviewed-by: Aviad Yehezkel <aviadye@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/mellanox/mlx5/core/fpga/ipsec.c