diff options
author | Martin Habets <mhabets@solarflare.com> | 2018-01-25 17:24:43 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-01-25 16:05:13 -0500 |
commit | b9b603d46d5aad1fb66fa007759193e82a50c680 (patch) | |
tree | d9d0a733ccd7ec6d78262c2ba5cbfce6023ed5cb /drivers/net/ethernet/sfc/ptp.c | |
parent | 5227ecccea2d645d253d243ad287169335a4ae64 (diff) |
sfc: handle TX timestamps in the normal data path
Before this work, TX timestamping is done by sending each SKB to the MC.
On the 8000 series (Medford1) we have high speed timestamping via the
MAC, which means we can use normal TX queues for this without a
significant drop in bandwidth. On the X2000 series (Medford2) support
for transmitting via the MC is removed, so the new way must be used.
This patch enables timestamping on a TX queue, if requested.
It also enhances TX event handling to process the extra completion events,
and puts the time in the SKB.
Signed-off-by: Martin Habets <mhabets@solarflare.com>
Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sfc/ptp.c')
-rw-r--r-- | drivers/net/ethernet/sfc/ptp.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c index 3b37d7ded3c4..976d38bf6068 100644 --- a/drivers/net/ethernet/sfc/ptp.c +++ b/drivers/net/ethernet/sfc/ptp.c @@ -471,6 +471,17 @@ static ktime_t efx_ptp_s27_to_ktime_correction(u32 nic_major, u32 nic_minor, return efx_ptp_s27_to_ktime(nic_major, nic_minor); } +ktime_t efx_ptp_nic_to_kernel_time(struct efx_tx_queue *tx_queue) +{ + struct efx_nic *efx = tx_queue->efx; + struct efx_ptp_data *ptp = efx->ptp_data; + ktime_t kt; + + kt = ptp->nic_to_kernel_time(tx_queue->completed_timestamp_major, + tx_queue->completed_timestamp_minor, 0); + return kt; +} + /* Get PTP attributes and set up time conversions */ static int efx_ptp_get_attributes(struct efx_nic *efx) { |