提交 a11b6c1a 编写于 作者: M Michal Michalik 提交者: Tony Nguyen

ice: fix PTP stale Tx timestamps cleanup

Read stale PTP Tx timestamps from PHY on cleanup.

After running out of Tx timestamps request handlers, hardware (HW) stops
reporting finished requests. Function ice_ptp_tx_tstamp_cleanup() used
to only clean up stale handlers in driver and was leaving the hardware
registers not read. Not reading stale PTP Tx timestamps prevents next
interrupts from arriving and makes timestamping unusable.

Fixes: ea9b847c ("ice: enable transmit timestamps for E810 devices")
Signed-off-by: NMichal Michalik <michal.michalik@intel.com>
Reviewed-by: NJacob Keller <jacob.e.keller@intel.com>
Reviewed-by: NPaul Menzel <pmenzel@molgen.mpg.de>
Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
上级 6096dae9
...@@ -2287,6 +2287,7 @@ ice_ptp_init_tx_e810(struct ice_pf *pf, struct ice_ptp_tx *tx) ...@@ -2287,6 +2287,7 @@ ice_ptp_init_tx_e810(struct ice_pf *pf, struct ice_ptp_tx *tx)
/** /**
* ice_ptp_tx_tstamp_cleanup - Cleanup old timestamp requests that got dropped * ice_ptp_tx_tstamp_cleanup - Cleanup old timestamp requests that got dropped
* @hw: pointer to the hw struct
* @tx: PTP Tx tracker to clean up * @tx: PTP Tx tracker to clean up
* *
* Loop through the Tx timestamp requests and see if any of them have been * Loop through the Tx timestamp requests and see if any of them have been
...@@ -2295,7 +2296,7 @@ ice_ptp_init_tx_e810(struct ice_pf *pf, struct ice_ptp_tx *tx) ...@@ -2295,7 +2296,7 @@ ice_ptp_init_tx_e810(struct ice_pf *pf, struct ice_ptp_tx *tx)
* timestamp will never be captured. This might happen if the packet gets * timestamp will never be captured. This might happen if the packet gets
* discarded before it reaches the PHY timestamping block. * discarded before it reaches the PHY timestamping block.
*/ */
static void ice_ptp_tx_tstamp_cleanup(struct ice_ptp_tx *tx) static void ice_ptp_tx_tstamp_cleanup(struct ice_hw *hw, struct ice_ptp_tx *tx)
{ {
u8 idx; u8 idx;
...@@ -2304,11 +2305,16 @@ static void ice_ptp_tx_tstamp_cleanup(struct ice_ptp_tx *tx) ...@@ -2304,11 +2305,16 @@ static void ice_ptp_tx_tstamp_cleanup(struct ice_ptp_tx *tx)
for_each_set_bit(idx, tx->in_use, tx->len) { for_each_set_bit(idx, tx->in_use, tx->len) {
struct sk_buff *skb; struct sk_buff *skb;
u64 raw_tstamp;
/* Check if this SKB has been waiting for too long */ /* Check if this SKB has been waiting for too long */
if (time_is_after_jiffies(tx->tstamps[idx].start + 2 * HZ)) if (time_is_after_jiffies(tx->tstamps[idx].start + 2 * HZ))
continue; continue;
/* Read tstamp to be able to use this register again */
ice_read_phy_tstamp(hw, tx->quad, idx + tx->quad_offset,
&raw_tstamp);
spin_lock(&tx->lock); spin_lock(&tx->lock);
skb = tx->tstamps[idx].skb; skb = tx->tstamps[idx].skb;
tx->tstamps[idx].skb = NULL; tx->tstamps[idx].skb = NULL;
...@@ -2330,7 +2336,7 @@ static void ice_ptp_periodic_work(struct kthread_work *work) ...@@ -2330,7 +2336,7 @@ static void ice_ptp_periodic_work(struct kthread_work *work)
ice_ptp_update_cached_phctime(pf); ice_ptp_update_cached_phctime(pf);
ice_ptp_tx_tstamp_cleanup(&pf->ptp.port.tx); ice_ptp_tx_tstamp_cleanup(&pf->hw, &pf->ptp.port.tx);
/* Run twice a second */ /* Run twice a second */
kthread_queue_delayed_work(ptp->kworker, &ptp->work, kthread_queue_delayed_work(ptp->kworker, &ptp->work,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册