[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20171004224032.zofzqj7zzmrvn4gf@ast-mbp.dhcp.thefacebook.com>
Date: Wed, 4 Oct 2017 15:40:34 -0700
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Jakub Kicinski <kubakici@...pl>
Cc: Daniel Borkmann <daniel@...earbox.net>,
Eric Dumazet <eric.dumazet@...il.com>, dsahern@...il.com,
netdev@...r.kernel.org, oss-drivers@...ronome.com,
david.beckett@...ronome.com
Subject: Re: [RFC] bpf: remove global verifier state
On Wed, Oct 04, 2017 at 02:57:44PM -0700, Jakub Kicinski wrote:
> On Wed, 04 Oct 2017 21:13:47 +0200, Daniel Borkmann wrote:
> > On 10/04/2017 05:43 AM, Alexei Starovoitov wrote:
> > > On Tue, Oct 03, 2017 at 08:24:06PM -0700, Eric Dumazet wrote:
> > >> On Tue, 2017-10-03 at 19:52 -0700, Alexei Starovoitov wrote:
> > >>
> > >>> yep. looks great.
> > >>> Please test it and submit officially :)
> > >>> The commit aafe6ae9cee3 ("bpf: dynamically allocate digest scratch buffer")
> > >>> fixed the other case where we were relying on the above mutex.
> > >>> The only other spot to be adjusted is to add spin_lock/mutex or DO_ONCE() to
> > >>> bpf_get_skb_set_tunnel_proto() to protect md_dst init.
> > >>> imo that would be it.
> > >>> Daniel, anything else comes to mind?
> >
> > Yes, this should be all. DO_ONCE() for the tunnel proto seems a
> > good choice.
>
> Hm. I actually did:
>
> if (!dst) {
> tmp = alloc();
> if (!tmp)
> return;
> if (cmpxchg(&dst, NULL, tmp))
> free(tmp);
> }
>
> I don't like how DO_ONCE() doesn't handle errors from the init
> function :(
yeah. good point.
Above looks good to me.
Powered by blists - more mailing lists