From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 87F6C41D8D for ; Mon, 27 Feb 2023 08:04:28 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8480340A84; Mon, 27 Feb 2023 08:04:28 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2087.outbound.protection.outlook.com [40.107.94.87]) by mails.dpdk.org (Postfix) with ESMTP id 574EC40A7D for ; Mon, 27 Feb 2023 08:04:27 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JMjPSkUkXph0GX8FFLp640JfQq4mJPRhcMPUZOU6ktJZt61oMR6txjep/fQT799tIKdW7bCwuspoEknZHAgj9rBh32zT3seW6O40sD/uz9nvbwOwjJAnyONQndx4bvUqpacqHK4CinDRccxXxHJxukJPBVv8xGHN48PZ2RI1x8PeOmLWJ2FzmAkq1O2kNDeKrjlNO7MmxQtU09wBLhpnkz0Eklqxmc5kyj4ZwgmXWYPjZcVv6XXGkTiPO6tIoqFF2DBatvW3RaB1azAifAF+evnHW0UN5jy9gn16D93/WADaJcZ/W4KBT077v2VFr1iGbK30CtPx8D9PxeTso8uplg== 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=sjVsYr0Ll8GACIfDabzRahzw+NnXo3WBlHNzRT2dwJ0=; b=Bz0DtNY/DqhV5Ss1naxDyWbieM9ioVKq3kEqFlraViKrQ8H8Pxpjn6YaUQyMvQl7bwTQ+5p5YcChGqf1DoEGMl7F5rk/3SKqtTclwSa8u7a69maE9jdrmad0ji9alB554JRMQ0fALVoBNmSuDT8hZGxVLwcJ/21FlIgsUS3PpzU+dwpHyicOWUwnVKhJhvjGf1JFBH/3kS3YURm+XeCA7PUow3vKNzvr487Sq9TTFhN8CuOppsOgBZB3DRXU1/XcBNc6gScNbTrVgZAlUwoAN3cCIh2L7MZLhVgWX9nvMD5bRQ4DeMRiPydlL/KuBQ3JVj8d2+UtB+cbEbz2zqV++Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=huawei.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sjVsYr0Ll8GACIfDabzRahzw+NnXo3WBlHNzRT2dwJ0=; b=pO+wMMKog50uoqWH7PFOaxc2OZ0954cGh5arNXkNTlLGL7qzUwU8sXRvn2C48kQEsf3H7NmME3gg3JDYWmoeo+kMyTbmRRhDOhLdAHGVVLFchxZPuoJ7SvAT8RBv1/1qpjXubylFJybeIXutVbBkGp6omBCEKH16qjhu2p+Fzsmaxw5pffO06QIySkSwhhcm265h4H+Ig2rwS+8vb29J9IIC/QcPtGH5XZ6K2i5IXPgGmwSd12W8KLlcr69X6DdVuOufbO3zHYzDtvAhjztvXU/uYlF/plXwAneuj2eltwzZtcuopHtQxcjuO6q3ipIBxGl3XKGIOZrvqpaJGpx+zg== Received: from BN1PR12CA0030.namprd12.prod.outlook.com (2603:10b6:408:e1::35) by SJ0PR12MB6990.namprd12.prod.outlook.com (2603:10b6:a03:449::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.27; Mon, 27 Feb 2023 07:04:25 +0000 Received: from BL02EPF000108EA.namprd05.prod.outlook.com (2603:10b6:408:e1:cafe::ea) by BN1PR12CA0030.outlook.office365.com (2603:10b6:408:e1::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.29 via Frontend Transport; Mon, 27 Feb 2023 07:04:24 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BL02EPF000108EA.mail.protection.outlook.com (10.167.241.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.12 via Frontend Transport; Mon, 27 Feb 2023 07:04:24 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Sun, 26 Feb 2023 23:04:13 -0800 Received: from nvidia.com (10.126.231.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Sun, 26 Feb 2023 23:04:10 -0800 From: Xueming Li To: Huisong Li CC: Dongdong Liu , dpdk stable Subject: patch 'net/hns3: fix inaccurate RTC time to read' has been queued to stable release 22.11.2 Date: Mon, 27 Feb 2023 14:58:56 +0800 Message-ID: <20230227070107.15664-28-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230227070107.15664-1-xuemingl@nvidia.com> References: <20230227062349.13764-1-xuemingl@nvidia.com> <20230227070107.15664-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.37] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF000108EA:EE_|SJ0PR12MB6990:EE_ X-MS-Office365-Filtering-Correlation-Id: 2cfa81fc-9584-41b4-825a-08db1890dbe1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: t1lUVh9V7thIJ4Gv/s0UvAAl/dBdFx9B7FP2IVxMek7AmdXyu+OzhVOfvCToHsmCrdvyLiRCi1XxcdWAOmZB4hSfsR5AA3a5SHhGEBdcTAIr1nsgunQEqDq9dkH7P5fi1qXz6uuRSD/dJzcASkRrZGywPFUZezwg7XYBNTphiv/N8QEjYCJ4Op/5+jn5xPqLLxfbs2rQq0VtJ2gTxIhNklRSgp2lymxNNPIGpACJyyvhOVy7LoZ3yKGRkFRYle51a7+XKL0k67mV5XiolL0jZE1GzlZQELW7xBo8DKeNyxNwEBpPOGTaM/5Lq8d+yTg85aZGYlNwXmzBeoPX5JXuD9cwdsbhCwnWNpd1StuQ93NeTpxou+fd/9UmHP4dTAWf5o+StHPPFWG7y2mDpTA42Qal03ZEcQy9UJJh92R8pprXIUuOnc3BucRWR5zJ/kwrbM3BJ7mcgwWymRgUeMN2JFl3Qsak59B4pjjz2frmS03XtgZSnnNdmLl9/kipEZjIjGchcpLRy1DIEkTVNYoJ+15PHuhTD5eMsFEY9hCwJxu5jtdLKEWzcq23WshqzeHmBPMMQ0kUuOMYh7+NDo2jqNt4PFV/s6KCT6ak0froKbfY5VOeFbB7tlXof7YgoZobHPchZhfPCU9JbEYYoABVCUoStNWk3wjbA5SWgVPLuFFOoawpMLaSifDIFphl5otTjrDc1/iTBlOeKKjHHGwn4TIaOB8BB8oVOtPHSRxhc4QouppKHGymSvwHIA7AX91BouFF+85JCeAMuOAWJqyzjSAtq+T7aLWfJjnl0pwfB8I= X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230025)(4636009)(39860400002)(136003)(376002)(346002)(396003)(451199018)(46966006)(40470700004)(36840700001)(7636003)(54906003)(8936002)(316002)(82740400003)(336012)(16526019)(8676002)(6286002)(36756003)(186003)(26005)(478600001)(53546011)(82310400005)(40460700003)(356005)(86362001)(7696005)(966005)(1076003)(6666004)(55016003)(2906002)(40480700001)(2616005)(5660300002)(83380400001)(70586007)(70206006)(4326008)(6916009)(426003)(47076005)(41300700001)(36860700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2023 07:04:24.4372 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2cfa81fc-9584-41b4-825a-08db1890dbe1 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF000108EA.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6990 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 22.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/01/23. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=58db4361dc585b453a6808ef5ada1002476cdf08 Thanks. Xueming Li --- >From 58db4361dc585b453a6808ef5ada1002476cdf08 Mon Sep 17 00:00:00 2001 From: Huisong Li Date: Mon, 9 Jan 2023 16:23:44 +0800 Subject: [PATCH] net/hns3: fix inaccurate RTC time to read Cc: Xueming Li [ upstream commit 6170abd5c0cc3d8cf4e358c4200ed7737d639d10 ] The sequence of reading current RTC time register doesn't meet the hardware requirements, which causes this time obtained is the one before modifying RTC time. Fixes: 38b539d96eb6 ("net/hns3: support IEEE 1588 PTP") Signed-off-by: Huisong Li Acked-by: Dongdong Liu --- drivers/net/hns3/hns3_ptp.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/hns3/hns3_ptp.c b/drivers/net/hns3/hns3_ptp.c index 6bbd85ba23..db3c007b12 100644 --- a/drivers/net/hns3/hns3_ptp.c +++ b/drivers/net/hns3/hns3_ptp.c @@ -216,17 +216,21 @@ hns3_timesync_read_tx_timestamp(struct rte_eth_dev *dev, int hns3_timesync_read_time(struct rte_eth_dev *dev, struct timespec *ts) { +#define HNS3_PTP_SEC_H_OFFSET 32 +#define HNS3_PTP_SEC_H_MASK 0xFFFF + struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private); + uint32_t sec_hi, sec_lo; uint64_t ns, sec; if (!hns3_dev_get_support(hw, PTP)) return -ENOTSUP; - sec = hns3_read_dev(hw, HNS3_CURR_TIME_OUT_L); - sec |= (uint64_t)(hns3_read_dev(hw, HNS3_CURR_TIME_OUT_H) & 0xFFFF) - << 32; - ns = hns3_read_dev(hw, HNS3_CURR_TIME_OUT_NS); + sec_hi = hns3_read_dev(hw, HNS3_CURR_TIME_OUT_H) & HNS3_PTP_SEC_H_MASK; + sec_lo = hns3_read_dev(hw, HNS3_CURR_TIME_OUT_L); + sec = ((uint64_t)sec_hi << HNS3_PTP_SEC_H_OFFSET) | sec_lo; + ns += sec * NSEC_PER_SEC; *ts = rte_ns_to_timespec(ns); -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-02-27 14:08:41.872754400 +0800 +++ 0029-net-hns3-fix-inaccurate-RTC-time-to-read.patch 2023-02-27 14:08:40.739237000 +0800 @@ -1 +1 @@ -From 6170abd5c0cc3d8cf4e358c4200ed7737d639d10 Mon Sep 17 00:00:00 2001 +From 58db4361dc585b453a6808ef5ada1002476cdf08 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 6170abd5c0cc3d8cf4e358c4200ed7737d639d10 ] @@ -11 +13,0 @@ -Cc: stable@dpdk.org