From patchwork Mon Jun 26 15:40:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 11304 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp7602408vqr; Mon, 26 Jun 2023 09:26:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6u3GNFhqWLjCq+ZQEvQ+d9pnSUT3UIGPbU7XK2/gSi6pNQxOi5tNVs2JptBJ1DXDB69GYs X-Received: by 2002:a2e:8316:0:b0:2b5:89a6:c12b with SMTP id a22-20020a2e8316000000b002b589a6c12bmr9022974ljh.10.1687796815457; Mon, 26 Jun 2023 09:26:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1687796815; cv=pass; d=google.com; s=arc-20160816; b=TG4njOWobYZKjmmcM4jAS1ONiNuqHoRSfT9z7qntEOlmGT/j2yu/TKVzb7Z2ti65KH 059E8s7kuvljVU0kA9TTFSKjegzhgF1r+XTjrd0tzOPyRBbwJxCIkf8j4VoZAo3Bm+nk 4gtYH4z5xX1E0G2Uao3DG3mnSFp/i+TYplqB9hiGb5mf0LU718LX6f6LMB/6F5ATmaYd 2vtLll0k9l4+OYGV1zZKeAJxb8LCVetULyRemQppfAetAeIS6ntbzYi8KxDWNOh6Cbba k7VQw6xfn1AV23CKAQGTuM99BQMS71orwR0s/Abrf+UwUwKUtekGX7acLScyb8OyiBmA ZUTQ== 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=XV1rDkwxV5MkbKlVUoEHnt4bioN45V9xSIYe8ApRGbg=; fh=iurQRswHi9hWiYvyPjsOpfQdagiAg7Zmv5exCLcOUfA=; b=YmaBxWkKlZTfkC0ONWyRulkQzvHaIz4+sqAP6KPkE5a/XdRWAU2sqCM0sn3WA4GnyD VXFksuzMl+r8+iX2wXF05kE/4iMRRjNe4p0bXI25nTsI9N+L8mv4UTlg25x+6khKdo1B 68L/az0mSU5GVWrfTQjxI8TG1S6CQ4xfePtEURIBMUhktpF1GYVlxERkvWu2N07oCshm pwSIZ4sp/i0FOn72i2gbGktGDVVhhkOz/ytiyeypwvpoKz4m/AZ1GnKe9E7eAkoh2ISj 7V4Y8o27qDjNDp2YvIJIvk1jA5FV+32A3ESUfRwKdC3n03a+0qIMVbiQJtn+sQ165EqV 9/Ew== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=fQTiz8Bn; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ci13-20020a170906c34d00b009887417e314si2954027ejb.999.2023.06.26.09.26.30; Mon, 26 Jun 2023 09:26:55 -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=fQTiz8Bn; 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 S231374AbjFZPka (ORCPT + 99 others); Mon, 26 Jun 2023 11:40:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229965AbjFZPkY (ORCPT ); Mon, 26 Jun 2023 11:40:24 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2050.outbound.protection.outlook.com [40.107.7.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1932C10D9; Mon, 26 Jun 2023 08:40:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UAddwFxdzVSD9qSeLPCfMOquEBzArrKcW7P8DoZRQKpSoYP5IVdBwEAvJD+Vh57N0qTK1FJF+JF6QfLN1fR3dY6IL6NiDt74jEPd4b7s+sz46ZVian8joCPjKONYfC0O/zSnbqZcFzUOTdU8gNeh7ebJUevM3rCYp6Xud/Wn7YzgbFIbwTc0Ne070JidRfiuVO/OZ/AgsFGWXdGqZbXE5o1F+Zr7/iT2KKYNVu1TsH+69wBzbFM8Ot3o5lWRTrtyPLHXnFLXs86RVL2gKzdxeHCzCQyShJGzIVBaz9WvoFCWXt/0CjjXH2iWjSrUf/q8KNNUaDKDHdbycqbVXroLNw== 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=XV1rDkwxV5MkbKlVUoEHnt4bioN45V9xSIYe8ApRGbg=; b=HhbyAtdN9wXKuWWkcVLmrOZNRj7N1HWuekGwD7BKTq2kOtel0nlRY4YrmPssAtmVmt+nSxfY/4rMrKb6WJ62x0uy01vk0qXnRuIlMn0/Rrh/0/2VOGiHLacezAWyO0THQPhahgHoXVeQoE7pkgGsqKcl5ga5/nJENu57UCYFLfR/x902GfIaf3f9tYYD0DlQuFp4KPQLHI0XjYlpC6gJ4Ril8qyUBBABjkCGz8+HFh1X3zTo0dP+yF+LrREcz7jHj8kkd2n+o/IZP+WecWaN1ODjtUHxCtKjDHqJ0F4CjTNFfR239Etmm/7p+Lafjmc5hAXGttKyKVoAcbLSYZ7Vcg== 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=XV1rDkwxV5MkbKlVUoEHnt4bioN45V9xSIYe8ApRGbg=; b=fQTiz8BnteDHwmmDALrATYM0bPg9PgQEDE+/7tjz9QCcq0XlWCagnS1xPG3WBzhlBsD6w59NKT/Ty73BJyW3bSYfXFXux4YFopNr91kga0UZhiLpXmVfWy84B/+evAQ1vLwdWjPv63grx8yZHMCraqE9YJxfKiRAT7rAQmwUlOA= 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 PAXPR04MB8638.eurprd04.prod.outlook.com (2603:10a6:102:21d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.26; Mon, 26 Jun 2023 15:40:20 +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; Mon, 26 Jun 2023 15:40:19 +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 net 0/3] Fix PTP packet drops with ocelot-8021q DSA tag protocol Date: Mon, 26 Jun 2023 18:40:00 +0300 Message-Id: <20230626154003.3153076-1-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: AM0PR10CA0121.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:e6::38) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|PAXPR04MB8638:EE_ X-MS-Office365-Filtering-Correlation-Id: c49ccfe7-d7af-4032-a7db-08db765ba5a2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: e5gqKLQsUPIBzTH/YiDB0/Z6tJHxhlE2FoizTcn6Vw2UOgjZOahMlD9Q6fIpf9Vf1QTO1TovMe+ZxtGho97QFWXfVWgdHvEuBdTB0FafYCsecLay1EGtpLS9My0ACoc72WtvPPgV/CoJDWF1vvA/tUwiwkDAfvCZVa8yvk6s1ywSoW8LRmgyw7X0FnAWmoBgjAQK/kpvhQiwbP3b3Y3QPzNWk/75RIZl6CmYJzgSy4TgNp6vigPM4iDVkTlvVQ/A+wY2iF56vNuplF4HgRCkVkpRCmkQVIXOFh4WPUDlG4iaCZX2rea5+rQPWuNab/+vl0x6Qr5HwMzLea1iSmJiSFfGivfVWSwFUaJ7H3qSmLakFvHN9vFmw9+aR9XWyzdGZwqsvYIkH7FUz9U83mxy1MWuPsI6Xkn9XipeTGLNhjSpo80iNOvuRg2XEQ17U10tYfEWKJAlxeQdVEd27pD0oHi/V3LAowgVuAOw1zmOpJscKQIawUdqMCct6khjBox2sf8r4MmUfuLZ6Ry0hGD67rQ+hA0Tuj+39EH48e+P2TdbbkUowIjYckJ9u2oCK+BedCIsMTn1YX53D1buRxCgqbJzkrgQ2tDiIKBgAXqzLXchaUobx4Q7sfGQ7dDPIPKH 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)(366004)(39860400002)(376002)(346002)(396003)(451199021)(8676002)(66946007)(41300700001)(66476007)(316002)(66556008)(8936002)(4326008)(26005)(1076003)(6506007)(6512007)(186003)(6916009)(2616005)(54906003)(478600001)(6486002)(6666004)(52116002)(2906002)(5660300002)(7416002)(44832011)(38100700002)(38350700002)(36756003)(86362001)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: heM4ee8N2Kb0SrqhOUN2eVU7TvZFKqMX3mwxDA7wqGita5lcwd0TL/2R70mpmQb9aywS+o/zmeOjI7jp9pR/HtsDfotN8ASM5e1JqCa5Sa+CpwzzIou43Lq+60WTa3Ofz+emWXE2ic9J5cpKRQpCel3bSiqstFfsZjIRWDJLTwOw4ftYsTqHIhygPr7Sg/aiuaZDzWa+nhKYxMeXp0xbGEY0u8Acck02Bc49qbH7iflKRooTGDTNNyY276pT5/MSdOkm2sNuuAU7qXRSu/w5zhWOOQNBRGAhk6nAbCJU342sD/hTkcMgZMUCY4kaH0K/lDdDbhp+Frnw+XrthG6ylzQM9n7F/KDBbhVbxzl5lX6nX3ftUW8+tagfq734gNhDHOadgpawcM+PAxyjY9avdbbM6YQcHcbdOq7gxDh47CZJLZH6mlVlpJ0S5bPH8K1z94wZQEUAShzKo8QqRtmFIsmsrRA+w/kcFOwDCT5dvrGALI8nmz0XSJowiplwVwfXH7kwMOBwkted19ht77do/AJfYR6AwJvBNt2opG8S024GeJnFu25SJ/deaUWtizJNcEY8qMuGquA1AqBf62EnOui8G4bZuhOPXNkurhdaoL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5a2 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jun 2023 15:40:19.7806 (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: mZfDKvIkx8GtiN6AEjnqjsAdpn5R/qxwUwrHJkNlnOoGTQAVF/R55Qx4LaqbO77sqH3tQQ2lSUUOZ22ZPbX+yQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8638 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 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769783233674985712?= X-GMAIL-MSGID: =?utf-8?q?1769783233674985712?= Patch 3/3 fixes an issue with the ocelot/felix driver, where it would drop PTP traffic on RX unless hardware timestamping 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]->ptp_rx_filter 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 | 3 +++ drivers/net/ethernet/mscc/ocelot.c | 1 - drivers/net/ethernet/mscc/ocelot_ptp.c | 35 +++++++++++++++----------- include/soc/mscc/ocelot.h | 5 ++-- 4 files changed, 25 insertions(+), 19 deletions(-)