All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/7] tcp: remove pointless .dsack/.num_sacks code
@ 2009-03-15  0:23 Ilpo Järvinen
  2009-03-15  0:23 ` [PATCH 2/7] tcp: kill dead end_seq variable in clean_rtx_queue Ilpo Järvinen
  0 siblings, 1 reply; 11+ messages in thread
From: Ilpo Järvinen @ 2009-03-15  0:23 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

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: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---

My apologies for the duplicated patches, I succeeded once again
to make mess out of it with git-send-email and 8-bit chars in
header which vger consistently is known to reject... Thus resending
to get a copy to appear on netdev too.

Grr, 3rd attempt, now with --no-signed-off-by-cc though it _should_
have worked without that too like it used to.

 net/ipv4/tcp_input.c  |    7 ++-----
 net/ipv4/tcp_output.c |    3 +--
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 5ecd7aa..cd39d1d 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -4248,8 +4248,7 @@ static void tcp_sack_remove(struct tcp_sock *tp)
 		this_sack++;
 		sp++;
 	}
-	if (num_sacks != tp->rx_opt.num_sacks)
-		tp->rx_opt.num_sacks = num_sacks;
+	tp->rx_opt.num_sacks = num_sacks;
 }
 
 /* This one checks to see if we can put data from the
@@ -4325,8 +4324,7 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *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.
 	 *  Packets in sequence go to the receive queue.
@@ -4445,7 +4443,6 @@ drop:
 		/* Initial out of order segment, build 1 SACK. */
 		if (tcp_is_sack(tp)) {
 			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].end_seq =
 						TCP_SKB_CB(skb)->end_seq;
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index eb285be..3256580 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -441,8 +441,7 @@ static void tcp_options_write(__be32 *ptr, struct tcp_sock *tp,
 			*ptr++ = htonl(sp[this_sack].end_seq);
 		}
 
-		if (tp->rx_opt.dsack)
-			tp->rx_opt.dsack = 0;
+		tp->rx_opt.dsack = 0;
 	}
 }
 
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2009-03-16  3:11 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1237075675426-git-send-email-ilpo.jarvinen@helsinki.fi>
2009-03-16  3:10 ` [PATCH 1/7] tcp: remove pointless .dsack/.num_sacks code David Miller
     [not found] ` <12370756753599-git-send-email-ilpo.jarvinen@helsinki.fi>
2009-03-16  3:10   ` [PATCH 2/7] tcp: kill dead end_seq variable in clean_rtx_queue David Miller
     [not found]   ` <12370756754094-git-send-email-ilpo.jarvinen@helsinki.fi>
2009-03-16  3:10     ` [PATCH 3/7] tcp: consolidate paws check David Miller
     [not found]     ` <12370756752410-git-send-email-ilpo.jarvinen@helsinki.fi>
2009-03-16  3:10       ` [PATCH 4/7] tcp: don't check mtu probe completion in the loop David Miller
     [not found]       ` <12370756751028-git-send-email-ilpo.jarvinen@helsinki.fi>
     [not found]         ` <12370756752721-git-send-email-ilpo.jarvinen@helsinki.fi>
2009-03-15  8:36           ` [PATCH 6/7] tcp: cache result of earlier divides when mss-aligning things Evgeniy Polyakov
2009-03-15  8:45             ` Ilpo Järvinen
2009-03-15  9:08               ` Evgeniy Polyakov
2009-03-16  3:11               ` David Miller
     [not found]           ` <12370756754020-git-send-email-ilpo.jarvinen@helsinki.fi>
2009-03-16  3:11             ` [PATCH 7/7] tcp: make sure xmit goal size never becomes zero David Miller
2009-03-16  3:10         ` [PATCH 5/7] tcp: simplify tcp_current_mss David Miller
2009-03-15  0:23 [PATCH 1/7] tcp: remove pointless .dsack/.num_sacks code Ilpo Järvinen
2009-03-15  0:23 ` [PATCH 2/7] tcp: kill dead end_seq variable in clean_rtx_queue Ilpo Järvinen
2009-03-15  0:23   ` [PATCH 3/7] tcp: consolidate paws check Ilpo Järvinen
2009-03-15  0:23     ` [PATCH 4/7] tcp: don't check mtu probe completion in the loop Ilpo Järvinen
2009-03-15  0:23       ` [PATCH 5/7] tcp: simplify tcp_current_mss Ilpo Järvinen
2009-03-15  0:23         ` [PATCH 6/7] tcp: cache result of earlier divides when mss-aligning things Ilpo Järvinen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.