Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp17984353rwd; Tue, 27 Jun 2023 09:59:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7k79qLCJUbfh2x5NBdzRmG0KUevPFlhFIVSys7c3nqj6VzKLyM96IBypZN720Ke5StlhRA X-Received: by 2002:a17:90b:3601:b0:263:1528:cb28 with SMTP id ml1-20020a17090b360100b002631528cb28mr2162799pjb.45.1687885184305; Tue, 27 Jun 2023 09:59:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1687885184; cv=pass; d=google.com; s=arc-20160816; b=TD6aYKnWsRo3B3CXt08E9UpmWZ2EqUHNN5Dg74YXlrm+RtuhhPl3pc4ceqVVJHp3kG O+OPXYB5g7oaYOOZV65gMDXkp1zpDs6rbn4ePWHXdy162GoOxoHkt2mseKlu/t0KNZ8F pFwWQIKfzaZ10gyogHSBGZLeFLgKE58AWuBYKQUIJw0rUQ6HDNN3/7aFXi3oRU0MWoCG LD5+o64tkMQeyhZeJo6ZE/yAU3C3ywkl3KTey6xV205LkeVfW3cUf7oJPeABhZSh5/o1 2g3ynJIFgx5AJiTvrABsBK2fiY8kqgRPrjzulu/o6w1e6UVvu/xmoOnXVUdibCL3LsNa /J4g== 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=Y4qcaUqNanHHtxoAPK5Ov1WCMrI4/cQtkes7O0mwpxg=; fh=iurQRswHi9hWiYvyPjsOpfQdagiAg7Zmv5exCLcOUfA=; b=0fKSj/Br8r/+RR134vjWU/ciLDI6P8Sc8J7AlQKuwrgrf0b6xHBvPyJhiANxNFGDyh jWXNrgocGDe+4sTn798Uh8Xz9hOuiFCm8+svtHNfJiQC+fYUgkPN/isn33PlEjPICz+b ZjKTGfafp+zC0zzhZO70G1dBe4NALYgzuf26Z5QBjMxgZhsYgOJRr+QqXVV80c2aV2AC vjs4FqzfjYtZY4gWFI/OXQNJKnXdQ18zTcmsvYyywVMzmOjATSqqfglfUUr4LHFQrNJh Yzsv3xIYCZt+1PhF8vvgxGHCYFpfyYu5YsN4IiJwTnrJOeTgEI3xWC9bdb87PDHMYQBo GzMA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=rxZlrrcJ; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=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=pass (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 nl6-20020a17090b384600b0025ef1357d96si8168328pjb.67.2023.06.27.09.59.00; Tue, 27 Jun 2023 09:59:44 -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=@nxp.com header.s=selector2 header.b=rxZlrrcJ; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=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=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232545AbjF0QcO (ORCPT + 99 others); Tue, 27 Jun 2023 12:32:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232466AbjF0Qbs (ORCPT ); Tue, 27 Jun 2023 12:31:48 -0400 Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2086.outbound.protection.outlook.com [40.107.249.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3A803AA7; Tue, 27 Jun 2023 09:31:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OjwuLiMYFIxuSkC/SW59wKTYqTIAozsfD8DMOA9y7Myi1yTl5C8q5w5NFmV1JAskderNPR38bvJr96wULDkfPtsmoFGh2ToKt3hpWtPwrAmauz1fKkXDx0hSe5tXiPdCEB9HvriAjvdVEPVIDlwovgtzUnFBcKq2oOL3hrdA04Azb+x04Qk/IfzoYqnQhpwbnSI7E3TLslmngwrKz8srHxG4HqkAIbYHpbISvNP3MT8byXtQJOrwggjNkrZUAdJMeMa97L3aOLLFubq7iE46WgPoG7KS02yt2lu+QOkVjY59hNcsRp5AC/O1pT8uO4WbntUzWlnAKPbEMX2VHxzEgg== 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=Y4qcaUqNanHHtxoAPK5Ov1WCMrI4/cQtkes7O0mwpxg=; b=Dp6UBO3SPLdBU51RVueiD0pPLOwwdbuzTSRdPoWcwQvdYAteIq8bVr1ULIJrFfJTP8SaEqLbOe8QOLp6KUiyS+A+NAakdUEUdwp+u305iEj2mGl5QO3Tv0RY/ZA/QvOIsKSvjh4o7KPh4IXdS73LI5pmBBmu4xJH1yjlA1NwqeNsMk1hlLLqJZo+lJL8ptiY+6ypOs4Ds6ch7rj4TmpnPc2oUPzCIoKLdwd8Y5j2XtX2csyCoiYaOTitKkeOFAGPvl5cOowbNO2T/lLtXpP1wioLOF5E/oksh97xPa8lf8z53KbORRcDoRJQmNmgEBoAy25Q1ykdVUTp0iKy6Usv4Q== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Y4qcaUqNanHHtxoAPK5Ov1WCMrI4/cQtkes7O0mwpxg=; b=rxZlrrcJjUoP5gvzU1dLQWI2ovSl37ZCi9Ctwkgnk+cAYnUTNTeYZZx9WWNieFEgni6oYLQ7/nitHeyaUBV/IeN52fOkzHC9zkyIpNOM8rvGmR5s16b1AGX8Bnc0WarzUGDKau3JSn7t3B67qVa18j7bl3eM4S+URUV1K0mh3So= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) by AM8PR04MB7314.eurprd04.prod.outlook.com (2603:10a6:20b:1df::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.26; Tue, 27 Jun 2023 16:31:28 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::c40e:d76:fd88:f460]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::c40e:d76:fd88:f460%5]) with mapi id 15.20.6521.026; Tue, 27 Jun 2023 16:31:28 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: Andrew Lunn , Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Xiaoliang Yang , Richard Cochran , Antoine Tenart , linux-kernel@vger.kernel.org Subject: [PATCH v2 net 0/3] Fix PTP packet drops with ocelot-8021q DSA tag protocol Date: Tue, 27 Jun 2023 19:31:11 +0300 Message-Id: <20230627163114.3561597-1-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: FR3P281CA0078.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1f::19) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|AM8PR04MB7314:EE_ X-MS-Office365-Filtering-Correlation-Id: 0a220490-378a-4cea-a1cf-08db772bf53b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: f8GqNhUSy3M8513zvQEeBHC+khcu7E3ZxNcNd1U4usI1tGtH5AAbxNfUUVmNd3NWtGlRdpxiKnBTyIiSNUJuurFIadmSHLk1xpJ/VOjXpa337VPh9HET0/TbAuPvxe9ObOIxZ14j2+m8sHqdWI0e3dV5wuy/OMRtf1UInyEwy/cGNdF3v8wB3tSjCzegT2PL+aA+8AFjEekPJkwTIlFFUrxYhcoFAdOxEtV74Lwr3/WaUrE/XDVR5Uzt4Gs6oB2NkhhNz/xn7AIS5XnNZdDj4Ee7RIgdbUE4K23sM48xAmBHqe3m/+QdkUzSqzMr+b09OyOEakrIjFmYnKINPFeabn+aFQR8yDuR3lnJeaSebg7otMXmqbqxKu+ygohP5MuheouNnKWDFFx03r7tceCM+2fQELhxpB9eal8P1fu+rYwHRcFZH9UyNuzIRLek8r01+AJrnt/3Lw3k6gdeC1UjUTj/Fp0DBQgYOAUfwoD2nWTJSRDAPP8E/1RKEl6oxhUrHo0I3ivFRBIoxU49lkH3Nfbd6+hhdEnqa/hLCXVjMNVy6JIqrhz5EIHEX8LVcMjb68wTMEwpXH5MvjE3yOYKKB8fZpH9jZhw/4KNhchpetA= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB6452.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(346002)(376002)(396003)(39860400002)(366004)(451199021)(6512007)(1076003)(44832011)(7416002)(66556008)(4326008)(6916009)(66946007)(478600001)(316002)(36756003)(8936002)(66476007)(5660300002)(8676002)(2906002)(966005)(86362001)(54906003)(41300700001)(26005)(52116002)(6486002)(186003)(6506007)(38100700002)(6666004)(38350700002)(2616005)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?sLD0+l1wEB2OiATaRePzeCyWeRPG1WU7yD/eH3Qm4mta34JaNAFoqxWZYHbZ?= =?us-ascii?Q?r5OFx+CYDgoht+UWXDlOjoi1BeETk83Hfpaw3klUIPZoliyp+Oh+f/qXFvKP?= =?us-ascii?Q?XSq/lYc4hGUfv8P0MJMetcS3XlMZOTTDIFwQgZRtjcd94u8oI7TNC/+LL8jI?= =?us-ascii?Q?2ZyDqMcyA6ZoQk8XOhuaN1nuuD4lf7G8hsdxDphLDnjxYyHIUF2x+5joSGx7?= =?us-ascii?Q?yOs6dOjjUJUpxcELdcjpT9qW8eGyqvRVv/dsApCeyBSK8xseKxIpN+X/Z7a4?= =?us-ascii?Q?JYIAs6LqKr85bL2wcLHaLf8Zj6+ITjiUFINY7nvn7Mtyy8hhmSjrRbtVhE0c?= =?us-ascii?Q?dNZrG6IvbPeR1MQ5JjvUdpzSZq/5lcxQhzPNNfq+71GfJB8mUhjyBoj2K/Ei?= =?us-ascii?Q?sc6OBEEKTLMLF5Hmqzhs891JHnuUFo8wzK07/YmDutttHtXBtBtKESPB6cJi?= =?us-ascii?Q?usXMdHl2KHe1QpLUSO8YMfRPJHOhr4aV0tovgHNQzKXG5pUiYr+VJwPHlyWs?= =?us-ascii?Q?92udLo9wDa7imAK8w6h0I6eNw3bG3+N7BFa8eZ9tZYnX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RgHAoVJrLmNfTSwPiCdi3RLhoz4SGBrsb5cjY?= =?us-ascii?Q?r/qXSGUmXNqFH/SLgFScX+v8jXH625CKHZACE4IvE/W+OEsSVFzDwdAw+ygL?= =?us-ascii?Q?Uuf5Ud6yyGpyd4iNOBl5V/3BoAI7O+8kSeQ36wkbeweZH/bhL/0mAJxHWycl?= =?us-ascii?Q?Hw=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0a220490-378a-4cea-a1cf-08db772bf53b X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2023 16:31:28.6376 (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: sHewWaEtux2AhH2v2OR3FMYhMpTi+w3ebQPfcr8noXLwWEHGty3yxJf+DRYS8ghufcVkjIsZG750E0zYcRtdGQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7314 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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 Changes in v2: - Distinguish between L2 and L4 PTP packets v1 at: https://lore.kernel.org/netdev/20230626154003.3153076-1-vladimir.oltean@nxp.com/ Patch 3/3 fixes an issue with the ocelot/felix driver, where it would drop PTP traffic on RX unless hardware timestamping for that packet type was enabled. Fixing that requires the driver to know whether it had previously configured the hardware to timestamp PTP packets on that port. But it cannot correctly determine that today using the existing code structure, so patches 1/3 and 2/3 fix the control path of the code such that ocelot->ports[port]->trap_proto faithfully reflects whether that configuration took place. Vladimir Oltean (3): net: mscc: ocelot: don't report that RX timestamping is enabled by default net: mscc: ocelot: don't keep PTP configuration of all ports in single structure net: dsa: felix: don't drop PTP frames with tag_8021q when RX timestamping is disabled drivers/net/dsa/ocelot/felix.c | 12 +++++ drivers/net/ethernet/mscc/ocelot.c | 1 - drivers/net/ethernet/mscc/ocelot_ptp.c | 66 ++++++++++++++++---------- include/soc/mscc/ocelot.h | 10 ++-- 4 files changed, 60 insertions(+), 29 deletions(-) -- 2.34.1