From patchwork Thu Aug 15 00:06:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 13764275 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011030.outbound.protection.outlook.com [52.101.70.30]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1FC55A20; Thu, 15 Aug 2024 00:09:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.30 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723680569; cv=fail; b=mTXBrUDy05X04WgKIuO6IRHg8fP1Lnsys+o4kOeHuaCRzXOsXb8aIdFeMOKjib9y5Q2Rjcp4eF7IQm/PMi+pifimkBdDFZqczMUC4ztqvhctr5lbEZQ+T3vZV6A1+8eWoBFCe7pHhd+lgc4rGOy4WvafEl73VCU7sRvco+lns5g= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723680569; c=relaxed/simple; bh=JqdqPVoQKIaKtIPhR9Y598LN+cwBiChjJxTPCg6YioQ=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=AcMJeW+gDe3k0c1EcSAN14J9hVdG+CjKUavDAm/4AsUMV4ylwX7mKJKY3Q8w13HVm2UnqlnP/FJmF0EM2T08xNBwig27JSvdkA1WmkC5m1Mdf6ysRuuvNu8mwIMrA+TP6pl/zx+sJ1KB8gwQn7ZykKJBo3GqPAC8Ui/nUV+09nk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=CeX5ISSW; arc=fail smtp.client-ip=52.101.70.30 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="CeX5ISSW" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=K7dgnFQBpLkkozeTvxsYEgpy0cpZyimra8SEtrRy44wORtUfv+HpuFK7a564o35lM4d9+QPwPPhesT3wATqG18iqyRVs9qGzY4lA54po6ZFH+4gCMP+tvRZYi+oUJ7DKGQzfG8bA01VCz/+wRgvSOAWm/GPkmY4TNpTO7DgMrhOsS+YQEDgwIz4B+13tkZJHXABEdi2/OZiUOPHsNGyYdVkpkXV/p9W0YcHxZEPi9VNz1ouA86DfwEMjJQDlorvj3+LWIvJ+HImWEIzANSZzDjnORwYN87o1Cam9BfVpyAoAVHNyZwxnRrvChp5kRMHlts7nGHJrKZBFjCTWDDMi4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=2s2J5v4yNMJYUmwxuWj6s+lY7aSx7dDlXfFFyax224c=; b=FojmB2rGChjGhuMdr+Limq3j7mLXLfoxP51x3B2WwDWojN+rXwISyDHwBPNj/orM+xZMnAgZZq0+vY5J7lkFrF6UiQ3UeOoWKyCYNLjcOSEoWm0cXdgRVcwsU3bAPLtutQGnwJlHr3SYtTBQnTjPZhoQlVWkrJ+PiObv4ZKu3qHF+okPKtm4EQFw5ylZhdVCWxnZTDZD7PgkuVmtcqJPHZy7wDuzx9uCgizuK+uNPJjdTkEgRY07c4Nf1n7ibUnGYq9OhhZwStGF/QezkxEghlfg5SfSV6md0+j4Hs1h+TBeWUVJBVL10T+4xOKfnk9no/jAUWemlicT8Qd2TbN9Kg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2s2J5v4yNMJYUmwxuWj6s+lY7aSx7dDlXfFFyax224c=; b=CeX5ISSWz2GCO7upMn5xyr0st2JU7r4Hu9UDShghYD6iW4esd4rKWcB/GWefl3J5TNnK86Le2I0bK8Xx85ekvcVWsw6OIC7LRRPOafeEW8nA6srG4gq98QZhgKfDjZSQgKxnGNg1iRW5WNmuKr0gt2x+SOli8+08G9F7uPyQ6SoSqxlmArefoy9VsC+3LQ2S1OQy+bfZp8Z8zrAdNpFTy0oPWMX6EDrxuVi4Cct6MehhJujO2htWPZIrh0ZfSWS5stYZ57Lb+PJ8SpbtT/Db4N92yVUJnIUPyamt9oWwNSX0dlm5yg4dOf80Gmp9r78YzaG+UydxYnEvZtvXt+YlLg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM8PR04MB7779.eurprd04.prod.outlook.com (2603:10a6:20b:24b::14) by VI2PR04MB10285.eurprd04.prod.outlook.com (2603:10a6:800:21e::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.18; Thu, 15 Aug 2024 00:09:24 +0000 Received: from AM8PR04MB7779.eurprd04.prod.outlook.com ([fe80::7417:d17f:8d97:44d2]) by AM8PR04MB7779.eurprd04.prod.outlook.com ([fe80::7417:d17f:8d97:44d2%4]) with mapi id 15.20.7875.016; Thu, 15 Aug 2024 00:09:23 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Claudiu Manoil , Alexandre Belloni , Antoine Tenart , UNGLinuxDriver@microchip.com, Hongbo Wang , Xiaoliang Yang , Andrew Lunn , Florian Fainelli , Colin Foster , Horatiu Vultur , Hangbin Liu , Petr Machata , Ido Schimmel , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net 00/14] VLAN fixes for Ocelot driver Date: Thu, 15 Aug 2024 03:06:53 +0300 Message-Id: <20240815000707.2006121-1-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: HE1PR06CA0143.eurprd06.prod.outlook.com (2603:10a6:7:16::30) To AM8PR04MB7779.eurprd04.prod.outlook.com (2603:10a6:20b:24b::14) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM8PR04MB7779:EE_|VI2PR04MB10285:EE_ X-MS-Office365-Filtering-Correlation-Id: a80d87d8-5fc3-40d8-d530-08dcbcbe8478 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|52116014|7416014|38350700014; X-Microsoft-Antispam-Message-Info: Pp+DcOLGht55cRLJT7/6pPzYFnmkrqJTHg5XE0ZkZkhTOscA8tA1Gg2TF+COSrt3kPIXJFqiUCkp7ZezkWVpRfxuskd0FgPAFkWZKIRW+t58K0lgZCRmuXLyXjnFWv+Yk3o5lVbIpew2L+QSOaXVMhMXuCuouR2cEiZojVf4yZmw2oYxGVrCdw7OATnkPkl0+UkVZnsCXCEQsqnJ6zKhUnuRBXBG/2bAGTiYkfRjULeqj4GwIJFbMMIgKPY4ePXgYOXxSLTpaZ523EtYHVmBvavmSC2NXc68jeRtwme5/z9aHDgXc1MWKG2agcq4rSlsbfmEdM0Z6f45jb4T4a4OJNXzSEdfOZnYfXd4gtnRPdcWrv2p+LPVGikTlF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CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM8PR04MB7779.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(52116014)(7416014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GGMnuT3HYsixZruPaxIGvxSg9kgmAUOIjGNe6oQxFf93hO4xstN6yLK8sNYRyeoLzQLYFaa48t8BeKLWZW1D4gVjkJ51GOAIFZGnGHN2jgSojIduhVTTxMOFR8vXmzfL1QO2HAcn5gqYMyN6/u0wNhrZbBHLZoJPHryeFqHLKWPklmfFquxa77B+xs9f1l+j8e7+ehq8VKFd9jlZTN5Xb6KiQ+C60XeiIyOEh7xLCGW05BHIjqg6q95BEu5Yh2VHvORef4gnIAUt79Ho5QiKHFso92j41aKdGAHYfV2irpETx4BBSXHNB7VML1DcCFkqTlh4Y2xIBJciq7td3M67TWA7XUGhL9iMmix9WKl0MoSiiuCCIys1ij2PnLKdIe7u8449l7SEGlh6LiHWjxqbVCnLkhT0EGV8SafbI1PVi293nJnbW/PYkCUVD0QTsaWYFGq3gHePHq8ajZrEzMgJOJEtpM0180ixANqnSs9ZM+PPV7xksHwH83XmpSTdQWxfqmhvXqstF7PyL58s3Gp3q3/NqZvEoqaoYpb8BbNVsyqhuwoWYJSrxvqw5W8bBH26TqGbdkDEruPGgdMSUZqK1ysahiO2+1Dr3k+crM+2pv2wwMQQ9vHAfYseGNL0Q0LNZwUob3ktdmho0u8F69Y6TeJV8JgbQ+a044vn66d0Dj9kw3Yu1zpI0lYF+3iaNwljNtLnTmhCeHPhrH6qf5wvezBgJMbrCpTmiHltT7Y982bGzYPe7Gz7KnNJgCE/1F49f3J+m5QTSj9mo9lEuxO8GLDPrk3GnlTEPtawtjTUVWkJIY6AC2wsDDjnj2UQrmu5Dh7QrAzx6sdUUtlmlbsgb+P91aH7AH4thpxz5qLXFViacuZ9FFeTKyYXYXZIwu7LOoMbk0S5BWmGvL4rtiqgPgRKGfXut3zbhCErjb3wCq0Ew0Pcez60qn6Za6OdQm9uESvmwKCzK5FuaOzcgItu4jg+jDBVdWhH6H3x+OhlOynOd/e3EW94TfMp0ZuySb0eWkAQVoNJDHRyJA2v6FigAChTu6TtqqyXx8Eu3DIVsd89mmsVhCOYyiSqAommhsVlqJZRbdwyrbBI4pp93AHCPlU/fZebDQstQy0j30iMlT0Qa14dWsDMrwI+moPbB76DCwlro9R+zp3hQZGWVG86SuLJsXstD0OlVZoyufMqyure6W+MJ4MeXi1DEUYc012TsEwRKerNlTGyadK6Do1efAAKC5f4zs4cMZsHdntcU0Gwx1RUBPed3TUAeSRpEruy7AMd8A4ZUp6U+edhPKyhDovOGVwc12yrt70Q9Ph1KLAxazw7A4Q0QwQvpp6gvM0c2Jb23QFs8TT69/HIWVY9cakYbuGTiNL50Z20i2vDo4iISu2PGKwwmpMWqJvQuLDDnAncOO4OQuDmSbF/gIVUmJqb1k7MBXlgVdvvUMI2VS9WxV7ccGTfdUNl3xPK8FHNF0nrWZebSg1jHTpICzt7A6IAsOvbHZvO3TnATbPlRkRhLNCF99ZhcWpVrRFnhWv2A19uBYHo4aQxQ4jys0YO8EaMjU/LfwwbpszZm5ynQqayUab7xmFQsEE1ZhRJK4pNOVbV8cYwbVfM1OePgpkzRA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a80d87d8-5fc3-40d8-d530-08dcbcbe8478 X-MS-Exchange-CrossTenant-AuthSource: AM8PR04MB7779.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Aug 2024 00:09:23.3912 (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: LY0TZSYjFtUvUqkBNwhDWRp1FYLy4pOF1915Qf45bgT8/zyPvhx3L3wk0Jl8XiTyjME02GprgnAKCr9zB/fohw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI2PR04MB10285 X-Patchwork-Delegate: kuba@kernel.org This is a collection of patches I've gathered over the past several months. Patches 1-6/14 are supporting patches for selftests. Patch 9/14 fixes PTP TX from a VLAN upper of a VLAN-aware bridge port when using the "ocelot-8021q" tagging protocol. Patch 7/14 is its supporting selftest. Patch 10/14 fixes the QoS class used by PTP in the same case as above. It is hard to quantify - there is no selftest. Patch 11/14 fixes potential data corruption during PTP TX in the same case as above. Again, there is no selftest. Patch 13/14 fixes RX in the same case as above - 8021q upper of a VLAN-aware bridge port, with the "ocelot-8021q" tagging protocol. Patch 12/14 is a supporting patch for this in the DSA core, and 7/14 is also its selftest. Patch 14/14 ensures that VLAN-aware bridges offloaded to Ocelot only react to the ETH_P_8021Q TPID, and treat absolutely everything else as VLAN-untagged, including ETH_P_8021AD. Patch 8/14 is the supporting selftest. Vladimir Oltean (14): selftests: net: local_termination: refactor macvlan creation/deletion selftests: net: local_termination: parameterize sending interface selftests: net: local_termination: parameterize test name selftests: net: local_termination: add one more test for VLAN-aware bridges selftests: net: local_termination: introduce new tests which capture VLAN behavior selftests: net: local_termination: don't use xfail_on_veth() selftests: net: local_termination: add PTP frames to the mix selftests: net: bridge_vlan_aware: test that other TPIDs are seen as untagged net: mscc: ocelot: use ocelot_xmit_get_vlan_info() also for FDMA and register injection net: mscc: ocelot: fix QoS class for injected packets with "ocelot-8021q" net: mscc: ocelot: serialize access to the injection/extraction groups net: dsa: provide a software untagging function on RX for VLAN-aware bridges net: dsa: felix: fix VLAN tag loss on CPU reception with ocelot-8021q net: mscc: ocelot: treat 802.1ad tagged traffic as 802.1Q-untagged drivers/net/dsa/ocelot/felix.c | 126 ++++- drivers/net/ethernet/mscc/ocelot.c | 279 +++++++++++- drivers/net/ethernet/mscc/ocelot_fdma.c | 3 +- drivers/net/ethernet/mscc/ocelot_vcap.c | 1 + drivers/net/ethernet/mscc/ocelot_vsc7514.c | 4 + include/linux/dsa/ocelot.h | 47 ++ include/net/dsa.h | 16 +- include/soc/mscc/ocelot.h | 12 +- include/soc/mscc/ocelot_vcap.h | 2 + net/dsa/tag.c | 5 +- net/dsa/tag.h | 135 ++++-- net/dsa/tag_ocelot.c | 37 +- .../net/forwarding/bridge_vlan_aware.sh | 54 ++- tools/testing/selftests/net/forwarding/lib.sh | 57 +++ .../net/forwarding/local_termination.sh | 431 +++++++++++++++--- 15 files changed, 1036 insertions(+), 173 deletions(-)