Commit 407ef1de authored by Ilpo Järvinen's avatar Ilpo Järvinen Committed by David S. Miller

[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: default avatarIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bce392f3
...@@ -1118,12 +1118,11 @@ static int tcp_is_sackblock_valid(struct tcp_sock *tp, int is_dsack, ...@@ -1118,12 +1118,11 @@ static int tcp_is_sackblock_valid(struct tcp_sock *tp, int is_dsack,
* highest SACK block). Also calculate the lowest snd_nxt among the remaining * highest SACK block). Also calculate the lowest snd_nxt among the remaining
* retransmitted skbs to avoid some costly processing per ACKs. * retransmitted skbs to avoid some costly processing per ACKs.
*/ */
static int tcp_mark_lost_retrans(struct sock *sk) static void tcp_mark_lost_retrans(struct sock *sk)
{ {
const struct inet_connection_sock *icsk = inet_csk(sk); const struct inet_connection_sock *icsk = inet_csk(sk);
struct tcp_sock *tp = tcp_sk(sk); struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *skb; struct sk_buff *skb;
int flag = 0;
int cnt = 0; int cnt = 0;
u32 new_low_seq = tp->snd_nxt; u32 new_low_seq = tp->snd_nxt;
u32 received_upto = TCP_SKB_CB(tp->highest_sack)->end_seq; 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,7 +1130,7 @@ static int tcp_mark_lost_retrans(struct sock *sk)
if (!tcp_is_fack(tp) || !tp->retrans_out || if (!tcp_is_fack(tp) || !tp->retrans_out ||
!after(received_upto, tp->lost_retrans_low) || !after(received_upto, tp->lost_retrans_low) ||
icsk->icsk_ca_state != TCP_CA_Recovery) icsk->icsk_ca_state != TCP_CA_Recovery)
return flag; return;
tcp_for_write_queue(skb, sk) { tcp_for_write_queue(skb, sk) {
u32 ack_seq = TCP_SKB_CB(skb)->ack_seq; u32 ack_seq = TCP_SKB_CB(skb)->ack_seq;
...@@ -1159,7 +1158,6 @@ static int tcp_mark_lost_retrans(struct sock *sk) ...@@ -1159,7 +1158,6 @@ static int tcp_mark_lost_retrans(struct sock *sk)
if (!(TCP_SKB_CB(skb)->sacked & (TCPCB_LOST|TCPCB_SACKED_ACKED))) { if (!(TCP_SKB_CB(skb)->sacked & (TCPCB_LOST|TCPCB_SACKED_ACKED))) {
tp->lost_out += tcp_skb_pcount(skb); tp->lost_out += tcp_skb_pcount(skb);
TCP_SKB_CB(skb)->sacked |= TCPCB_LOST; TCP_SKB_CB(skb)->sacked |= TCPCB_LOST;
flag |= FLAG_DATA_SACKED;
} }
NET_INC_STATS_BH(LINUX_MIB_TCPLOSTRETRANSMIT); NET_INC_STATS_BH(LINUX_MIB_TCPLOSTRETRANSMIT);
} else { } else {
...@@ -1171,8 +1169,6 @@ static int tcp_mark_lost_retrans(struct sock *sk) ...@@ -1171,8 +1169,6 @@ static int tcp_mark_lost_retrans(struct sock *sk)
if (tp->retrans_out) if (tp->retrans_out)
tp->lost_retrans_low = new_low_seq; tp->lost_retrans_low = new_low_seq;
return flag;
} }
static int tcp_check_dsack(struct tcp_sock *tp, struct sk_buff *ack_skb, static int tcp_check_dsack(struct tcp_sock *tp, struct sk_buff *ack_skb,
...@@ -1603,7 +1599,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_ ...@@ -1603,7 +1599,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
for (j = 0; j < used_sacks; j++) for (j = 0; j < used_sacks; j++)
tp->recv_sack_cache[i++] = sp[j]; tp->recv_sack_cache[i++] = sp[j];
flag |= tcp_mark_lost_retrans(sk); tcp_mark_lost_retrans(sk);
tcp_verify_left_out(tp); tcp_verify_left_out(tp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment