Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1106179rda; Mon, 23 Oct 2023 02:44:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGubTZXc06iJXmQUVwZ52GKnJqMGSOqjOt7Us1amFTRnmv+Ffpymwwz/2bq8E7KJPF35zP5 X-Received: by 2002:a17:90b:46c2:b0:27d:4283:b8a2 with SMTP id jx2-20020a17090b46c200b0027d4283b8a2mr8194055pjb.14.1698054250889; Mon, 23 Oct 2023 02:44:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698054250; cv=pass; d=google.com; s=arc-20160816; b=Jw9UB39JB5mhxQMN/ZlCgKaVFtHTbQ+sHSyGBTXXG+FZM8WliveByne9HdgmI5cmTq P1+F6lxzPCOCgYUC0BWiaooQNYYmor3qUKvD7yoiwMijnf4ienr5smw2B7Gsb+w42B+f eVL/oTW9+lgYbU0ooGD/u4/X57C+eboXnJ7JP7QYBhBemSBB9vG6/h6qcOUYqNRRQazp nz9B1DY9wuG22FGFMlqVe7MKhZ29/lnXKeIuBkiHcun0MTHxn8Vyl3/a2MgUSZEtS1df mWxOh1rplt4agiKXfHypLSyhMmFMpWFXb8Y/XpK0IMz1Q8bWitZ+mJWjeAcvCsBYDsSu 0ySQ== 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=x5iOtSKH2MAw9ZhqeiV83lh2GmFIQD8PcWmZLhbUGJQ=; fh=s+N9zLYkhYW6x0tN5kM/nSX5iVt7LcJWvFt8Uz0wx+Y=; b=hH4yzIWy1G2gzZaVVgEwjTgcr+Y8X4wsx9b1MP0kI7zar7GGW6LlQBzfIoQqtHSrCK ZHNti5bfw2qS4Gh1Q3BCPVJskUOWQZCH1ImxKDytbA/B0n6Cykl+YHWMd6mNJHCDsdih I4LXWdgLSg5Dw8SitDAkYRDSsyaULB2rFtlL1j+PaodFJqEN2nwoeK7VoH7by5VFIQ3D +09McsFALR2c2yYatbhtMETy6fau/HZI+lXOYAC6QYUFelrErsKE815qW9idIIZb1hiQ qR2UwMixiwes+/efc9vIjmzVLvEQYBdfzMJHn0I/vZiG1c1NbUQadNkPEwv/i3ryqauW 3CqA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=i88AGMTm; 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:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id 19-20020a17090a031300b0027491bac826si6175094pje.140.2023.10.23.02.44.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 02:44:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=i88AGMTm; 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:7 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 snail.vger.email (Postfix) with ESMTP id 7551580B232A; Mon, 23 Oct 2023 02:44:09 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229912AbjJWJoH (ORCPT + 99 others); Mon, 23 Oct 2023 05:44:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232994AbjJWJnx (ORCPT ); Mon, 23 Oct 2023 05:43:53 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2073.outbound.protection.outlook.com [40.107.6.73]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BAF9D71; Mon, 23 Oct 2023 02:43:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EbMoXXWiB36o5B8HCXREj60Cp/2H2Oez+fj82LlLJvF7sFGp3tAjAyRq9uqKHQF95l0rg1XxS0xv99uUDQs83HtY1WqOld6zIZOTuM1+yicFCO0DlbLeBhaUu2zJPRxSJDQS4ELWVnTOWRbhuBQt28FlHcutEmY+ZnoCjGaJqhx/frGrPxUFdokYd5inBgMuEafV+QVlsqNeH54tqdzlo9SmqGlmNpQMBQZfTOk/kePxFR1zfs2+RAHMEUipQa7m+ZODnzC8rRiTJA/xNmsnXGtlYrVpkKBm5gEVs+zky8LlcFaj3pPCtMg4OXNt3bCN6wgSKVSvRwQYRyEtnAwuyg== 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=x5iOtSKH2MAw9ZhqeiV83lh2GmFIQD8PcWmZLhbUGJQ=; b=ePw67QWDr1IlPwUt5J40INpZkEvB23gtvw97QX5NeHqnFpcTeYi8FB09GpuAoZHmf33HalmNo5QZaHaYhu7VguW1NUlOkcW81YgPSDCAWJ+Ba9YRkaw+UWLc3qAuptxTJSjMBqFURR06SLmv1v++FdukX4M0z58Q+RtNBsYwLqo6elya64kcLjC/Z85mdENlTW7NttMlBhu74bS+NK3FXz1Q3QNmzV/FdwF/GR8eMUfL++wtlbWv7j0GeUbENrcotyunLlhFzL1gQ6NF1dKqoN6pvYcqYLkg4jTlBUkgkMZKHjo1Yb3QiYwoJM2pBlizZno7sLCz6KCianTOC+ywAQ== 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=x5iOtSKH2MAw9ZhqeiV83lh2GmFIQD8PcWmZLhbUGJQ=; b=i88AGMTmLEUM9NrkwkaoA9l1L5++bwezp+gxPpS9xd0kTO8tfA9XWFVer+Gwal1C8JX0FWEOVfbg0TDtMadz8mbA7EK6o2CY1A3C0fFrF2daQRfpKoA6CNOuf/xnDqLSNEEfTUSZliDGt6Ogyq1vrUwsRtgkZmFr7kWi5AZ4/UM= 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 AM8PR04MB8018.eurprd04.prod.outlook.com (2603:10a6:20b:236::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.11; Mon, 23 Oct 2023 09:43:47 +0000 Received: from AM9PR04MB8954.eurprd04.prod.outlook.com ([fe80::b1fa:fd23:8cc2:f5ee]) by AM9PR04MB8954.eurprd04.prod.outlook.com ([fe80::b1fa:fd23:8cc2:f5ee%6]) with mapi id 15.20.6933.011; Mon, 23 Oct 2023 09:43:47 +0000 From: "Radu Pirea (NXP OSS)" To: sd@queasysnail.net, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, richardcochran@gmail.com Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, sebastian.tobuschat@oss.nxp.com, "Radu Pirea (NXP OSS)" Subject: [PATCH net-next v8 0/7] Add MACsec support for TJA11XX C45 PHYs Date: Mon, 23 Oct 2023 12:43:20 +0300 Message-Id: <20231023094327.565297-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: AM0PR10CA0079.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:15::32) 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_|AM8PR04MB8018:EE_ X-MS-Office365-Filtering-Correlation-Id: 74363da9-4054-4639-3f4f-08dbd3ac8db6 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: qsw0daDgW+6cIwFGw2ziFXp+/N+9LqfhesWdD+FADSm7+YwbaeQ7kQSTjDx+8VMOYc6cBbBLsEdXWaVUW3F5OKUmdk9Uqk/0bjwE04Mo/fIB8OiFjIsHyvaNPhil2G/86H5+uT06lvwmqxQpKoaJU6qPE/qLU7r7iGr1/yaslMNwSf3uqjSSdDfPIgNehaJQ8G2z/TAAxytQipmS9OAblPkeoHbMe4bS+W/VWMqDBWykE5wUi8griFByz4Mnag7scN8KVpYCVOVdNzedreT1LtdjoxYu4p5kXVn5d/cd3UfAlqcjSo5mAp55JMyiqL+/1HB4QkHGPYqO5VM2BRHI0BHiPwBrxJusUiAI0PU6Air2bQS1t2MNgSoutMMZLE7o4lw0lMvVkTCifXVVWfCcDW5fud4yFL6N4EbrI0oNTMKjH+8hnshyv2W/xRCXL+j+eaJVnklzdU5v4j1oe5+UuK1E6PF5a6GIt4l7TtwnXwdHwOjDTYdV/WoAW+PKnigYLq9z4ba46UztjkUiajyLwca60gLZsSlmDremO5VFf6Kmb6zCLKbCwO65P1uw7+8gnG10+C4gGa/gL77OlpxJiATpJFV5eiKyRfbW3JrwolUrlD/5D7yCovriZyov8zWV 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)(39860400002)(376002)(346002)(136003)(396003)(366004)(230922051799003)(186009)(1800799009)(64100799003)(451199024)(2616005)(7416002)(2906002)(26005)(1076003)(38350700005)(83380400001)(41300700001)(6486002)(478600001)(8676002)(38100700002)(52116002)(4326008)(5660300002)(8936002)(6506007)(6512007)(6666004)(316002)(86362001)(66476007)(66556008)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?IHivM/WmLtgNUBDGPx0wzzjxeV4kPlS0e4k9N1yCD+TbHuCwrXtoxjAaM0HR?= =?us-ascii?Q?SJ/geWDh5UDEk+ykdkzGqssFJdqPg13Z8pDpqUYUE/B6pQQVl4P0fG+9ZIDm?= =?us-ascii?Q?pO1Vy6Nyx65n/VFmhDLgWnmMf8IIWKysqBwz67skdVC1zrd3kdKO9J0Z8lXj?= =?us-ascii?Q?1DIjBREgZObFxfmaSFflNpz3QmeS/p/5scPmhOO7rBYdvoRs5HZ1yJDYgUwi?= =?us-ascii?Q?f1TtZjV0pY87ollf5A53jP6cVES6N+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6U6H5jh/vO2Yc7/pQvMeAAszunaU/L2Mf1CvGNnbAE6neBQO0pcaYLI+?= =?us-ascii?Q?69D1CsPjSsFw4fqfzcI0a5J+kyrXAmypV9q3cGuA/ZGKS5NyZ86HzVpQQBH3?= =?us-ascii?Q?pOHMUEooNH2xH7gzBmdZdrXjkFoXXy3Z3evZnDcwW0CsFbs9Fh5k6cHpQUoV?= =?us-ascii?Q?OHCp/OfBu2hO1jgpOTJybtd4KcgdZegHNKhOjvDChnbtI8Plyf6oULgXK8rn?= =?us-ascii?Q?qfyhm8HGrfU7ZST0dYUcSuXbtEUYD6G7rZ+IOq+DIPSA6nqsqniYwZQ/OnCX?= =?us-ascii?Q?VjlmTBHtA6ZSAJm/fVDKHIEh0Veono3DH3tJQ+OrLdkuqerJxKHQI4yqKcL0?= =?us-ascii?Q?80lF1+q1R/pdSZU4TqaQyb/JZ9OQcN03CjSvJflcdIKqH3RX9u4VaTUcGDuo?= =?us-ascii?Q?Q1JZUucsOIaU6mNQmJjO9wA7h7b0tGmeD7hrMWBAlozSCmZzjSJPg50mrS2C?= =?us-ascii?Q?Nw=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 74363da9-4054-4639-3f4f-08dbd3ac8db6 X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB8954.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2023 09:43:47.1811 (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: eukN0qw1m0Vjzddy9okFBxDV6rb98/QTqRtzuL8aQWNN5E0O9/Z3BAI3u6xbnIZuMWuzZW804wRzXI8XBa3sF4jLJm+LhEDKacGSzU1KtN0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB8018 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Mon, 23 Oct 2023 02:44:09 -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: revert the MAC address if mdo_upd_secy fails 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 | 130 +- 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 | 54 + 9 files changed, 2011 insertions(+), 51 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