* [PATCH v4 3/4] net/ice: fix TxPP/IEEE 1588 port forwarding conflict
[not found] <20251106064638.23020-4-soumyadeep.hore@intel.com>
@ 2025-11-06 19:01 ` Soumyadeep Hore
0 siblings, 0 replies; only message in thread
From: Soumyadeep Hore @ 2025-11-06 19:01 UTC (permalink / raw)
To: dev, bruce.richardson
Cc: rajesh3.kumar, aman.deep.singh, manoj.kumar.subbarao, stable
TxPP could not run alongside IEEE 1588 forwarding. When IEEE 1588
port forwarding was enabled after TxPP enablement, it caused multiple
calls to ice_timesync_enable() and ice_timesync_disable() functions.
This commit introduces a txpp_ena flag in the adapter to properly
handle these multiple function calls and resolve the compatibility issue.
Fixes: 0b6ff09a1f19 ("net/intel: support Tx packet pacing for E830")
Cc: stable@dpdk.org
Signed-off-by: Soumyadeep Hore <soumyadeep.hore@intel.com>
---
drivers/net/intel/ice/ice_ethdev.c | 16 ++++++++++++++--
drivers/net/intel/ice/ice_ethdev.h | 1 +
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/drivers/net/intel/ice/ice_ethdev.c b/drivers/net/intel/ice/ice_ethdev.c
index 3eef4303e9..2ac63bf97f 100644
--- a/drivers/net/intel/ice/ice_ethdev.c
+++ b/drivers/net/intel/ice/ice_ethdev.c
@@ -2873,6 +2873,8 @@ ice_dev_stop(struct rte_eth_dev *dev)
{
struct rte_eth_dev_data *data = dev->data;
struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
+ struct ice_adapter *ad =
+ ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
struct ice_vsi *main_vsi = pf->main_vsi;
struct rte_pci_device *pci_dev = ICE_DEV_TO_PCI(dev);
struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
@@ -2893,8 +2895,10 @@ 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)
+ if (dev->data->dev_conf.txmode.offloads & RTE_ETH_TX_OFFLOAD_SEND_ON_TIMESTAMP) {
+ ad->txpp_ena = 0;
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 &&
@@ -4436,8 +4440,10 @@ ice_dev_start(struct rte_eth_dev *dev)
}
}
- if (dev->data->dev_conf.txmode.offloads & RTE_ETH_TX_OFFLOAD_SEND_ON_TIMESTAMP)
+ if (dev->data->dev_conf.txmode.offloads & RTE_ETH_TX_OFFLOAD_SEND_ON_TIMESTAMP) {
ice_timesync_enable(dev);
+ ad->txpp_ena = 1;
+ }
return 0;
@@ -7029,6 +7035,9 @@ ice_timesync_enable(struct rte_eth_dev *dev)
ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
int ret;
+ if (ad->txpp_ena)
+ return 0;
+
if (dev->data->dev_started && !(dev->data->dev_conf.rxmode.offloads &
RTE_ETH_RX_OFFLOAD_TIMESTAMP)) {
PMD_DRV_LOG(ERR, "Rx timestamp offload not configured");
@@ -7267,6 +7276,9 @@ ice_timesync_disable(struct rte_eth_dev *dev)
uint64_t val;
uint8_t lport;
+ if (ad->txpp_ena)
+ return 0;
+
lport = hw->port_info->lport;
ice_clear_phy_tstamp(hw, lport, 0);
diff --git a/drivers/net/intel/ice/ice_ethdev.h b/drivers/net/intel/ice/ice_ethdev.h
index 6478d6dfbd..26c9598df1 100644
--- a/drivers/net/intel/ice/ice_ethdev.h
+++ b/drivers/net/intel/ice/ice_ethdev.h
@@ -667,6 +667,7 @@ struct ice_adapter {
uint8_t ptp_tx_block;
uint8_t ptp_tx_index;
bool ptp_ena;
+ bool txpp_ena; /* For TxPP */
uint64_t time_hw;
struct ice_fdir_prof_info fdir_prof_info[ICE_MAX_PTGS];
struct ice_rss_prof_info rss_prof_info[ICE_MAX_PTGS];
--
2.47.1
^ permalink raw reply [flat|nested] only message in thread