Commit 5861f8e5 authored by Ilpo Järvinen's avatar Ilpo Järvinen Committed by David S. Miller

tcp: remove pointless .dsack/.num_sacks code

In the pure assignment case, the earlier zeroing is
still in effect.

David S. Miller raised concerns if the ifs are there to avoid
dirtying cachelines. I came to these conclusions:

> We'll be dirty it anyway (now that I check), the first "real" statement
> in tcp_rcv_established is:
>
>       tp->rx_opt.saw_tstamp = 0;
>
> ...that'll land on the same dword. :-/
>
> I suppose the blocks are there just because they had more complexity
> inside when they had to calculate the eff_sacks too (maybe it would
> have been better to just remove them in that drop-patch so you would
> have had less head-ache :-)).
Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7cd0a638
...@@ -4248,7 +4248,6 @@ static void tcp_sack_remove(struct tcp_sock *tp) ...@@ -4248,7 +4248,6 @@ static void tcp_sack_remove(struct tcp_sock *tp)
this_sack++; this_sack++;
sp++; sp++;
} }
if (num_sacks != tp->rx_opt.num_sacks)
tp->rx_opt.num_sacks = num_sacks; tp->rx_opt.num_sacks = num_sacks;
} }
...@@ -4325,7 +4324,6 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb) ...@@ -4325,7 +4324,6 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb)
TCP_ECN_accept_cwr(tp, skb); TCP_ECN_accept_cwr(tp, skb);
if (tp->rx_opt.dsack)
tp->rx_opt.dsack = 0; tp->rx_opt.dsack = 0;
/* Queue data for delivery to the user. /* Queue data for delivery to the user.
...@@ -4445,7 +4443,6 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb) ...@@ -4445,7 +4443,6 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb)
/* Initial out of order segment, build 1 SACK. */ /* Initial out of order segment, build 1 SACK. */
if (tcp_is_sack(tp)) { if (tcp_is_sack(tp)) {
tp->rx_opt.num_sacks = 1; tp->rx_opt.num_sacks = 1;
tp->rx_opt.dsack = 0;
tp->selective_acks[0].start_seq = TCP_SKB_CB(skb)->seq; tp->selective_acks[0].start_seq = TCP_SKB_CB(skb)->seq;
tp->selective_acks[0].end_seq = tp->selective_acks[0].end_seq =
TCP_SKB_CB(skb)->end_seq; TCP_SKB_CB(skb)->end_seq;
......
...@@ -441,7 +441,6 @@ static void tcp_options_write(__be32 *ptr, struct tcp_sock *tp, ...@@ -441,7 +441,6 @@ static void tcp_options_write(__be32 *ptr, struct tcp_sock *tp,
*ptr++ = htonl(sp[this_sack].end_seq); *ptr++ = htonl(sp[this_sack].end_seq);
} }
if (tp->rx_opt.dsack)
tp->rx_opt.dsack = 0; tp->rx_opt.dsack = 0;
} }
} }
......
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