[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bd002756-3295-b708-e304-976d42dbf121@linux.dev>
Date: Thu, 5 Jan 2023 16:47:55 -0800
From: Martin KaFai Lau <martin.lau@...ux.dev>
To: Stanislav Fomichev <sdf@...gle.com>
Cc: ast@...nel.org, daniel@...earbox.net, andrii@...nel.org,
song@...nel.org, yhs@...com, john.fastabend@...il.com,
kpsingh@...nel.org, haoluo@...gle.com, jolsa@...nel.org,
David Ahern <dsahern@...il.com>,
Jakub Kicinski <kuba@...nel.org>,
Willem de Bruijn <willemb@...gle.com>,
Jesper Dangaard Brouer <brouer@...hat.com>,
Anatoly Burakov <anatoly.burakov@...el.com>,
Alexander Lobakin <alexandr.lobakin@...el.com>,
Magnus Karlsson <magnus.karlsson@...il.com>,
Maryam Tahhan <mtahhan@...hat.com>, xdp-hints@...-project.net,
netdev@...r.kernel.org, bpf@...r.kernel.org
Subject: Re: [PATCH bpf-next v6 07/17] bpf: XDP metadata RX kfuncs
On 1/4/23 1:59 PM, Stanislav Fomichev wrote:
> +void *bpf_dev_bound_resolve_kfunc(struct bpf_prog *prog, u32 func_id)
> +{
> + const struct xdp_metadata_ops *ops;
> + void *p = NULL;
> +
> + /* We don't hold bpf_devs_lock while resolving several
> + * kfuncs and can race with the unregister_netdevice().
> + * We rely on bpf_dev_bound_match() check at attach
> + * to render this program unusable.
> + */
> + down_read(&bpf_devs_lock);
> + if (!prog->aux->offload || !prog->aux->offload->netdev)
nit. !prog->aux->offload->netdev check is not needed. Testing
!prog->aux->offload should be as good.
Powered by blists - more mailing lists