BPF List
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Edward Cree <ecree.xilinx@gmail.com>
Cc: Yury Vostrikov <mon@unformed.ru>,
	bpf@vger.kernel.org, Martin Habets <habetsm.xilinx@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: NULL pointer deref inside xdp_do_flush due to bpf_net_ctx_get_all_used_flush_lists
Date: Tue, 1 Oct 2024 16:04:38 +0200	[thread overview]
Message-ID: <20241001140438.mq8L_5Zh@linutronix.de> (raw)
In-Reply-To: <09947f9d-0694-fad6-661a-0b24db9aa47a@gmail.com>

On 2024-10-01 15:01:25 [+0100], Edward Cree wrote:
> On 01/10/2024 14:36, Sebastian Andrzej Siewior wrote:
> > diff --git a/drivers/net/ethernet/sfc/efx_channels.c b/drivers/net/ethernet/sfc/efx_channels.c
> > index c9e17a8208a90..f3288e02c1bd8 100644
> > --- a/drivers/net/ethernet/sfc/efx_channels.c
> > +++ b/drivers/net/ethernet/sfc/efx_channels.c
> > @@ -1260,7 +1260,8 @@ static int efx_poll(struct napi_struct *napi, int budget)
> >  
> >  	spent = efx_process_channel(channel, budget);
> >  
> > -	xdp_do_flush();
> > +	if (spent)
> > +		xdp_do_flush();
> >  
> >  	if (spent < budget) {
> >  		if (efx_channel_has_rx_queue(channel) &&
> 
> Seems reasonable to me.
> Another alternative is to look at budget rather than spent,
>  as that seems like the condition that drives whether we
>  have a real XDP.

If you prefer. What are chances that you had budget but cleaned nothing?

> -ed

Sebastian

  reply	other threads:[~2024-10-01 14:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-01 11:30 NULL pointer deref inside xdp_do_flush due to bpf_net_ctx_get_all_used_flush_lists Yury Vostrikov
2024-10-01 13:36 ` Sebastian Andrzej Siewior
2024-10-01 14:01   ` Edward Cree
2024-10-01 14:04     ` Sebastian Andrzej Siewior [this message]
2024-10-01 13:36 ` Toke Høiland-Jørgensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241001140438.mq8L_5Zh@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=bpf@vger.kernel.org \
    --cc=ecree.xilinx@gmail.com \
    --cc=habetsm.xilinx@gmail.com \
    --cc=mon@unformed.ru \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox