netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: yanhaishuang@cmss.chinamobile.com
Cc: kuznet@ms2.inr.ac.ru, edumazet@google.com, weiwan@google.com,
	lucab@debian.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 2/3] ipv4: Namespaceify tcp_fastopen_key knob
Date: Tue, 26 Sep 2017 11:18:51 -0700 (PDT)	[thread overview]
Message-ID: <20170926.111851.1172660559080066162.davem@davemloft.net> (raw)
In-Reply-To: <F9EA5C4F-2306-4BC5-923A-3AB1D8F50FF1@cmss.chinamobile.com>

From: 严海双 <yanhaishuang@cmss.chinamobile.com>
Date: Tue, 26 Sep 2017 09:25:51 +0800

>> On 2017年9月26日, at 上午7:24, David Miller <davem@davemloft.net> wrote:
>> 
>> From: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
>> Date: Fri, 22 Sep 2017 21:48:43 +0800
>> 
>>> @@ -9,13 +9,18 @@
>>> #include <net/inetpeer.h>
>>> #include <net/tcp.h>
>>> 
>>> -struct tcp_fastopen_context __rcu *tcp_fastopen_ctx;
>>> -
>>> -static DEFINE_SPINLOCK(tcp_fastopen_ctx_lock);
>>> -
>>> -void tcp_fastopen_init_key_once(bool publish)
>>> +void tcp_fastopen_init_key_once(struct net *net)
>> 
>> Why did you remove the 'publish' logic from this function?
>> 
> 
> I think this logic is not necessary now, in proc_tcp_fastopen_key, I have removed 
> tcp_fastopen_init_key_once(false) where the ‘publish’ is false:
> 
> -		/* Generate a dummy secret but don't publish it. This
> -		 * is needed so we don't regenerate a new key on the
> -		 * first invocation of tcp_fastopen_cookie_gen
> -		 */
> -		tcp_fastopen_init_key_once(false);
> -		tcp_fastopen_reset_cipher(user_key, TCP_FASTOPEN_KEY_LENGTH);
> +		tcp_fastopen_reset_cipher(net, user_key, TCP_FASTOPEN_KEY_LENGTH);
> 
> It said we don't regenerate a new key on first invocation of tcp_fastopen_cookie_gen, 
> but in tcp_fastopen_cookie_gen,it didn’t  call tcp_fastopen_init_key_once since
> from commit dfea2aa654243 (tcp: Do not call tcp_fastopen_reset_cipher from interrupt context):
> 
> And in other places where call tcp_fastopen_init_key_once, the ‘publish’ is always true:

Ok, this simplification seems legitimate.

But it is unrelated to this namespacification.  So it should be in a separate patch,
and should be documented well in the commit message using the great explanation you
gave to me above.

Please respin this series, with this patch #2 split up into two changes.

Thank you.

  reply	other threads:[~2017-09-26 18:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-22 13:48 [PATCH v4 1/3] ipv4: Namespaceify tcp_fastopen knob Haishuang Yan
2017-09-22 13:48 ` [PATCH v4 2/3] ipv4: Namespaceify tcp_fastopen_key knob Haishuang Yan
2017-09-25 23:24   ` David Miller
2017-09-26  1:25     ` 严海双
2017-09-26 18:18       ` David Miller [this message]
2017-09-27  1:05         ` 严海双
2017-09-22 13:48 ` [PATCH v4 3/3] ipv4: Namespaceify tcp_fastopen_blackhole_timeout knob Haishuang Yan

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=20170926.111851.1172660559080066162.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucab@debian.org \
    --cc=netdev@vger.kernel.org \
    --cc=weiwan@google.com \
    --cc=yanhaishuang@cmss.chinamobile.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).