tcp: introduce tcp_skb_timestamp_us() helper
There are few places where TCP reads skb->skb_mstamp expecting a value in usec unit. skb->tstamp (aka skb->skb_mstamp) will soon store CLOCK_TAI nsec value. Add tcp_skb_timestamp_us() to provide proper conversion when needed. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
72b0094f91
commit
2fd66ffba5
@@ -1966,7 +1966,7 @@ static bool tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb,
|
||||
head = tcp_rtx_queue_head(sk);
|
||||
if (!head)
|
||||
goto send_now;
|
||||
age = tcp_stamp_us_delta(tp->tcp_mstamp, head->skb_mstamp);
|
||||
age = tcp_stamp_us_delta(tp->tcp_mstamp, tcp_skb_timestamp_us(head));
|
||||
/* If next ACK is likely to come too late (half srtt), do not defer */
|
||||
if (age < (tp->srtt_us >> 4))
|
||||
goto send_now;
|
||||
|
Reference in New Issue
Block a user