Re: [PATCH] sfc: handle NULL returned by xdp_convert_buff_to_frame()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux