aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/networking
diff options
context:
space:
mode:
authorAndrew Lutomirski <luto@amacapital.net>2014-03-04 20:24:10 -0500
committerDavid S. Miller <davem@davemloft.net>2014-03-06 16:18:01 -0500
commitadca4767821e54c72d4a2f467af77923f2c87e07 (patch)
tree3e7991d42d84176a64aa1f42b1fe674f64eb560d /Documentation/networking
parent4ae6e50c76def306d726a5d2678e88998ad5258e (diff)
net: Improve SO_TIMESTAMPING documentation and fix a minor code bug
The original documentation was very unclear. The code fix is presumably related to the formerly unclear documentation: SOCK_TIMESTAMPING_RX_SOFTWARE has no effect on __sock_recv_timestamp's behavior, so calling __sock_recv_ts_and_drops from sock_recv_ts_and_drops if only SOCK_TIMESTAMPING_RX_SOFTWARE is set is pointless. This should have no user-observable effect. Signed-off-by: Andy Lutomirski <luto@amacapital.net> Acked-by: Richard Cochran <richardcochran@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'Documentation/networking')
-rw-r--r--Documentation/networking/timestamping.txt52
1 files changed, 32 insertions, 20 deletions
diff --git a/Documentation/networking/timestamping.txt b/Documentation/networking/timestamping.txt
index 661d3c316a17..048c92b487f6 100644
--- a/Documentation/networking/timestamping.txt
+++ b/Documentation/networking/timestamping.txt
@@ -21,26 +21,38 @@ has such a feature).
21 21
22SO_TIMESTAMPING: 22SO_TIMESTAMPING:
23 23
24Instructs the socket layer which kind of information is wanted. The 24Instructs the socket layer which kind of information should be collected
25parameter is an integer with some of the following bits set. Setting 25and/or reported. The parameter is an integer with some of the following
26other bits is an error and doesn't change the current state. 26bits set. Setting other bits is an error and doesn't change the current
27 27state.
28SOF_TIMESTAMPING_TX_HARDWARE: try to obtain send time stamp in hardware 28
29SOF_TIMESTAMPING_TX_SOFTWARE: if SOF_TIMESTAMPING_TX_HARDWARE is off or 29Four of the bits are requests to the stack to try to generate
30 fails, then do it in software 30timestamps. Any combination of them is valid.
31SOF_TIMESTAMPING_RX_HARDWARE: return the original, unmodified time stamp 31
32 as generated by the hardware 32SOF_TIMESTAMPING_TX_HARDWARE: try to obtain send time stamps in hardware
33SOF_TIMESTAMPING_RX_SOFTWARE: if SOF_TIMESTAMPING_RX_HARDWARE is off or 33SOF_TIMESTAMPING_TX_SOFTWARE: try to obtain send time stamps in software
34 fails, then do it in software 34SOF_TIMESTAMPING_RX_HARDWARE: try to obtain receive time stamps in hardware
35SOF_TIMESTAMPING_RAW_HARDWARE: return original raw hardware time stamp 35SOF_TIMESTAMPING_RX_SOFTWARE: try to obtain receive time stamps in software
36SOF_TIMESTAMPING_SYS_HARDWARE: return hardware time stamp transformed to 36
37 the system time base 37The other three bits control which timestamps will be reported in a
38SOF_TIMESTAMPING_SOFTWARE: return system time stamp generated in 38generated control message. If none of these bits are set or if none of
39 software 39the set bits correspond to data that is available, then the control
40 40message will not be generated:
41SOF_TIMESTAMPING_TX/RX determine how time stamps are generated. 41
42SOF_TIMESTAMPING_RAW/SYS determine how they are reported in the 42SOF_TIMESTAMPING_SOFTWARE: report systime if available
43following control message: 43SOF_TIMESTAMPING_SYS_HARDWARE: report hwtimetrans if available
44SOF_TIMESTAMPING_RAW_HARDWARE: report hwtimeraw if available
45
46It is worth noting that timestamps may be collected for reasons other
47than being requested by a particular socket with
48SOF_TIMESTAMPING_[TR]X_(HARD|SOFT)WARE. For example, most drivers that
49can generate hardware receive timestamps ignore
50SOF_TIMESTAMPING_RX_HARDWARE. It is still a good idea to set that flag
51in case future drivers pay attention.
52
53If timestamps are reported, they will appear in a control message with
54cmsg_level==SOL_SOCKET, cmsg_type==SO_TIMESTAMPING, and a payload like
55this:
44 56
45struct scm_timestamping { 57struct scm_timestamping {
46 struct timespec systime; 58 struct timespec systime;