tcp_output.c (2987babb6982306509380fc11b450227a844493b) | tcp_output.c (27cde44a259c380a3c09066fc4b42de7dde9b1ad) |
---|---|
1/* 2 * INET An implementation of the TCP/IP protocol suite for the LINUX 3 * operating system. INET is implemented using the BSD Socket 4 * interface as the means of communication with the user level. 5 * 6 * Implementation of the Transmission Control Protocol(TCP). 7 * 8 * Authors: Ross Biro --- 146 unchanged lines hidden (view full) --- 155 /* If it is a reply for ato after last received 156 * packet, enter pingpong mode. 157 */ 158 if ((u32)(now - icsk->icsk_ack.lrcvtime) < icsk->icsk_ack.ato) 159 icsk->icsk_ack.pingpong = 1; 160} 161 162/* Account for an ACK we sent. */ | 1/* 2 * INET An implementation of the TCP/IP protocol suite for the LINUX 3 * operating system. INET is implemented using the BSD Socket 4 * interface as the means of communication with the user level. 5 * 6 * Implementation of the Transmission Control Protocol(TCP). 7 * 8 * Authors: Ross Biro --- 146 unchanged lines hidden (view full) --- 155 /* If it is a reply for ato after last received 156 * packet, enter pingpong mode. 157 */ 158 if ((u32)(now - icsk->icsk_ack.lrcvtime) < icsk->icsk_ack.ato) 159 icsk->icsk_ack.pingpong = 1; 160} 161 162/* Account for an ACK we sent. */ |
163static inline void tcp_event_ack_sent(struct sock *sk, unsigned int pkts) | 163static inline void tcp_event_ack_sent(struct sock *sk, unsigned int pkts, 164 u32 rcv_nxt) |
164{ 165 struct tcp_sock *tp = tcp_sk(sk); 166 167 if (unlikely(tp->compressed_ack)) { 168 NET_ADD_STATS(sock_net(sk), LINUX_MIB_TCPACKCOMPRESSED, 169 tp->compressed_ack); 170 tp->compressed_ack = 0; 171 if (hrtimer_try_to_cancel(&tp->compressed_ack_timer) == 1) 172 __sock_put(sk); 173 } | 165{ 166 struct tcp_sock *tp = tcp_sk(sk); 167 168 if (unlikely(tp->compressed_ack)) { 169 NET_ADD_STATS(sock_net(sk), LINUX_MIB_TCPACKCOMPRESSED, 170 tp->compressed_ack); 171 tp->compressed_ack = 0; 172 if (hrtimer_try_to_cancel(&tp->compressed_ack_timer) == 1) 173 __sock_put(sk); 174 } |
175 176 if (unlikely(rcv_nxt != tp->rcv_nxt)) 177 return; /* Special ACK sent by DCTCP to reflect ECN */ |
|
174 tcp_dec_quickack_mode(sk, pkts); 175 inet_csk_clear_xmit_timer(sk, ICSK_TIME_DACK); 176} 177 178 179u32 tcp_default_init_rwnd(u32 mss) 180{ 181 /* Initial receive window should be twice of TCP_INIT_CWND to --- 954 unchanged lines hidden (view full) --- 1136 tp->af_specific->calc_md5_hash(opts.hash_location, 1137 md5, sk, skb); 1138 } 1139#endif 1140 1141 icsk->icsk_af_ops->send_check(sk, skb); 1142 1143 if (likely(tcb->tcp_flags & TCPHDR_ACK)) | 178 tcp_dec_quickack_mode(sk, pkts); 179 inet_csk_clear_xmit_timer(sk, ICSK_TIME_DACK); 180} 181 182 183u32 tcp_default_init_rwnd(u32 mss) 184{ 185 /* Initial receive window should be twice of TCP_INIT_CWND to --- 954 unchanged lines hidden (view full) --- 1140 tp->af_specific->calc_md5_hash(opts.hash_location, 1141 md5, sk, skb); 1142 } 1143#endif 1144 1145 icsk->icsk_af_ops->send_check(sk, skb); 1146 1147 if (likely(tcb->tcp_flags & TCPHDR_ACK)) |
1144 tcp_event_ack_sent(sk, tcp_skb_pcount(skb)); | 1148 tcp_event_ack_sent(sk, tcp_skb_pcount(skb), rcv_nxt); |
1145 1146 if (skb->len != tcp_header_size) { 1147 tcp_event_data_sent(tp, sk); 1148 tp->data_segs_out += tcp_skb_pcount(skb); 1149 tcp_internal_pacing(sk, skb); 1150 } 1151 1152 if (after(tcb->end_seq, tp->snd_nxt) || tcb->seq == tcb->end_seq) --- 2455 unchanged lines hidden (view full) --- 3608 * too much. 3609 * SKB_TRUESIZE(max(1 .. 66, MAX_TCP_HEADER)) is unfortunately ~784 3610 */ 3611 skb_set_tcp_pure_ack(buff); 3612 3613 /* Send it off, this clears delayed acks for us. */ 3614 __tcp_transmit_skb(sk, buff, 0, (__force gfp_t)0, rcv_nxt); 3615} | 1149 1150 if (skb->len != tcp_header_size) { 1151 tcp_event_data_sent(tp, sk); 1152 tp->data_segs_out += tcp_skb_pcount(skb); 1153 tcp_internal_pacing(sk, skb); 1154 } 1155 1156 if (after(tcb->end_seq, tp->snd_nxt) || tcb->seq == tcb->end_seq) --- 2455 unchanged lines hidden (view full) --- 3612 * too much. 3613 * SKB_TRUESIZE(max(1 .. 66, MAX_TCP_HEADER)) is unfortunately ~784 3614 */ 3615 skb_set_tcp_pure_ack(buff); 3616 3617 /* Send it off, this clears delayed acks for us. */ 3618 __tcp_transmit_skb(sk, buff, 0, (__force gfp_t)0, rcv_nxt); 3619} |
3620EXPORT_SYMBOL_GPL(__tcp_send_ack); |
|
3616 3617void tcp_send_ack(struct sock *sk) 3618{ 3619 __tcp_send_ack(sk, tcp_sk(sk)->rcv_nxt); 3620} | 3621 3622void tcp_send_ack(struct sock *sk) 3623{ 3624 __tcp_send_ack(sk, tcp_sk(sk)->rcv_nxt); 3625} |
3621EXPORT_SYMBOL_GPL(tcp_send_ack); | |
3622 3623/* This routine sends a packet with an out of date sequence 3624 * number. It assumes the other end will try to ack it. 3625 * 3626 * Question: what should we make while urgent mode? 3627 * 4.4BSD forces sending single byte of data. We cannot send 3628 * out of window data, because we have SND.NXT==SND.MAX... 3629 * --- 139 unchanged lines hidden --- | 3626 3627/* This routine sends a packet with an out of date sequence 3628 * number. It assumes the other end will try to ack it. 3629 * 3630 * Question: what should we make while urgent mode? 3631 * 4.4BSD forces sending single byte of data. We cannot send 3632 * out of window data, because we have SND.NXT==SND.MAX... 3633 * --- 139 unchanged lines hidden --- |