patch 'net/cnxk: fix Rx timestamp handling for VF' has been queued to stable release 22.11.7
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Wed Oct 23 23:16:03 CEST 2024
Hi,
FYI, your patch has been queued to stable release 22.11.7
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 10/25/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/bluca/dpdk-stable
This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/8d056353d1a1c9000f7375825c3d4bad457ef8b1
Thanks.
Luca Boccassi
---
>From 8d056353d1a1c9000f7375825c3d4bad457ef8b1 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 4658713591..ed979d42af 100644
--- a/drivers/net/cnxk/cn10k_ethdev.c
+++ b/drivers/net/cnxk/cn10k_ethdev.c
@@ -381,7 +381,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;
@@ -404,7 +404,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 3b702d9696..3243c9f82c 100644
--- a/drivers/net/cnxk/cn9k_ethdev.c
+++ b/drivers/net/cnxk/cn9k_ethdev.c
@@ -362,7 +362,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;
@@ -385,7 +385,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 56b26a9650..73f59dede1 100644
--- a/drivers/net/cnxk/cnxk_ethdev.c
+++ b/drivers/net/cnxk/cnxk_ethdev.c
@@ -1684,7 +1684,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.45.2
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2024-10-23 22:16:41.411028371 +0100
+++ 0023-net-cnxk-fix-Rx-timestamp-handling-for-VF.patch 2024-10-23 22:16:40.455941029 +0100
@@ -1 +1 @@
-From 0efd93a2740d1ab13fc55656ce9e55f79e09c4f3 Mon Sep 17 00:00:00 2001
+From 8d056353d1a1c9000f7375825c3d4bad457ef8b1 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 4658713591..ed979d42af 100644
@@ -26 +27 @@
-@@ -473,7 +473,7 @@ cn10k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en)
+@@ -381,7 +381,7 @@ cn10k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en)
@@ -35 +36 @@
-@@ -496,7 +496,17 @@ cn10k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en)
+@@ -404,7 +404,17 @@ cn10k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en)
@@ -54 +55 @@
-index 84c88655f8..5417628368 100644
+index 3b702d9696..3243c9f82c 100644
@@ -57 +58 @@
-@@ -432,7 +432,7 @@ cn9k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en)
+@@ -362,7 +362,7 @@ cn9k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en)
@@ -66 +67 @@
-@@ -455,7 +455,17 @@ cn9k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en)
+@@ -385,7 +385,17 @@ cn9k_nix_ptp_info_update_cb(struct roc_nix *nix, bool ptp_en)
@@ -85 +86 @@
-index 33bac55704..74b266ad58 100644
+index 56b26a9650..73f59dede1 100644
@@ -88 +89 @@
-@@ -1751,7 +1751,7 @@ cnxk_nix_dev_start(struct rte_eth_dev *eth_dev)
+@@ -1684,7 +1684,7 @@ cnxk_nix_dev_start(struct rte_eth_dev *eth_dev)
More information about the stable
mailing list