aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorWillem de Bruijn <willemb@google.com>2014-08-04 22:11:47 -0400
committerDavid S. Miller <davem@davemloft.net>2014-08-05 19:35:54 -0400
commit09c2d251b70723650ba47e83571ff49281320f7c (patch)
treeb40d8ab4ed6533a357b885ca6184ab7e86537c22 /include/net
parentb9f40e21ef4298650ab33e35740fa85bd57706d5 (diff)
net-timestamp: add key to disambiguate concurrent datagrams
Datagrams timestamped on transmission can coexist in the kernel stack and be reordered in packet scheduling. When reading looped datagrams from the socket error queue it is not always possible to unique correlate looped data with original send() call (for application level retransmits). Even if possible, it may be expensive and complex, requiring packet inspection. Introduce a data-independent ID mechanism to associate timestamps with send calls. Pass an ID alongside the timestamp in field ee_data of sock_extended_err. The ID is a simple 32 bit unsigned int that is associated with the socket and incremented on each send() call for which software tx timestamp generation is enabled. The feature is enabled only if SOF_TIMESTAMPING_OPT_ID is set, to avoid changing ee_data for existing applications that expect it 0. The counter is reset each time the flag is reenabled. Reenabling does not change the ID of already submitted data. It is possible to receive out of order IDs if the timestamp stream is not quiesced first. Signed-off-by: Willem de Bruijn <willemb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/sock.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index a21129716aae..52fe0bc5598a 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -280,6 +280,7 @@ struct cg_proto;
280 * @sk_timer: sock cleanup timer 280 * @sk_timer: sock cleanup timer
281 * @sk_stamp: time stamp of last packet received 281 * @sk_stamp: time stamp of last packet received
282 * @sk_tsflags: SO_TIMESTAMPING socket options 282 * @sk_tsflags: SO_TIMESTAMPING socket options
283 * @sk_tskey: counter to disambiguate concurrent tstamp requests
283 * @sk_socket: Identd and reporting IO signals 284 * @sk_socket: Identd and reporting IO signals
284 * @sk_user_data: RPC layer private data 285 * @sk_user_data: RPC layer private data
285 * @sk_frag: cached page frag 286 * @sk_frag: cached page frag
@@ -414,6 +415,7 @@ struct sock {
414 struct timer_list sk_timer; 415 struct timer_list sk_timer;
415 ktime_t sk_stamp; 416 ktime_t sk_stamp;
416 u16 sk_tsflags; 417 u16 sk_tsflags;
418 u32 sk_tskey;
417 struct socket *sk_socket; 419 struct socket *sk_socket;
418 void *sk_user_data; 420 void *sk_user_data;
419 struct page_frag sk_frag; 421 struct page_frag sk_frag;