net-timestamp: ACK timestamp for bytestreams
Add SOF_TIMESTAMPING_TX_ACK, a request for a tstamp when the last byte in the send() call is acknowledged. It implements the feature for TCP. The timestamp is generated when the TCP socket cumulative ACK is moved beyond the tracked seqno for the first time. The feature ignores SACK and FACK, because those acknowledge the specific byte, but not necessarily the entire contents of the buffer up to that byte. Signed-off-by: Willem de Bruijn <willemb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
4ed2d765df
commit
e1c8a607b2
@@ -74,6 +74,7 @@
|
||||
#include <linux/ipsec.h>
|
||||
#include <asm/unaligned.h>
|
||||
#include <net/netdma.h>
|
||||
#include <linux/errqueue.h>
|
||||
|
||||
int sysctl_tcp_timestamps __read_mostly = 1;
|
||||
int sysctl_tcp_window_scaling __read_mostly = 1;
|
||||
@@ -3106,6 +3107,11 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets,
|
||||
tp->retrans_stamp = 0;
|
||||
}
|
||||
|
||||
if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_ACK_TSTAMP) &&
|
||||
between(skb_shinfo(skb)->tskey, prior_snd_una,
|
||||
tp->snd_una + 1))
|
||||
__skb_tstamp_tx(skb, NULL, sk, SCM_TSTAMP_ACK);
|
||||
|
||||
if (!fully_acked)
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user