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 6DFE142D46 for ; Sun, 25 Jun 2023 08:40:22 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 68A8240ED8; Sun, 25 Jun 2023 08:40:22 +0200 (CEST) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2074.outbound.protection.outlook.com [40.107.100.74]) by mails.dpdk.org (Postfix) with ESMTP id 1DF5B40A7F for ; Sun, 25 Jun 2023 08:40:21 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Nl7molN3Z7IZ+rHfgLrCD4QflBqoxckpvXC1gZsifjqu1+B61tnAgZa5pGKlxmYDrt2ni3dyTgVddm7AbygOf69kvapVb+ypr8NfXiaohyP/TbkYZCtBtZ+fAudyOGRkVS77OjTL/3lfhUB1Ux9GIMHakKKnVs7lVPsGZmloO0N6YD7P4dfFILhYT17AAOCiyWkqTCr84R9pwGfTDHyDWDVOkSOk4FSqW+tj/gGSbUk7WQ2Lv+shpvGAMmPZSBJ3Kor8r9l8Hy0OLmj4Q9+tPJzvAISeLFO0hnoRE2CaL2ihhnPoM/oM/3IO5ePhVqtfv0Wrl72hZfnPBEjLKYVIZw== 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=FH3coEumM3FyudDWwg6l2edeIL8YzVGFvqZmcQsAPHk=; b=kpQBSd3HCrjqNYa1Os1Gakvk3PHb3LM07k4J1EXvSz06hQqZcZYz+RwR3imw7TxUdQLyTCjLiS+eTYS5o1eAPZlkbBnpQQ1NE+v1MHE+EjhefmCFFHSuSXItrcBbQ/xMTF33+XmsYbnju/NXhoMwpQjyabECz8ycVz9yECveaaGOfUjg/ZW+gX+9HCC9UWmQbv4Z0Xu76envmeylD0qlEKPVjZJ+reaCs06mHUwxCwmpp8ihVbyemtsOOi5wHEDvmTqN7s0hqCIiMA88Z73o3e+U3xK58V3TT0Xw/Acu261FPV7O/bjZ/Ne3DB2i44nQ11VNgaudfpPFC0wXQYWrlQ== 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=FH3coEumM3FyudDWwg6l2edeIL8YzVGFvqZmcQsAPHk=; b=QvfnD5gCm0miGQpF1n3Wjp5Mx2d1++AKVFKoiIlHwADs8nXMqsKMOR6BHx9Epe1KzECagypyzRMJpVuIsTdLLsj7jfpCZaWrFqXtfTOcb33Kjlh31Y9HXDoiOOnk0TStyS3sDIxhRARyvO0oZXP8vApST1Rbu7il2D2N3CvovR/tfpWIZMrL8zYxtLmfVbuvHkyFkuBXrXRqUO3DGa6kate7JzFVyYyUHWhjCOczq2LhC4ie03NsA0Wvm2sRyda0FYnhsRkNhz+4eEVdlS4nCE8+HU8vyVNJpzp96GnF52ay4rkjjjXObbe6QP50Jayz3Gb6Af1WmuQax5027LpNZQ== Received: from BN9PR03CA0315.namprd03.prod.outlook.com (2603:10b6:408:112::20) by SJ0PR12MB8615.namprd12.prod.outlook.com (2603:10b6:a03:484::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Sun, 25 Jun 2023 06:40:19 +0000 Received: from BN8NAM11FT023.eop-nam11.prod.protection.outlook.com (2603:10b6:408:112:cafe::55) by BN9PR03CA0315.outlook.office365.com (2603:10b6:408:112::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.32 via Frontend Transport; Sun, 25 Jun 2023 06:40:19 +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 BN8NAM11FT023.mail.protection.outlook.com (10.13.177.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.45 via Frontend Transport; Sun, 25 Jun 2023 06:40:16 +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.5; Sat, 24 Jun 2023 23:40:04 -0700 Received: from nvidia.com (10.126.230.35) 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; Sat, 24 Jun 2023 23:40:02 -0700 From: Xueming Li To: Huisong Li CC: Dongdong Liu , dpdk stable Subject: patch 'net/hns3: fix RTC time on initialization' has been queued to stable release 22.11.3 Date: Sun, 25 Jun 2023 14:34:26 +0800 Message-ID: <20230625063544.11183-49-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230625063544.11183-1-xuemingl@nvidia.com> References: <20230625063544.11183-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] 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: BN8NAM11FT023:EE_|SJ0PR12MB8615:EE_ X-MS-Office365-Filtering-Correlation-Id: 53907e41-73cc-4f66-e3ae-08db754709b1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5KS/WS/pgR2/Ysl9oJNkxSII/GGb06Real/t8/1qcM0q/by9kPTuNQ1twyOpemYSUiuyDaDZ4j9mBROCofanEw7XlqwQiriMV7BGQlLAKkC8n3AbBAktlXM7+PwblDIGOhBJesqHviCGEipG1NtQaU01x+ii6ZeC96sikR2YglKAsXK73zwTnxWSl4k+D/EouDgURX9mpldkFYo3DFOBCL54r55Yo4V1GvkweBsH1/citNrEW4MJZESNPnVqnLYOEpxz9GR+YqXwM28NxY0KSxMg6DtNtHHXWJtSQoXb4roSWAx26M5iraf+fy5Ggv4Q3qpbuLGM5ZJ3GIxr8SfrMF00EykdlGsJRsiOG8copbTrg+zYycb7c0VzXvfWlEN/gKL2uFvYYvIhEo4UPcyz1yK/y3QbGr6MhPrQ+G2pAfE1f/WehtFhJP3vCaM63Kmxw1qBIWDGl9pPxYsxLqd97S/Tp/o+uG7GZjSuMyzvwGY4Okcmdk2fqRa6dhHfIgWK49dYjiDjhJvkB2N0Uzt8+t3xVQ5SHivZiXYgTJNlInYEnTZmXOOuJv5a8vsrgErbLjrws9qoEtIcWwYWfV5RI7M5mGt0h0dK3+3WmXQ2MZx4YEyp9vXClhDc7MyjH1O1m7tzoyjdcrMbiQr2rbO75oCHDGNcVQCZedem40p/F+EaIvVJGKb8gQk/qH6X5cnnim8zJJoH9PYKItGrwe6WGb3wiDQK9Jd3M0XLXsy/F9oixqPhNnuxgEkRd5bYSkO9vJLhsMHAuNK2gSYaaboY2A== 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:(13230028)(4636009)(376002)(136003)(396003)(346002)(39860400002)(451199021)(46966006)(36840700001)(40470700004)(36860700001)(82310400005)(47076005)(966005)(478600001)(7696005)(6666004)(2616005)(54906003)(426003)(83380400001)(336012)(26005)(53546011)(1076003)(186003)(16526019)(6286002)(2906002)(5660300002)(40460700003)(36756003)(70206006)(356005)(4326008)(7636003)(70586007)(82740400003)(55016003)(40480700001)(316002)(86362001)(8936002)(8676002)(41300700001)(6916009); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jun 2023 06:40:16.6801 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 53907e41-73cc-4f66-e3ae-08db754709b1 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: BN8NAM11FT023.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB8615 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.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/27/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=69bff6ea1c35e00eb10145a41269ce7234ce8558 Thanks. Xueming Li --- >From 69bff6ea1c35e00eb10145a41269ce7234ce8558 Mon Sep 17 00:00:00 2001 From: Huisong Li Date: Fri, 2 Jun 2023 19:41:55 +0800 Subject: [PATCH] net/hns3: fix RTC time on initialization Cc: Xueming Li [ upstream commit f901c570e50d042f466de29b186db68e177f93ab ] Driver doesn't initialize RTC time during probe phase, which lead to an inaccurate time. Fixes: 38b539d96eb6 ("net/hns3: support IEEE 1588 PTP") Signed-off-by: Huisong Li Signed-off-by: Dongdong Liu --- drivers/net/hns3/hns3_ptp.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/drivers/net/hns3/hns3_ptp.c b/drivers/net/hns3/hns3_ptp.c index db3c007b12..1e27e4aeca 100644 --- a/drivers/net/hns3/hns3_ptp.c +++ b/drivers/net/hns3/hns3_ptp.c @@ -56,9 +56,23 @@ hns3_ptp_int_en(struct hns3_hw *hw, bool en) return ret; } +static void +hns3_ptp_timesync_write_time(struct hns3_hw *hw, const struct timespec *ts) +{ + uint64_t sec = ts->tv_sec; + uint64_t ns = ts->tv_nsec; + + /* Set the timecounters to a new value. */ + hns3_write_dev(hw, HNS3_CFG_TIME_SYNC_H, upper_32_bits(sec)); + hns3_write_dev(hw, HNS3_CFG_TIME_SYNC_M, lower_32_bits(sec)); + hns3_write_dev(hw, HNS3_CFG_TIME_SYNC_L, lower_32_bits(ns)); + hns3_write_dev(hw, HNS3_CFG_TIME_SYNC_RDY, 1); +} + int hns3_ptp_init(struct hns3_hw *hw) { + struct timespec sys_time; int ret; if (!hns3_dev_get_support(hw, PTP)) @@ -71,6 +85,10 @@ hns3_ptp_init(struct hns3_hw *hw) /* Start PTP timer */ hns3_write_dev(hw, HNS3_CFG_TIME_CYC_EN, 1); + /* Initializing the RTC. */ + clock_gettime(CLOCK_REALTIME, &sys_time); + hns3_ptp_timesync_write_time(hw, &sys_time); + return 0; } @@ -241,17 +259,11 @@ int hns3_timesync_write_time(struct rte_eth_dev *dev, const struct timespec *ts) { struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private); - uint64_t sec = ts->tv_sec; - uint64_t ns = ts->tv_nsec; if (!hns3_dev_get_support(hw, PTP)) return -ENOTSUP; - /* Set the timecounters to a new value. */ - hns3_write_dev(hw, HNS3_CFG_TIME_SYNC_H, upper_32_bits(sec)); - hns3_write_dev(hw, HNS3_CFG_TIME_SYNC_M, lower_32_bits(sec)); - hns3_write_dev(hw, HNS3_CFG_TIME_SYNC_L, lower_32_bits(ns)); - hns3_write_dev(hw, HNS3_CFG_TIME_SYNC_RDY, 1); + hns3_ptp_timesync_write_time(hw, ts); return 0; } -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-06-25 14:31:59.797256300 +0800 +++ 0048-net-hns3-fix-RTC-time-on-initialization.patch 2023-06-25 14:31:58.365773900 +0800 @@ -1 +1 @@ -From f901c570e50d042f466de29b186db68e177f93ab Mon Sep 17 00:00:00 2001 +From 69bff6ea1c35e00eb10145a41269ce7234ce8558 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit f901c570e50d042f466de29b186db68e177f93ab ] @@ -10 +12,0 @@ -Cc: stable@dpdk.org