Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1351241rdb; Wed, 20 Sep 2023 07:01:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF4a9RHnh98QculNsgt4s948lQnrvwYv6qfzsw6WkAOhTZUbPd1PCx3SqB++C3rU1rKIu2L X-Received: by 2002:a17:90b:f12:b0:26f:b733:6887 with SMTP id br18-20020a17090b0f1200b0026fb7336887mr2487203pjb.27.1695218467863; Wed, 20 Sep 2023 07:01:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1695218467; cv=pass; d=google.com; s=arc-20160816; b=FfB82bTynAY3WO5+ZLK23E2XCR91Mb7+HzHETbG5Vs7RKfe48O0ouqWz+UvUXDcJ6h Xz35Cw2fLoXZ+ru0GFfiBIq8RlLADH1KeXrZNRQKDGULR/0IyDQg16u0Me/zuFJl3ysp 82e3l9eOI+tPZ3nenjf111/3bzaxQ1m6Dhj8kLuBeigKTcNlK2fsLIDNqLV6XaQEuJIW 38p7+Vhf8PqDmdQhVakDmvkwPDTmhwPLLuqvokZmVezmV4lR1YUMInr2E4VhpMHizMnD c34p1nip5UJJHnTn5dUBIa5Z/dLuGkZzRl5/5bd/gfqTpu0r9nTz7hGF2wFFCP5nwnNV uQkA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=Zl8pt38Xogqp5vRRnoSMx+wK/pjlZ+pAyb3ySUDvfm4=; fh=NHRRo6huwoujaubKF99pfZhRLAgifT70TQY5FYo2edY=; b=Om0AkW4wEnhSPrNtYXjUZ2osFbZSp12U5v6JSgJKhvto/zRb6MrI8Vv7bE/rcxM5S+ U6pewUKAta+46LAnqcPFwX6Xiefa6JorZe851I1EGgm0f2nCoajZg+2EoMsFD4ePTYlG b4kXBQ88LJZIAOjFboyRherDHtcr+liYolKeGi8sBzxSRyaxb9XAIEOEozKBSB8T2XbF /5dGGMRM+G0dI+AS+Bt/uEVSr+1odbNnTmaCyLaLdJqHLpeD7S/kHllQeAOmDaArbL0w WtHvsjm9zA209o6l/SFvpQQSNkiuhJvqGSjZnd3H1iaFwgEWQOe6wsvjyBX6C6c93Dp4 EBeA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=Y+NpIK1F; 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:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id ce14-20020a17090aff0e00b00263dcd605a9si1572271pjb.25.2023.09.20.07.01.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 07:01:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=Y+NpIK1F; 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:8 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 fry.vger.email (Postfix) with ESMTP id 6CB3A8290990; Wed, 20 Sep 2023 02:23:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233974AbjITJXL (ORCPT + 99 others); Wed, 20 Sep 2023 05:23:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233556AbjITJXH (ORCPT ); Wed, 20 Sep 2023 05:23:07 -0400 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2060.outbound.protection.outlook.com [40.107.105.60]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AEDB83; Wed, 20 Sep 2023 02:23:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CSGWnzLIL4r2ebZKbLXbfN6ygnhNIAkeXP/LpIjVfFIJzibL0u/qQFs0ehIBE1wUK0XarK5WzOO6LeCLwaTt2quroIWIkFXaj1Qsltzgzs3gps0EvWsWABj0Zho7Oehy3ZghTwiHZwxO/jkq32+Tg+oIJL4RnM+fCQykfbTgamvwmH7zpiN63dR2A2lNxD2iQ/TLVVapEcxzjtny7QDdK8W4MPOXnXBXJbhIDTBxSH0AzjhL0eY3QB0kfpX27yOtAjmQrKcMiwHUNRGOEObI/Ne8qyxfCHItpRBFMM6nMj0v1DDOH3dduI9W4OULaZlCadLZu4epZ9ZZQnwOEAhFKg== 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=Zl8pt38Xogqp5vRRnoSMx+wK/pjlZ+pAyb3ySUDvfm4=; b=f7kdSURxrzNe0n3Un5ASNqvqM/IMc2Z8v19kwNQt8yP7bYooKufw9eHjK+fBgrbtzoUh2aWiHi70l2tnYeeJyJLQPBhA/dQqNT0MKK24gmrhVSdSAQ2vZjqJxhFC0/AyvAgFInA/IdNrqXbnBNB3F+f9GPRS2ifi+20HpqalnXXMHhSK3BJia+9rLzRNI/U+vVcFADE5Z0PNWmUIfmcl5O+hIlG3/XQsxgL1+L3QYlCBVymqtznJ0iuwH05FIgyuUCDgj4rTabvPMj2UmSWTxLBC9wK2wonBth4JzpWH/4x5zS5qrbVckf0sjfPjq9IDdITT5r6hvxbhKPsxVBXjcA== 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=Zl8pt38Xogqp5vRRnoSMx+wK/pjlZ+pAyb3ySUDvfm4=; b=Y+NpIK1F2R/E0Z3mj+YSSNSTKC+BuRVnnHcMS5FuTKk9m1N3RqX9Bu4/1Ld8/u0NF+Pdh56gWFLLluXWKYpaaZjypC8du+v1+Bf4PIeRpTLIGZIqGv6IWG8GrWkP3BsP3k50n9DLVxPoBLAuMbtwKe+OZbQC34vT3y3Nsdd1PaM= 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 VE1PR04MB7407.eurprd04.prod.outlook.com (2603:10a6:800:1ab::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.19; Wed, 20 Sep 2023 09:22:57 +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.6792.026; Wed, 20 Sep 2023 09:22:57 +0000 From: "Radu Pirea (NXP OSS)" To: andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, richardcochran@gmail.com, sd@queasysnail.net, sebastian.tobuschat@oss.nxp.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Radu Pirea (NXP OSS)" Subject: [PATCH net-next v5 0/7] Add MACsec support for TJA11XX C45 PHYs Date: Wed, 20 Sep 2023 12:22:30 +0300 Message-Id: <20230920092237.121033-1-radu-nicolae.pirea@oss.nxp.com> X-Mailer: git-send-email 2.34.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: AM9P193CA0019.EURP193.PROD.OUTLOOK.COM (2603:10a6:20b:21e::24) 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_|VE1PR04MB7407:EE_ X-MS-Office365-Filtering-Correlation-Id: 18998608-b5d4-4ea1-a271-08dbb9bb2d4b 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: BVyMzbro7bWAqTR8Uj+sPas9xOG2a+aTMWhR7cCyEFLrB6tC0I26VhHoUTIGtX0DHoyRD4ed5PBlCmd9RmJyih+7hLptVFUmfxysqn1CYNTxuN8b2DaxsDywfIsuWqEQ4iwb1aBTYTE9w3x2Qx79vX17rL+pqyQLAZM4gcB6WkjPGeNh63wnBb38WvNlF2kdIo6QAOeRWcLG0ExqoCJIqXBC215bEc1m2tQVwVJozKLqQJe5myFOWAZYbx12q52ABEV1t3WnXNjRKl5vqUEL5GgefOwsTKKT0vduYDcLqZWZTUEy7Y5FFDcQYagCOSRcIQZi0qujmIUYqspKb3KASB9dlJbl3nAdMIElwnRSK6N6kE+u0WRjxXWkjJZ+AsAV5HujUROmL6XyUA0HsjxWous5X/w6D8igSBooVQgSBh/xFDFTDbCqBkd7cd881FeqNUYKt9jxq3H+F3xTj0vQQF3bjlf5dhCqAx+1E6i9VyhOwSz+DAZySgLKvXRoknCMdqPRzOz4Q1lIGk2BitoNQeJU6eA9WybPnHv8SQhOeqM22twMwHyvaiA57lZSrkFP+jTiPK+ZfRlWgoRofbqlwMY7+EIcCsc0hedll4T91lS7PyN+A7TRkRi+hNMkWz0yDxXzLPLMOxv+ZxxZAtqr6Q== 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)(366004)(396003)(39860400002)(346002)(136003)(376002)(1800799009)(186009)(451199024)(6666004)(6512007)(6506007)(6486002)(52116002)(478600001)(8936002)(8676002)(83380400001)(66946007)(66556008)(66476007)(6636002)(316002)(5660300002)(2616005)(38350700002)(86362001)(38100700002)(4326008)(2906002)(7416002)(26005)(1076003)(41300700001)(921005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?/5zMO4jdmcTgkFxA4/nq2A1srcPO5zhsFJPAMOZ/8lL4AN7NZ5ULqAlTTQTJ?= =?us-ascii?Q?1DqMZGinXXi5sir5XWOCE3M8qlKzYMvJdvNMIKvMc1Lwj0TjNRqTnbvWP728?= =?us-ascii?Q?aFL8D6V7UnksbQOV3x3H3H/Af8rSxgppQuuJ3D21kJ1bhvF9CUmDDyv/Uue7?= =?us-ascii?Q?H3EBle7PDPQMm3TaAzXM0CkYrP+7T7dLxnzSkRRhmnvY8tRXj1SB7qnDbKAg?= =?us-ascii?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p+uHz3w6k8+GyfOrynik?= =?us-ascii?Q?dJSi5gWls5bFMAgowPEd6irI3VJ2WBnvFz/2imYT4U6CpkwqkvnlC2PrzjbR?= =?us-ascii?Q?0+DDEjd5ywEiAwrUTXDhi+H4rmvkFTHdLeVL3iJ52nzsQteKpG4LNdIWULwl?= =?us-ascii?Q?0g1CGUCAij7KQoyRjJ8oJsIJnJf2gLkXyoCEHuXbwMYXNjyRE6b5DlvU03y7?= =?us-ascii?Q?kZ/XfGtfus5i6hSymUO/RM9V1TTtPBvSO4xFVqCqKZfXnpJgw9z+abxG+Jws?= =?us-ascii?Q?7A0+kvIiORd7NH9N1JcLKlp+mRvikDKoWnDnYnBHsrJijzSmllnMKAw37kFt?= =?us-ascii?Q?VoNEV6iHCgU7MPAdQ/8v+mBBt064WNRKnUsWcHzf5IaQ2v/8UjPeUnrFkBz/?= =?us-ascii?Q?Ca+MtpDXDoWpQVC8W3wfLCUqk8gzH4RjmCJa4zK8KZBmGnQTTVJCyizxhCbi?= =?us-ascii?Q?2JhLStzw/dJ2lQr83r2yv4nD/YEqDovh4ZdUIjgDg5zIdxfGpzaEFTY4KoqR?= =?us-ascii?Q?gA=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 18998608-b5d4-4ea1-a271-08dbb9bb2d4b X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB8954.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Sep 2023 09:22:57.4342 (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: tlevI3jyyANXBqtfzHd5auRaMZvsICK6wvMsao2vxCAtQAVzG4Z6/Axx7P87oo/TyzLUCZKfb86/0rYIVrN5UF1QRkfulLvXmWE6Rk0NzYI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7407 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 fry.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 (fry.vger.email [0.0.0.0]); Wed, 20 Sep 2023 02:23:11 -0700 (PDT) This is the MACsec support for TJA11XX PHYs. The MACsec block encrypts the ethernet frames on the fly and has no buffering. This operation will grow the frames by 32 bytes. If the frames are sent back to back, the MACsec block will not have enough room to insert the SecTAG and the ICV and the frames will be dropped. To mitigate this, the PHY can parse a specific ethertype with some padding bytes and replace them with the SecTAG and ICV. These padding bytes might be dummy or might contain information about TX SC that must be used to encrypt the frame. Radu P. Radu Pirea (NXP OSS) (7): net: macsec: move sci_to_cpu to macsec header net: macsec: documentation for macsec_context and macsec_ops net: macsec: indicate next pn update when offloading net: macsec: introduce mdo_insert_tx_tag net: phy: nxp-c45-tja11xx: add MACsec support net: phy: nxp-c45-tja11xx: add MACsec statistics net: phy: nxp-c45-tja11xx: implement mdo_insert_tx_tag MAINTAINERS | 2 +- drivers/net/macsec.c | 94 +- drivers/net/netdevsim/macsec.c | 5 - drivers/net/phy/Kconfig | 2 +- drivers/net/phy/Makefile | 6 +- drivers/net/phy/nxp-c45-tja11xx-macsec.c | 1724 ++++++++++++++++++++++ drivers/net/phy/nxp-c45-tja11xx.c | 77 +- drivers/net/phy/nxp-c45-tja11xx.h | 62 + include/net/macsec.h | 55 + 9 files changed, 1988 insertions(+), 39 deletions(-) create mode 100644 drivers/net/phy/nxp-c45-tja11xx-macsec.c create mode 100644 drivers/net/phy/nxp-c45-tja11xx.h -- 2.34.1