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 8B32845DB9 for ; Wed, 27 Nov 2024 18:20:20 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 792F5402DE; Wed, 27 Nov 2024 18:20:20 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id A00F7402DE for ; Wed, 27 Nov 2024 18:20:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1732728019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ikywKjgEcv9pH8g9VFXhTZP4GNnkIla6B8LIbIBYnX0=; b=Tg1GMMICYwlzqAQBthj3UrwuxOSTuEQF9ZCi9L81SD09N/oCzaBwn0ZSnDeeyBlRYUg/EO 543RleKHA31SHN0yEI21YLEKWZKyCJ20w9hI9Ded0FJnIQHzeKtByuNyZz+yJLevLtOWKP nFm92DosphmSI22TLwwLvWuhurUv6Is= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-363-e6Nx3RB2O32mCXC8_gTcKw-1; Wed, 27 Nov 2024 12:20:16 -0500 X-MC-Unique: e6Nx3RB2O32mCXC8_gTcKw-1 X-Mimecast-MFC-AGG-ID: e6Nx3RB2O32mCXC8_gTcKw Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 23F191955BF4; Wed, 27 Nov 2024 17:20:15 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.192.52]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E5CFE300019E; Wed, 27 Nov 2024 17:20:13 +0000 (UTC) From: Kevin Traynor To: Rakesh Kudurumalla Cc: dpdk stable Subject: patch 'net/cnxk: fix Rx timestamp handling for VF' has been queued to stable release 21.11.9 Date: Wed, 27 Nov 2024 17:17:27 +0000 Message-ID: <20241127171916.690404-20-ktraynor@redhat.com> In-Reply-To: <20241127171916.690404-1-ktraynor@redhat.com> References: <20241127171916.690404-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: tZ8cxte18mpv1xxN0yN1LBUfbC_-9117tsoB6EK0rv0_1732728015 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true 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 21.11.9 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/02/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://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/afcc1f14556788bb10fc10d99fea99e36f254e74 Thanks. Kevin --- >From afcc1f14556788bb10fc10d99fea99e36f254e74 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 [ 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 c36b858110..fed447c874 100644 --- a/drivers/net/cnxk/cn10k_ethdev.c +++ b/drivers/net/cnxk/cn10k_ethdev.c @@ -370,5 +370,5 @@ cn10k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en) struct rte_eth_dev *eth_dev; struct cn10k_eth_rxq *rxq; - int i; + int i, rc; if (!dev) @@ -393,5 +393,15 @@ cn10k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en) * 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 f8f3d3895e..9ec5d7fe89 100644 --- a/drivers/net/cnxk/cn9k_ethdev.c +++ b/drivers/net/cnxk/cn9k_ethdev.c @@ -361,5 +361,5 @@ cn9k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en) struct rte_eth_dev *eth_dev; struct cn9k_eth_rxq *rxq; - int i; + int i, rc; if (!dev) @@ -384,5 +384,15 @@ cn9k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en) * 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 e4c22e7297..86f86c6c7a 100644 --- a/drivers/net/cnxk/cnxk_ethdev.c +++ b/drivers/net/cnxk/cnxk_ethdev.c @@ -1544,5 +1544,5 @@ cnxk_nix_dev_start(struct rte_eth_dev *eth_dev) 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, -- 2.47.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-11-27 17:17:38.943580775 +0000 +++ 0020-net-cnxk-fix-Rx-timestamp-handling-for-VF.patch 2024-11-27 17:17:38.176269119 +0000 @@ -1 +1 @@ -From 0efd93a2740d1ab13fc55656ce9e55f79e09c4f3 Mon Sep 17 00:00:00 2001 +From afcc1f14556788bb10fc10d99fea99e36f254e74 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 0efd93a2740d1ab13fc55656ce9e55f79e09c4f3 ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -23 +24 @@ -index ad6bc1ec21..46476e386a 100644 +index c36b858110..fed447c874 100644 @@ -26 +27 @@ -@@ -474,5 +474,5 @@ cn10k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en) +@@ -370,5 +370,5 @@ cn10k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en) @@ -33 +34 @@ -@@ -497,5 +497,15 @@ cn10k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en) +@@ -393,5 +393,15 @@ cn10k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en) @@ -50 +51 @@ -index 84c88655f8..5417628368 100644 +index f8f3d3895e..9ec5d7fe89 100644 @@ -53 +54 @@ -@@ -433,5 +433,5 @@ cn9k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en) +@@ -361,5 +361,5 @@ cn9k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en) @@ -60 +61 @@ -@@ -456,5 +456,15 @@ cn9k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en) +@@ -384,5 +384,15 @@ cn9k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en) @@ -77 +78 @@ -index 33bac55704..74b266ad58 100644 +index e4c22e7297..86f86c6c7a 100644 @@ -80 +81 @@ -@@ -1752,5 +1752,5 @@ cnxk_nix_dev_start(struct rte_eth_dev *eth_dev) +@@ -1544,5 +1544,5 @@ cnxk_nix_dev_start(struct rte_eth_dev *eth_dev)