Netdev List
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Daniel Machon <daniel.machon@microchip.com>,
	Horatiu Vultur <horatiu.vultur@microchip.com>,
	UNGLinuxDriver@microchip.com, Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	Stanislav Fomichev <sdf@fomichev.me>
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org
Subject: Re: [PATCH net] net: lan966x: return an error for XDP frames that are not queued
Date: Fri, 27 Nov 2026 10:06:39 +0100	[thread overview]
Message-ID: <d7c589fd-0faa-4f48-817e-66efee73185c@redhat.com> (raw)
In-Reply-To: <20261123-lan966x-xdp-xmit-errors-v1-1-f25b6661167d@microchip.com>

On 11/23/26 15:54, Daniel Machon wrote:
> lan966x_xdp_xmit() counts a frame as transmitted when
> lan966x_fdma_xmit_xdpf() returns 0, and its caller only returns the
> frames that were not counted.
> 
> Before this patch, lan966x_fdma_xmit_xdpf() returns NETDEV_TX_OK, which
> is 0, when an xdp_frame has less headroom than the IFH or when its DMA
> mapping fails, without queueing the frame. The frame is then counted as
> transmitted and never freed. An xdp_frame can have less headroom than
> the IFH when an XDP program grows the head of a frame with
> bpf_xdp_adjust_head() before redirecting it to a lan966x port.
> 
> Return -EINVAL and -ENOMEM in these cases, so that lan966x_xdp_xmit()
> stops and the frames that were not queued are returned to the caller.
> 
> Found by an AI code review agent. Reproduced on a lan9668 board with an
> XDP program that grows the head of each frame and redirects it to
> another lan966x port. With the fix the frames are returned to the
> caller.
> 
> Fixes: a825b611c7c1 ("net: lan966x: Add support for XDP_REDIRECT")
> Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
It's not clear to me if the issue addressed here is stats miscount
(should target net-next) or deterministic memory leak per packet.

Could you please clarify?

Thanks!

Paolo


      reply	other threads:[~2026-11-27  9:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 14:54 [PATCH net] net: lan966x: return an error for XDP frames that are not queued Daniel Machon
2026-11-27  9:06 ` Paolo Abeni [this message]

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=d7c589fd-0faa-4f48-817e-66efee73185c@redhat.com \
    --to=pabeni@redhat.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel.machon@microchip.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=hawk@kernel.org \
    --cc=horatiu.vultur@microchip.com \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sdf@fomichev.me \
    /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