Thread (20 messages) 20 messages, 5 authors, 27d ago

AW: [PATCH net-next v6 7/7] net: macb: introduce ndo_xdp_xmit support

From: Koehrer Mathias (ETAS-ICA/XPC-Fe1) <hidden>
Date: 2026-06-11 11:15:22

Hi,

within the function gem_xdp_xmit, there should be a call to "xdp_return_frame" for each successful processing in
"macb_xdp_submit_frame".
Otherwise, this driver does not work properly with Ethernet drivers that XDP_REDIRECT to this driver and use 
page_pools. In this case, the pages from the pools are not returned to the pool.

Best regards

Mathias
+static int gem_xdp_xmit(struct net_device *dev, int num_frame,
+                       struct xdp_frame **frames, u32 flags)
+{
+       struct macb *bp = netdev_priv(dev);
+       u32 xmitted = 0;
+       int i;
+
+       if (!macb_is_gem(bp))
+               return -EOPNOTSUPP;
+
+       if (unlikely(!netif_carrier_ok(dev)))
+               return -ENETDOWN;
+
+       if (unlikely(flags & ~XDP_XMIT_FLAGS_MASK))
+               return -EINVAL;
+
+       for (i = 0; i < num_frame; i++) {
+               if (macb_xdp_submit_frame(bp, frames[i], dev, true, 0))
+                       break;
+
+               xmitted++;
+       }
+
+       return xmitted;
+}
+
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help