On 14.11.23 19:36, Tony Nguyen wrote:
From: Vinicius Costa Gomes <vinicius.gomes@xxxxxxxxx> Add support for using Timer 1 (i225/i226 have 4 timer registers) as a free-running clock (the "cycles" clock) in addition to Timer 0 (the default, "adjustable clock"). The objective is to allow taprio/etf offloading to coexist with PTP vclocks. Besides the implementation of .getcyclesx64() for i225/i226, to keep timestamping working when vclocks are in use, we also need to add support for TX and RX timestamping using the free running timer, when the requesting socket is bound to a vclock. On the RX side, i225/i226 can be configured to store the values of two timers in the received packet metadata area, so it's a matter of configuring the right registers and retrieving the right timestamp. The TX is a bit more involved because the hardware stores a single timestamp (with the selected timer in the TX descriptor) into one of the timestamp registers. Note some changes at how the timestamps are done for RX, the conversion and adjustment of timestamps are now done closer to the consumption of the timestamp instead of near the reception. Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@xxxxxxxxx> Tested-by: Naama Meir <naamax.meir@xxxxxxxxxxxxxxx> Signed-off-by: Tony Nguyen <anthony.l.nguyen@xxxxxxxxx> --- drivers/net/ethernet/intel/igc/igc.h | 21 +++++++- drivers/net/ethernet/intel/igc/igc_base.h | 4 ++ drivers/net/ethernet/intel/igc/igc_defines.h | 2 + drivers/net/ethernet/intel/igc/igc_main.c | 55 ++++++++++++++------ drivers/net/ethernet/intel/igc/igc_ptp.c | 50 +++++++++++------- drivers/net/ethernet/intel/igc/igc_regs.h | 5 ++ 6 files changed, 101 insertions(+), 36 deletions(-)
I'm happy to see a second driver supporting this functionality! Reviewed-by: Gerhard Engleder <gerhard@xxxxxxxxxxxxxxxxxxxxx>