[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250715134740.GA1341824@horms.kernel.org>
Date: Tue, 15 Jul 2025 14:47:40 +0100
From: Simon Horman <horms@...nel.org>
To: Mohsin Bashir <mohsin.bashr@...il.com>
Cc: netdev@...r.kernel.org, kuba@...nel.org, andrew+netdev@...n.ch,
davem@...emloft.net, edumazet@...gle.com, pabeni@...hat.com,
shuah@...nel.org, cratiu@...dia.com, noren@...dia.com,
cjubran@...dia.com, mbloch@...dia.com, jdamato@...tly.com,
gal@...dia.com, sdf@...ichev.me, ast@...nel.org,
daniel@...earbox.net, hawk@...nel.org, john.fastabend@...il.com,
nathan@...nel.org, nick.desaulniers+lkml@...il.com,
morbo@...gle.com, justinstitt@...gle.com, bpf@...r.kernel.org,
linux-kselftest@...r.kernel.org
Subject: Re: [PATCH net-next V4 1/5] net: netdevsim: hook in XDP handling
On Mon, Jul 14, 2025 at 02:03:48PM -0700, Mohsin Bashir wrote:
> From: Jakub Kicinski <kuba@...nel.org>
>
> Add basic XDP support by hooking in do_xdp_generic().
> This should be enough to validate most basic XDP tests.
>
> Signed-off-by: Jakub Kicinski <kuba@...nel.org>
> Signed-off-by: Mohsin Bashir <mohsin.bashr@...il.com>
> ---
> drivers/net/netdevsim/netdev.c | 19 ++++++++++++++++++-
> 1 file changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/netdevsim/netdev.c b/drivers/net/netdevsim/netdev.c
> index f316e44130f7..ab2cdbf968a7 100644
> --- a/drivers/net/netdevsim/netdev.c
> +++ b/drivers/net/netdevsim/netdev.c
> @@ -332,15 +332,32 @@ static int nsim_get_iflink(const struct net_device *dev)
> static int nsim_rcv(struct nsim_rq *rq, int budget)
> {
> struct net_device *dev = rq->napi.dev;
> + struct bpf_prog *xdp_prog;
> + struct netdevsim *ns;
> struct sk_buff *skb;
> unsigned int skblen;
> int i, ret;
>
> + ns = netdev_priv(dev);
> + xdp_prog = rcu_dereference(ns->xdp.prog);
I'm somewhat confused by this because ns->xdp.prog doesn't appear to be
protected by RCU.
Flagged by Sparse.
--
pw-bot: changes-requested
Powered by blists - more mailing lists