diff options
| author | Eric Dumazet <[email protected]> | 2018-09-21 15:51:49 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2018-09-22 02:37:59 +0000 |
| commit | 9799ccb0e984a5c1311b22a212e7ff96e8b736de (patch) | |
| tree | 85061422e73b7f752c2e5c568ba57367e28d31a1 /net/ipv4/tcp_output.c | |
| parent | net_sched: sch_fq: switch to CLOCK_TAI (diff) | |
| download | kernel-9799ccb0e984a5c1311b22a212e7ff96e8b736de.tar.gz kernel-9799ccb0e984a5c1311b22a212e7ff96e8b736de.zip | |
tcp: add tcp_wstamp_ns socket field
TCP will soon provide earliest departure time on TX skbs.
It needs to track this in a new variable.
tcp_mstamp_refresh() needs to update this variable, and
became too big to stay an inline.
Signed-off-by: Eric Dumazet <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/ipv4/tcp_output.c')
| -rw-r--r-- | net/ipv4/tcp_output.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index b95aa72d8823..5a8105e84f7c 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -45,6 +45,22 @@ #include <trace/events/tcp.h> +/* Refresh clocks of a TCP socket, + * ensuring monotically increasing values. + */ +void tcp_mstamp_refresh(struct tcp_sock *tp) +{ + u64 val = tcp_clock_ns(); + + /* departure time for next data packet */ + if (val > tp->tcp_wstamp_ns) + tp->tcp_wstamp_ns = val; + + val = div_u64(val, NSEC_PER_USEC); + if (val > tp->tcp_mstamp) + tp->tcp_mstamp = val; +} + static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle, int push_one, gfp_t gfp); |
