Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp473219rdb; Thu, 5 Oct 2023 11:08:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEnTDD+TvrI+MyvL686mEk5SpEk643PN9XniWmYGLaG//GzkeS7Ah4KnOSM5n862Uny6OAD X-Received: by 2002:a17:902:ef8f:b0:1c5:fe75:b304 with SMTP id iz15-20020a170902ef8f00b001c5fe75b304mr5057567plb.59.1696529318781; Thu, 05 Oct 2023 11:08:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696529318; cv=pass; d=google.com; s=arc-20160816; b=Wi+AEtwPpQK6W8tvRYTL9MKmAOKzFEEue/uscUVVou+zXyeoFQwPDiFe9+Ggra+I5v apbaXImXk209Pnho4Us3SEYaVOFeTeR1rx5nqPncrPv7UBsa5m+snsSF0Y6rv7HAWASw tyvlHH6P3yHeq7gywgtuLS8H/NMQMQkJlQN9cTZhrQ6GAOxAgW/GT66Oz6pOqjuAgzaq pU9qkQsO4/9ZaSN8OGdhxfiVTHFLcJgoo1c4iSr4otkwdhFhhtgVFSrl1qPOlqGTXLvP +Tjr24eqE8d4HXe6P7sv8XQ6iB7xSNqCAY0czcbGaTJmeHRap3BUJxCJQR1jH77gYMXJ M8hQ== 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=XPFhBZyLC0qBinCvNIGYq0QFRoz4qNOw8azdrzHJyIs=; fh=EKQQ4bYwtC0dyqARAmSAa7wb7ZA9Yxg4HcG53waFRSQ=; b=N7mnyWRrIuWc3xDz74aE+6ie59QhVcEt6DAHU0Kxlwt6ZLmhVh1ExbPfiA8/vLc0mv ZNDioZwUHnUTIhYlyKxydK0TEQRWq49ckw8rqfe9M8Vtdwvem1nEtlvzAzBUfyn4KuMd mZjzPAUGnfbq7kWmOwJI4Q1u7VoufI64LLwZrhYIUA6cRLWGcPfT9urxrx01Qz9ZRmxa Ysgq0YTlydaaBrvw3gZcdNKviCexWMKV93e+qBvzWoRb9peh9ufkWh3LZMTpHfks+daQ Co1P8saRWw7abPCDvqeGSe4LYaObPa0+LSXR3AdUxVJlRBY4sLbmlsqkZTZN8Jo+KnJP 9vDQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=gFJ2EPNT; 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 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id j190-20020a6380c7000000b005641315d956si1979726pgd.147.2023.10.05.11.08.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 11:08:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=gFJ2EPNT; 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 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 1E2F08222299; Thu, 5 Oct 2023 11:08:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231724AbjJESIC (ORCPT + 99 others); Thu, 5 Oct 2023 14:08:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232135AbjJESHl (ORCPT ); Thu, 5 Oct 2023 14:07:41 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2085.outbound.protection.outlook.com [40.107.21.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 820E793; Thu, 5 Oct 2023 11:07:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Iu7BWHsSxK77pEZWSyps2nFaqxFYODkBkwn2y2cYVXPT3maJnw+a3FyHACIr+Rb5/oN6P/PIVFXQew4c6WvkY00aId4ZWS7ClEtBxHBCGojMBoRTizrga39TECYOmYPSdArXJXvqc/CSFC0jJmRO6eVVHhTQ/ngTwEzhK/85Mmr7hYrZ16petvvr4OZUlYbd+wKXUhV1VUJW5zn+SzBTWgdwf3WtLKywChgPcmNvGHUB6ebj8OBGwoG1G3quALeVHXA4NWyyObvn1wkaBfXpdzl8E729ltudMQx1GS3f6O25PgTCmaofuYaqGSmmWYypXieYqWqJnovcRSF1XNy2TQ== 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=XPFhBZyLC0qBinCvNIGYq0QFRoz4qNOw8azdrzHJyIs=; b=axNn7oUPexSQV6i2mX7jZjBLs5qoTtYiJW998t4T0Hsuvlc7Md3QXwpJqT/AEvuKorgsNuffIj2lJLxamU1LRzFW8WNky9mmOiVz+VwjjNnK/i8YzasMHY0Dku038FKmA4Zp5+zopEw7qwxO6fjtPhACltpw6OBlCOUqdRMWEkemZNlIZTVv7iAUY4CVT9pvogoT4XdKtc/KJoUFyHFuIGStgvSTncEQLtWy0On4+Wq/xl1Wcrkwe721tcCf8QuwBU8voUohlZTYIl8rjgEheNipQHX2I+QJ+zTEHWAwqZn3GfdNs0zSakxFI8+/E9PQ9Yy/pm5FFbaD3vJHGPQoyg== 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=XPFhBZyLC0qBinCvNIGYq0QFRoz4qNOw8azdrzHJyIs=; b=gFJ2EPNTOHDJKxCEi+9d8ovBasrbgb9hX1YfrexPK27Sw6B7pm3HybJoZGdPIHvmc35OCV2BlU1126lYbeAiRPuroJYz4INSj9Askaug03M2GDhdnsVMYZ/3zq2XDIj007Q/eEYKSQwLdtH54D0tPlpR1xWIfGbrkAZs0JPDqHI= 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 AM8PR04MB7890.eurprd04.prod.outlook.com (2603:10a6:20b:24e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.23; Thu, 5 Oct 2023 18:07:37 +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.6838.033; Thu, 5 Oct 2023 18:07:37 +0000 From: "Radu Pirea (NXP OSS)" To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-rdma@vger.kernel.org Cc: 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, phaddad@nvidia.com, ehakim@nvidia.com, raeds@nvidia.com, atenart@kernel.org, "Radu Pirea (NXP OSS)" Subject: [PATCH net v7 4/4] net/mlx5e: macsec: use update_pn flag instead of PN comparation Date: Thu, 5 Oct 2023 21:06:36 +0300 Message-Id: <20231005180636.672791-5-radu-nicolae.pirea@oss.nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231005180636.672791-1-radu-nicolae.pirea@oss.nxp.com> References: <20231005180636.672791-1-radu-nicolae.pirea@oss.nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: VI1P194CA0041.EURP194.PROD.OUTLOOK.COM (2603:10a6:803:3c::30) 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_|AM8PR04MB7890:EE_ X-MS-Office365-Filtering-Correlation-Id: 5d2f66ce-6c82-42fc-8351-08dbc5cdf54c 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: uIDjLEGi80KKfLoiKBfPwR6SqRkJ+sSccc8AY7alPd9vphDHJqiL8c1EX7a4oxWxSflCb3TGzhT2L41ko0BFQC3mUi+29PrRt/UPUzjsAZ2vdokL8MyR8hOkaYFRC65GyqN2fcjCQsyeggNsh1vJi0CpscSWP0c7pEEUYP7MIERHbKjoJyDfXRnK43pHQH6+tISaX7unS1c61Sse2lbOYE8WlmMaWjHaZxpgL6ciisVV1UOErPXdrh1GJM/lWUYEpTKXZSNOrPEQRFm8EgCvkYSrVvQZRJTskMgV/818omRH1IMZ/BlmZ57UZFngqDxVBIEGUSwzRgjwFB6YkIyFXYExkpUzV9dyIxM2BlRZ2FqAlOT/Z4rh3TjyXYd+vgrClJx1UCKN8Fz03Goq3aFG839x8Zg9KLR6o8XW9k2X0IVXvvMUaHBZYlTnxfiMbiutb1d4+bZgk4HgEr8PsjUZXtgnRo//voKJFY2zJ839NE1ubJ5xrYfRb3w15NnvnjN1y4hladjgmPsTAl8qy7Dv/qXTyNbz6ppABx8pO4hraRNqp3w2zE20yd0xaA9qvgk2tfRPEdo2sSSvYJh3ZstJ8O8zqQL8XcgvLa4cIbbWpUj09bLUZn1+/YGeizQWV62T 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)(396003)(39860400002)(346002)(366004)(376002)(136003)(230922051799003)(186009)(1800799009)(64100799003)(451199024)(6512007)(52116002)(6506007)(478600001)(6486002)(83380400001)(26005)(1076003)(7416002)(2906002)(2616005)(15650500001)(316002)(66476007)(66556008)(66946007)(4326008)(41300700001)(8936002)(8676002)(5660300002)(38100700002)(38350700002)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?w87/Ekzlr9nZCSapRGFAiGe57PVptEovOoBjPVxentKDEHTKqaW26LDgsP5/?= =?us-ascii?Q?05CE1hM89lti7rEPgfelnKLyf0CBJk0RBNRau9uswzrA4BKNebKDajCym/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YCAb01vZE4JheQeyfGjO?= =?us-ascii?Q?px7I9BJm6JRV7wUPmGXbL4EwePLQ3VMC5ab0r1IGKTROiN+T88YnEWvPg+tP?= =?us-ascii?Q?235Wm8sgEY+A9vBCMVE904/ZrD+SWqrLJYux+e8xJ2Kt3LCIPjt/xw6VxLJJ?= =?us-ascii?Q?o5BB2r0Qy/QsDrkuwtwXaWX7KuhFiHZpGJISBdUUCMzH4sgbR9n3epQmoZlJ?= =?us-ascii?Q?icGYF+482xq59clnDpi0WbcdmibHQGAosB3P8RI+wyUhFtl/78eLAE07RgRa?= =?us-ascii?Q?SeXovM/g3k6HZ1DTx0D27udW3HAE/CxaDD04snavPLZdq/QdDmSXuDLy0WPN?= =?us-ascii?Q?/DUuFvgbvr66MLwLYJ7DVQySowRNqCSRySDGGYW4bL3D5Tn4C3Oy56nSoDuY?= =?us-ascii?Q?xgEyQ73xpj4C0jZ5Svvu/bXClAX+afOwVUN7B2LPKHFcm/ZM0LgAXlUFwVIZ?= =?us-ascii?Q?mQCFKu2Jwt8ujq8suhyz0Q/ZOlM9pdPQQxP5m7TzxKusAi08AjS0xO52Czml?= =?us-ascii?Q?jrdDPoTqOaTpwCBcMDF3dVgxJxJq/W5CkpoK0hjieNF54fP+MbCD1jva1cSW?= =?us-ascii?Q?l8w6kCri1M65F/TO5CxlvG4auZwYH9ktL8Rh+XOyJTIPJD+jmwLWKlAZwSMY?= =?us-ascii?Q?Ag=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5d2f66ce-6c82-42fc-8351-08dbc5cdf54c X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB8954.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2023 18:07:37.8904 (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: LSZwLfTRQRK/jqqYxjWBxJfW+Raot1eWHKbWyyS2y13Ys0VkuSUIJoCKTw5rpDJ3g7SFeTE0TLXOptGQkgYxoZOhHhM341fPRva+Dk8R+gg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7890 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 agentk.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 (agentk.vger.email [0.0.0.0]); Thu, 05 Oct 2023 11:08:35 -0700 (PDT) When updating the SA, use the new update_pn flags instead of comparing the new PN with the initial one. Comparing the initial PN value with the new value will allow the user to update the SA using the initial PN value as a parameter like this: $ ip macsec add macsec0 tx sa 0 pn 1 on key 00 \ ead3664f508eb06c40ac7104cdae4ce5 $ ip macsec set macsec0 tx sa 0 pn 1 off Fixes: 8ff0ac5be144 ("net/mlx5: Add MACsec offload Tx command support") Fixes: aae3454e4d4c ("net/mlx5e: Add MACsec offload Rx command support") Signed-off-by: Radu Pirea (NXP OSS) --- Changes in v7: - none Changes in v6: - patch added in v6 drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 c9c1db971652..d4ebd8743114 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c @@ -580,7 +580,7 @@ static int mlx5e_macsec_upd_txsa(struct macsec_context *ctx) goto out; } - if (tx_sa->next_pn != ctx_tx_sa->next_pn_halves.lower) { + if (ctx->sa.update_pn) { netdev_err(netdev, "MACsec offload: update TX sa %d PN isn't supported\n", assoc_num); err = -EINVAL; @@ -973,7 +973,7 @@ static int mlx5e_macsec_upd_rxsa(struct macsec_context *ctx) goto out; } - if (rx_sa->next_pn != ctx_rx_sa->next_pn_halves.lower) { + if (ctx->sa.update_pn) { netdev_err(ctx->netdev, "MACsec offload update RX sa %d PN isn't supported\n", assoc_num); -- 2.34.1