public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Alexei Starovoitov <ast@plumgrid•com>
To: Daniel Borkmann <daniel@iogearbox•net>, davem@davemloft•net
Cc: hannes@stressinduktion•org, netdev@vger•kernel.org,
	Chema Gonzalez <chema@google•com>
Subject: Re: [PATCH net-next 5/5] bpf: split state from prandom_u32() and consolidate {c,e}BPF prngs
Date: Wed, 7 Oct 2015 09:38:28 -0700	[thread overview]
Message-ID: <56154A84.5020206@plumgrid.com> (raw)
In-Reply-To: <2b3b623837d040c99186d76966c3524f17057745.1444224502.git.daniel@iogearbox.net>

On 10/7/15 6:43 AM, Daniel Borkmann wrote:
> +void bpf_user_rnd_init_once(void)
> +{
> +	prandom_init_once(&bpf_user_rnd_state);
> +}

here the helper is definitely needed, since it's called from two
places and we must make sure that prandom_init_once doesn't
duplicate its static_key in two places.
Probably makes sense to add a comment to do_once api that

do_once(func, arg);
do_once(func, arg);

is not equal to

void my_helper(void) { do_once(func, arg); }
my_helper();
my_helper();

For this patch:
Acked-by: Alexei Starovoitov <ast@plumgrid•com>

  reply	other threads:[~2015-10-07 16:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-07 13:43 [PATCH net-next 0/5] BPF/random32 updates Daniel Borkmann
2015-10-07 13:43 ` [PATCH net-next 1/5] net: move net_get_random_once to lib Daniel Borkmann
2015-10-07 13:43 ` [PATCH net-next 2/5] once: make helper generic for calling function once Daniel Borkmann
2015-10-07 16:16   ` Alexei Starovoitov
2015-10-07 21:00     ` Daniel Borkmann
2015-10-07 13:43 ` [PATCH net-next 3/5] random32: add prandom_seed_full_state helper Daniel Borkmann
2015-10-07 13:43 ` [PATCH net-next 4/5] random32: add prandom_init_once helper for own rngs Daniel Borkmann
2015-10-07 16:32   ` Alexei Starovoitov
2015-10-07 13:43 ` [PATCH net-next 5/5] bpf: split state from prandom_u32() and consolidate {c,e}BPF prngs Daniel Borkmann
2015-10-07 16:38   ` Alexei Starovoitov [this message]
2015-10-07 21:01     ` Daniel Borkmann

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=56154A84.5020206@plumgrid.com \
    --to=ast@plumgrid$(echo .)com \
    --cc=chema@google$(echo .)com \
    --cc=daniel@iogearbox$(echo .)net \
    --cc=davem@davemloft$(echo .)net \
    --cc=hannes@stressinduktion$(echo .)org \
    --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