i40e: fix PTP work and teardown races
Get series with b4
b4 am [email protected]Versions newest first
- v2 Latest5 patches 5 repliesIn review
Changes in v2 from the cover letter
Patch 1 (new):
- Split Tx timestamp skb ownership into an independent patch and protect the slot across transmit, timeout, interrupt, error, and stop paths. (Simon Horman, Sashiko)
- Use ptp_tx_skb as the single source of slot state and verify the skb owner before releasing it from the Tx error path.
- Keep the existing enable checks outside ptp_tx_lock so the critical section only covers pending slot ownership.
Patch 2 (new):
- Serialize the PTP_ENA transition with hardware timestamp configuration so an ioctl cannot re-enable interrupts during teardown. (Sashiko)
Patch 3 (new):
- Split reset/recovery synchronization from the external timestamp work fix and stop service work before PTP and device teardown.
Patch 4 (new):
- Move the reset polling replacement into its own patch and use the wait-bit API for reset ownership. (Simon Horman, Sashiko)
Patch 5:
- Close the configuration gate, then disable external timestamp events and drain the work outside ptp_config_lock before unregistering the PHC.
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | i40e: serialize Tx timestamp skb ownershipdrivers/ drivers/ drivers/ +1 more | +67 | 1 reply | |
| 2/5 | i40e: serialize timestamp configuration with PTP teardowndrivers/ drivers/ drivers/ | +16 | 1 reply | |
| 3/5 | i40e: synchronize reset recovery with device removaldrivers/ | +14 | 1 reply | |
| 4/5 | i40e: replace reset polling with wait-bit synchronizationdrivers/ | +6 | 1 reply | |
| 5/5 | i40e: fix races in PTP external timestamp work handlingdrivers/ drivers/ drivers/ | +20 | 1 reply |
Reviews trailers per patch
None of the 5 patches has a Reviewed-by or Acked-by.
| Patch | Alexander Nowlin |
|---|---|
| 1/5 | T-b |
| 2/5 | T-b |
| 3/5 | T-b |
| 4/5 | T-b |
| 5/5 | T-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH iwl-net v2 0/5] i40e: fix PTP work and teardown races
From: Xuanqiang Luo <[email protected]>
The i40e PTP paths have independent ownership and lifetime races. A Tx timestamp skb can be released concurrently, timestamp configuration can race PTP teardown, reset recovery can rebuild the device during removal, and external timestamp work can outlive the PHC or PF.
Split the fixes by invariant so each patch remains independently reviewable. The series is ordered so the external timestamp work fix can rely on the configuration and reset teardown synchronization introduced earlier.
---
Changes:
v2:
Patch 1 (new):
- Split Tx timestamp skb ownership into an independent patch and protect the slot across transmit, timeout, interrupt, error, and stop paths. (Simon Horman, Sashiko)
- Use ptp_tx_skb as the single source of slot state and verify the skb owner before releasing it from the Tx error path.
- Keep the existing enable checks outside ptp_tx_lock so the critical section only covers pending slot ownership.
Patch 2 (new):
- Serialize the PTP_ENA transition with hardware timestamp configuration so an ioctl cannot re-enable interrupts during teardown. (Sashiko)
Patch 3 (new):
- Split reset/recovery synchronization from the external timestamp work fix and stop service work before PTP and device teardown.
Patch 4 (new):
- Move the reset polling replacement into its own patch and use the wait-bit API for reset ownership. (Simon Horman, Sashiko)
Patch 5:
- Close the configuration gate, then disable external timestamp events and drain the work outside ptp_config_lock before unregistering the PHC.
v1: https://lore.kernel.org/all/[email protected]/
Xuanqiang Luo (5):
i40e: serialize Tx timestamp skb ownership
i40e: serialize timestamp configuration with PTP teardown
i40e: synchronize reset recovery with device removal
i40e: replace reset polling with wait-bit synchronization
i40e: fix races in PTP external timestamp work handling
drivers/net/ethernet/intel/i40e/i40e.h | 6 +- drivers/net/ethernet/intel/i40e/i40e_main.c | 37 ++++---- drivers/net/ethernet/intel/i40e/i40e_ptp.c | 95 ++++++++++++++------- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 38 ++++++--- 4 files changed, 120 insertions(+), 56 deletions(-)
base-commit: 075b74841bd0065a3bda3440873c747938e69b68
Signature · 1 line
2.43.0