IDPF allows to access the clock through virtchnl messages, or directly, through PCI BAR registers. Registers offsets are negotiated with the Control Plane during driver initialization process.
This series adds support for the direct mode, in which the main timer is disciplined and the Tx timestamps are read straight from the BAR registers, instead of sending a virtchnl message to the Control Plane. Patch 1 adds the direct access to discipline the main timer. Patch 2 adds the direct readout of the Tx timestamps. The latches are collected by a timer that runs for as long as the Tx timestamping is enabled, so no register access is added to the Tx and the Tx completion paths. Latches whose timestamp does not show up within 500 ms are reclaimed and counted as lost in the HW timestamping statistics. Przemyslaw Korba (2): idpf: add direct access to discipline the main timer idpf: add direct Tx timestamp readout drivers/net/ethernet/intel/idpf/idpf.h | 6 + drivers/net/ethernet/intel/idpf/idpf_dev.c | 9 +- .../net/ethernet/intel/idpf/idpf_ethtool.c | 8 +- .../ethernet/intel/idpf/idpf_lan_pf_regs.h | 3 + drivers/net/ethernet/intel/idpf/idpf_ptp.c | 597 ++++++++++++++++-- drivers/net/ethernet/intel/idpf/idpf_ptp.h | 124 ++-- drivers/net/ethernet/intel/idpf/idpf_txrx.c | 24 +- .../net/ethernet/intel/idpf/idpf_virtchnl.c | 12 +- .../ethernet/intel/idpf/idpf_virtchnl_ptp.c | 191 +++++- include/linux/net/intel/virtchnl2.h | 6 +- 10 files changed, 843 insertions(+), 137 deletions(-) -- 2.47.3
