[PATCH v3 2/4] net/ice: fix PTP clock corruption with TxPP
Soumyadeep Hore
soumyadeep.hore at intel.com
Thu Nov 6 07:46:35 CET 2025
On enabling TxPP PTP clock was getting corrupted as timesync was enabled
on during setup. Currently timesync will be enabled during start of tx
queue, hence enabling PHC clock to get updated on starting and stopping
of ports.
Earlier when timesync was enabled in tx queue setup, on stopping ports
time will reset back to 0. Currently after every port restart PHC clock
will be set to current system CLOCK_REALTIME.
Fixes: 0b6ff09a1f19 ("net/intel: support Tx packet pacing for E830")
Cc: stable at dpdk.org
Signed-off-by: Soumyadeep Hore <soumyadeep.hore at intel.com>
---
drivers/net/intel/ice/ice_ethdev.c | 6 ++++++
drivers/net/intel/ice/ice_rxtx.c | 2 --
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/intel/ice/ice_ethdev.c b/drivers/net/intel/ice/ice_ethdev.c
index 4669eba7c7..3eef4303e9 100644
--- a/drivers/net/intel/ice/ice_ethdev.c
+++ b/drivers/net/intel/ice/ice_ethdev.c
@@ -2893,6 +2893,9 @@ ice_dev_stop(struct rte_eth_dev *dev)
/* disable all queue interrupts */
ice_vsi_disable_queues_intr(main_vsi);
+ if (dev->data->dev_conf.txmode.offloads & RTE_ETH_TX_OFFLOAD_SEND_ON_TIMESTAMP)
+ ice_timesync_disable(dev);
+
if (pf->adapter->devargs.link_state_on_close == ICE_LINK_UP ||
(pf->adapter->devargs.link_state_on_close == ICE_LINK_INITIAL &&
pf->init_link_up))
@@ -4433,6 +4436,9 @@ ice_dev_start(struct rte_eth_dev *dev)
}
}
+ if (dev->data->dev_conf.txmode.offloads & RTE_ETH_TX_OFFLOAD_SEND_ON_TIMESTAMP)
+ ice_timesync_enable(dev);
+
return 0;
/* stop the started queues if failed to start all queues */
diff --git a/drivers/net/intel/ice/ice_rxtx.c b/drivers/net/intel/ice/ice_rxtx.c
index fd0b3a7532..2673e885c3 100644
--- a/drivers/net/intel/ice/ice_rxtx.c
+++ b/drivers/net/intel/ice/ice_rxtx.c
@@ -1181,7 +1181,6 @@ ice_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id)
if (txq->tsq != NULL && txq->tsq->ts_flag > 0) {
struct ice_aqc_ena_dis_txtime_qgrp txtime_pg;
- dev->dev_ops->timesync_disable(dev);
status = ice_aq_ena_dis_txtimeq(hw, q_ids[0], 1, 0, &txtime_pg, NULL);
if (status != ICE_SUCCESS) {
PMD_DRV_LOG(DEBUG, "Failed to disable Tx time queue");
@@ -1671,7 +1670,6 @@ ice_tx_queue_setup(struct rte_eth_dev *dev,
PMD_INIT_LOG(ERR, "Cannot register Tx mbuf field/flag for timestamp");
return -EINVAL;
}
- dev->dev_ops->timesync_enable(dev);
txq->tsq->nb_ts_desc = ice_calc_ts_ring_count(ICE_VSI_TO_HW(vsi), txq->nb_tx_desc);
ring_size = sizeof(struct ice_ts_desc) * txq->tsq->nb_ts_desc;
--
2.47.1
More information about the dev
mailing list