From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 605DCC4332F for ; Thu, 24 Nov 2022 08:11:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229790AbiKXILa (ORCPT ); Thu, 24 Nov 2022 03:11:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229758AbiKXILP (ORCPT ); Thu, 24 Nov 2022 03:11:15 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E60ADEAC0 for ; Thu, 24 Nov 2022 00:11:05 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 29976B82702 for ; Thu, 24 Nov 2022 08:11:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CBF1DC433D6; Thu, 24 Nov 2022 08:11:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669277462; bh=xqr5DxSoiFwakgPHkQoo/BMGLoVgiYTyG32XcS+nrNM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SUO7Qk+lvyMHaBWCs1Z+Hz6mK1C4P5FIhEbGJabJ2YFcz+fRlQCuTyNEqrRY23q5z GRut9tBpWxE/m+vNOKgIkNYBhU5eyCsiMoIFz/I4TJjkUEL7Xtd+oTx2pKIVJXRvEg oK5NEq8qgyc2j12gGoZ8LOWxucH2gOP+OLE3DcAo3ST7IDSivk7z1Q6TJPjQIZckQg LC6bRLaSko6lcdmrObUAgKVXcWP4qTiJfYS/KJSdOpDXt014//ywtkGmTreD31EiNp YkkvpsXz8zLMmNWgZlOqMXWTILcwcwQeH9PlHmFkToyQoI6OAqUqNu/T+2DgKWYdgq nvvEDRAoDSTpw== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet Cc: Saeed Mahameed , netdev@vger.kernel.org, Tariq Toukan , Raed Salem , Emeel Hakim Subject: [net 10/15] net/mlx5e: MACsec, fix update Rx secure channel active field Date: Thu, 24 Nov 2022 00:10:35 -0800 Message-Id: <20221124081040.171790-11-saeed@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221124081040.171790-1-saeed@kernel.org> References: <20221124081040.171790-1-saeed@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Raed Salem The main functionality for this operation is to update the active state of the Rx security channel (SC) if the new active setting is different from the current active state of this Rx SC, however the relevant active state check is done post updating the current active state to match the new active state, effectively blocks any offload state update for the Rx SC in question. Fix by delay the assignment to be post the relevant check. Fixes: aae3454e4d4c ("net/mlx5e: Add MACsec offload Rx command support") Signed-off-by: Raed Salem Reviewed-by: Emeel Hakim Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c index b51de07d5bad..9c891a877998 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c @@ -803,10 +803,10 @@ static int mlx5e_macsec_upd_rxsc(struct macsec_context *ctx) goto out; } - rx_sc->active = ctx_rx_sc->active; if (rx_sc->active == ctx_rx_sc->active) goto out; + rx_sc->active = ctx_rx_sc->active; for (i = 0; i < MACSEC_NUM_AN; ++i) { rx_sa = rx_sc->rx_sa[i]; if (!rx_sa) -- 2.38.1