Subject: Re: [PATCH] Discard tcp out-of-order queue if system limit is reached

From: Stephen Hemminger <[email-masked]>
Date: Tue, 15 Apr 2008 08:22:59 -0700

On Tue, 15 Apr 2008 18:54:44 +0400
Vitaliy Gusev <[email-masked]> wrote:

> Hello!
> 
> tcp_prune_queue() doesn't prune an out-of-order queue if socket
> is under rcvbuf. However even if socket is under rcvbuf but system-wide limit is
> reached then skb cannot be queued. It can lead to deadlock situation as any skb that
> fills sequence hole is dropped.
> So discard out-of-order queue if system-wide limit is reached.
> 
> Signed-off-by: Vitaliy Gusev <[email-masked]>
> 
> ---
>  net/ipv4/tcp_input.c |   78 +++++++++++++++++++++++++++++++++----------------
>  1 files changed, 52 insertions(+), 26 deletions(-)
> 
> 
> diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
> index 5119856..bbb7d88 100644
> --- a/net/ipv4/tcp_input.c
> +++ b/net/ipv4/tcp_input.c
> @@ -3841,8 +3841,28 @@ static void tcp_ofo_queue(struct sock *sk)
>  	}
>  }
>  
> +static int tcp_prune_ofo_queue(struct sock *sk);
>  static int tcp_prune_queue(struct sock *sk);
>  
> +static inline int tcp_try_rmem_schedule(struct sock *sk, unsigned int size)

minor nit, current preferred style is to not use inline for used once functions,
the compiler will do it anyway.