]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
net/mlx5e: kTLS, Destroy key object after destroying the TIS
authorTariq Toukan <tariqt@mellanox.com>
Mon, 27 Apr 2020 13:56:59 +0000 (16:56 +0300)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Mon, 22 Jun 2020 20:23:03 +0000 (17:23 -0300)
BugLink: https://bugs.launchpad.net/bugs/1881927
[ 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 <tariqt@mellanox.com>
Reviewed-by: Boris Pismenny <borisp@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.c

index 46725cd743a369b6531b2dc3fd8051e2129f266e..7d1985fa0d4f7603ce0f3a1a9ee7d02028601d40 100644 (file)
@@ -69,8 +69,8 @@ static void mlx5e_ktls_del(struct net_device *netdev,
        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);
 }