From: Tariq Toukan <tar...@mellanox.com>

[ Upstream commit 16736e11f43b80a38f98f6add54fab3b8c297df3 ]

The TLS TIS object contains the dek/key ID.
By destroying the key first, the TIS would contain an invalid
non-existing key ID.
Reverse the destroy order, this also acheives the desired assymetry
between the destroy and the create flows.

Fixes: d2ead1f360e8 ("net/mlx5e: Add kTLS TX HW offload support")
Signed-off-by: Tariq Toukan <tar...@mellanox.com>
Reviewed-by: Boris Pismenny <bor...@mellanox.com>
Signed-off-by: Saeed Mahameed <sae...@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.c
@@ -69,8 +69,8 @@ static void mlx5e_ktls_del(struct net_de
        struct mlx5e_ktls_offload_context_tx *tx_priv =
                mlx5e_get_ktls_tx_priv_ctx(tls_ctx);
 
-       mlx5_ktls_destroy_key(priv->mdev, tx_priv->key_id);
        mlx5e_destroy_tis(priv->mdev, tx_priv->tisn);
+       mlx5_ktls_destroy_key(priv->mdev, tx_priv->key_id);
        kvfree(tx_priv);
 }
 


Reply via email to