[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221116124256.04a75fba@kernel.org>
Date: Wed, 16 Nov 2022 12:42:56 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Stanislav Fomichev <sdf@...gle.com>
Cc: bpf@...r.kernel.org, ast@...nel.org, daniel@...earbox.net,
andrii@...nel.org, martin.lau@...ux.dev, song@...nel.org,
yhs@...com, john.fastabend@...il.com, kpsingh@...nel.org,
haoluo@...gle.com, jolsa@...nel.org,
David Ahern <dsahern@...il.com>,
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
Subject: Re: [PATCH bpf-next 03/11] bpf: Support inlined/unrolled kfuncs for
xdp metadata
On Mon, 14 Nov 2022 19:02:02 -0800 Stanislav Fomichev wrote:
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 117e830cabb0..a2227f4f4a0b 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -9258,6 +9258,13 @@ static int dev_xdp_attach(struct net_device *dev, struct netlink_ext_ack *extack
> return -EOPNOTSUPP;
> }
>
> + if (new_prog &&
> + new_prog->aux->xdp_kfunc_ndo &&
> + new_prog->aux->xdp_kfunc_ndo != dev->netdev_ops) {
> + NL_SET_ERR_MSG(extack, "Cannot attach to a different target device");
> + return -EINVAL;
> + }
This chunk can go up into the large
if (new_prog) {
...
list of checks?
nit: aux->xdp_kfunc_ndo sounds like you're storing the kfunc NDO,
not all ndos. Throw in an 's' at the end, or some such?
Powered by blists - more mailing lists