[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070201072252.GX22455@galon.ev-en.org>
Date: Thu, 1 Feb 2007 09:22:52 +0200
From: Baruch Even <baruch@...en.org>
To: David Miller <davem@...emloft.net>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH 3/3] Check num sacks in SACK fast path
* David Miller <davem@...emloft.net> [070131 22:52]:
> From: Baruch Even <baruch@...en.org>
> Date: Mon, 29 Jan 2007 09:13:49 +0200
>
> > 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@...en.org>
>
> We could implement this without extra state, for example by
> clearing out the rest of the recv_sack_cache entries.
>
> We should never see a SACK block from sequence zero to zero,
> which would be an empty SACK block.
That would work as well at the cost of extra writing to memory for each
ack packet. Though I won't guess what is worse, the extra memory used or
the extra writing.
> Something like the following?
>
> diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
> index c26076f..84cd722 100644
> --- a/net/ipv4/tcp_input.c
> +++ b/net/ipv4/tcp_input.c
> @@ -999,6 +1001,10 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
> return 0;
> }
> }
> + for (; i <= 4; i++) {
That won't work though, the <= should be <, I've actually used
ARRAY_SIZE just to be on the safe side.
> + tp->recv_sack_cache[i].start_seq = 0;
> + tp->recv_sack_cache[i].end_seq = 0;
> + }
>
> if (flag)
> num_sacks = 1;
Baruch
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists