BPF List
 help / color / mirror / Atom feed
From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: Marcin Knap <Marcin.Knap@vecima.com>
Cc: "Jakub Kicinski" <kuba@kernel.org>,
	"Tony Nguyen" <anthony.l.nguyen@intel.com>,
	"Przemek Kitszel" <przemyslaw.kitszel@intel.com>,
	"Andrew Lunn" <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Magnus Karlsson" <magnus.karlsson@intel.com>,
	"Stanislav Fomichev" <sdf@fomichev.me>,
	"Simon Horman" <horms@kernel.org>,
	"Alexei Starovoitov" <ast@kernel.org>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	"Jesper Dangaard Brouer" <hawk@kernel.org>,
	"John Fastabend" <john.fastabend@gmail.com>,
	"jtollet@cisco.com" <jtollet@cisco.com>,
	"intel-wired-lan@lists.osuosl.org"
	<intel-wired-lan@lists.osuosl.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"bpf@vger.kernel.org" <bpf@vger.kernel.org>,
	"Björn Töpel" <bjorn@kernel.org>,
	"Jason Xing" <kerneljasonxing@gmail.com>,
	"Nitin Shetty J" <nshettyj@marvell.com>,
	"Joshua Washington" <joshwash@google.com>,
	"Harshitha Ramamurthy" <hramamurthy@google.com>,
	"Sunil Goutham" <sgoutham@marvell.com>,
	"Geetha sowjanya" <gakula@marvell.com>,
	"Ratheesh Kannoth" <rkannoth@marvell.com>,
	"Subbaraya Sundeep" <sbhatta@marvell.com>,
	"Bharat Bhushan" <bbhushan2@marvell.com>
Subject: Re: [PATCH net v4] xsk: Do not free ZC Rx buffer when the Rx ring is full
Date: Thu, 12 Nov 2026 11:48:48 +0100	[thread overview]
Message-ID: <avWZkOvpKXVzpALX@boxer> (raw)
In-Reply-To: <DS4PPFFD8A841C21E59BFBD0D40DF2C5EA380702@DS4PPFFD8A841C2.namprd18.prod.outlook.com>

On Thu, Nov 12, 2026 at 07:58:51AM +0000, Marcin Knap wrote:
> >But what's the plan for fixing those redirect targets?
> >I think it'd be much better if we had one series which
> >addresses all the cases, which AI can review...
> >If there's consensus that xdp_convert_zc_to_xdp_frame()
> >can be trivially handled later let's document that (and
> >how) in the commit message?
> 
> Thanks for the review. I looked at the devmap/cpumap/ifindex path. The
> fix I have in mind is local to xdp_do_redirect(): for zero-copy buffers,
> copy into the new frame without freeing the ZC buffer, free the ZC
> buffer only once __xdp_do_redirect_frame() has succeeded, and free the
> copied frame on failure. That gives the same rule as the XSKMAP path
> after this patch (on error the caller still owns the buffer) and also
> fixes the leak of the copied page. xdp_convert_zc_to_xdp_frame() would
> stay as it is, since its XDP_TX users (e.g. mlx5) rely on it freeing
> the buffer.

Hmm. So it seems like currently, when we managed to properly copy from zc
the 'normal' page and redirect failed, we would interpret this as (based
on ice implementation, not sure about other zc drivers) ICE_XDP_CONSUMED
which would do another xsk_buff_free() which would be a no-op on this
xdp_buff at this point but 'normal' page would indeed leak?

> 
> I'm away from Monday for about a month and won't be able to drive that
> change and its review properly before then, so I'd rather keep this
> series to the XSKMAP fix and document the plan in the commit message,
> as you suggested. v5 will have that. I'm happy to pick up the redirect
> fix when I'm back, unless someone wants to take it earlier.
> 
> Regards,
> Marcin Knap

  reply	other threads:[~2026-11-12 10:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-09 11:01 [PATCH net v4] xsk: Do not free ZC Rx buffer when the Rx ring is full Marcin Knap via B4 Relay
2026-11-12  1:37 ` Jakub Kicinski
2026-11-12  7:58   ` Marcin Knap
2026-11-12 10:48     ` Maciej Fijalkowski [this message]
2026-11-12 12:01       ` Marcin Knap

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=avWZkOvpKXVzpALX@boxer \
    --to=maciej.fijalkowski@intel.com \
    --cc=Marcin.Knap@vecima.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=ast@kernel.org \
    --cc=bbhushan2@marvell.com \
    --cc=bjorn@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=gakula@marvell.com \
    --cc=hawk@kernel.org \
    --cc=horms@kernel.org \
    --cc=hramamurthy@google.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=john.fastabend@gmail.com \
    --cc=joshwash@google.com \
    --cc=jtollet@cisco.com \
    --cc=kerneljasonxing@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=nshettyj@marvell.com \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=rkannoth@marvell.com \
    --cc=sbhatta@marvell.com \
    --cc=sdf@fomichev.me \
    --cc=sgoutham@marvell.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