net/mlx5: Don't hide fallback to software IPsec in FS code
authorLeon Romanovsky <leonro@nvidia.com>
Tue, 1 Mar 2022 09:55:25 +0000 (11:55 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Wed, 4 May 2022 05:59:14 +0000 (22:59 -0700)
commit021a429bdbde93be504adcea79a81a3f19349483
tree593c6ff2424c487d2bef4d909063426be5766f69
parent9af1968ee13b33b0bff7def9c4861f1730389a7b
net/mlx5: Don't hide fallback to software IPsec in FS code

The XFRM code performs fallback to software IPsec if .xdo_dev_state_add()
returns -EOPNOTSUPP. This is what mlx5 did very deep in its stack trace,
despite have all the knowledge that IPsec is not going to work in very
early stage.

This is achieved by making sure that priv->ipsec pointer is valid for
fully working and supported hardware crypto IPsec engine.

In case, the hardware IPsec is not supported, the XFRM code will set NULL
to xso->dev and it will prevent from calls to various .xdo_dev_state_*()
callbacks.

Reviewed-by: Raed Salem <raeds@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c