diff options
Diffstat (limited to 'net/ipv4/tcp_output.c')
| -rw-r--r-- | net/ipv4/tcp_output.c | 27 | 
1 files changed, 11 insertions, 16 deletions
| diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 95618d0e78e4..16c48df8df4c 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -1301,7 +1301,7 @@ static int __tcp_transmit_skb(struct sock *sk, struct sk_buff *skb,  	tp = tcp_sk(sk);  	prior_wstamp = tp->tcp_wstamp_ns;  	tp->tcp_wstamp_ns = max(tp->tcp_wstamp_ns, tp->tcp_clock_cache); -	skb_set_delivery_time(skb, tp->tcp_wstamp_ns, true); +	skb_set_delivery_time(skb, tp->tcp_wstamp_ns, SKB_CLOCK_MONOTONIC);  	if (clone_it) {  		oskb = skb; @@ -1655,7 +1655,7 @@ int tcp_fragment(struct sock *sk, enum tcp_queue tcp_queue,  	skb_split(skb, buff, len); -	skb_set_delivery_time(buff, skb->tstamp, true); +	skb_set_delivery_time(buff, skb->tstamp, SKB_CLOCK_MONOTONIC);  	tcp_fragment_tstamp(skb, buff);  	old_factor = tcp_skb_pcount(skb); @@ -2764,7 +2764,7 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,  		if (unlikely(tp->repair) && tp->repair_queue == TCP_SEND_QUEUE) {  			/* "skb_mstamp_ns" is used as a start point for the retransmit timer */  			tp->tcp_wstamp_ns = tp->tcp_clock_cache; -			skb_set_delivery_time(skb, tp->tcp_wstamp_ns, true); +			skb_set_delivery_time(skb, tp->tcp_wstamp_ns, SKB_CLOCK_MONOTONIC);  			list_move_tail(&skb->tcp_tsorted_anchor, &tp->tsorted_sent_queue);  			tcp_init_tso_segs(skb, mss_now);  			goto repair; /* Skip network transmission */ @@ -3752,11 +3752,11 @@ struct sk_buff *tcp_make_synack(const struct sock *sk, struct dst_entry *dst,  #ifdef CONFIG_SYN_COOKIES  	if (unlikely(synack_type == TCP_SYNACK_COOKIE && ireq->tstamp_ok))  		skb_set_delivery_time(skb, cookie_init_timestamp(req, now), -				      true); +				      SKB_CLOCK_MONOTONIC);  	else  #endif  	{ -		skb_set_delivery_time(skb, now, true); +		skb_set_delivery_time(skb, now, SKB_CLOCK_MONOTONIC);  		if (!tcp_rsk(req)->snt_synack) /* Timestamp first SYNACK */  			tcp_rsk(req)->snt_synack = tcp_skb_timestamp_us(skb);  	} @@ -3768,6 +3768,7 @@ struct sk_buff *tcp_make_synack(const struct sock *sk, struct dst_entry *dst,  #ifdef CONFIG_TCP_AO  		struct tcp_ao_key *ao_key = NULL;  		u8 keyid = tcp_rsk(req)->ao_keyid; +		u8 rnext = tcp_rsk(req)->ao_rcv_next;  		ao_key = tcp_sk(sk)->af_specific->ao_lookup(sk, req_to_sk(req),  							    keyid, -1); @@ -3777,6 +3778,7 @@ struct sk_buff *tcp_make_synack(const struct sock *sk, struct dst_entry *dst,  		 * ao_keyid (RFC5925 RNextKeyID), so let's keep it simple here.  		 */  		if (unlikely(!ao_key)) { +			trace_tcp_ao_synack_no_key(sk, keyid, rnext);  			rcu_read_unlock();  			kfree_skb(skb);  			net_warn_ratelimited("TCP-AO: the keyid %u from SYN packet is not present - not sending SYNACK\n", @@ -3843,7 +3845,7 @@ struct sk_buff *tcp_make_synack(const struct sock *sk, struct dst_entry *dst,  	bpf_skops_write_hdr_opt((struct sock *)sk, skb, req, syn_skb,  				synack_type, &opts); -	skb_set_delivery_time(skb, now, true); +	skb_set_delivery_time(skb, now, SKB_CLOCK_MONOTONIC);  	tcp_add_tx_delay(skb, tp);  	return skb; @@ -4027,7 +4029,7 @@ static int tcp_send_syn_data(struct sock *sk, struct sk_buff *syn)  	err = tcp_transmit_skb(sk, syn_data, 1, sk->sk_allocation); -	skb_set_delivery_time(syn, syn_data->skb_mstamp_ns, true); +	skb_set_delivery_time(syn, syn_data->skb_mstamp_ns, SKB_CLOCK_MONOTONIC);  	/* Now full SYN+DATA was cloned and sent (or not),  	 * remove the SYN from the original skb (syn_data) @@ -4163,16 +4165,9 @@ EXPORT_SYMBOL(tcp_connect);  u32 tcp_delack_max(const struct sock *sk)  { -	const struct dst_entry *dst = __sk_dst_get(sk); -	u32 delack_max = inet_csk(sk)->icsk_delack_max; - -	if (dst && dst_metric_locked(dst, RTAX_RTO_MIN)) { -		u32 rto_min = dst_metric_rtt(dst, RTAX_RTO_MIN); -		u32 delack_from_rto_min = max_t(int, 1, rto_min - 1); +	u32 delack_from_rto_min = max(tcp_rto_min(sk), 2) - 1; -		delack_max = min_t(u32, delack_max, delack_from_rto_min); -	} -	return delack_max; +	return min(inet_csk(sk)->icsk_delack_max, delack_from_rto_min);  }  /* Send out a delayed ack, the caller does the policy checking |