From patchwork Mon Jun 1 17:52:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 224980 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2396C433E0 for ; Mon, 1 Jun 2020 18:42:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7C8B320872 for ; Mon, 1 Jun 2020 18:42:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591036921; bh=zsnNwinp/DE+F74R59YrcglBgXtqUtkXfpuHn77ZXQA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=HRVt5QR4K0wm5Na7H98Fla5ePWP67DMnutAVUnveh7q95pVu5rMjyZBl8g58sJfa+ bouW1nN8iUU0bLW+prLhcb9y0xkQHRiYgE11xE1wxzwXTGBms4Pph/Rb0uRh1WLma/ nkIkm4DCx23TkSmClHy9ekfRJdLjqRDVx0GTKzoU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729187AbgFASl4 (ORCPT ); Mon, 1 Jun 2020 14:41:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:59560 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730787AbgFASMM (ORCPT ); Mon, 1 Jun 2020 14:12:12 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B15BC2068D; Mon, 1 Jun 2020 18:12:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591035132; bh=zsnNwinp/DE+F74R59YrcglBgXtqUtkXfpuHn77ZXQA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y02iWMD9f+gqU24A2okRQTzxQwq0OZrsGTIaHP+Xj2NOTBCamL1TLbzLL/pwmnMyY IV9H/AxnyZjWB2DECl8U6BK5eTSwYXY7vOBRx9uSKK7uB4Iki/SHhaD+FWHX+2TscN BAXhAuCwyUGkf4jk24rdk2+1FLiIAGSBzLFXt7sA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tariq Toukan , Boris Pismenny , Saeed Mahameed Subject: [PATCH 5.6 023/177] net/mlx5e: kTLS, Destroy key object after destroying the TIS Date: Mon, 1 Jun 2020 19:52:41 +0200 Message-Id: <20200601174050.694478525@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174048.468952319@linuxfoundation.org> References: <20200601174048.468952319@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Tariq Toukan [ 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 Reviewed-by: Boris Pismenny Signed-off-by: Saeed Mahameed Signed-off-by: Greg Kroah-Hartman --- 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); }