diff options
author | Laurence Evans <levans@solarflare.com> | 2018-01-25 12:27:02 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-01-25 16:05:14 -0500 |
commit | c4f64fcc4d31e7f773cb4eec9d90c40ebb049c14 (patch) | |
tree | 71a3274bc1437a46cc7a0e78327655f3661103d5 | |
parent | 6aa47c87cb053670bb636fb2001deb4a868f9486 (diff) |
sfc: simplify RX datapath timestamping
Use timestamp conversion function with correction to avoid duplicate
correction handling.
Signed-off-by: Laurence Evans <levans@solarflare.com>
Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/sfc/ptp.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c index cbfc171d90ee..29dbb47b270c 100644 --- a/drivers/net/ethernet/sfc/ptp.c +++ b/drivers/net/ethernet/sfc/ptp.c | |||
@@ -586,8 +586,6 @@ static int efx_ptp_get_attributes(struct efx_nic *efx) | |||
586 | return -ERANGE; | 586 | return -ERANGE; |
587 | } | 587 | } |
588 | 588 | ||
589 | ptp->time_format = fmt; | ||
590 | |||
591 | /* MC_CMD_PTP_OP_GET_ATTRIBUTES is an extended version of an older | 589 | /* MC_CMD_PTP_OP_GET_ATTRIBUTES is an extended version of an older |
592 | * operation MC_CMD_PTP_OP_GET_TIME_FORMAT that also returns a value | 590 | * operation MC_CMD_PTP_OP_GET_TIME_FORMAT that also returns a value |
593 | * to use for the minimum acceptable corrected synchronization window. | 591 | * to use for the minimum acceptable corrected synchronization window. |
@@ -1869,10 +1867,7 @@ void __efx_rx_skb_attach_timestamp(struct efx_channel *channel, | |||
1869 | u32 diff, carry; | 1867 | u32 diff, carry; |
1870 | struct skb_shared_hwtstamps *timestamps; | 1868 | struct skb_shared_hwtstamps *timestamps; |
1871 | 1869 | ||
1872 | pkt_timestamp_minor = (efx_rx_buf_timestamp_minor(efx, | 1870 | pkt_timestamp_minor = efx_rx_buf_timestamp_minor(efx, skb_mac_header(skb)); |
1873 | skb_mac_header(skb)) + | ||
1874 | (u32) efx->ptp_data->ts_corrections.rx) & | ||
1875 | (MINOR_TICKS_PER_SECOND - 1); | ||
1876 | 1871 | ||
1877 | /* get the difference between the packet and sync timestamps, | 1872 | /* get the difference between the packet and sync timestamps, |
1878 | * modulo one second | 1873 | * modulo one second |
@@ -1910,8 +1905,10 @@ void __efx_rx_skb_attach_timestamp(struct efx_channel *channel, | |||
1910 | 1905 | ||
1911 | /* attach the timestamps to the skb */ | 1906 | /* attach the timestamps to the skb */ |
1912 | timestamps = skb_hwtstamps(skb); | 1907 | timestamps = skb_hwtstamps(skb); |
1913 | timestamps->hwtstamp = | 1908 | timestamps->hwtstamp = efx_ptp_s27_to_ktime_correction( |
1914 | efx_ptp_s27_to_ktime(pkt_timestamp_major, pkt_timestamp_minor); | 1909 | pkt_timestamp_major, |
1910 | pkt_timestamp_minor, | ||
1911 | efx->ptp_data->ts_corrections.rx); | ||
1915 | } | 1912 | } |
1916 | 1913 | ||
1917 | static int efx_phc_adjfreq(struct ptp_clock_info *ptp, s32 delta) | 1914 | static int efx_phc_adjfreq(struct ptp_clock_info *ptp, s32 delta) |