From nobody Thu May 7 22:00:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 009EDC433EF for ; Wed, 18 May 2022 11:33:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235690AbiERLdk (ORCPT ); Wed, 18 May 2022 07:33:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235692AbiERLd3 (ORCPT ); Wed, 18 May 2022 07:33:29 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2078.outbound.protection.outlook.com [40.107.220.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96398111B9E; Wed, 18 May 2022 04:33:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T72GiVIMJzDZ731AeqcmzKVmeqv/yKpN/Hp+PMiQLX7/zojdNbQENb6oWiQxGmgFlZfqxXW/FeH4YqgppeC7pJTT7XkYoXrJXFwyxKIkNiibVJUqFQLNKwLjjrwjvfmJSYcN7PMwmxlzOathCuUz3gQRm2cyAgQXJtgCS76x5HaXft78yMweDwVPdIp5Z0jnW8SBpYWV4MmL+AW5Gz2r7604ZP0bfYjp8MzRyR/dgTI6wt/HTaEIi+oBVh1SscNDIVGWMJlXsa99wJOkZ8dsKb/CxY8O6VIcTdTD/4rBgjhjHs4agj0li9voAbX9ZoCg6zgi6LjFPq8wJkYH/cgQ4g== 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=FcuSpLEywbuFAfH5li1/EqYk1T/U3iTYF8qpgkrGwJg=; b=J/C+kp6WEAxjSgwmT2tC/6bfjaGJTDqnr+fGN+toIwzrtyLxWxYiOxVMhSD2iSOchmjRD7i4/aQHmiViTdUeIxQKPYc4WYciF/OxfhFoeokT9DH0zsBRFr2hFadLf+yjkF/lTEVxJi6h/IF7gjsllLoyfsNPQIuFhX+cFDLWhb1Nhtj+v745pJi63YxA9uQ7cyYdg8Ohr1FqP0oNEb98n7Ium8gQUeSHRLZ0QnH6wEZr4XsCpRT8WfMValkuQRixIca5gf2ECq40ImDW9eKv7tlZxsg4plNmyOxbLm0AiuFMsL8qMcJaTEYwhUA0i32WX6W9bESB8Ji82Ik66Lnplg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=microchip.com smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FcuSpLEywbuFAfH5li1/EqYk1T/U3iTYF8qpgkrGwJg=; b=AbaYMZtNIHAmMh0o6CLV88gNjwwOgRJKOCCffYcUy5VNxpNvEdr3Pg9TGwLiLyLLk1i375xKVIf3lQR9LJFAHv8KyKB2K9gxx69+3gzvM84+jbJ9cwrOanYjXrpKTC2SJrIoEQHz/fAVTnTjxWmio6+xEwVIf17tF18G84ZFN78= Received: from BN9PR03CA0895.namprd03.prod.outlook.com (2603:10b6:408:13c::30) by BL0PR02MB6483.namprd02.prod.outlook.com (2603:10b6:208:1cb::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.13; Wed, 18 May 2022 11:33:25 +0000 Received: from BN1NAM02FT014.eop-nam02.prod.protection.outlook.com (2603:10b6:408:13c:cafe::6e) by BN9PR03CA0895.outlook.office365.com (2603:10b6:408:13c::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.13 via Frontend Transport; Wed, 18 May 2022 11:33:25 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; pr=C Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by BN1NAM02FT014.mail.protection.outlook.com (10.13.2.131) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5273.14 via Frontend Transport; Wed, 18 May 2022 11:33:25 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Wed, 18 May 2022 04:33:18 -0700 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Wed, 18 May 2022 04:33:18 -0700 Envelope-to: nicolas.ferre@microchip.com, davem@davemloft.net, richardcochran@gmail.com, claudiu.beznea@microchip.com, kuba@kernel.org, edumazet@google.com, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, harinikatakamlinux@gmail.com Received: from [10.140.6.13] (port=41766 helo=xhdharinik40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1nrHva-000DlO-9B; Wed, 18 May 2022 04:33:18 -0700 From: Harini Katakam To: , , , , , , CC: , , , , , Subject: [PATCH net v2 1/2] include: ptp: Add common two step flag mask Date: Wed, 18 May 2022 17:03:09 +0530 Message-ID: <20220518113310.28132-2-harini.katakam@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220518113310.28132-1-harini.katakam@xilinx.com> References: <20220518113310.28132-1-harini.katakam@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 53a6b4dd-dd14-4ef0-111b-08da38c23909 X-MS-TrafficTypeDiagnostic: BL0PR02MB6483:EE_ X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +WVKQDZOi52KVr656POlFcTCcthnkkX21sGrRV4TxHHtYKEdLfnRe5/GfF1uQDgwku/KLHeQRDi4caM6Ekz3vODin9f/6B/0/zwQWXtj9fJ+XJKVylFADzp90KKula6qxTS+5448VE6qnN4OlOq1nNDNLXLbxYHCRtEPm7aEMrBt8g3uu6lTLlk772YqwQpfZKxgfyl6KiWHJtJJ7MmSOwkJ6dHzvhIrecbObbATRCsGM5AyMiLM/15hcH1OmU4YuM+HHuI6+qZqT7uTaoWo4ykIWGt3KgLgiNHgH7I1dvI5P21fpOV3QHcq7cEPZwul9yUvCidBD+61loNt4oi6oVrsOGLvwppJSvuFwq7ixZyOI+dZqbk2Ss0t3ZYeagcceXL+nSUq/ONXnIe1wBljRKitQQlZewn7QFV8t0BuLJB69iKYsXEPcdNVlBNqYaAoV1qe+2cigEFakftRew0ZRHjbRc6rMgSKexgsMbI2h+DvX1jo1r/2ST7biQfG4edUEBaKb4LovWSxf1sKmLoZ8JSQcnAXTyouxjCCF7ynpQrbYpVph360DKi7uAvROVeY6/weI6hFDkKGm5w7+17gj8kgOWftzSbBu8lyWbsj+ZRDoCc2taGepvnK+SuBaFu9/bsb8LoDFj6quFHQZ6WTjx6BKw93DHTrv+FH+beHbJZFhcw+yqq4JO8W29AfXyQGietf6HkYFhxZgB9KKFGWxg== X-Forefront-Antispam-Report: CIP:149.199.62.198;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:xsj-pvapexch02.xlnx.xilinx.com;PTR:unknown-62-198.xilinx.com;CAT:NONE;SFS:(13230001)(4636009)(36840700001)(46966006)(40470700004)(316002)(8676002)(54906003)(36756003)(82310400005)(110136005)(70206006)(70586007)(4326008)(36860700001)(508600001)(6666004)(40460700003)(356005)(7416002)(5660300002)(7636003)(8936002)(44832011)(4744005)(9786002)(2906002)(186003)(7696005)(1076003)(26005)(426003)(336012)(2616005)(47076005)(107886003)(102446001);DIR:OUT;SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2022 11:33:25.6646 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 53a6b4dd-dd14-4ef0-111b-08da38c23909 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.62.198];Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: BN1NAM02FT014.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR02MB6483 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add mask for PTP header flag field "twoStepflag". Signed-off-by: Harini Katakam --- include/linux/ptp_classify.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/ptp_classify.h b/include/linux/ptp_classify.h index fefa7790dc46..2b6ea36ad162 100644 --- a/include/linux/ptp_classify.h +++ b/include/linux/ptp_classify.h @@ -43,6 +43,9 @@ #define OFF_PTP_SOURCE_UUID 22 /* PTPv1 only */ #define OFF_PTP_SEQUENCE_ID 30 =20 +/* PTP header flag fields */ +#define PTP_FLAG_TWOSTEP BIT(1) + /* Below defines should actually be removed at some point in time. */ #define IP6_HLEN 40 #define UDP_HLEN 8 --=20 2.17.1 From nobody Thu May 7 22:00:53 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 406CBC433EF for ; Wed, 18 May 2022 11:33:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235727AbiERLdq (ORCPT ); Wed, 18 May 2022 07:33:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235710AbiERLde (ORCPT ); Wed, 18 May 2022 07:33:34 -0400 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam08on2062.outbound.protection.outlook.com [40.107.102.62]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CDB4118013; Wed, 18 May 2022 04:33:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cZ+9veTZCMphfGl4pG2Hq91NQKJJqHTb71WFj+EPo32Wxl/PzwwS12gcKRw09ShUudC4MGq+BqyPPzn4nETJSvLcdfviXn6g/zB+uJ8ZTvKYT24kmSkTRXqAbLlsTpkbFRPHjQ9jUKtxcQShyvEhsahmKl9ZForl+yKapFuqjrt0j8VOu2q1aIciNprzBlnaWf7NYUohdWUkoT0zkheNFKUsm85SEZtDkWNZVO7eNMcyYoJDwh12mZGJ/o1+xISiUsvE9mxjZosF+jqRhTGFI99GOJuj282DmoStHDIPAPoEMX5v1K5V1TdbifGO+udxzw1imQihYOb4FrLlwP6b7A== 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=2smaeBBhQ/MbtbS6rY6hiJ2maCU6cXRs5w2UPHtvJ6A=; b=TFClMnHzMz2Yba0aIeSVteBMlvNqeNR0tTvHQTmlNFYPo51ud2c3X9bxnCIHDxh7/2pDUMwZO8GNQx5Qt0TC35TCOpi3m85tXYxazm36wyWECD7tFmuBhIuQQTCY6CVA3ntfOrl1RljMi6cygq2yLz5iM4hFxtFKsZdaxKOfbr78z1CfXtN6yWinpz8NPHECUGkMGkQ9lG408yNqoCS9l+BvemEOjGzvbQK1eDa3BM8GMAzYJJObZ9vN1cOzSeUrb8AD7lOiulbVI+pKjO9K0GK6JiC0QWqUjTzhLDobJGrH8bih4KbSv1ug65jJbupqyrjrD6YQbgl1ecXOGGae/A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=microchip.com smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2smaeBBhQ/MbtbS6rY6hiJ2maCU6cXRs5w2UPHtvJ6A=; b=l7hX+HwkOksVLXogwxSZvKKaIuRQl5NkfnanK61ElA0RoXc5bw7CoBE+1rp69rD3YMF8tg8ZRQlaZfm+2mSpW62ElPyFZdMbpx40VcrAmR3KlPmCpmrEbhuOlY9N1OtXZ+0b0VB+e3toPUR5iLgZGTmXqxhUI+jQP3NUla0efzk= Received: from BN9PR03CA0880.namprd03.prod.outlook.com (2603:10b6:408:13c::15) by MWHPR02MB2895.namprd02.prod.outlook.com (2603:10b6:300:108::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.14; Wed, 18 May 2022 11:33:28 +0000 Received: from BN1NAM02FT014.eop-nam02.prod.protection.outlook.com (2603:10b6:408:13c:cafe::81) by BN9PR03CA0880.outlook.office365.com (2603:10b6:408:13c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.15 via Frontend Transport; Wed, 18 May 2022 11:33:27 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; pr=C Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by BN1NAM02FT014.mail.protection.outlook.com (10.13.2.131) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5273.14 via Frontend Transport; Wed, 18 May 2022 11:33:27 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Wed, 18 May 2022 04:33:22 -0700 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Wed, 18 May 2022 04:33:22 -0700 Envelope-to: nicolas.ferre@microchip.com, davem@davemloft.net, richardcochran@gmail.com, claudiu.beznea@microchip.com, kuba@kernel.org, edumazet@google.com, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, harinikatakamlinux@gmail.com Received: from [10.140.6.13] (port=41766 helo=xhdharinik40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1nrHvd-000DlO-Sm; Wed, 18 May 2022 04:33:22 -0700 From: Harini Katakam To: , , , , , , CC: , , , , , Subject: [PATCH net v2 2/2] net: macb: Fix PTP one step sync support Date: Wed, 18 May 2022 17:03:10 +0530 Message-ID: <20220518113310.28132-3-harini.katakam@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220518113310.28132-1-harini.katakam@xilinx.com> References: <20220518113310.28132-1-harini.katakam@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 41c25bc4-1d25-4057-c431-08da38c23a05 X-MS-TrafficTypeDiagnostic: MWHPR02MB2895:EE_ X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: l5FetUod4oQFCM802wvT0sxZHZWx1qi4n5+XWwp6cHRbwoPGilLH/97/5FtL+l87XelvBqSOET66pOHJW5+2N9/VbzXI6z6spt166TfrWJvUA2SDD4cZQXqVN2EU79tVwwiu7/GDQ/gcftdaOmY2+FBmjbykBnnUcfnlA2zocpIKM72Tth3NVdOq//1eO1vVS3fGWsWzAgbHr7rUyxcywTkHASWIhnJUr/Mgg5jaBbcTkf1srEWJAg+E2AyKCtvcMRTM3e27+9glqLOzCkOkgZ6i0jQt8tJLhbCtzHoemd5zoZQQKzXbFyE+m0f3ub3NmfywksZV6/PSg2jX8HgnZhNRAZ0Y1jtUdFZ3TOBbRqBNu2Uer+NLXPSvTUfucHtuulSkwlu1PlyeQhm3pQ9aVTltKH1RElxpsWILe/D1Iy0OJhm+ycCy7jMiu0Oh61EebWgCbjIhMh+BLVERltKE8HERZF3nhWv6bHykCbuisD5Tp2sg7ZAWEl987t3mAAKSx3PZ2QBgQce+7QB28BUW/VVoARBIBQiajUXlyAtkeweMlpy8eGCXNr3FRQyazBG+FcSBHpH9vP56w6EsoJjaHYW0K8iPHPhE/hTMHqlvP1hVCxeTXUn+bGBq/xFZ6PTZqiIR+/LwomIO4pGgTGBv4A3eKWgd0P6MKrTXuy2T+glU0dlVJMwc3SA+ejcw+1vFk9oGJRezSxbqv1Lp/DAaKA== X-Forefront-Antispam-Report: CIP:149.199.62.198;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:xsj-pvapexch02.xlnx.xilinx.com;PTR:unknown-62-198.xilinx.com;CAT:NONE;SFS:(13230001)(4636009)(36840700001)(46966006)(40470700004)(36756003)(82310400005)(186003)(336012)(44832011)(2906002)(47076005)(1076003)(356005)(54906003)(508600001)(110136005)(26005)(7636003)(9786002)(426003)(7696005)(70206006)(70586007)(8676002)(4326008)(6666004)(2616005)(8936002)(5660300002)(7416002)(107886003)(40460700003)(83380400001)(316002)(36860700001)(102446001);DIR:OUT;SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2022 11:33:27.3207 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 41c25bc4-1d25-4057-c431-08da38c23a05 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.62.198];Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: BN1NAM02FT014.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR02MB2895 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" PTP one step sync packets cannot have CSUM padding and insertion in SW since time stamp is inserted on the fly by HW. In addition, ptp4l version 3.0 and above report an error when skb timestamps are reported for packets that not processed for TX TS after transmission. Add a helper to identify PTP one step sync and fix the above two errors. Also reset ptp OSS bit when one step is not selected. Fixes: ab91f0a9b5f4 ("net: macb: Add hardware PTP support") Fixes: 653e92a9175e ("net: macb: add support for padding and fcs computatio= n") Signed-off-by: Harini Katakam Reviewed-by: Radhey Shyam Pandey --- v2: - Separate fix for net branch - Fix include order - ptp_oss -> ptp_one_step_sync - Remove inline and add "likely" on SKB_HWTSTAMP check in ptp helper - Dont split gem_ptp_do_tx_tstamp from if condition as order of evaluation will take care of intent - Remove redundant comments in macb_pad_and_fcs - Add PTP flag to ptp_classify header for common use (Dint add Richard's ACK as the patch changed and there's a minor addition in ptp_classify.h as well) v1 Notes: -> Added the macb pad and fcs fixes tag because strictly speaking the PTP s= upport patch precedes the fcs patch in timeline. -> FYI, the error observed with setting HW TX timestamp for one step sync p= ackets: ptp4l[405.292]: port 1: unexpected socket error drivers/net/ethernet/cadence/macb_main.c | 41 +++++++++++++++++++++--- drivers/net/ethernet/cadence/macb_ptp.c | 4 ++- 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/etherne= t/cadence/macb_main.c index e993616308f8..d6e71f03e73b 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include "macb.h" =20 @@ -1122,6 +1123,36 @@ static void macb_tx_error_task(struct work_struct *w= ork) napi_enable(&queue->napi_tx); } =20 +static bool ptp_one_step_sync(struct sk_buff *skb) +{ + struct ptp_header *hdr; + unsigned int ptp_class; + u8 msgtype; + + /* No need to parse packet if PTP TS is not involved */ + if (likely(!(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP))) + goto not_oss; + + /* Identify and return whether PTP one step sync is being processed */ + ptp_class =3D ptp_classify_raw(skb); + if (ptp_class =3D=3D PTP_CLASS_NONE) + goto not_oss; + + hdr =3D ptp_parse_header(skb, ptp_class); + if (!hdr) + goto not_oss; + + if (hdr->flag_field[0] & PTP_FLAG_TWOSTEP) + goto not_oss; + + msgtype =3D ptp_get_msgtype(hdr, ptp_class); + if (msgtype =3D=3D PTP_MSGTYPE_SYNC) + return true; + +not_oss: + return false; +} + static int macb_tx_complete(struct macb_queue *queue, int budget) { struct macb *bp =3D queue->bp; @@ -1158,8 +1189,8 @@ static int macb_tx_complete(struct macb_queue *queue,= int budget) =20 /* First, update TX stats if needed */ if (skb) { - if (unlikely(skb_shinfo(skb)->tx_flags & - SKBTX_HW_TSTAMP) && + if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) && + !ptp_one_step_sync(skb) && gem_ptp_do_txstamp(queue, skb, desc) =3D=3D 0) { /* skb now belongs to timestamp buffer * and will be removed later @@ -2063,7 +2094,8 @@ static unsigned int macb_tx_map(struct macb *bp, ctrl |=3D MACB_BF(TX_LSO, lso_ctrl); ctrl |=3D MACB_BF(TX_TCP_SEQ_SRC, seq_ctrl); if ((bp->dev->features & NETIF_F_HW_CSUM) && - skb->ip_summed !=3D CHECKSUM_PARTIAL && !lso_ctrl) + skb->ip_summed !=3D CHECKSUM_PARTIAL && !lso_ctrl && + !ptp_one_step_sync(skb)) ctrl |=3D MACB_BIT(TX_NOCRC); } else /* Only set MSS/MFS on payload descriptors @@ -2159,9 +2191,10 @@ static int macb_pad_and_fcs(struct sk_buff **skb, st= ruct net_device *ndev) struct sk_buff *nskb; u32 fcs; =20 + /* Not available for GSO and PTP one step sync */ if (!(ndev->features & NETIF_F_HW_CSUM) || !((*skb)->ip_summed !=3D CHECKSUM_PARTIAL) || - skb_shinfo(*skb)->gso_size) /* Not available for GSO */ + skb_shinfo(*skb)->gso_size || ptp_one_step_sync(*skb)) return 0; =20 if (padlen <=3D 0) { diff --git a/drivers/net/ethernet/cadence/macb_ptp.c b/drivers/net/ethernet= /cadence/macb_ptp.c index fb6b27f46b15..9559c16078f9 100644 --- a/drivers/net/ethernet/cadence/macb_ptp.c +++ b/drivers/net/ethernet/cadence/macb_ptp.c @@ -470,8 +470,10 @@ int gem_set_hwtst(struct net_device *dev, struct ifreq= *ifr, int cmd) case HWTSTAMP_TX_ONESTEP_SYNC: if (gem_ptp_set_one_step_sync(bp, 1) !=3D 0) return -ERANGE; - fallthrough; + tx_bd_control =3D TSTAMP_ALL_FRAMES; + break; case HWTSTAMP_TX_ON: + gem_ptp_set_one_step_sync(bp, 0); tx_bd_control =3D TSTAMP_ALL_FRAMES; break; default: --=20 2.17.1