Skip to content

Commit 0ffb08b

Browse files
jacob-kellerPaolo Abeni
authored andcommitted
ice: remove ptp_tx ring parameter flag
Before performing a Tx timestamp in ice_stamp(), the driver checks a ptp_tx ring variable to see if timestamping is enabled on that ring. This value is set for all rings whenever userspace configures Tx timestamping. Ostensibly this was done to avoid wasting cycles checking other fields when timestamping has not been enabled. However, for Tx timestamps we already get an individual per-SKB flag indicating whether userspace wants to request a timestamp on that packet. We do not gain much by also having a separate flag to check for whether timestamping was enabled. In fact, the driver currently fails to restore the field after a PF reset. Because of this, if a PF reset occurs, timestamps will be disabled. Since this flag doesn't add value in the hotpath, remove it and always provide a timestamp if the SKB flag has been set. A following change will fix the reset path to properly restore user timestamping configuration completely. This went unnoticed for some time because one of the most common applications using Tx timestamps, ptp4l, will reconfigure the socket as part of its fault recovery logic. Fixes: ea9b847 ("ice: enable transmit timestamps for E810 devices") Signed-off-by: Jacob Keller <[email protected]> Reviewed-by: Jesse Brandeburg <[email protected]> Reviewed-by: Simon Horman <[email protected]> Tested-by: Pucha Himasekhar Reddy <[email protected]> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent d9775fb commit 0ffb08b

File tree

3 files changed

+0
-18
lines changed

3 files changed

+0
-18
lines changed

drivers/net/ethernet/intel/ice/ice_ptp.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -280,20 +280,6 @@ static void ice_ptp_configure_tx_tstamp(struct ice_pf *pf, bool on)
280280
*/
281281
static void ice_set_tx_tstamp(struct ice_pf *pf, bool on)
282282
{
283-
struct ice_vsi *vsi;
284-
u16 i;
285-
286-
vsi = ice_get_main_vsi(pf);
287-
if (!vsi)
288-
return;
289-
290-
/* Set the timestamp enable flag for all the Tx rings */
291-
ice_for_each_txq(vsi, i) {
292-
if (!vsi->tx_rings[i])
293-
continue;
294-
vsi->tx_rings[i]->ptp_tx = on;
295-
}
296-
297283
if (pf->ptp.tx_interrupt_mode == ICE_PTP_TX_INTERRUPT_SELF)
298284
ice_ptp_configure_tx_tstamp(pf, on);
299285

drivers/net/ethernet/intel/ice/ice_txrx.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2306,9 +2306,6 @@ ice_tstamp(struct ice_tx_ring *tx_ring, struct sk_buff *skb,
23062306
if (likely(!(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)))
23072307
return;
23082308

2309-
if (!tx_ring->ptp_tx)
2310-
return;
2311-
23122309
/* Tx timestamps cannot be sampled when doing TSO */
23132310
if (first->tx_flags & ICE_TX_FLAGS_TSO)
23142311
return;

drivers/net/ethernet/intel/ice/ice_txrx.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,6 @@ struct ice_tx_ring {
380380
#define ICE_TX_FLAGS_RING_VLAN_L2TAG2 BIT(2)
381381
u8 flags;
382382
u8 dcb_tc; /* Traffic class of ring */
383-
u8 ptp_tx;
384383
} ____cacheline_internodealigned_in_smp;
385384

386385
static inline bool ice_ring_uses_build_skb(struct ice_rx_ring *ring)

0 commit comments

Comments
 (0)