public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Lawrence Brakmo <brakmo@fb•com>
To: Eric Dumazet <eric.dumazet@gmail•com>
Cc: netdev <netdev@vger•kernel.org>, Kernel Team <Kernel-team@fb•com>
Subject: Re: [PATCH net-next] tcp: Change txhash on every SYN and RTO retransmit
Date: Tue, 27 Sep 2016 23:07:53 +0000	[thread overview]
Message-ID: <D4102B75.1F212%brakmo@fb.com> (raw)
In-Reply-To: <1474993790.28155.60.camel@edumazet-glaptop3.roam.corp.google.com>

Eric, thank you for comments. V2 should be out shortly.

Thanks!

On 9/27/16, 9:29 AM, "netdev-owner@vger•kernel.org on behalf of Eric
Dumazet" <netdev-owner@vger•kernel.org on behalf of
eric.dumazet@gmail•com> wrote:

>On Tue, 2016-09-27 at 09:06 -0700, Lawrence Brakmo wrote:
>> The current code changes txhash (flowlables) on every retransmitted
>> SYN/ACK, but only after the 2nd retransmitted SYN and only after
>> tcp_retries1 RTO retransmits.
>> 
>> With this patch:
>> 1) txhash is changed with every SYN retransmist
>> 2) adds the option for the txhash to be changed before tcp_retries1
>>    RTO retransmits. A new sysctl tcp_rto_txhash_prob represents the
>>    probability that txhash will be changed. The default value is 0
>>    which maintains previous behavior and a value of 100 will always
>>    change it.
>
>...
>
>> @@ -213,6 +215,11 @@ static int tcp_write_timeout(struct sock *sk)
>>  			tcp_mtu_probing(icsk, sk);
>>  
>>  			dst_negative_advice(sk);
>> +		} else if (sk->sk_txhash && sysctl_tcp_rto_txhash_prob > 0) {
>> +			u32 v = prandom_u32() % 100;
>> +
>> +			if (v < sysctl_tcp_rto_txhash_prob)
>> +				sk_set_txhash(sk);
>>  
>
>Write timeouts are rare events and sk_txhash should already be set.
>
>Also prandom_u32_max() is a bit faster (no divide, and even no multiply
>for 100 which is 5*5*4, compiler can emit 2 lea instructions )
>
>I would suggest not using all these tests and instead be very simple :
>
> 	} else if (prandom_u32_max(100) < sysctl_tcp_rto_txhash_prob) {
>		sk_set_txhash(sk);
>	}
>
>Finally, adding a new sysctl requires a Documentation update
>( Documentation/networking/ip-sysctl.txt )
>
>Thanks.
>
>
>

      reply	other threads:[~2016-09-27 23:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-27 16:06 [PATCH net-next] tcp: Change txhash on every SYN and RTO retransmit Lawrence Brakmo
2016-09-27 16:29 ` Eric Dumazet
2016-09-27 23:07   ` Lawrence Brakmo [this message]

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=D4102B75.1F212%brakmo@fb.com \
    --to=brakmo@fb$(echo .)com \
    --cc=Kernel-team@fb$(echo .)com \
    --cc=eric.dumazet@gmail$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox