[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20171130180556.2913ecdb@cakuba.netronome.com>
Date: Thu, 30 Nov 2017 18:05:56 -0800
From: Jakub Kicinski <jakub.kicinski@...ronome.com>
To: Kirill Tkhai <ktkhai@...tuozzo.com>
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
oss-drivers@...ronome.com, alexei.starovoitov@...il.com,
daniel@...earbox.net, "Eric W . Biederman" <ebiederm@...ssion.com>
Subject: Re: [RFC] bpf: offload: report device information for offloaded
programs
Hi Kirill,
On Thu, 30 Nov 2017 16:19:13 +0300, Kirill Tkhai wrote:
> > @@ -164,6 +166,38 @@ int bpf_prog_offload_compile(struct bpf_prog *prog)
> > return bpf_prog_offload_translate(prog);
> > }
> >
> > +int bpf_prog_offload_info_fill(struct bpf_prog_info *info,
> > + struct bpf_prog *prog)
> > +{
> > + struct bpf_dev_offload *offload = prog->aux->offload;
> > + struct inode *ns_inode;
> > + struct path ns_path;
> > + struct net *net;
> > + int ret = 0;
> > + void *ptr;
> > +
> > + info->dev_bound = 1;
> > +
> > + rtnl_lock();
>
> rtnl_lock() is too big lock and it is already overused in kernel.
> Can't we use smaller lock in this driver to protect bpf_prog_offload_devs?
> I suppose rwlock would be appropriate for that.
>
> (Then, we may completely remove rtnl_lock() from bpf_prog_offload_init()
> and use readlocked dev_base_lock for __dev_get_by_index() instead and
> the new small_rwlock to link in the list.
>
> Not sure about bpf_prog_offload_verifier_prep() and bpf_prog_offload_translate()
> and which context expect net_device_ops->ndo_bpf users. Either they need rtnl
> or not).
Thanks for the comments, removing the use of rtnl_lock is definitely on
my todo list!
Powered by blists - more mailing lists