linux-stable/drivers/net/ethernet/intel/igc
Vinicius Costa Gomes c789ad7cbe igc: Work around HW bug causing missing timestamps
There's an hardware issue that can cause missing timestamps. The bug
is that the interrupt is only cleared if the IGC_TXSTMPH_0 register is
read.

The bug can cause a race condition if a timestamp is captured at the
wrong time, and we will miss that timestamp. To reduce the time window
that the problem is able to happen, in case no timestamp was ready, we
read the "previous" value of the timestamp registers, and we compare
with the "current" one, if it didn't change we can be reasonably sure
that no timestamp was captured. If they are different, we use the new
value as the captured timestamp.

The HW bug is not easy to reproduce, got to reproduce it when smashing
the NIC with timestamping requests from multiple applications (e.g.
multiple ntpperf instances + ptp4l), after 10s of minutes.

This workaround has more impact when multiple timestamp registers are
used, and the IGC_TXSTMPH_0 register always need to be read, so the
interrupt is cleared.

Fixes: 2c344ae245 ("igc: Add support for TX timestamping")
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Tested-by: Naama Meir <naamax.meir@linux.intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2023-06-22 08:22:35 -07:00
..
igc.h igc: Retrieve TX timestamp during interrupt handling 2023-06-22 08:22:35 -07:00
igc_base.c igc: remove I226 Qbv BaseTime restriction 2023-01-03 09:35:37 -08:00
igc_base.h igc: read before write to SRRCTL register 2023-05-03 09:19:11 +01:00
igc_defines.h igc: Remove obsolete DMA coalescing code 2023-03-21 11:37:16 -07:00
igc_diag.c
igc_diag.h
igc_dump.c igb/igc: use strongly typed pointer 2021-05-26 09:11:41 -07:00
igc_ethtool.c igc: Add qbv_config_change_errors counter 2023-03-07 13:45:56 -08:00
igc_hw.h igc: offload queue max SDU from tc-taprio 2023-03-07 13:45:56 -08:00
igc_i225.c igc: Remove obsolete DMA coalescing code 2023-03-21 11:37:16 -07:00
igc_i225.h
igc_mac.c intel/igc:fix repeated words in comments 2022-06-30 11:06:23 -07:00
igc_mac.h
igc_main.c igc: Retrieve TX timestamp during interrupt handling 2023-06-22 08:22:35 -07:00
igc_nvm.c
igc_nvm.h
igc_phy.c igc: Change type of the 'igc_check_downshift' method 2022-05-10 14:02:53 -07:00
igc_phy.h igc: Change type of the 'igc_check_downshift' method 2022-05-10 14:02:53 -07:00
igc_ptp.c igc: Work around HW bug causing missing timestamps 2023-06-22 08:22:35 -07:00
igc_regs.h igc: Remove obsolete DMA coalescing code 2023-03-21 11:37:16 -07:00
igc_tsn.c igc: Add qbv_config_change_errors counter 2023-03-07 13:45:56 -08:00
igc_tsn.h igc: Remove reset adapter task for i226 during disable tsn config 2023-01-03 09:36:25 -08:00
igc_xdp.c drivers: net: turn on XDP features 2023-02-02 20:48:23 -08:00
igc_xdp.h igc: Enable RX via AF_XDP zero-copy 2021-05-20 10:21:42 -07:00
Makefile igc: Add initial XDP support 2021-03-29 09:09:53 -07:00