]> www.infradead.org Git - users/hch/misc.git/commit
iavf: add support for Rx timestamps to hotpath
authorJacob Keller <jacob.e.keller@intel.com>
Wed, 6 Nov 2024 17:37:31 +0000 (12:37 -0500)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Fri, 14 Feb 2025 18:58:08 +0000 (10:58 -0800)
commit48ccdcd87e0d2d4c82eb50eaff53c6aeb9a8372b
treea3d55228e68325c50833038ff3efd2eb3503e69b
parent51534239ef132afbc8cc65cf430aeaeec244a6ad
iavf: add support for Rx timestamps to hotpath

Add support for receive timestamps to the Rx hotpath. This support only
works when using the flexible descriptor format, so make sure that we
request this format by default if we have receive timestamp support
available in the PTP capabilities.

In order to report the timestamps to userspace, we need to perform
timestamp extension. The Rx descriptor does actually contain the "40
bit" timestamp. However, upper 32 bits which contain nanoseconds are
conveniently stored separately in the descriptor. We could extract the
32bits and lower 8 bits, then perform a bitwise OR to calculate the
40bit value. This makes no sense, because the timestamp extension
algorithm would simply discard the lower 8 bits anyways.

Thus, implement timestamp extension as iavf_ptp_extend_32b_timestamp(),
and extract and forward only the 32bits of nominal nanoseconds.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Reviewed-by: Sunil Goutham <sgoutham@marvell.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Mateusz Polchlopek <mateusz.polchlopek@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/iavf/iavf_main.c
drivers/net/ethernet/intel/iavf/iavf_ptp.c
drivers/net/ethernet/intel/iavf/iavf_ptp.h
drivers/net/ethernet/intel/iavf/iavf_txrx.c
drivers/net/ethernet/intel/iavf/iavf_type.h