Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp16384120rwd; Mon, 26 Jun 2023 09:15:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Z0aYvD63TKEsiuXxcUhVe1HTmBnyFn3uYsxjSMfd1SexVudgYfOO49QtzQ37K2nE6r6Zg X-Received: by 2002:aa7:cf1a:0:b0:51d:91d2:335b with SMTP id a26-20020aa7cf1a000000b0051d91d2335bmr3659726edy.1.1687796137521; Mon, 26 Jun 2023 09:15:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1687796137; cv=pass; d=google.com; s=arc-20160816; b=LX5LJDNS1hELCAxp63is9zD802cBblKOxEmDP3Fx7FlDLMFzIBggAD0ed5KBScesnq BdUCUAGm9i01oc2mzy0/dqOdBNTzYMSrVLVdcACc1m9Gyyg123lMKv99sazgxKMV+rtk uO+rePkNU6jHeXTSnZuhZoU8LZKly7NH11evv2aFUl8LLh3qGrMOKmPXw8jUxvTGxJpj GPgxv9KLdf/eE3VYzoY+7ro1lJXmUI1dQzXDTzAaqIV9uqjlWD6kGlAU4g/CkNW220Ak RZ39hp/qhL2bySMeRHB8X6IX21tY/y6iFIkTlaFP5pe1/UJ1FtFZwVrvL8VOvt0CF3W/ y0GQ== 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=6isCo4W/qt2+deuKSmeCVxUyhhJQjnFMocv3q1kkiPM=; fh=9p/1aqzINVh8DO/zPcykqNKgLrhLVZ/UEQZMM3tSbYQ=; b=eD47EtFQB6FNbHQSkbc4XUBcvXP37N6rD4kDJSS09PG2RRJDOHhlbrMGujKnNMdEkH oC553irYhPiCtgnpyw34qgZR013VxHCWqpd2arEVYO/awzcgjH9CZM67jl7TXE8PpED4 fplZOcXkHWp/xUEI4xLVckMwHelPdtA3fQMdxAliQaPrzuIcpU6gmekXTsKUaZhxaqv4 ZZ14jvHkTDYahSqs4cFBRIQKy5wEEndiczY8LxQWzqfVLEg22ZPXCKMhV6d80al/yRp3 UoseH/n4C+ervCzR5X+pQZ3EeA+3133c6bhtiSEyJ3dS0gdOpCZ+6pVaHDBpTsxNiEvY d+IA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=BuP7KkP2; 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 l10-20020aa7d94a000000b0051d9a97ce11si1179856eds.57.2023.06.26.09.15.10; Mon, 26 Jun 2023 09:15:37 -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=BuP7KkP2; 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 S231493AbjFZPwY (ORCPT + 99 others); Mon, 26 Jun 2023 11:52:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231483AbjFZPwV (ORCPT ); Mon, 26 Jun 2023 11:52:21 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2068.outbound.protection.outlook.com [40.107.21.68]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 385A1F3; Mon, 26 Jun 2023 08:52:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SgQ/M6fP6wgdux2HgyAIwOwizRPJwncEFMNw/Fn7EYdLFkqa6L/huuG1XIX107oNh+P4tTaUMkLV/NTRBmQ+oaQLopq1a5td1yBRX2NQKdQehpUyBm4maEW+rN35bV6Vt/4iYPq2yQBYUt7zpxMBG19Q1jI1e3uBlcQqBPO3AHqU8KHOTiwNwwMwTcgLzdoYbrLCBGZy3utV0065a23pNzBSakIT/NP6NC/GpfCEyBhoo3Ghxu9pOChTeH+WAE9dgzs8EBAl34BS+OgFroeieLi36WPDF2+0eC0fVHZJ3kK4I0GhNGTUMN/tBdik3GKtLqYisCShGZkJOfSDELd75A== 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=6isCo4W/qt2+deuKSmeCVxUyhhJQjnFMocv3q1kkiPM=; b=i+2h03x4novlmpjriuCtFeRmnyJUbe7F8rOi7GOU9JxpXJ3kO6Nt797LWou8xjt4kbOrM/mj5xBOlqNE7ZrS33O1WT4tTTMcfRqp3N71MXU04CCzoFoxWsK+jp/odFHaNkjhvjMEkq/konjm5eRjMHvjsnhrKVM3NRECgxOnNxhASwr0cQOgo5Enbp/Y9MyosSEAD+eafjN6vZPETMWozrqizFUMgQjXOC85nnRfnHzm+p+g/QdC4telp97bF1IeMQfFV4Ow+MXGjmkTY+ehVqV7vbf5dtAl11Chj4x3wrCVdwLCh9nDPsnsGjRme49mnlfpH7h9FT7iGKc0GTtdcQ== 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=6isCo4W/qt2+deuKSmeCVxUyhhJQjnFMocv3q1kkiPM=; b=BuP7KkP2s1t+YmjBUdNnmN3hR7evJjntjFBIrjxYetzo3vHBEVdoN7TvzpxRbBSGjvDo6pHqClar3tPTKZYBYHjbv3mOGOqggFHsNnP/kLrR07bZNrWLaK07qR/qyax+qhQ4EeARTlStbMn87GW8QsHq08V31tMUNCJ0oz/oICQ= 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 DU2PR04MB9522.eurprd04.prod.outlook.com (2603:10a6:10:2f5::8) 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:52:17 +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:52:17 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: Andrew Lunn , Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org Subject: [PATCH net 0/2] Fix PTP received on wrong port with bridged SJA1105 DSA Date: Mon, 26 Jun 2023 18:51:10 +0300 Message-Id: <20230626155112.3155993-1-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: AM4PR0302CA0003.eurprd03.prod.outlook.com (2603:10a6:205:2::16) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|DU2PR04MB9522:EE_ X-MS-Office365-Filtering-Correlation-Id: c5629bdf-cefd-4d94-49c3-08db765d515a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NuIdrbTHhsP53RHDnZomJt5IMqXbkTLw48LOmyntyQetDRm+sYGd23Fidz63BFz43XndgZjJbjtuc8w8tJZO52rKZixAYntdRwq1rGVbs+ejAzziGIvOddTJlX7D7gh1VaoCB9ljcpJZpPRiT7gG8iFExfyXihXRz+npgJrQGHVcDmVy2eh2/9RUo8OiDXWHPuHGbdzwxkY8PP7tOV4NfNf7RLEX5eRVj4EWuBm4QDgGrZhaGFg3W+CaDYm+LQvjHlM2YgANqhw6neNJxwXnqMdDiAQ31iV5h3bihRiAjuJm//6omynJ0mqKyGFKCGK/UCI+8BQNYEd68N56IwNoKRqPvWR749eHQjXVp82oyJRsU+i0ny55Yl3A0E2ah/xPZ6io+74ARP6rkDT4jouQrrW1CfbTvo8ppSsT8ZK+LubVvoDzmxxH3m0xMa3vDfatiCDWq2ob0Y9IY1qvoO1uLQdR9HVpLcSLBcUXX2AARj/EsTviFShnvDFFdAfmrF0ESgLcvMpdE7GBs4zbqSZ9BGKmmo+wAKHkAL0IAJ2KgKvxdURsTWdPAHekWpd9DC1z0Q40vaG5VdhylE5gO+LH5HMQkQIvaQrgbyoitl8Vs61tmdMJZqVWl+37XB8fY7Cu 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)(39860400002)(136003)(376002)(346002)(396003)(366004)(451199021)(6512007)(1076003)(44832011)(66556008)(6916009)(66946007)(66476007)(4326008)(316002)(478600001)(8936002)(36756003)(8676002)(5660300002)(2906002)(86362001)(54906003)(41300700001)(6486002)(52116002)(6666004)(186003)(6506007)(26005)(38350700002)(38100700002)(83380400001)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?H6hSEWRVMdtYdhNR+hr+qTQk6wm7ZDpQF2gEr90l39O+Pzrehclyw9/2kri8?= =?us-ascii?Q?yenWmIVJXoFmQ2klxxg4UwG34f/TefX9QE6jEkvHVxgU+U2pWoVqcY3PlUFm?= =?us-ascii?Q?xy2K+0YxLrL550I2hXV/6O1Mc4QiZqmhKF8lzlQuv1JWIz+pcnBwK+wOJcsd?= =?us-ascii?Q?to23yGGKGpVSCOEkvbaAOGgJs+ANWUkEg1MmAWWhCUP/hm/biVIWLmPa20ZR?= =?us-ascii?Q?BkX6boONxC+hlL+g0FcUDHWGw0jKCjq2uklHR6Z3oS9EvxuAV/FzaIGUKCcq?= =?us-ascii?Q?cBUK6b4tiZ1/AuEZ6K4rfjC4oeuG7jnTb6tYmxnOpPRI5d6tZxQBsIMmtLsU?= =?us-ascii?Q?EUtyn97rEGpD6G5aS2bSceTx8QHUGVOP//IAyTomPscKyIOW+Gvkn+TnxeyQ?= =?us-ascii?Q?9xn8yE4F7f+agFzc+YcH2msQf6S+uIuYYOJBwyYBFyW30dfTRx94BhWyhHyp?= =?us-ascii?Q?7jlPMGozdWJZCzyBRmQBU0OAK3TfTJHkn6/L3WY8tNrdiuSToxLgipMivrZ2?= =?us-ascii?Q?T1zqRjbUlgjgYjqIysRn49wqXaHU4kfO4Yn6ao0O9lhgFh7c9+GMR72Lwi0y?= =?us-ascii?Q?vQTrjADSiyeWzJJfxhBF/SXOvmHsBbUIt2whJ3LNdMTyKDUyABKG0gLG8bTw?= =?us-ascii?Q?W3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6xETwnVI+EKIB12?= =?us-ascii?Q?a8fuYm/p7GfDzK2N6ntU8MgelSiF3unD5U+eMsHvN9RTEcr94bdI8Zkm7BTK?= =?us-ascii?Q?ug=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c5629bdf-cefd-4d94-49c3-08db765d515a 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:52:17.3962 (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: mfxXKdFge37Vr3hHBOryNsFr8iRXZgu+MekrYlDboxGhJuf1jDt+jhXGo8i7R79r2jK3osC6nhiSJNaNQNTNSg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB9522 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 Since the changes were made to tag_8021q to support imprecise RX for bridged ports, the tag_sja1105 driver still prefers the source port information deduced from the VLAN headers for link-local traffic, even though the switch can theoretically do better and report the precise source port. The problem is that the tagger doesn't know when to trust one source of information over another, because the INCL_SRCPT option (to "tag" link local frames) is sometimes enabled and sometimes it isn't. The first patch makes the switch provide the hardware tag for link local traffic under all circumstances, and the second patch makes the tagger always use that hardware tag as primary source of information for link local packets. Vladimir Oltean (2): net: dsa: sja1105: always enable the INCL_SRCPT option net: dsa: tag_sja1105: always prefer source port information from INCL_SRCPT drivers/net/dsa/sja1105/sja1105_main.c | 9 ++----- net/dsa/tag_sja1105.c | 35 ++++++++++++++++++-------- 2 files changed, 27 insertions(+), 17 deletions(-) -- 2.34.1