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 2418745CE3 for ; Mon, 11 Nov 2024 07:32:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1C0C840E1F; Mon, 11 Nov 2024 07:32:50 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2059.outbound.protection.outlook.com [40.107.237.59]) by mails.dpdk.org (Postfix) with ESMTP id 75BAB40685 for ; Mon, 11 Nov 2024 07:32:48 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=C8x5d6qzNaQT1vvhXLfbVwIdKKm3/xSUOYFNdE93nrTU/2zCu7BkosShSdvMr59rJa0yoM19czEAFdyoGQLmzeMbC634y/VF3xYtgPlrsPXs3vuqg2soQtouec2ahlSkado2XE5gydMFdUNpF4dgzTfkQ1gYKjTV51EKErWYeLLFN/urDtYxYbaD8j+kgc2eP6Syw0XWz31lV0H45qHNvVGlXF1ggrXW9Nu8km7iMCTRWswNuY0enLt/R7w71rV6fT2g3fNqz46Jfe21N6LIr2GzRic6eUcfsqKVJlhDZSL4u6iFrIH62q8gbKtJNaK28S4cUT8u6BEeSEheWPohRg== 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=4oX797UdqFim+XydsrIvTt1IoYq0MUXxuvV/bu7V//0=; b=bWWZ6+IjeeVne0YQCdUetoK0z5EezJ4vR+PvzmMd21opp3kv2IPPJ9fanK8VMft/L5VdOBaZ6iIQUXnYSWoFVRcs/IhI7ffYO6IOiRDREVkFw7+m+44rQTV2Nh3qOuZq8mDCYVFwFv+aEyWgWphrH/8Tu1TTAfTXGupDPJMW/sZ6F6DdnbifMtbazs3UI9nBFR2XpbNsOnVqMUVpC0Dmisp79Uvpgi0J2dKkoofAk1gEm+4plTdas5MK1fjwVAlvclO+ieI7PIuQmxwH8eJNTQGG+M4ecY0gFGjIu9LZ/FhyaJZSvCio0HCi7cAUjivpp160ocxrH2C8cTYL3Ntg+g== 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=4oX797UdqFim+XydsrIvTt1IoYq0MUXxuvV/bu7V//0=; b=V8xbXt9sGLJ1Lvh+Mm8/BegDTMQ0HvrKTGNbme2QWz9xdj9TL1ks8QteYrGd2e3j05qFVbn5GNypOeVTo1kWj3AfHd9snduBOfo5X7sPTJ2rlvksbijRt000DoAD0im6QQUTLjcJ3NiQPWkHryOGPK7EZ4uKEaxNZH64ukhqGdqO+xvD7o7MwqMyDC7ZT9XXewiB+E5wcDIys8nXfd3PZ95xMBhpcZeRSmyxP+ITaBh8+d+E6qeN04H5+dVF7s3eY1zj3KfzXcyjIRRb64wv7+6oUaDxYXDfeMsMw0EGEzyNjYPTAbIN3ee2Jzp3sXiP+MC4ZK644rsDqlOUgjOMpw== Received: from BN9PR03CA0640.namprd03.prod.outlook.com (2603:10b6:408:13b::15) by SA3PR12MB7975.namprd12.prod.outlook.com (2603:10b6:806:320::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.26; Mon, 11 Nov 2024 06:32:44 +0000 Received: from BN2PEPF000055DA.namprd21.prod.outlook.com (2603:10b6:408:13b:cafe::e6) by BN9PR03CA0640.outlook.office365.com (2603:10b6:408:13b::15) 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:32:44 +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:32:44 +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:30 -0800 Received: from nvidia.com (10.126.231.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:28 -0800 From: Xueming Li To: Rakesh Kudurumalla CC: , dpdk stable Subject: patch 'net/cnxk: fix Rx timestamp handling for VF' has been queued to stable release 23.11.3 Date: Mon, 11 Nov 2024 14:27:20 +0800 Message-ID: <20241111062847.216344-35-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.231.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_|SA3PR12MB7975:EE_ X-MS-Office365-Filtering-Correlation-Id: c48af37a-d1ff-4d84-9954-08dd021aa6be X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|82310400026|376014|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?btCRVvh1MbUPIRnZBEMGMxyY/eARV8kPbMMuhytBYZHnkhkPT+JW8j0tcdf+?= =?us-ascii?Q?ltQbmjQgH7lAaG8UYPn4GeEz1YApE0u2d9+E5eDJzUNwzzAbbh28ajDk0SQY?= =?us-ascii?Q?ZlD4u2uY4lBhK9Ow65YmXiHktL4/dkExCngjI0ZVoYeppeMm6oXP7vIxRQ0K?= =?us-ascii?Q?N+79PTpMRcf6m03QbDAN8W8E+nu2KO5aKodLCsLmZKf6KAmbNxnRmPCgeW5p?= =?us-ascii?Q?bZKfuSJADHj1qZ+5qcEEi3cRs/yyUKqjQ3ExcCC6gsH4+oUAO7yGlEP31LjP?= =?us-ascii?Q?6FGEBA+CcXa2iXp96BOaSOwL0HUKnwuRSe9pFT3/nUz+aaZfOgaO17f6ws0o?= =?us-ascii?Q?NHn8GYwTc4r0pm2RcqtiG3VkNZEFQ6rXZpTzQXWNJBlTazjS1qRi8LhUh/w2?= =?us-ascii?Q?kY0+r4VxYb65Tf1CcNE2xus94iOMAcw0DKNfxzcVrREB4EGK6y85toHUhxUN?= =?us-ascii?Q?utp246U8+6hAw0DRiCQx5FFjZrOz9DjUpEsGwCPHcGxgpsP+NTeBH0DWv10e?= =?us-ascii?Q?y0268T/R7tTAyVTl/FUefkil3wpTsQi33rYFdu+i0L3/sYDoSMJOKmpAjvzK?= =?us-ascii?Q?lrsxYInF8Ti4gor7QU/MfabMrePJeuD7P7sox/O8TpFESpaMLzetvYwDuqwJ?= =?us-ascii?Q?eReHl85KOyGdDljDerxlJiKoMYCIQSwwNE4XJ3/kRHnwHHmskjPOAlkyGUyb?= =?us-ascii?Q?8h1Z7WjhWDaBSJ4GbyHRIpXtNOgZTwobuDYIkH049af21v98luy6ZIqNos9w?= =?us-ascii?Q?vVGlsLPUta29V4T2i9iNdOQSALXdI10eRaA4lqptOyRt6SZk0w5iDa0s6cNB?= =?us-ascii?Q?Ox3Gh3nDDzhFulEOlldZhYoVXrshXAuNZNuIyECQ+n8uMR53+GifGy8BqG1O?= =?us-ascii?Q?fgWGm6K7OdMFEoZSxQ2zy5L1DJKepR9+v9GCk4/z998uYF71ulPWzh1Uk320?= =?us-ascii?Q?Bb+wlottHpu7XtW/R3e/nsdzrf2OYpNbjWiBZA5WKuo+dXjh/UW920RQNu5d?= =?us-ascii?Q?O6EoCL9e57DpX/Rq2EkZVugrD0MQ/MkXfPDLBp59ROWZ+ncQ+HydaTcM9CFg?= =?us-ascii?Q?VpMhZw/gHXhbOPKs+upMVR2mK5j811RhEERtUXAdVEnLR7/Wkgt6QbQE+kdn?= =?us-ascii?Q?ceCWqsER9Yn7MQOKbOZYCNT0ts/7SUcJalw9ZbM49QsKCJe3V6RlquZPd6xq?= =?us-ascii?Q?h1+Q3kSzpmnchkzXzS2lO5MSWubLB+P7lmGoBGkWMlxBInkyaSV+0knV99if?= =?us-ascii?Q?+NUcMxJDuOJgkr/GENIsydoVhCrK5aiLRH5nvuUaWZPWCzXk/53uh+Al2XTG?= =?us-ascii?Q?uqWCPJaeZTNV7hHgvMA1tEYaTjqecK3wzv2jwV/lxVL6HChsizz1wp5XlvDg?= =?us-ascii?Q?F2Zb6EQBGyzBr0UyfAyznfhMs3dhZMCM3t6A4VM3z43LZBUskg=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)(376014)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2024 06:32:44.4431 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c48af37a-d1ff-4d84-9954-08dd021aa6be 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: SA3PR12MB7975 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=54799745107bd25078888a57d1e185e57763075b Thanks. Xueming Li --- >From 54799745107bd25078888a57d1e185e57763075b Mon Sep 17 00:00:00 2001 From: Rakesh Kudurumalla Date: Tue, 1 Oct 2024 11:30:40 +0530 Subject: [PATCH] net/cnxk: fix Rx timestamp handling for VF Cc: Xueming Li [ upstream commit 0efd93a2740d1ab13fc55656ce9e55f79e09c4f3 ] When timestamp is enabled on PF in kernel and respective VF is attached to application in DPDK then mbuf_addr is getting corrupted in cnxk_nix_timestamp_dynfield() as "tstamp_dynfield_offset" is zero for PTP enabled PF This patch fixes the same. Fixes: 76dff63874e3 ("net/cnxk: support base PTP timesync") Signed-off-by: Rakesh Kudurumalla --- drivers/net/cnxk/cn10k_ethdev.c | 12 +++++++++++- drivers/net/cnxk/cn9k_ethdev.c | 12 +++++++++++- drivers/net/cnxk/cnxk_ethdev.c | 2 +- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/drivers/net/cnxk/cn10k_ethdev.c b/drivers/net/cnxk/cn10k_ethdev.c index 29b7f2ba5e..24c4c2d15e 100644 --- a/drivers/net/cnxk/cn10k_ethdev.c +++ b/drivers/net/cnxk/cn10k_ethdev.c @@ -473,7 +473,7 @@ cn10k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en) struct cnxk_eth_dev *dev = (struct cnxk_eth_dev *)nix; struct rte_eth_dev *eth_dev; struct cn10k_eth_rxq *rxq; - int i; + int i, rc; if (!dev) return -EINVAL; @@ -496,7 +496,17 @@ cn10k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en) * and MTU setting also requires MBOX message to be * sent(VF->PF) */ + if (dev->ptp_en) { + rc = rte_mbuf_dyn_rx_timestamp_register + (&dev->tstamp.tstamp_dynfield_offset, + &dev->tstamp.rx_tstamp_dynflag); + if (rc != 0) { + plt_err("Failed to register Rx timestamp field/flag"); + return -EINVAL; + } + } eth_dev->rx_pkt_burst = nix_ptp_vf_burst; + rte_eth_fp_ops[eth_dev->data->port_id].rx_pkt_burst = eth_dev->rx_pkt_burst; rte_mb(); } diff --git a/drivers/net/cnxk/cn9k_ethdev.c b/drivers/net/cnxk/cn9k_ethdev.c index b92b978a27..c06764d745 100644 --- a/drivers/net/cnxk/cn9k_ethdev.c +++ b/drivers/net/cnxk/cn9k_ethdev.c @@ -432,7 +432,7 @@ cn9k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en) struct cnxk_eth_dev *dev = (struct cnxk_eth_dev *)nix; struct rte_eth_dev *eth_dev; struct cn9k_eth_rxq *rxq; - int i; + int i, rc; if (!dev) return -EINVAL; @@ -455,7 +455,17 @@ cn9k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en) * and MTU setting also requires MBOX message to be * sent(VF->PF) */ + if (dev->ptp_en) { + rc = rte_mbuf_dyn_rx_timestamp_register + (&dev->tstamp.tstamp_dynfield_offset, + &dev->tstamp.rx_tstamp_dynflag); + if (rc != 0) { + plt_err("Failed to register Rx timestamp field/flag"); + return -EINVAL; + } + } eth_dev->rx_pkt_burst = nix_ptp_vf_burst; + rte_eth_fp_ops[eth_dev->data->port_id].rx_pkt_burst = eth_dev->rx_pkt_burst; rte_mb(); } diff --git a/drivers/net/cnxk/cnxk_ethdev.c b/drivers/net/cnxk/cnxk_ethdev.c index 60baf806ab..f0cf376e7d 100644 --- a/drivers/net/cnxk/cnxk_ethdev.c +++ b/drivers/net/cnxk/cnxk_ethdev.c @@ -1734,7 +1734,7 @@ cnxk_nix_dev_start(struct rte_eth_dev *eth_dev) else cnxk_eth_dev_ops.timesync_disable(eth_dev); - if (dev->rx_offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP) { + if (dev->rx_offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP || dev->ptp_en) { rc = rte_mbuf_dyn_rx_timestamp_register (&dev->tstamp.tstamp_dynfield_offset, &dev->tstamp.rx_tstamp_dynflag); -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-11-11 14:23:06.847757505 +0800 +++ 0034-net-cnxk-fix-Rx-timestamp-handling-for-VF.patch 2024-11-11 14:23:05.092192840 +0800 @@ -1 +1 @@ -From 0efd93a2740d1ab13fc55656ce9e55f79e09c4f3 Mon Sep 17 00:00:00 2001 +From 54799745107bd25078888a57d1e185e57763075b Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 0efd93a2740d1ab13fc55656ce9e55f79e09c4f3 ] @@ -13 +15,0 @@ -Cc: stable@dpdk.org @@ -23 +25 @@ -index ad6bc1ec21..46476e386a 100644 +index 29b7f2ba5e..24c4c2d15e 100644 @@ -54 +56 @@ -index 84c88655f8..5417628368 100644 +index b92b978a27..c06764d745 100644 @@ -85 +87 @@ -index 33bac55704..74b266ad58 100644 +index 60baf806ab..f0cf376e7d 100644 @@ -88 +90 @@ -@@ -1751,7 +1751,7 @@ cnxk_nix_dev_start(struct rte_eth_dev *eth_dev) +@@ -1734,7 +1734,7 @@ cnxk_nix_dev_start(struct rte_eth_dev *eth_dev)