All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Petlund <apetlund@simula.no>
To: Damian Lukowski <damian@tvk.rwth-aachen.de>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@helsinki.fi>,
	"Eric Dumazet" <eric.dumazet@gmail.com>,
	"Arnd Hannemann" <hannemann@nets.rwth-aachen.de>,
	LKML <linux-kernel@vger.kernel.org>,
	shemminger@vyatta.com, "David Miller" <davem@davemloft.net>,
	william.allen.simpson@gmail.com
Subject: Re: [net-next PATCH v2 2/3] net: TCP thin linear timeouts
Date: Tue, 09 Feb 2010 17:40:20 +0100	[thread overview]
Message-ID: <4B718FF4.6040906@simula.no> (raw)
In-Reply-To: <4B707901.50905@tvk.rwth-aachen.de>

On 02/08/2010 09:50 PM, Damian Lukowski wrote:
>>  out_reset_timer:
>> -	icsk->icsk_rto = min(icsk->icsk_rto << 1, TCP_RTO_MAX);
>> +	/* If stream is thin, use linear timeouts. Since 'icsk_backoff' is
>> +	 * used to reset timer, set to 0. Recalculate 'icsk_rto' as this
>> +	 * might be increased if the stream oscillates between thin and thick,
>> +	 * thus the old value might already be too high compared to the value
>> +	 * set by 'tcp_set_rto' in tcp_input.c which resets the rto without
>> +	 * backoff. Limit to TCP_THIN_LT_RETRIES before initiating exponential
>> +	 * backoff behaviour to avoid continue hammering linear-timeout 
>> +	 * retransmissions into a black hole*/
>> +	if ((tp->thin_lt || sysctl_tcp_force_thin_linear_timeouts) &&
>> +	    tcp_stream_is_thin(sk) && sk->sk_state == TCP_ESTABLISHED &&
>> +	    icsk->icsk_retransmits <= TCP_THIN_LT_RETRIES) {
>> +		icsk->icsk_backoff = 0;
> 
> Hi,
> I think, this value should be at least 1, as icsk_backoff
> might be decreased to -1 and used for bit-shifting in tcp_v4_err().
> A lower boundary check might be even better.

Hi

Thanks for the feedback.

As far as I can see, the check a couple of lines above the decrementation
stops the icsk->icsk_backoff from being decremented if already zero.
Beyond that I cannot find any more places where this situation may arise.
Please correct me if I'm wrong and a boundary check is indeed warranted.


Excerpt from tcp_ipv4.c
------------------
                if (seq != tp->snd_una  || !icsk->icsk_retransmits ||
                    !icsk->icsk_backoff)
                        break;

                icsk->icsk_backoff--;
                inet_csk(sk)->icsk_rto = __tcp_set_rto(tp) <<
                                         icsk->icsk_backoff;
------------------

Best regards,
Andreas

  reply	other threads:[~2010-02-09 16:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-08 14:25 [net-next PATCH v2 2/3] net: TCP thin linear timeouts Andreas Petlund
2010-02-08 20:50 ` Damian Lukowski
2010-02-09 16:40   ` Andreas Petlund [this message]
2010-02-10 17:33     ` Damian Lukowski
2010-02-09  6:31 ` Eric Dumazet
2010-02-10 13:49   ` Andreas Petlund

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=4B718FF4.6040906@simula.no \
    --to=apetlund@simula.no \
    --cc=damian@tvk.rwth-aachen.de \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=hannemann@nets.rwth-aachen.de \
    --cc=ilpo.jarvinen@helsinki.fi \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@vyatta.com \
    --cc=william.allen.simpson@gmail.com \
    /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.