All of lore.kernel.org
 help / color / mirror / Atom feed
From: Baruch Even <baruch@ev-en.org>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: [PATCH 3/3] Check num sacks in SACK fast path
Date: Sat, 27 Jan 2007 18:50:40 +0200	[thread overview]
Message-ID: <20070127165040.GD4829@galon.ev-en.org> (raw)
In-Reply-To: <20070127164702.GA4829@galon.ev-en.org>

When we check for SACK fast path make sure that we also have the same number of
SACK blocks in the cache and in the new SACK data. This prevents us from
mistakenly taking the cache data if the old data in the SACK cache is the same
as the data in the SACK block.

Signed-Off-By: Baruch Even <baruch@ev-en.org>

Index: 2.6-rc6/include/linux/tcp.h
===================================================================
--- 2.6-rc6.orig/include/linux/tcp.h	2007-01-27 15:06:02.000000000 +0200
+++ 2.6-rc6/include/linux/tcp.h	2007-01-27 15:19:04.000000000 +0200
@@ -317,6 +317,7 @@
 	struct tcp_sack_block selective_acks[4]; /* The SACKS themselves*/
 
 	struct tcp_sack_block recv_sack_cache[4];
+	u32     recv_sack_cache_size;
 
 	/* from STCP, retrans queue hinting */
 	struct sk_buff* lost_skb_hint;
Index: 2.6-rc6/net/ipv4/tcp_input.c
===================================================================
--- 2.6-rc6.orig/net/ipv4/tcp_input.c	2007-01-27 15:18:30.000000000 +0200
+++ 2.6-rc6/net/ipv4/tcp_input.c	2007-01-27 15:30:09.000000000 +0200
@@ -979,7 +979,8 @@
 	 * if the only SACK change is the increase of the end_seq of
 	 * the first block then only apply that SACK block
 	 * and use retrans queue hinting otherwise slowpath */
-	flag = 1;
+	flag = num_sacks == tp->recv_sack_cache_size;
+	tp->recv_sack_cache_size = num_sacks;
 	for (i = 0; i < num_sacks; i++) {
 		__u32 start_seq = sp[i].start_seq;
 		__u32 end_seq = sp[i].end_seq;

  parent reply	other threads:[~2007-01-27 16:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-27 16:47 [PATCH 0/3] Fix issues with SACK processing Baruch Even
2007-01-27 16:48 ` [PATCH 1/3] Advance fast path pointer for first block only Baruch Even
2007-01-27 16:49 ` [PATCH 2/3] Seperate DSACK from SACK fast path Baruch Even
2007-01-28  4:06   ` David Miller
2007-01-28  5:27     ` Baruch Even
2007-01-29  5:06       ` Herbert Xu
2007-01-29  5:28         ` David Miller
2007-01-27 16:50 ` Baruch Even [this message]
     [not found] <20070129071339.24050.21052.sendpatchset@galon.ev-en.org>
     [not found] ` <20070129071349.24050.56022.sendpatchset@galon.ev-en.org>
2007-01-31 20:52   ` [PATCH 3/3] Check num sacks in " David Miller
2007-02-01  7:22     ` Baruch Even
2007-02-01 22:38       ` David Miller
     [not found] <20070202144116.26863.3722.sendpatchset@galon.ev-en.org>
     [not found] ` <20070202144127.26863.97696.sendpatchset@galon.ev-en.org>
2007-02-05  7:38   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070127165040.GD4829@galon.ev-en.org \
    --to=baruch@ev-en.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.