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 A626E428F8 for ; Sun, 9 Apr 2023 17:30:08 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A0C1842BB1; Sun, 9 Apr 2023 17:30:08 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2085.outbound.protection.outlook.com [40.107.93.85]) by mails.dpdk.org (Postfix) with ESMTP id 4CDD84067E for ; Sun, 9 Apr 2023 17:30:07 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UzpCYubGxY2n2ybdgM75gmDzvRCh0InOsr+aC4FCgzg5yZy0dAJS+9QN6KOJKTVaoB5AhRM9y+QNW3MKqea0IqNSp6eKa/OKaQ5FYcRAESKegOp9DvFWL7CZhcWNB35viaW1S076Ut6O9Mnu3xYfNR92lLN32Ed7KaYvkYA0dmKt/N6yD/mflsgdSBe/lVL1WLFh5oqwyPJJbFjidoS7+BbrOpXJH/CapBywU4GXcneeYwxWpp1UEd5b/YNtL1+ID4TuEahdcXrXPERT7msbx5aG9QLKxib7pEWUz+YicmBeRtnjc7LKaliCIZFHgNV7O351GZxJCyqh6HS415hGeA== 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=eoSKWgKPT1r84WcHtAWb7HhqiwmZiSgtRS0miKn00gM=; b=b1LAYXLNZK9GuepkSaWpUmkWI+45GVXHsoqQP4dPinHi2FFwMSld0l83wd0lrAPWhMtA3n5NyvVXau7AXl5GJ9K2/IWdNhNvRM+A1imE/wb/Je1yEXkxAmpybpVJ75YMf2hWOkXRwwZMjwYc5Djd99vqdpEkGjVt5QuhfhU7L8cW/hxf8Zm9SLQDTI74RqwGkm+PH9QGx3hin22RaeFjnpVhpoUvW0TAZwdrN0DhGlbfd736CFt8OKn29MiZ/rPataWLLkX5Im5XBK0tP4/pYVR1Rz1BjfHJ0hpdwA9qziPFYsYLMIv0pe+bl0qR1QCey3JAe1sphsbStEGt1hcI3g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=intel.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=eoSKWgKPT1r84WcHtAWb7HhqiwmZiSgtRS0miKn00gM=; b=CLv7HsGVtwP+N6yCXl+3rOuLdlPXGAIKat4Y1LTjyuiRvCGvEV73nf833dBVy31RBj/2p1GNaWYXFWUwfPoM3hJhErihkcX6pCZd9dIXl/GX5OyBk6HZ78+yayP30XtekM5dFtofd1jXjewsSh53Qgh2Zp5HpFSRBDmAG5Zs3bIWn189h3tg43RLTdMG3mkqj3kwjeMisBEi4Jg/UPIFuY+XMk/TcG8bogB92Kf7MkXT1ki5kdQkf1/z1RVx5fBBDhCQ0G1NcWZ4Lw3DC6E5ck+VY3NGYJk8mm+TWCkEMbYxQLkph2R6DHxDEbYjrSyVUldo5WxZuqvcOTCx4dsbZg== Received: from DM6PR18CA0034.namprd18.prod.outlook.com (2603:10b6:5:15b::47) by MN0PR12MB6176.namprd12.prod.outlook.com (2603:10b6:208:3c3::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.31; Sun, 9 Apr 2023 15:30:05 +0000 Received: from DM6NAM11FT006.eop-nam11.prod.protection.outlook.com (2603:10b6:5:15b:cafe::38) by DM6PR18CA0034.outlook.office365.com (2603:10b6:5:15b::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.36 via Frontend Transport; Sun, 9 Apr 2023 15:30:05 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by DM6NAM11FT006.mail.protection.outlook.com (10.13.173.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.21 via Frontend Transport; Sun, 9 Apr 2023 15:30:04 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Sun, 9 Apr 2023 08:30:01 -0700 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, 9 Apr 2023 08:30:00 -0700 From: Xueming Li To: Simei Su CC: Wenjun Wu , dpdk stable Subject: patch 'net/ice: fix Rx timestamp' has been queued to stable release 22.11.2 Date: Sun, 9 Apr 2023 23:23:58 +0800 Message-ID: <20230409152529.5308-51-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230409152529.5308-1-xuemingl@nvidia.com> References: <20230227062349.13764-1-xuemingl@nvidia.com> <20230409152529.5308-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: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT006:EE_|MN0PR12MB6176:EE_ X-MS-Office365-Filtering-Correlation-Id: b943894d-e580-499e-c308-08db390f4b0b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RcGxLoEFQFzJTB+ATmAq5yD2UBSGKKg5wHy2i9jWp5rImHAil8pR8F87r4kAU5J0IPh75uwa5IBDmThUlfaKBndeO4MIhj5+uGkkqYCQ0U9qB92/gycqMkuHZCoiuLug0ErMlmQFHZyQvBRPMBKL3FTyBiWevvyHDQNP82pk5hyKLsqyH0f+vmRT1SbwZcSv5KoHpARMEd4vTcbiYMCWHjCtJvwfHD4ojSNNrrHeUEMZdD8D/kDChUr78ljmAw2uflK8p0/+9QlnjhJIXbTieFpOIiGYnKhDPOh9asjH72wecCHEL6HebLaW5wARxkcxcWEEoNoUnmhUX8VDBhrAD1+fXhsTsbes/JzKNXRdnphBxSvS8cSAsOWbMrjqpvpxNZchbp/FApdaLlfS326E9gXeGDorLbhtctO853LbTxOMjqqWyffTiy6NmUAqdkNcAXa+yR5W+tk8ehTH05YS8ds1Pi6Fur+3cAO0J4JWnNbkd+nEgEF2XoLrA+MJFrSsq0Y7HFzp3Eii10FYS6Kft1XVt9XP6ZVCbPgSsnPvNsAH2zju7cytV0w82g+JB/W25hfVOJgebYH4hQ9g3KkSHjCDWsOl8iYOTu9SFNROhpdel9duo/rqeBD3pEIbi3287O4yvwdya4ZYKidbHrp3HkK3s73lFOUzBhxPq/jQZfRN6+00eazJuFMiRnv9DwOjcI9FiVltBWS0G+8IymxMd05Sk9wOkAG9WlyV+PRnKOB+5TPtm4lu0FPjOEwNs9+LyJKfYaAsWVNUypdNBDGLdBt3JHETtAB/093AL7zjTYHQltJlO33Xx7a8qj0mDa6Rc/n84RZGibhrGQm+B9LkGA== X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230028)(4636009)(39860400002)(346002)(136003)(376002)(396003)(451199021)(40470700004)(46966006)(36840700001)(82310400005)(2906002)(40140700001)(86362001)(36756003)(55016003)(40480700001)(7696005)(36860700001)(53546011)(16526019)(336012)(83380400001)(426003)(186003)(47076005)(6286002)(26005)(966005)(1076003)(4326008)(82740400003)(70206006)(8676002)(70586007)(6916009)(40460700003)(7636003)(5660300002)(2616005)(316002)(54906003)(41300700001)(356005)(478600001)(8936002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2023 15:30:04.8005 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b943894d-e580-499e-c308-08db390f4b0b 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.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT006.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6176 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 04/11/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/log/?h=22.11-staging/commit/14688b03c0b50b94694957b516a7e77d929b9d5c Thanks. Xueming Li --- >From 14688b03c0b50b94694957b516a7e77d929b9d5c Mon Sep 17 00:00:00 2001 From: Simei Su Date: Wed, 8 Mar 2023 12:36:55 +0800 Subject: [PATCH] net/ice: fix Rx timestamp Cc: Xueming Li [ upstream commit 0e1c5d03d30c531b6d6d42cf5cb5def46f61ca70 ] For E822, the time value in Rx Flex Descriptors is 0 due to the missing PHY clock timer setup. Also, the source clock index in use is based on device capabilities instead of always being zero. Fixes: 953e74e6b73a ("net/ice: enable Rx timestamp on flex descriptor") Fixes: 646dcbe6c701 ("net/ice: support IEEE 1588 PTP") Fixes: fb800fde66f4 ("net/ice/base: work around missing PTP capabilities") Signed-off-by: Simei Su Acked-by: Wenjun Wu --- drivers/net/ice/base/ice_common.c | 4 +--- drivers/net/ice/ice_ethdev.c | 36 +++++++++++++++++++------------ drivers/net/ice/ice_rxtx.h | 11 +++++----- 3 files changed, 29 insertions(+), 22 deletions(-) diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c index 5391bd666b..1a02aad869 100644 --- a/drivers/net/ice/base/ice_common.c +++ b/drivers/net/ice/base/ice_common.c @@ -2554,9 +2554,7 @@ ice_parse_1588_func_caps(struct ice_hw *hw, struct ice_hw_func_caps *func_p, struct ice_aqc_list_caps_elem *cap) { struct ice_ts_func_info *info = &func_p->ts_func_info; - u32 number = ICE_TS_FUNC_ENA_M | ICE_TS_SRC_TMR_OWND_M | - ICE_TS_TMR_ENA_M | ICE_TS_TMR_IDX_OWND_M | - ICE_TS_TMR_IDX_ASSOC_M; + u32 number = LE32_TO_CPU(cap->number); u8 clk_freq; ice_debug(hw, ICE_DBG_INIT, "1588 func caps: raw value %x\n", number); diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index 0bc739daf0..263c80a6eb 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -2399,6 +2399,17 @@ ice_dev_init(struct rte_eth_dev *dev) /* Initialize TM configuration */ ice_tm_conf_init(dev); + if (ice_is_e810(hw)) + hw->phy_cfg = ICE_PHY_E810; + else + hw->phy_cfg = ICE_PHY_E822; + + if (hw->phy_cfg == ICE_PHY_E822) { + ret = ice_start_phy_timer_e822(hw, hw->pf_id, true); + if (ret) + PMD_INIT_LOG(ERR, "Failed to start phy timer\n"); + } + if (!ad->is_safe_mode) { ret = ice_flow_init(ad); if (ret) { @@ -5800,11 +5811,6 @@ ice_timesync_enable(struct rte_eth_dev *dev) return -1; } - if (ice_is_e810(hw)) - hw->phy_cfg = ICE_PHY_E810; - else - hw->phy_cfg = ICE_PHY_E822; - if (hw->func_caps.ts_func_info.src_tmr_owned) { ret = ice_ptp_init_phc(hw); if (ret) { @@ -5925,16 +5931,17 @@ ice_timesync_read_time(struct rte_eth_dev *dev, struct timespec *ts) struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private); struct ice_adapter *ad = ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); + uint8_t tmr_idx = hw->func_caps.ts_func_info.tmr_index_assoc; uint32_t hi, lo, lo2; uint64_t time, ns; - lo = ICE_READ_REG(hw, GLTSYN_TIME_L(0)); - hi = ICE_READ_REG(hw, GLTSYN_TIME_H(0)); - lo2 = ICE_READ_REG(hw, GLTSYN_TIME_L(0)); + lo = ICE_READ_REG(hw, GLTSYN_TIME_L(tmr_idx)); + hi = ICE_READ_REG(hw, GLTSYN_TIME_H(tmr_idx)); + lo2 = ICE_READ_REG(hw, GLTSYN_TIME_L(tmr_idx)); if (lo2 < lo) { - lo = ICE_READ_REG(hw, GLTSYN_TIME_L(0)); - hi = ICE_READ_REG(hw, GLTSYN_TIME_H(0)); + lo = ICE_READ_REG(hw, GLTSYN_TIME_L(tmr_idx)); + hi = ICE_READ_REG(hw, GLTSYN_TIME_H(tmr_idx)); } time = ((uint64_t)hi << 32) | lo; @@ -5950,6 +5957,7 @@ ice_timesync_disable(struct rte_eth_dev *dev) struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private); struct ice_adapter *ad = ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); + uint8_t tmr_idx = hw->func_caps.ts_func_info.tmr_index_assoc; uint64_t val; uint8_t lport; @@ -5957,12 +5965,12 @@ ice_timesync_disable(struct rte_eth_dev *dev) ice_clear_phy_tstamp(hw, lport, 0); - val = ICE_READ_REG(hw, GLTSYN_ENA(0)); + val = ICE_READ_REG(hw, GLTSYN_ENA(tmr_idx)); val &= ~GLTSYN_ENA_TSYN_ENA_M; - ICE_WRITE_REG(hw, GLTSYN_ENA(0), val); + ICE_WRITE_REG(hw, GLTSYN_ENA(tmr_idx), val); - ICE_WRITE_REG(hw, GLTSYN_INCVAL_L(0), 0); - ICE_WRITE_REG(hw, GLTSYN_INCVAL_H(0), 0); + ICE_WRITE_REG(hw, GLTSYN_INCVAL_L(tmr_idx), 0); + ICE_WRITE_REG(hw, GLTSYN_INCVAL_H(tmr_idx), 0); ad->ptp_ena = 0; diff --git a/drivers/net/ice/ice_rxtx.h b/drivers/net/ice/ice_rxtx.h index 4947d5c25f..94f6bcf3d1 100644 --- a/drivers/net/ice/ice_rxtx.h +++ b/drivers/net/ice/ice_rxtx.h @@ -349,26 +349,27 @@ static inline uint64_t ice_tstamp_convert_32b_64b(struct ice_hw *hw, struct ice_adapter *ad, uint32_t flag, uint32_t in_timestamp) { + uint8_t tmr_idx = hw->func_caps.ts_func_info.tmr_index_assoc; const uint64_t mask = 0xFFFFFFFF; uint32_t hi, lo, lo2, delta; uint64_t ns; if (flag) { - lo = ICE_READ_REG(hw, GLTSYN_TIME_L(0)); - hi = ICE_READ_REG(hw, GLTSYN_TIME_H(0)); + lo = ICE_READ_REG(hw, GLTSYN_TIME_L(tmr_idx)); + hi = ICE_READ_REG(hw, GLTSYN_TIME_H(tmr_idx)); /* * On typical system, the delta between lo and lo2 is ~1000ns, * so 10000 seems a large-enough but not overly-big guard band. */ if (lo > (UINT32_MAX - ICE_TIMESYNC_REG_WRAP_GUARD_BAND)) - lo2 = ICE_READ_REG(hw, GLTSYN_TIME_L(0)); + lo2 = ICE_READ_REG(hw, GLTSYN_TIME_L(tmr_idx)); else lo2 = lo; if (lo2 < lo) { - lo = ICE_READ_REG(hw, GLTSYN_TIME_L(0)); - hi = ICE_READ_REG(hw, GLTSYN_TIME_H(0)); + lo = ICE_READ_REG(hw, GLTSYN_TIME_L(tmr_idx)); + hi = ICE_READ_REG(hw, GLTSYN_TIME_H(tmr_idx)); } ad->time_hw = ((uint64_t)hi << 32) | lo; -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-04-09 21:45:40.065822200 +0800 +++ 0050-net-ice-fix-Rx-timestamp.patch 2023-04-09 21:45:38.659042200 +0800 @@ -1 +1 @@ -From 0e1c5d03d30c531b6d6d42cf5cb5def46f61ca70 Mon Sep 17 00:00:00 2001 +From 14688b03c0b50b94694957b516a7e77d929b9d5c Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 0e1c5d03d30c531b6d6d42cf5cb5def46f61ca70 ] @@ -13 +15,0 @@ -Cc: stable@dpdk.org @@ -39 +41 @@ -index 0d011bbffa..9a88cf9796 100644 +index 0bc739daf0..263c80a6eb 100644 @@ -42 +44 @@ -@@ -2413,6 +2413,17 @@ ice_dev_init(struct rte_eth_dev *dev) +@@ -2399,6 +2399,17 @@ ice_dev_init(struct rte_eth_dev *dev) @@ -60 +62 @@ -@@ -5814,11 +5825,6 @@ ice_timesync_enable(struct rte_eth_dev *dev) +@@ -5800,11 +5811,6 @@ ice_timesync_enable(struct rte_eth_dev *dev) @@ -72 +74 @@ -@@ -5939,16 +5945,17 @@ ice_timesync_read_time(struct rte_eth_dev *dev, struct timespec *ts) +@@ -5925,16 +5931,17 @@ ice_timesync_read_time(struct rte_eth_dev *dev, struct timespec *ts) @@ -95 +97 @@ -@@ -5964,6 +5971,7 @@ ice_timesync_disable(struct rte_eth_dev *dev) +@@ -5950,6 +5957,7 @@ ice_timesync_disable(struct rte_eth_dev *dev) @@ -103 +105 @@ -@@ -5971,12 +5979,12 @@ ice_timesync_disable(struct rte_eth_dev *dev) +@@ -5957,12 +5965,12 @@ ice_timesync_disable(struct rte_eth_dev *dev)