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 462DF45CE3 for ; Mon, 11 Nov 2024 07:33:11 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 404BD40E09; Mon, 11 Nov 2024 07:33:11 +0100 (CET) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2071.outbound.protection.outlook.com [40.107.93.71]) by mails.dpdk.org (Postfix) with ESMTP id D8AC940685 for ; Mon, 11 Nov 2024 07:33:08 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mDhvZJO7cKGg5a33wJVV6PVLFpu3YXrTpDFfQBqs4ad0dbDGvSkg4l8W8SJnzUXCQ/TF/0xal+2LhLuIPcuCKSfafJ9lFG8XlYvPhoPK9+BTYH9JaCmcLAR38/KPXUOtgSjD2yOeFHW5+WQP9BnrvErNCp/nRzkmjNbGcWARSz9rwuvUO8ft6dUH6jpFHKEcabMZes1DBALQlDG42382YvLg5Q3IIh4rYvQwWfoqXbtN0eQ/8Ij9vG8Fgx4yepQ42g4Z59kOAbTQHFdI+KBhQ4MwA8AD0P999a5lbGRCKhz3jKJeEh2hHlqGzD8aw/uB+raBQSG+8YXXwqJlmRhIWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=hV8TcKBCXzOoGF6y9Xggr0OTxHD7JdStGJ8MivKDQEo=; b=rbH3jZpFB6AXzkQjqnJFWUM3XQAA9jgXUUQOIGho/x+/vVXHZfBEax+/pySo4hJRbSYXI5p+dqlR5tqqE36ObiS95Aka2JamNZfnAqtYBByA1BlFhHCJtoMcJBXUojaQFnBhOMQnAIrGl4TV+NsiGvRhfBXyipfKRFzN/oN4ryZkmX5ZoJioO9oZrObnTFjeiQ2o3ATV86aLC/T88GUIyfkZdNPVN5UYh6NpxQjJTn078dIqY6AaCotB522soK9KZ3Uv9D4w0v3xm7KDajE4+/06nNC8ioTDaJKb7KI5HuyXpTcnlVPrZCqFqmiV/xQWz3rLbQYkEeJ2dx2evk2Ksg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=marvell.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 (0) 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=hV8TcKBCXzOoGF6y9Xggr0OTxHD7JdStGJ8MivKDQEo=; b=fJaZ9npqQpnZDLyteKTLs4C1GNEEMMfmji1xan17EkiKZLXBPLREhizEGjlDyhQRtRaFGnL5DhYUt7ET2X+iN3+pwQ8630q8jezcKsj7DpU3qUoa7WbhQAGmsQG9sEJh8Ee7r0NqIBee33hyTAjhc/689sM6m0aUbgdHDkLSK61ufnsfHrOeytozGJ2wTXoV1xbbLYG7jwTDrKoctdnaTmkFwiQnwQcJ/WiA+ck6FclZERjBzAGQbrKPc7f7Ydh/IuDtu0ogTgdFwBS0OezPXYCMuminATz2+wTOs0qABsAzoYV9koNmhy44l4QEEjrOmPZlwWW0cWbEpZfHW2goxQ== Received: from BN9PR03CA0660.namprd03.prod.outlook.com (2603:10b6:408:13b::35) by CY5PR12MB6575.namprd12.prod.outlook.com (2603:10b6:930:41::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.28; Mon, 11 Nov 2024 06:33:06 +0000 Received: from BN2PEPF000055DA.namprd21.prod.outlook.com (2603:10b6:408:13b:cafe::a7) by BN9PR03CA0660.outlook.office365.com (2603:10b6:408:13b::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.28 via Frontend Transport; Mon, 11 Nov 2024 06:33:05 +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 BN2PEPF000055DA.mail.protection.outlook.com (10.167.245.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8182.1 via Frontend Transport; Mon, 11 Nov 2024 06:33:05 +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.1544.4; Sun, 10 Nov 2024 22:32:52 -0800 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.1544.4; Sun, 10 Nov 2024 22:32:51 -0800 From: Xueming Li To: Rakesh Kudurumalla CC: , dpdk stable Subject: patch 'event/cnxk: fix Rx timestamp handling' has been queued to stable release 23.11.3 Date: Mon, 11 Nov 2024 14:27:22 +0800 Message-ID: <20241111062847.216344-37-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241111062847.216344-1-xuemingl@nvidia.com> References: <20241111062847.216344-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: BN2PEPF000055DA:EE_|CY5PR12MB6575:EE_ X-MS-Office365-Filtering-Correlation-Id: c065cd89-ea89-464d-dadb-08dd021ab358 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|82310400026|1800799024|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?ZdWCAS1dn+GD5n5ysC/4vWg97dnGkSlbbLwFOkvuXpOYbEYRz/wKLuDqKdid?= =?us-ascii?Q?Fj49bNh5Q0K2OdWmpYRjcIKrs4+4Q5qDq79d7/3jzVWd6Ux4gVIWmULA+Se1?= =?us-ascii?Q?fomYVadi6aaNmVHDpyWYyrwBOlKQrzrfQhVqazzxP7Cw1RS2IO0ZZanXbggQ?= =?us-ascii?Q?+3gLJUCMkqz9kvwwxe8+pXVjZeEH6zgwN5/qEOjBtqTzgezNgKFdM2NK4087?= =?us-ascii?Q?JCPDv45zg1aNuxIjuaYbA5A+C0jQqkFZ+crRT8bzoXzx2jN5/1Hcm/Au7Q96?= =?us-ascii?Q?xNVU7NRB1NUlZoeyomoXxa1Os0aGwZHpf2bShrFmhb7X+lt1GosoTqxmIire?= =?us-ascii?Q?ia6HB6BiJfdyxmxjoHQVemnv7wsPdYhbFU69lK7848ek6gbf/HzEt9cuDMaY?= =?us-ascii?Q?wUFmiE12z25OlNd6WLde5Zv6/hzfQYMYzw/kW0n59LoxAdD/Q3fAG54sG3lR?= =?us-ascii?Q?P2RH+kVujfL6h9mqCag2TpTjirx3khyiq0nEzj38hFXlp8D3JkaOmRsjGJjh?= =?us-ascii?Q?mCkY+IcKnTFHRRXJfJ7VxGjX4rl9eLGP0q9c7ZeS4Al1O7lO/d/SHJ2Zdq6R?= =?us-ascii?Q?kBoie0rZMlzV3tjZAKVZJ68FbVnFyIBPTMwdgam0uSppeFd3mvrrzLrJBbCh?= =?us-ascii?Q?vUrjfExtk+FkqMM9mSoyzWsptKgzXN8vU/bB6LtzMSzJg1tNz12hq/UNOjm2?= =?us-ascii?Q?oQydHBci4VSXBvZmZoGeQjwFkROe4rUUd5RTr0WsIGPDsKeeroEg9OQBc+xH?= =?us-ascii?Q?vvT8KpMFtFAVStUEYqN1ld0M4vII2BeZqB8zfyCCBOP4G9p63Js/DMIHqFCl?= =?us-ascii?Q?exkpgV8CgtnZrcjb3ofwZb3uiGS+8B00ovX5vBo+edF6JzROkTAnzxBBIZgy?= =?us-ascii?Q?WFL2YIH3icQl1zF0oUEnYyCicV1Pfg3OeIcnjZ797BBsU3N2IuxcSYNeWmwY?= =?us-ascii?Q?ZDRbZ/duwmEWJyo7gh5TnzePBoJOFOusdROq10KNAO40fw/Wk5STBsVg5w4m?= =?us-ascii?Q?TnztYCgigqbVL5ldUL8q467EZG2E7u8l8dukQO8uw1BBc3r4IpTYOfatJWKf?= =?us-ascii?Q?sJ8pMOee5xeWa2kIviY1wceAoGqS+prKmYT0Cdwcms6q0ZNOFDXQXuAiAHpL?= =?us-ascii?Q?9EXiULtsQ+PC4FczERjq3MNLZMoW164qXueq+XuHPTI9PdFtkiA2P8YLPcDt?= =?us-ascii?Q?hyI+zI8SQbyItZEnFRvMB2IL1zj3lU7zcR+bRtABgLXx+JbDAg9MecFB8w1U?= =?us-ascii?Q?Mm3jaR/vbvFFOTkwu68STeORel6zOIGYx7dB47/nVqz/ZHOaz1K5lhpLW3Ll?= =?us-ascii?Q?TZL8XIfcCTRaxI2FEvHiC1CS/Xqxf4NP4Q9IQV/goKlsBC74F2JT7xCjZcab?= =?us-ascii?Q?UaTYzTbwjZjP2K+INcNIltfMXFmWa45mThC6TZyVMxhsdfihZQ=3D=3D?= 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:(13230040)(36860700013)(82310400026)(1800799024)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2024 06:33:05.5848 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c065cd89-ea89-464d-dadb-08dd021ab358 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: BN2PEPF000055DA.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6575 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 23.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 11/30/24. 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=23.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=7b06dc0a409f787ba2f45c98d97340effa6a6ff1 Thanks. Xueming Li --- >From 7b06dc0a409f787ba2f45c98d97340effa6a6ff1 Mon Sep 17 00:00:00 2001 From: Rakesh Kudurumalla Date: Tue, 1 Oct 2024 11:30:42 +0530 Subject: [PATCH] event/cnxk: fix Rx timestamp handling Cc: Xueming Li [ upstream commit 697883bcb0a84f06b52064ecbf60c619edbf9083 ] Handle timestamp correctly for VF when PTP is enabled before running application in event mode by updating RX offload flags in link up notification. Fixes: f1cdb3c5b616 ("net/cnxk: enable PTP for event Rx adapter") Signed-off-by: Rakesh Kudurumalla --- drivers/event/cnxk/cn10k_eventdev.c | 32 ++++++++++++++++++++++++ drivers/event/cnxk/cn9k_eventdev.c | 31 +++++++++++++++++++++++ drivers/event/cnxk/cnxk_eventdev_adptr.c | 2 +- 3 files changed, 64 insertions(+), 1 deletion(-) diff --git a/drivers/event/cnxk/cn10k_eventdev.c b/drivers/event/cnxk/cn10k_eventdev.c index bb0c910553..9f1d01f048 100644 --- a/drivers/event/cnxk/cn10k_eventdev.c +++ b/drivers/event/cnxk/cn10k_eventdev.c @@ -782,12 +782,40 @@ cn10k_sso_set_priv_mem(const struct rte_eventdev *event_dev, void *lookup_mem) } } +static void +eventdev_fops_tstamp_update(struct rte_eventdev *event_dev) +{ + struct rte_event_fp_ops *fp_op = + rte_event_fp_ops + event_dev->data->dev_id; + + fp_op->dequeue = event_dev->dequeue; + fp_op->dequeue_burst = event_dev->dequeue_burst; +} + +static void +cn10k_sso_tstamp_hdl_update(uint16_t port_id, uint16_t flags, bool ptp_en) +{ + struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + struct cnxk_eth_dev *cnxk_eth_dev = dev->data->dev_private; + struct rte_eventdev *event_dev = cnxk_eth_dev->evdev_priv; + struct cnxk_sso_evdev *evdev = cnxk_sso_pmd_priv(event_dev); + + evdev->rx_offloads |= flags; + if (ptp_en) + evdev->tstamp[port_id] = &cnxk_eth_dev->tstamp; + else + evdev->tstamp[port_id] = NULL; + cn10k_sso_fp_fns_set((struct rte_eventdev *)(uintptr_t)event_dev); + eventdev_fops_tstamp_update(event_dev); +} + static int cn10k_sso_rx_adapter_queue_add( const struct rte_eventdev *event_dev, const struct rte_eth_dev *eth_dev, int32_t rx_queue_id, const struct rte_event_eth_rx_adapter_queue_conf *queue_conf) { + struct cnxk_eth_dev *cnxk_eth_dev = eth_dev->data->dev_private; struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev); struct roc_sso_hwgrp_stash stash; struct cn10k_eth_rxq *rxq; @@ -802,6 +830,10 @@ cn10k_sso_rx_adapter_queue_add( queue_conf); if (rc) return -EINVAL; + + cnxk_eth_dev->cnxk_sso_ptp_tstamp_cb = cn10k_sso_tstamp_hdl_update; + cnxk_eth_dev->evdev_priv = (struct rte_eventdev *)(uintptr_t)event_dev; + rxq = eth_dev->data->rx_queues[0]; lookup_mem = rxq->lookup_mem; cn10k_sso_set_priv_mem(event_dev, lookup_mem); diff --git a/drivers/event/cnxk/cn9k_eventdev.c b/drivers/event/cnxk/cn9k_eventdev.c index 9fb9ca0d63..ec3022b38c 100644 --- a/drivers/event/cnxk/cn9k_eventdev.c +++ b/drivers/event/cnxk/cn9k_eventdev.c @@ -834,12 +834,40 @@ cn9k_sso_set_priv_mem(const struct rte_eventdev *event_dev, void *lookup_mem) } } +static void +eventdev_fops_tstamp_update(struct rte_eventdev *event_dev) +{ + struct rte_event_fp_ops *fp_op = + rte_event_fp_ops + event_dev->data->dev_id; + + fp_op->dequeue = event_dev->dequeue; + fp_op->dequeue_burst = event_dev->dequeue_burst; +} + +static void +cn9k_sso_tstamp_hdl_update(uint16_t port_id, uint16_t flags, bool ptp_en) +{ + struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + struct cnxk_eth_dev *cnxk_eth_dev = dev->data->dev_private; + struct rte_eventdev *event_dev = cnxk_eth_dev->evdev_priv; + struct cnxk_sso_evdev *evdev = cnxk_sso_pmd_priv(event_dev); + + evdev->rx_offloads |= flags; + if (ptp_en) + evdev->tstamp[port_id] = &cnxk_eth_dev->tstamp; + else + evdev->tstamp[port_id] = NULL; + cn9k_sso_fp_fns_set((struct rte_eventdev *)(uintptr_t)event_dev); + eventdev_fops_tstamp_update(event_dev); +} + static int cn9k_sso_rx_adapter_queue_add( const struct rte_eventdev *event_dev, const struct rte_eth_dev *eth_dev, int32_t rx_queue_id, const struct rte_event_eth_rx_adapter_queue_conf *queue_conf) { + struct cnxk_eth_dev *cnxk_eth_dev = eth_dev->data->dev_private; struct cn9k_eth_rxq *rxq; void *lookup_mem; int rc; @@ -853,6 +881,9 @@ cn9k_sso_rx_adapter_queue_add( if (rc) return -EINVAL; + cnxk_eth_dev->cnxk_sso_ptp_tstamp_cb = cn9k_sso_tstamp_hdl_update; + cnxk_eth_dev->evdev_priv = (struct rte_eventdev *)(uintptr_t)event_dev; + rxq = eth_dev->data->rx_queues[0]; lookup_mem = rxq->lookup_mem; cn9k_sso_set_priv_mem(event_dev, lookup_mem); diff --git a/drivers/event/cnxk/cnxk_eventdev_adptr.c b/drivers/event/cnxk/cnxk_eventdev_adptr.c index 92aea92389..fe905b5461 100644 --- a/drivers/event/cnxk/cnxk_eventdev_adptr.c +++ b/drivers/event/cnxk/cnxk_eventdev_adptr.c @@ -212,7 +212,7 @@ static void cnxk_sso_tstamp_cfg(uint16_t port_id, struct cnxk_eth_dev *cnxk_eth_dev, struct cnxk_sso_evdev *dev) { - if (cnxk_eth_dev->rx_offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP) + if (cnxk_eth_dev->rx_offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP || cnxk_eth_dev->ptp_en) dev->tstamp[port_id] = &cnxk_eth_dev->tstamp; } -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-11-11 14:23:06.922928903 +0800 +++ 0036-event-cnxk-fix-Rx-timestamp-handling.patch 2024-11-11 14:23:05.092192840 +0800 @@ -1 +1 @@ -From 697883bcb0a84f06b52064ecbf60c619edbf9083 Mon Sep 17 00:00:00 2001 +From 7b06dc0a409f787ba2f45c98d97340effa6a6ff1 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 697883bcb0a84f06b52064ecbf60c619edbf9083 ] @@ -11 +13,0 @@ -Cc: stable@dpdk.org @@ -21 +23 @@ -index 5bd779990e..c8767a1b2b 100644 +index bb0c910553..9f1d01f048 100644 @@ -24 +26 @@ -@@ -842,12 +842,40 @@ cn10k_sso_set_priv_mem(const struct rte_eventdev *event_dev, void *lookup_mem) +@@ -782,12 +782,40 @@ cn10k_sso_set_priv_mem(const struct rte_eventdev *event_dev, void *lookup_mem) @@ -65 +67 @@ -@@ -862,6 +890,10 @@ cn10k_sso_rx_adapter_queue_add( +@@ -802,6 +830,10 @@ cn10k_sso_rx_adapter_queue_add( @@ -77 +79 @@ -index 28350d1275..377e910837 100644 +index 9fb9ca0d63..ec3022b38c 100644 @@ -80 +82 @@ -@@ -911,12 +911,40 @@ cn9k_sso_set_priv_mem(const struct rte_eventdev *event_dev, void *lookup_mem) +@@ -834,12 +834,40 @@ cn9k_sso_set_priv_mem(const struct rte_eventdev *event_dev, void *lookup_mem) @@ -121 +123 @@ -@@ -930,6 +958,9 @@ cn9k_sso_rx_adapter_queue_add( +@@ -853,6 +881,9 @@ cn9k_sso_rx_adapter_queue_add( @@ -132 +134 @@ -index 2c049e7041..3cac42111a 100644 +index 92aea92389..fe905b5461 100644 @@ -135 +137 @@ -@@ -213,7 +213,7 @@ static void +@@ -212,7 +212,7 @@ static void