Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3259985rdh; Thu, 28 Sep 2023 07:07:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFYFLnLlelKae1LoDF8pLV9EN2FzsHsEoen5/ts4LKi/5cgAiGIUe7ck3UuuWuyHtUyRER8 X-Received: by 2002:a17:902:e545:b0:1c0:d17a:bfef with SMTP id n5-20020a170902e54500b001c0d17abfefmr1051506plf.30.1695910061228; Thu, 28 Sep 2023 07:07:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1695910061; cv=pass; d=google.com; s=arc-20160816; b=j3f5aT3s+ncW8gOV1lqsZbvp1nN4KePBO8TqIOmnxsFYpJ56tW2xkO6bVpOVfe6Dxl mLsJ7RxPHoJJUy5iJt9S5s8Hj5ahD3KpVv9s9LXzeTbPM414j1ORqlBVwsaFzVqo90Bw 9MJ5vY1Dm3Hu1cbCImYK1T28Z1MgcEx/vaWghzTn/fYY8ElL/aqBgGFq81yiJtd8AgD9 d0lBATTc3IpViu8+o4tZGAcEUyQeaqAENEBaE+G253qb/qpXh1aFher9xJsix5ng+z82 K6qUW1SVU0NSXYaQsKSXvQTBW0BZOmAueNriQ6IEj94zpj/X+XP4COD5ZODf3I9FQSrp ZeSA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YOaGR7AwYpP42vjC209vORt773LJsJ1Prod6yInbC/A=; fh=PwptI7Oo9FUxJJdm1mYJ2dHCUyBkoB5ZKvV8pFMIezU=; b=b6MnhDvWDBfMAu/IC62sBFMqjXEaaOy/pwHFTUBSm7D2pLhUj/kmm8ocp7xSX2N/mV d4udeoumC+ALAE9YTqn+XavI70f6klohgXk28f6MdBmdFSjAQpEQzhMRqV8AjH3C844W swjd6ehzLGAR6zGFp8fdQTxfqpcccDz0fdf+RheQlAvOknej4E1BM5HsUdTqlIE2AAt6 uC1QqpKH0ZcuLI+KGJlijpJhL9hCcSnTenH1HhkhA3QBfgs6a/FTPb9mcxfe80MXjyWQ innCgQtYPNU8IBvkA3HPhUvdH7xgfdVUZZEUPWNKS0EolyYzYCRAv4V1yPS1JANlvm+L +g6w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=iMeg3a5W; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id u17-20020a170903125100b001b89fd6bec4si20039059plh.144.2023.09.28.07.07.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 07:07:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=iMeg3a5W; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 8CE37805CADC; Thu, 28 Sep 2023 01:48:09 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231359AbjI1Irw (ORCPT + 99 others); Thu, 28 Sep 2023 04:47:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230274AbjI1Irt (ORCPT ); Thu, 28 Sep 2023 04:47:49 -0400 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on2052.outbound.protection.outlook.com [40.107.14.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1C3C9C; Thu, 28 Sep 2023 01:47:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XVEyJ+qXQYTdfs29Brgp+b0V/1k6mfqbIvsHOs5BBjduI8RSyTB55uQsgEVCgHtcH9yPZ8wSQQ0tRSpb4pQrtRxhPXZp2rv5YRMQ+I27pZBuVMLrKbE6HIaij1FU7L2UAGSYUJIy+1pig6GCFdsr6ZTNnMO4fKs1bcj96ydcbRJ3HFvUIofvUsdGpeQ/SSD09F3ZgCggucKoiUOiDzDB5IulUfZWpSH6IKZQarqYvY/+I9UiNa4I4Gko57nSOEMyo1SLjb7sSumKnW5220HLR5qqnx3YSLe0r6NC3ah6jY9dhIXZJlwVlK5Jm8NBrCEjDcwZsT535Rf9DLjl5r103A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YOaGR7AwYpP42vjC209vORt773LJsJ1Prod6yInbC/A=; b=I7qCuDvZg9Hkn/C+RAInYDZKtxJyASiDIG86eICHmb1wFXmB9ixNnVA0nGgYgTdZYPTJMSy9r1iC9rCQzlPb0OiMuPGmbXNbI+6i8kOGHpD944NiF6kp2JA2p0C0dN34mbcjILMmOFY6mV0TVte22MgaQs+TKQdYMnfrer5vG1lQGeeh2HOKuJJoc+J6++3IwuvPg2vkCigv3gUbN4aN4t7D8A7NcJDtmU4HFCPGEoZTYtNHWY65I2EK3h8o25QAnioSjG9M6o+X4fzn050FU3ptcajAVyjrmDOVvvZxZJc686feYTt4XlJLeof+woNbWnn1gGBA6ZkRjo+M3trbkA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YOaGR7AwYpP42vjC209vORt773LJsJ1Prod6yInbC/A=; b=iMeg3a5WJwe2z6Y70fdqhIJWY3BqcTS4uw8CAVEnQ6R5lO9Oe6auboRoek3yN4u/If6DGwn9C770YkBcOath7RcVDplxe7eqV2Ka9zcT4SEPuXuSb8l83mSwBv1ddkrgxlbiUHmfF6xlvOUDRZr32AG0+h3R+jwUrz0/3cDNv0k= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from AM9PR04MB8954.eurprd04.prod.outlook.com (2603:10a6:20b:409::7) by AS8PR04MB8514.eurprd04.prod.outlook.com (2603:10a6:20b:341::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Thu, 28 Sep 2023 08:47:43 +0000 Received: from AM9PR04MB8954.eurprd04.prod.outlook.com ([fe80::e109:7026:7d76:5617]) by AM9PR04MB8954.eurprd04.prod.outlook.com ([fe80::e109:7026:7d76:5617%7]) with mapi id 15.20.6813.027; Thu, 28 Sep 2023 08:47:43 +0000 From: "Radu Pirea (NXP OSS)" To: sgoutham@marvell.com, gakula@marvell.com, sbhatta@marvell.com, hkelam@marvell.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, borisp@nvidia.com, saeedm@nvidia.com, leon@kernel.org, sd@queasysnail.net, andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, richardcochran@gmail.com, sebastian.tobuschat@oss.nxp.com Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, "Radu Pirea (NXP OSS)" Subject: [PATCH net-next v6 05/10] octeontx2-pf: mcs: update PN only when update_pn is true Date: Thu, 28 Sep 2023 11:44:25 +0300 Message-Id: <20230928084430.1882670-6-radu-nicolae.pirea@oss.nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230928084430.1882670-1-radu-nicolae.pirea@oss.nxp.com> References: <20230928084430.1882670-1-radu-nicolae.pirea@oss.nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: VI1P190CA0018.EURP190.PROD.OUTLOOK.COM (2603:10a6:802:2b::31) To AM9PR04MB8954.eurprd04.prod.outlook.com (2603:10a6:20b:409::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM9PR04MB8954:EE_|AS8PR04MB8514:EE_ X-MS-Office365-Filtering-Correlation-Id: 6447dde5-a622-4139-06c8-08dbbfff84a2 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bqSimji4B/iMcKeVA7XTNRDnkURUBtX50cxDQ8McliZbw+5rY5omF1F86gV0U30eIc0C7XkJKTAqBqCS+LTdJBM3wuluHYYNVmhXAlMTjQrbKVaFjt0xcxs4eGrxBO+aMyHtScpwwJGjmazLX1sf+Sj/3XZejw3PZBviNTtnwebznzctmWMIPPQsVzxMxSAVQIjdWMCrnPhxE63kUWRnR+tQl0iarbJHIWwPgZTH+NySntBv33BiHbbs5p2XxnB05LltrGbKHUlaEQ0B2zt9Wpa47qv/ewVaRF5iPtXlmhVv6a5J1CKuTBxrzafpg+KJ9nDzArWhXCAYteGWRRGWZxDyZFgmJAn1/0Nv9dJnWY2wV7vDY5eCzQ/to+NlyUSNscG4fLv4BWw+Qzwuou6Zm6UDs+YlBfi8fQeEr/VvYjIuPgkwpKf26eKjvt5SMV8qd1oOUhfIexbmYzXqTsCEojOiCVYnQd84T+IrbYyh9XtDUGfl3kMxZoECb5TdJOBPuJ1DDT6aXd9/dlvkM0bo1mGidvWS4DJIxrxgN1L6LuyMyyOMFnrFEWj1tizqIa40cSJoVrDs6BKh4ybG6T9jmasUgKhOhtIdgahxv5Lz/ofjNsaAatu3WnC7Aqd1OuDl X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR04MB8954.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(366004)(396003)(346002)(376002)(39860400002)(230922051799003)(186009)(1800799009)(64100799003)(451199024)(6506007)(26005)(66476007)(66556008)(6666004)(86362001)(52116002)(1076003)(6512007)(6486002)(478600001)(2906002)(38350700002)(38100700002)(83380400001)(7416002)(316002)(8936002)(5660300002)(4326008)(2616005)(66946007)(8676002)(15650500001)(921005)(6636002)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?sxy94rFrcUXvjLjsSAcT8D9WEnHlUY7iJhOV2A1LowvxGMNmp2hwovz2aw+1?= =?us-ascii?Q?ygwSbsWyIpgQPmo91OTVYsWhGyOf2K7pFaYxKHdKehXzF7MgLWuAHUUV3epo?= =?us-ascii?Q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8Do/xCbodBZDUNxAKb?= =?us-ascii?Q?FHso5JhA4bLLpr1aMBYDbCiXaESCwgV+kGqy2pq8wu1PRQqNVD6hn3O3G7X6?= =?us-ascii?Q?dApShj5ATlOZhDeu/KtWu2xnrNIUqVJJeFTxl9Z1lL9T4dXVvyKFYrCt+v95?= =?us-ascii?Q?Z3+h05NxQqhqkrNZr5Hb4bWjgNOrZjbhanc3n3rphVVRrLy/mInT2KW6f0kQ?= =?us-ascii?Q?OXxaS7glfzVgdwjJAhumn13qM7KeNSwaNUO4Wkyf3rzMI8MVILy/1e6bt+7Z?= =?us-ascii?Q?/nD2yUVO1gUkvJmyepuWR2otj8ojUSjFDS1JsmcGXz16q6kuPc4x47vxSehO?= =?us-ascii?Q?0ft6U58yvlBe4zHtt3db6O8vpU3sC94Gc1Aw496bvcNdi0AbhL/24npo5xN7?= =?us-ascii?Q?oaEOdhPZUNYjJ91b6ZwTuL5dKxVTCQNJNDeafSrxAzA8IDG4xpaABrk7Tlah?= =?us-ascii?Q?LIMafo3lTuDK00pL7esW53FZf7LOiGnA1KaYlUA43ptHocw/Os4hNL93ndRN?= =?us-ascii?Q?5NGvkEoAMjyIZU935LtAJ9/LlmxahdY5GWRCRsv1CnRv7FN0FzfRapShS/CP?= =?us-ascii?Q?7/rSLk7UvU1olaiZJP/ZehiwRqhIiFTc68gburp/INmV50spw4YDw0jXlK3n?= =?us-ascii?Q?2A=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6447dde5-a622-4139-06c8-08dbbfff84a2 X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB8954.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2023 08:47:16.7396 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Bw8lczhdXJ495Y33Uzrx1WIevVh17/CF5iB8vKnNNgLAU1rfKVUCQqTquzMZLsSD8OYXOFpB+aLt85gOFlyiVpiZxc+an9o17hneMiuyjbU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8514 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 28 Sep 2023 01:48:09 -0700 (PDT) When updating SA, update the PN only when the update_pn flag is true. Otherwise, the PN will be reset to its previous value. Signed-off-by: Radu Pirea (NXP OSS) --- Changes in v6: - patch added in v6 drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c index 59b138214af2..4c59850dfddf 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c @@ -1362,6 +1362,9 @@ static int cn10k_mdo_upd_txsa(struct macsec_context *ctx) if (err) return err; + if (!ctx->sa.update_pn) + return 0; + err = cn10k_mcs_link_tx_sa2sc(pfvf, secy, txsc, sa_num, sw_tx_sa->active); if (err) @@ -1529,6 +1532,9 @@ static int cn10k_mdo_upd_rxsa(struct macsec_context *ctx) if (err) return err; + if (!ctx->sa.update_pn) + return 0; + err = cn10k_mcs_write_rx_sa_pn(pfvf, rxsc, sa_num, rx_sa->next_pn); if (err) -- 2.34.1