patch 'net/ice: adjust timestamp mbuf register' has been queued to stable release 22.11.3

Xueming Li xuemingl at nvidia.com
Sun Jun 25 08:35:36 CEST 2023


Hi,

FYI, your patch has been queued to stable release 22.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 06/27/23. 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=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=3b032bbf788f7836463bb6a4a261dc8586613660

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 3b032bbf788f7836463bb6a4a261dc8586613660 Mon Sep 17 00:00:00 2001
From: Wenjing Qiao <wenjing.qiao at intel.com>
Date: Fri, 19 May 2023 03:12:16 -0400
Subject: [PATCH] net/ice: adjust timestamp mbuf register
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit b16e1326048ea0c138cf794186985bb95eb7ff20 ]

Due to only support timestamp at port level, adjust
timestamp mbuf register to dev config.

Fixes: 953e74e6b73a ("net/ice: enable Rx timestamp on flex descriptor")

Signed-off-by: Wenjing Qiao <wenjing.qiao at intel.com>
Acked-by: Qi Zhang <qi.z.zhang at intel.com>
---
 drivers/net/ice/ice_ethdev.c | 10 ++++++++++
 drivers/net/ice/ice_rxtx.c   |  5 ++++-
 drivers/net/ice/ice_rxtx.h   |  1 +
 3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 4eb7de4ad5..c004aa42ee 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -3674,6 +3674,16 @@ ice_dev_start(struct rte_eth_dev *dev)
 		}
 	}
 
+	if (dev->data->dev_conf.rxmode.offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP) {
+		/* Register mbuf field and flag for Rx timestamp */
+		ret = rte_mbuf_dyn_rx_timestamp_register(&ice_timestamp_dynfield_offset,
+							 &ice_timestamp_dynflag);
+		if (ret) {
+			PMD_DRV_LOG(ERR, "Cannot register mbuf field/flag for timestamp");
+			goto tx_err;
+		}
+	}
+
 	/* program Rx queues' context in hardware*/
 	for (nb_rxq = 0; nb_rxq < data->nb_rx_queues; nb_rxq++) {
 		ret = ice_rx_queue_start(dev, nb_rxq);
diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
index 560c1a4af7..c998b0080a 100644
--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -274,7 +274,7 @@ ice_program_hw_rx_queue(struct ice_rx_queue *rxq)
 		return -EINVAL;
 	}
 
-	if (rxq->offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP) {
+	if (!rxq->ts_enable && (rxq->offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP)) {
 		/* Register mbuf field and flag for Rx timestamp */
 		err = rte_mbuf_dyn_rx_timestamp_register(
 				&ice_timestamp_dynfield_offset,
@@ -284,6 +284,7 @@ ice_program_hw_rx_queue(struct ice_rx_queue *rxq)
 				"Cannot register mbuf field/flag for timestamp");
 			return -EINVAL;
 		}
+		rxq->ts_enable = true;
 	}
 
 	memset(&rx_ctx, 0, sizeof(rx_ctx));
@@ -671,6 +672,8 @@ ice_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id)
 		return -EINVAL;
 	}
 
+	if (dev->data->dev_conf.rxmode.offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP)
+		rxq->ts_enable = true;
 	err = ice_program_hw_rx_queue(rxq);
 	if (err) {
 		PMD_DRV_LOG(ERR, "fail to program RX queue %u",
diff --git a/drivers/net/ice/ice_rxtx.h b/drivers/net/ice/ice_rxtx.h
index 89569029e1..268289716e 100644
--- a/drivers/net/ice/ice_rxtx.h
+++ b/drivers/net/ice/ice_rxtx.h
@@ -120,6 +120,7 @@ struct ice_rx_queue {
 	uint64_t hw_time_update; /* SW time of HW record updating */
 	struct rte_eth_rxseg_split rxseg[ICE_RX_MAX_NSEG];
 	uint32_t rxseg_nb;
+	bool ts_enable; /* if rxq timestamp is enabled */
 };
 
 struct ice_tx_entry {
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-06-25 14:32:01.635554100 +0800
+++ 0118-net-ice-adjust-timestamp-mbuf-register.patch	2023-06-25 14:31:58.575773900 +0800
@@ -1 +1 @@
-From b16e1326048ea0c138cf794186985bb95eb7ff20 Mon Sep 17 00:00:00 2001
+From 3b032bbf788f7836463bb6a4a261dc8586613660 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit b16e1326048ea0c138cf794186985bb95eb7ff20 ]
@@ -10 +12,0 @@
-Cc: stable at dpdk.org
@@ -21 +23 @@
-index 5a581bd2ba..2b0a977ba9 100644
+index 4eb7de4ad5..c004aa42ee 100644
@@ -24 +26 @@
-@@ -3691,6 +3691,16 @@ ice_dev_start(struct rte_eth_dev *dev)
+@@ -3674,6 +3674,16 @@ ice_dev_start(struct rte_eth_dev *dev)


More information about the stable mailing list