OSDN Git Service

ice: Don't put stale timestamps in the skb
authorKarol Kolacinski <karol.kolacinski@intel.com>
Tue, 16 Nov 2021 12:07:14 +0000 (13:07 +0100)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Tue, 14 Dec 2021 19:31:47 +0000 (11:31 -0800)
commit37e738b6fdb14529534dca441e0222313688fde3
tree9c7478d340257147f631478733a6aadbe2685419
parent0013881c1145d36bf26165bb70fdd7560a5507a3
ice: Don't put stale timestamps in the skb

The driver has to check if it does not accidentally put the timestamp in
the SKB before previous timestamp gets overwritten.
Timestamp values in the PHY are read only and do not get cleared except
at hardware reset or when a new timestamp value is captured.
The cached_tstamp field is used to detect the case where a new timestamp
has not yet been captured, ensuring that we avoid sending stale
timestamp data to the stack.

Fixes: ea9b847cda64 ("ice: enable transmit timestamps for E810 devices")
Signed-off-by: Karol Kolacinski <karol.kolacinski@intel.com>
Tested-by: Gurucharan G <gurucharanx.g@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_ptp.c
drivers/net/ethernet/intel/ice/ice_ptp.h