[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Wed, 12 Dec 2018 11:15:55 -0500
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: pasqualirb@...il.com
Cc: Network Development <netdev@...r.kernel.org>,
David Miller <davem@...emloft.net>
Subject: Re: [RFC] net: Allow setting clock type for network timestamps
On Tue, Dec 11, 2018 at 10:20 AM Ricardo Biehl Pasquali
<pasqualirb@...il.com> wrote:
>
> Network timestamps are always from REALTIME clock, which
> may be adjusted by the user (mainly Network Time Protocol
> corrections though).
>
> For applications that do not want this behavior, an option
> for setting clock type is needed.
>
> The sound subsystem has already an option to set the clock
> type for its timestamps. See SNDRV_PCM_TSTAMP_TYPE_* in
> include/uapi/sound/asound.h and snd_pcm_gettime() in
> include/sound/pcm.h .
>
> While preparing a small set of changes I found some issues.
>
> Brief of the changes:
>
> - Add SO_TIMESTAMP_CLOCK socket option macro.
>
> - Add macros for clock types:
> SOF_TIMESTAMP_CLOCK_REALTIME,
> SOF_TIMESTAMP_CLOCK_MONOTONIC,
> SOF_TIMESTAMP_CLOCK_MONOTONIC_RAW,
>
> - Add set/get for the option. Initialize to REALTIME.
>
> - In __net_timestamp(), get the time according to
> sk_timestamp_clock in 'struct sock'.
__net_timestamp is called early in the receive path before socket
lookup, in netif_receive_skb_internal through net_timestamp_check.
It is not possible to choose the clocktype based on destination
socket at this stage.
> - Do every caller of __net_timestamp() has skb->sk set?
See above, no.
Powered by blists - more mailing lists