Skip to content

ice: E82x: reduced timestamp processing logic fixes

Jacob Keller netdev 1 version In review

Get series with b4
b4 am [email protected] change-id 20261027-reduction-fe6ac6f36cb2

Versions newest first

  1. v1 Latest6 patches 2 repliesIn review 3 of 6 applied

Patches in v1 3 of 6 applied

#Subject and filesSizeRepliesApplied
1/6ice: use reference counting and SRCU for PTP port accessdrivers/net/ethernet/intel/ice/ice_adapter.c drivers/net/ethernet/intel/ice/ice_adapter.h drivers/net/ethernet/intel/ice/ice_ptp.c +1 more+121 -420 repliesApplied
2/6ice: set in_use only after preparing Tx timestamp indexdrivers/net/ethernet/intel/ice/ice_ptp.c+10 -20 repliesApplied
3/6ice: E822: keep Tx timestamps disabled during offset calibrationdrivers/net/ethernet/intel/ice/ice_ptp.c drivers/net/ethernet/intel/ice/ice_ptp.h+29 -140 repliesApplied
4/6ice: E825: stop clearing PHY_REG_TX_OFFSET_READYdrivers/net/ethernet/intel/ice/ice_ptp.c drivers/net/ethernet/intel/ice/ice_ptp.h drivers/net/ethernet/intel/ice/ice_ptp_hw.c +1 more+51 -232 replies
5/6ice: E825: clear PHY_TSTAMP memory prior to soft resetdrivers/net/ethernet/intel/ice/ice_ptp_hw.c+65 -530 replies
6/6ice: skip reading Tx ready bitmap on ports with no timestampsdrivers/net/ethernet/intel/ice/ice_ptp.c+1 -10 replies

Reviews trailers per patch

3 of 6 patches have a Reviewed-by or Acked-by.

PatchMaciek MachnikowskiAleksandr Loktionov
1/6R-b
2/6
3/6R-b
4/6
5/6R-b
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH net 0/6] ice: E82x: reduced timestamp processing logic fixes

Jake Keller says:

This is a reduced set patches originally posted as part of [1] which previously passes Sashiko review without comments. It does not completely resolve the outstanding issues that we had, but can hopefully unblock some progress.

First, the locking around the PTP ports list in the adapter structure is converted to use RCU primitives and a spinlock, resolving a couple of reports from Petr about places where the original list was accessed without lock protection. Note that an older version of this fix used an xarray instead of the list. The xarray has more overhead and results in an increase of ~25 microseconds to the average latency for processing Tx timestamps. The list is simpler and avoids this overhead.

Next, the ice_ptp_request_ts() function is updated to sequence the marking of the in_use bitmap in order to work properly with the lockless reader in the IRQ thread. This issue was reported by Sashiko during development.

Next, Przemyslaw Korba fixes the E822 timestamping logic to keep timestamp requests disabled until Vernier calibration completes.

Next, the driver is modified to stop clearing the PHY_REG_TX_OFFSET_READY bit. This bits only purpose is to tell hardware to mark any captured timestamps as invalid. Since this also disables the necessary side effects on read it is problematic to have cleared. According to hardware engineers, keeping it enabled should not have any other side effects. Instead, the tx.disabled field is used to disable new timestamps from software in a similar manner to the older E822 devices.

Next, the driver is modified to clear the PHY_REG_TX_MEMORY_STATUS by reading each index *prior* to the PHY soft reset. This ensures that any stale or invalid data left in the memory array is cleared, followed by the counter being reset via the PHY soft reset procedure.

Finally, the ice_ptp_process_tx_tstamp() function is modified to skip unnecessarily checking the ready bitmap for ports which do not have active timestamp requests.

I plan to rework and follow up the remaining patches from the original series after this lands.

[1]: https://lore.kernel.org/netdev/[email protected]/

---
Sashiko previously had no complaints about the SRCU changes on the port list. I suspect it may now complain about some invalid accesses due to the error cleanup flows in the reset or failure. I believe those should be considered pre-existing issues and not block this reduced series.

---
Jacob Keller (5):
ice: use reference counting and SRCU for PTP port access
ice: set in_use only after preparing Tx timestamp index
ice: E825: stop clearing PHY_REG_TX_OFFSET_READY
ice: E825: clear PHY_TSTAMP memory prior to soft reset
ice: skip reading Tx ready bitmap on ports with no timestamps

Karol Kolacinski (1):
ice: E822: keep Tx timestamps disabled during offset calibration

 drivers/net/ethernet/intel/ice/ice_adapter.h |  17 ++-
 drivers/net/ethernet/intel/ice/ice_ptp.h     |  11 +-
 drivers/net/ethernet/intel/ice/ice_ptp_hw.h  |   2 +-
 drivers/net/ethernet/intel/ice/ice_adapter.c |  17 ++-
 drivers/net/ethernet/intel/ice/ice_ptp.c     | 218 ++++++++++++++++++++-------
 drivers/net/ethernet/intel/ice/ice_ptp_hw.c  | 143 ++++++++++--------
 6 files changed, 275 insertions(+), 133 deletions(-)

---
base-commit: abeacca61eea4f6803df4a595b656ea45c2d3249
base-tree: git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git main
change-id: 20261027-reduction-fe6ac6f36cb2

Best regards,

Signature · 1 line
Jacob Keller <[email protected]>