netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Jason Xing <kerneljasonxing@gmail.com>,
	Jeroen de Borst <jeroendb@google.com>
Cc: netdev@vger.kernel.org, hramamurthy@google.com,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	willemb@google.com, Joshua Washington <joshwash@google.com>,
	Praveen Kaligineedi <pkaligineedi@google.com>
Subject: Re: [PATCH net-next v2 4/5] gve: implement DQO TX datapath for AF_XDP zero-copy
Date: Tue, 22 Jul 2025 11:32:00 +0200	[thread overview]
Message-ID: <534146d9-53b1-4b4a-8978-206f6ad4f77e@redhat.com> (raw)
In-Reply-To: <CAL+tcoBu0ZQzLA0MvwAzsYYpz=Z=xR7LiLmFwJUXcHFDvFZVPg@mail.gmail.com>

On 7/22/25 1:37 AM, Jason Xing wrote:
> On Thu, Jul 17, 2025 at 11:29 PM Jeroen de Borst <jeroendb@google.com> wrote:
>> +
>> +               pkt = gve_alloc_pending_packet(tx);
> 
> I checked gve_alloc_pending_packet() and noticed there is one slight
> chance to return NULL? If so, it will trigger a NULL dereference
> issue.

IIRC, a similar thing was already mentioned on an older patch. Still
IIRC, the trick is that there is a previous, successful call to
gve_has_avail_slots_tx_dqo() that ensures there are free TX packets
avail and operations racing in between on other CPUs could only add more
free pkts.

So the above looks safe to me.

Side note: since this looks like a recurrining topic, I guess it would
be nice a follow-up adding some comments above the relevant functions.

Thanks,

Paolo


  parent reply	other threads:[~2025-07-22  9:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-17 15:28 [PATCH net-next v2 0/5] gve: AF_XDP zero-copy for DQO RDA Jeroen de Borst
2025-07-17 15:28 ` [PATCH net-next v2 1/5] gve: deduplicate xdp info and xsk pool registration logic Jeroen de Borst
2025-07-17 15:28 ` [PATCH net-next v2 2/5] gve: merge xdp and xsk registration Jeroen de Borst
2025-07-17 15:28 ` [PATCH net-next v2 3/5] gve: keep registry of zc xsk pools in netdev_priv Jeroen de Borst
2025-07-17 15:28 ` [PATCH net-next v2 4/5] gve: implement DQO TX datapath for AF_XDP zero-copy Jeroen de Borst
2025-07-21 23:37   ` Jason Xing
2025-07-21 23:58     ` Jason Xing
2025-07-22  9:32     ` Paolo Abeni [this message]
2025-07-22 11:50       ` Jason Xing
2025-07-22 17:32       ` Harshitha Ramamurthy
2025-07-17 15:28 ` [PATCH net-next v2 5/5] gve: implement DQO RX datapath and control path " Jeroen de Borst
2025-07-22  9:50 ` [PATCH net-next v2 0/5] gve: AF_XDP zero-copy for DQO RDA patchwork-bot+netdevbpf

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=534146d9-53b1-4b4a-8978-206f6ad4f77e@redhat.com \
    --to=pabeni@redhat.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hramamurthy@google.com \
    --cc=jeroendb@google.com \
    --cc=joshwash@google.com \
    --cc=kerneljasonxing@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pkaligineedi@google.com \
    --cc=willemb@google.com \
    /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;
as well as URLs for NNTP newsgroup(s).