From: Kunwu Chan <kunwu.chan@linux.dev>
To: Edward Cree <ecree.xilinx@gmail.com>, Edward Cree <ecree@amd.com>,
Paolo Abeni <pabeni@redhat.com>,
Chenyuan Yang <chenyuan0y@gmail.com>,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, ast@kernel.org, daniel@iogearbox.net,
hawk@kernel.org, john.fastabend@gmail.com, sdf@fomichev.me,
lorenzo@kernel.org
Cc: netdev@vger.kernel.org, linux-net-drivers@amd.com,
bpf@vger.kernel.org, zzjas98@gmail.com
Subject: Re: [PATCH] sfc: handle NULL returned by xdp_convert_buff_to_frame()
Date: Wed, 30 Jul 2025 15:38:00 +0800 [thread overview]
Message-ID: <0b43ded0-701c-475b-99af-72612a8afc3d@linux.dev> (raw)
In-Reply-To: <4169cfd4-2231-417f-b091-d8fa2f73f176@gmail.com>
On 2025/7/28 22:28, Edward Cree wrote:
> On 25/07/2025 13:38, Kunwu Chan wrote:
>> Proposed refinement:
> ...
>> if (net_ratelimit())
>> netif_err(efx, rx_err, efx->net_dev,
>> - "XDP TX failed (%d)\n", err);
>> + "XDP TX failed (%d)%s\n", err,
>> + err == -ENOBUFS ? " [frame conversion]" : "");
> Unnecessary, since efx_xdp_tx_buffers() never returns ENOBUFS.
You're correct that efx_siena_xdp_tx_buffers() never returns -ENOBUFS,
and xdp_convert_buff_to_frame() returns NULL on failure.
Whether we need a log to distinguish where the errors come from?
+ if (unlikely(!xdpf))
+ err = -ENOBUFS;
+ else
+ err = efx_xdp_tx_buffers(efx, 1, &xdpf, true);
- err = efx_siena_xdp_tx_buffers(efx, 1, &xdpf, true);
if (unlikely(err != 1)) {
efx_siena_free_rx_buffers(rx_queue, rx_buf, 1);
if (net_ratelimit())
netif_err(efx, rx_err, efx->net_dev,
- "XDP TX failed (%d)\n", err);
+ "XDP TX failed (%d)%s\n", err,
+ err == -ENOBUFS ? " [xdp_convert_buff_to_frame]" :
"efx_siena_xdp_tx_buffers");
Just a personal thought.
>
>> channel->n_rx_xdp_bad_drops++;
>> - trace_xdp_exception(efx->net_dev, xdp_prog, xdp_act);
>> + if (err != -ENOBUFS)
>> + trace_xdp_exception(efx->net_dev, xdp_prog, xdp_act);
> Why prevent the tracepoint in this case??
You're correct, my mistake.
--
Thanks,
TAO.
---
“Life finds a way.”
next prev parent reply other threads:[~2025-07-30 7:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-23 0:32 [PATCH] sfc: handle NULL returned by xdp_convert_buff_to_frame() Chenyuan Yang
2025-07-24 9:57 ` Paolo Abeni
2025-07-25 10:11 ` Edward Cree
2025-07-25 12:38 ` Kunwu Chan
2025-07-26 19:56 ` Chenyuan Yang
2025-07-28 14:28 ` Edward Cree
2025-07-30 7:38 ` Kunwu Chan [this message]
2025-07-31 9:14 ` Jesper Dangaard Brouer
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=0b43ded0-701c-475b-99af-72612a8afc3d@linux.dev \
--to=kunwu.chan@linux.dev \
--cc=andrew+netdev@lunn.ch \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=chenyuan0y@gmail.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=ecree.xilinx@gmail.com \
--cc=ecree@amd.com \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-net-drivers@amd.com \
--cc=lorenzo@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@fomichev.me \
--cc=zzjas98@gmail.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).