|
@@ -52,9 +52,8 @@ 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;
|
|
|
+ if (val > tp->tcp_clock_cache)
|
|
|
+ tp->tcp_clock_cache = val;
|
|
|
|
|
|
val = div_u64(val, NSEC_PER_USEC);
|
|
|
if (val > tp->tcp_mstamp)
|
|
@@ -1050,6 +1049,10 @@ static int __tcp_transmit_skb(struct sock *sk, struct sk_buff *skb,
|
|
|
if (unlikely(!skb))
|
|
|
return -ENOBUFS;
|
|
|
}
|
|
|
+
|
|
|
+ /* TODO: might take care of jitter here */
|
|
|
+ tp->tcp_wstamp_ns = max(tp->tcp_wstamp_ns, tp->tcp_clock_cache);
|
|
|
+
|
|
|
skb->skb_mstamp_ns = tp->tcp_wstamp_ns;
|
|
|
|
|
|
inet = inet_sk(sk);
|