Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp1073660rdg; Fri, 11 Aug 2023 08:56:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGQZunvTGqszZ2tv/XDgjOA2MsQKvi2F3GRY4L5A0q11bKVbxzfkz5ugg4G5jCAcKxgxXwb X-Received: by 2002:a05:6808:1245:b0:3a3:78c7:58d with SMTP id o5-20020a056808124500b003a378c7058dmr3238856oiv.12.1691769368564; Fri, 11 Aug 2023 08:56:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1691769368; cv=pass; d=google.com; s=arc-20160816; b=FXG+JxllRSp5pfj1sQe95qBCjM0aGNvtMZQAm/m5bKj3cMf/5mTvxjo9MNGL6/Y7SX s8FqpQBKdCCuPcldD+RyJLYDCW+OmaHYuG5Lw7bGLvVjiBf+q+V7MfkfH/c+RjGMa9bY dzRL7gDf3yOQa0gTcyBbqAasnyDlu0jgZD/59wZwO9i+iowshwb042wk26PuybZLvZiV 1cHyGu2SR6cZ6V9UwBa1c//U5ZQAyw+wZ1jI6T9CJmyx+vIzCjs/yC6dzCnwMcGZjBpy tyZ0Oi7+o8NuBTOcUZrvevfNFpSKTZ8eelxsZ9wUH+m+fQqnNtGov0hhufT/nBympyvk RszA== 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=iVsi/i1yx4kwhMaLV9kwmwH+vEyaFigGUIjKMRzibiY=; fh=/McxEPFcP+MaPwGmLQCcO8U2lTDIUYjMX9TZfDKCkOc=; b=ouaScucdcXFjevGtQtgAywRH4b2QmoSwJQOCJW1nvCMa9PxkM1JeI4axiH+tpz+k1i PZye2TuCxuAGVKjIgAUGM8O7pGbKHxUV51byZr+w8xMjIsl8a6xwK9dp3I3M4wc+lw3G pgFWNKsDFseQhTZJ92d16Hn17ZRogoERFBuPp7MD1udCFfKBwlN1Zec5sZoc8OKUMLhb Ckfvi8ZaIAg5Xz4yovY420g2FwtkZEn33IlKoYibwbhDe+fUbHHar/p6BhC7ZDeHllB8 A42Iv63DnVaBjh/3q0/X2297bSAs5lfKBniDYyCKqzSvry1Zx0sTlkTywwSCH0vzI+ik /xiQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=gGFhOGi5; 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::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d187-20020a6336c4000000b005652bd280c2si3626152pga.141.2023.08.11.08.55.57; Fri, 11 Aug 2023 08:56:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=gGFhOGi5; 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::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236604AbjHKPdr (ORCPT + 99 others); Fri, 11 Aug 2023 11:33:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233325AbjHKPdq (ORCPT ); Fri, 11 Aug 2023 11:33:46 -0400 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2052.outbound.protection.outlook.com [40.107.8.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A469A10E4; Fri, 11 Aug 2023 08:33:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MpUjM4YD+vKU66A9wADdArTIprwvFbAkiUMYupbQxPf7Z4mI+UjJiCsJl4FGE9oSPoBK8Xc6t3jAkR/LeJ4kj1EDSiCYCXzCCEjAvr0a3oZ/+LPd2fbT9Wt3Rc/mQstibPebmxgoQAhRbI+uRcVfSIVIX9uGzPiq5FSd9mMRl5llAg+e/dJUdGgmzfGbjzulYYRXgGEnCxcIaAcMo0uNEFwaSSCseKeTGZpeU49029h7jn9rsii10xsmU0vPNxLdtwijpcfoWw1oojzHVeTbIe9KMYPgXtbfVbQMN7H06J3W5ciAcqtihNIf856vfqRrUHE57/nbGSGEtMQrrrGBEQ== 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=iVsi/i1yx4kwhMaLV9kwmwH+vEyaFigGUIjKMRzibiY=; b=Ybkg5YrR92ErKHbBuNveLJFS6iyaSjpDtLjy4dDTFvOatEEGW8qlMw6xnRxmHiHzo+eqlBRY2CKjU8xFrwvJYJkLqjEN2SrZTIbz+wqTUg2UR2htDWtHHBjwrAZn7SeqaHepbnAUQLUdXPWsP8bfcp7ufcLZUG8OlZkezI7GDbdFQIaOFb7UzVyozxL3a7AG35KIqcAn7S/wfTz0Ki01MOgO1DGOj356fuEo3UbkU06nYtmZM2BWOYlIbbXEUqPmje58j/BWBHCHSps9sYAG+btIbVhq1UZMvgUZaPSPZmLltMAResFSmFD8v7ijUVtyFt0A61izswq4nLlIXOt2uw== 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=iVsi/i1yx4kwhMaLV9kwmwH+vEyaFigGUIjKMRzibiY=; b=gGFhOGi5DlwfqW9WpLik4vznshCHiyKSgW978Qe9Y5hmAOISD78uGor+fxNNPYxpliUeE1FkgKo5IQ6R1AHktE/7LTBHau7lZazOJ3ltBlYqlB6TV8pGd8WnZ8pbWMVGf5Xr5nLuive7KeK3+xmOF+HJId1NLdHrKEDC937BY0M= 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 PR3PR04MB7338.eurprd04.prod.outlook.com (2603:10a6:102:80::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.30; Fri, 11 Aug 2023 15:33:42 +0000 Received: from AM9PR04MB8954.eurprd04.prod.outlook.com ([fe80::2545:6d13:5905:bf50]) by AM9PR04MB8954.eurprd04.prod.outlook.com ([fe80::2545:6d13:5905:bf50%4]) with mapi id 15.20.6652.029; Fri, 11 Aug 2023 15:33:42 +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 Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Radu Pirea (NXP OSS)" Subject: [RFC net-next v1 0/5] Add MACsec support for TJA11XX C45 PHYs Date: Fri, 11 Aug 2023 18:32:44 +0300 Message-Id: <20230811153249.283984-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: AM8P190CA0006.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:219::11) 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_|PR3PR04MB7338:EE_ X-MS-Office365-Filtering-Correlation-Id: c68958ff-28a4-4954-6179-08db9a8057b8 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: 8Tt6HPkoDzIgdPO+xEQW4BoSuvtLzZvYn3+w6/Gsd0JmKsjHi0BANjhk0wgpt2jSZpRQm/LXLd2nH7L8ezRsUz2WtADChzSfjuytSbO4+9c9M9YhBx29Aotl1CIO1CtkiAUa3i/4OsQfxSzAs8W0Lx0N4AneA15MdTbiykKBAu43QSPF4R4MvbM7qxbK+ix4EGCcYlgnlG2JMnb/uj+WZ5xYtXGxXo/UZ6+V+r03ZzfP4cCgzxw1BQQBiILEm2JimhdxO1c6BNYaG0Jz0DoXsmE4x6KboXurTj0mnXqIMKjmVQI6kPgDbD6UzXORTFmg0DIa6gpMXU98TYeZn2i2f6hjC2Nso4Ad/EtprOFepDO3JbV07Wxq/VjL5IUR6IpN3fg1rQWzKW01qW5kBL+esccKWOIuG4iRA449XGnFsV8LZQZy3skyvrjbNy76+vsbo0JxdgxDWsSm5+sJhOfhTYyNNUEJZcOW6F9wwAclZG4f/uScIZioF5M0az1EYTqKCGU+UGpJ8KYVUSwTwnXqWKDzkTA7LYwWqHqH0YT1sy0goYElkuCGcdK824Cxxdcr5YfD5XxCnz4AZG/cgHRJ5PlLGoI1s7h5oZ6sQAWd+eMYZAXiEkXOtjVQiWt7WIwt 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:(13230028)(4636009)(376002)(136003)(39860400002)(366004)(396003)(346002)(186006)(451199021)(1800799006)(2906002)(6486002)(52116002)(38100700002)(2616005)(83380400001)(6512007)(26005)(1076003)(38350700002)(6506007)(478600001)(316002)(4326008)(66946007)(41300700001)(8676002)(8936002)(5660300002)(66556008)(66476007)(7416002)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?rI74vOhSGH4tzR6SM//yHWsjRio6rXbACqx3ijiNiv8VnAfFHUbGxK05Mv9n?= =?us-ascii?Q?seClyhn6DBlfxYHjLUboAhlE/op5nl46lWHm4kZAuZOlm9hnLUCh/6GCChcZ?= =?us-ascii?Q?GpbjiIHg4h7haXrR8pUFHzgdL+Irv0vX70UnqoAZhBNwmPQRnTgNe/SJ8HvM?= =?us-ascii?Q?KujvRfnlGkGZzYrlHboxaG13s5j8uubpcd1hPdAV/nNJpa8fJ1qV2MDxguRW?= =?us-ascii?Q?M2kCQJkMV2eGIv090n7Jxk4EtFxLIVMfSyeGsgKe6GcttLhWxtDisvOumk7e?= =?us-ascii?Q?erVEXlVNkPdCxLiZp+2VSrixDyE5/PQwsu5sQB8f1rAderbaRBQWTnbaY8xl?= =?us-ascii?Q?JeGeAmSeEyCmpMxQm0nMo+pUhqv3u3RlZG4ObK3O2zWMWj7WEtgdtgUIDx+x?= =?us-ascii?Q?6KHKeiD/oBfIV8EnKwgvb7CXj+fYcQA+xpP0HElbnvWqMntPRh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YsAq7uHdjxwoDXp/h8BgLncqJJu598pB1OzweNPAoiwsHP+3?= =?us-ascii?Q?N6LAEqim7Y9EYeycYaRZaHsNF8IKkEkv5ZN+u/SbgdarTs3evB4tLRC0Hkj7?= =?us-ascii?Q?k9quWsN3SABPgxPaq6ffBUfvXZu+F/aEL/29p+V7+3sNFYsDkV7ETutdz2w3?= =?us-ascii?Q?0fEeswrjy7eQ+uuIwxOVWcCDHd0rnKOTiyyfR9zqEWEsGPTEopD69J4sNCzy?= =?us-ascii?Q?tcuujTTgdD6EqRf9mJFUTCOEtrhWW23W0iQEWK5s8t99Lw0lJCjlX+/H6c7j?= =?us-ascii?Q?IQ=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c68958ff-28a4-4954-6179-08db9a8057b8 X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB8954.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2023 15:33:42.4113 (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: /zyHBy8Bi9SBJUh9vnxIdfgh/VaU5CjrnYh9WBtBQLRffOu8dte1Y1+PGzvwVxNlUytG4wLxYV+lomqtWWQ70bLNHd3gFg3mTmtWAUGCunA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7338 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 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. On the RX path, the PHY can insert a similar tag that contains information about the RX SC which received the frame. However, the RX tag is not enabled in this patch series, but I consider this important for the review. Radu P. Radu Pirea (NXP OSS) (5): net: macsec: declare macsec_pn_wrapped shim net: phy: remove MACSEC guard net: phy: nxp-c45-tja11xx add MACsec support net: macsec: introduce mdo_insert_tx_tag net: phy: nxp-c45-tja11xx: implement mdo_insert_tx_tag MAINTAINERS | 2 +- drivers/net/macsec.c | 79 + drivers/net/phy/Makefile | 2 +- drivers/net/phy/nxp-c45-tja11xx-macsec.c | 1878 ++++++++++++++++++++++ drivers/net/phy/nxp-c45-tja11xx.c | 72 +- drivers/net/phy/nxp-c45-tja11xx.h | 37 + include/linux/phy.h | 2 - include/net/macsec.h | 12 + 8 files changed, 2051 insertions(+), 33 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