lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0b43ded0-701c-475b-99af-72612a8afc3d@linux.dev>
Date: Wed, 30 Jul 2025 15:38:00 +0800
From: Kunwu Chan <kunwu.chan@...ux.dev>
To: Edward Cree <ecree.xilinx@...il.com>, Edward Cree <ecree@....com>,
 Paolo Abeni <pabeni@...hat.com>, Chenyuan Yang <chenyuan0y@...il.com>,
 andrew+netdev@...n.ch, davem@...emloft.net, edumazet@...gle.com,
 kuba@...nel.org, ast@...nel.org, daniel@...earbox.net, hawk@...nel.org,
 john.fastabend@...il.com, sdf@...ichev.me, lorenzo@...nel.org
Cc: netdev@...r.kernel.org, linux-net-drivers@....com, bpf@...r.kernel.org,
 zzjas98@...il.com
Subject: Re: [PATCH] sfc: handle NULL returned by xdp_convert_buff_to_frame()

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.”


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ