tcp: add tp->tcp_mstamp field
We want to use precise timestamps in TCP stack, but we do not want to call possibly expensive kernel time services too often. tp->tcp_mstamp is guaranteed to be updated once per incoming packet. We will use it in the following patches, removing specific skb_mstamp_get() calls, and removing ack_time from struct tcp_sacktag_state. Signed-off-by: Eric Dumazet <edumazet@google.com> Acked-by: Soheil Hassas Yeganeh <soheil@google.com> Acked-by: Neal Cardwell <ncardwell@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
		
				
					committed by
					
						 David S. Miller
						David S. Miller
					
				
			
			
				
	
			
			
			
						parent
						
							038a3e858d
						
					
				
				
					commit
					69e996c58a
				
			| @@ -5362,6 +5362,7 @@ void tcp_rcv_established(struct sock *sk, struct sk_buff *skb, | ||||
| { | ||||
| 	struct tcp_sock *tp = tcp_sk(sk); | ||||
| 
 | ||||
| 	skb_mstamp_get(&tp->tcp_mstamp); | ||||
| 	if (unlikely(!sk->sk_rx_dst)) | ||||
| 		inet_csk(sk)->icsk_af_ops->sk_rx_dst_set(sk, skb); | ||||
| 	/*
 | ||||
| @@ -5922,6 +5923,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb) | ||||
| 
 | ||||
| 	case TCP_SYN_SENT: | ||||
| 		tp->rx_opt.saw_tstamp = 0; | ||||
| 		skb_mstamp_get(&tp->tcp_mstamp); | ||||
| 		queued = tcp_rcv_synsent_state_process(sk, skb, th); | ||||
| 		if (queued >= 0) | ||||
| 			return queued; | ||||
| @@ -5933,6 +5935,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb) | ||||
| 		return 0; | ||||
| 	} | ||||
| 
 | ||||
| 	skb_mstamp_get(&tp->tcp_mstamp); | ||||
| 	tp->rx_opt.saw_tstamp = 0; | ||||
| 	req = tp->fastopen_rsk; | ||||
| 	if (req) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user