aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_input.c
diff options
context:
space:
mode:
authorIlpo Järvinen <ilpo.jarvinen@helsinki.fi>2007-12-01 17:47:57 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:55:40 -0500
commit407ef1de03e87225d75a9bed271f35ea6880f5f1 (patch)
tree5003ff9db585997fceda75340f4631c311b0fe51 /net/ipv4/tcp_input.c
parentbce392f3b02755a8c615d4ced3d3b9cb1d9e3648 (diff)
[TCP]: Remove superflucious FLAG_DATA_SACKED
To get there, highest_sack must have advanced. When it advances, a new skb is SACKed, which already sets that FLAG. Besides, the original purpose of it has puzzled me, never understood why LOST bit setting of retransmitted skb is marked with FLAG_DATA_SACKED. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r--net/ipv4/tcp_input.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 6ca77f8bceea..871110842809 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1118,12 +1118,11 @@ static int tcp_is_sackblock_valid(struct tcp_sock *tp, int is_dsack,
1118 * highest SACK block). Also calculate the lowest snd_nxt among the remaining 1118 * highest SACK block). Also calculate the lowest snd_nxt among the remaining
1119 * retransmitted skbs to avoid some costly processing per ACKs. 1119 * retransmitted skbs to avoid some costly processing per ACKs.
1120 */ 1120 */
1121static int tcp_mark_lost_retrans(struct sock *sk) 1121static void tcp_mark_lost_retrans(struct sock *sk)
1122{ 1122{
1123 const struct inet_connection_sock *icsk = inet_csk(sk); 1123 const struct inet_connection_sock *icsk = inet_csk(sk);
1124 struct tcp_sock *tp = tcp_sk(sk); 1124 struct tcp_sock *tp = tcp_sk(sk);
1125 struct sk_buff *skb; 1125 struct sk_buff *skb;
1126 int flag = 0;
1127 int cnt = 0; 1126 int cnt = 0;
1128 u32 new_low_seq = tp->snd_nxt; 1127 u32 new_low_seq = tp->snd_nxt;
1129 u32 received_upto = TCP_SKB_CB(tp->highest_sack)->end_seq; 1128 u32 received_upto = TCP_SKB_CB(tp->highest_sack)->end_seq;
@@ -1131,7 +1130,7 @@ static int tcp_mark_lost_retrans(struct sock *sk)
1131 if (!tcp_is_fack(tp) || !tp->retrans_out || 1130 if (!tcp_is_fack(tp) || !tp->retrans_out ||
1132 !after(received_upto, tp->lost_retrans_low) || 1131 !after(received_upto, tp->lost_retrans_low) ||
1133 icsk->icsk_ca_state != TCP_CA_Recovery) 1132 icsk->icsk_ca_state != TCP_CA_Recovery)
1134 return flag; 1133 return;
1135 1134
1136 tcp_for_write_queue(skb, sk) { 1135 tcp_for_write_queue(skb, sk) {
1137 u32 ack_seq = TCP_SKB_CB(skb)->ack_seq; 1136 u32 ack_seq = TCP_SKB_CB(skb)->ack_seq;
@@ -1159,7 +1158,6 @@ static int tcp_mark_lost_retrans(struct sock *sk)
1159 if (!(TCP_SKB_CB(skb)->sacked & (TCPCB_LOST|TCPCB_SACKED_ACKED))) { 1158 if (!(TCP_SKB_CB(skb)->sacked & (TCPCB_LOST|TCPCB_SACKED_ACKED))) {
1160 tp->lost_out += tcp_skb_pcount(skb); 1159 tp->lost_out += tcp_skb_pcount(skb);
1161 TCP_SKB_CB(skb)->sacked |= TCPCB_LOST; 1160 TCP_SKB_CB(skb)->sacked |= TCPCB_LOST;
1162 flag |= FLAG_DATA_SACKED;
1163 } 1161 }
1164 NET_INC_STATS_BH(LINUX_MIB_TCPLOSTRETRANSMIT); 1162 NET_INC_STATS_BH(LINUX_MIB_TCPLOSTRETRANSMIT);
1165 } else { 1163 } else {
@@ -1171,8 +1169,6 @@ static int tcp_mark_lost_retrans(struct sock *sk)
1171 1169
1172 if (tp->retrans_out) 1170 if (tp->retrans_out)
1173 tp->lost_retrans_low = new_low_seq; 1171 tp->lost_retrans_low = new_low_seq;
1174
1175 return flag;
1176} 1172}
1177 1173
1178static int tcp_check_dsack(struct tcp_sock *tp, struct sk_buff *ack_skb, 1174static int tcp_check_dsack(struct tcp_sock *tp, struct sk_buff *ack_skb,
@@ -1603,7 +1599,7 @@ advance_sp:
1603 for (j = 0; j < used_sacks; j++) 1599 for (j = 0; j < used_sacks; j++)
1604 tp->recv_sack_cache[i++] = sp[j]; 1600 tp->recv_sack_cache[i++] = sp[j];
1605 1601
1606 flag |= tcp_mark_lost_retrans(sk); 1602 tcp_mark_lost_retrans(sk);
1607 1603
1608 tcp_verify_left_out(tp); 1604 tcp_verify_left_out(tp);
1609 1605