patch 'net/cnxk: fix Rx timestamp handling for VF' has been queued to stable release 21.11.9

Kevin Traynor ktraynor at redhat.com
Wed Nov 27 18:17:27 CET 2024


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 <rkudurumalla at marvell.com>
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 <rkudurumalla at marvell.com>
---
 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 at 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)



More information about the stable mailing list