Thread (11 messages) 11 messages, 2 authors, 2026-03-05

Re: [net-next,v3,7/8] net: macb: add XDP support for gem

From: Paolo Abeni <pabeni@redhat.com>
Date: 2026-03-05 11:01:34

This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.

For local reproduction steps see https://netdev-ai.bots.linux.dev/ai-local.html
---
net: macb: add XDP support for gem

This commit introduces basic XDP support for the macb/gem driver,
implementing support for XDP_TX, XDP_PASS, XDP_DROP, and XDP_REDIRECT
verdicts.
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h
index 1ae80938331b..009a44e94726 100644
--- a/drivers/net/ethernet/cadence/macb.h
+++ b/drivers/net/ethernet/cadence/macb.h
[ ... ]
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index fc6ea1391846..152cbf5eb33a 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
[ ... ]
quoted hunk ↗ jump to hunk
@@ -3216,11 +3450,24 @@ static int macb_close(struct net_device *dev)
 	return 0;
 }

+static bool gem_xdp_valid_mtu(struct macb *bp, int mtu)
+{
+	return __gem_total_rx_buffer_size(gem_max_rx_data_size(mtu + bp->rx_ip_align),
+					  XDP_PACKET_HEADROOM) <= PAGE_SIZE;
+}
+
 static int macb_change_mtu(struct net_device *dev, int new_mtu)
 {
+	struct macb *bp = netdev_priv(dev);
+
 	if (netif_running(dev))
 		return -EBUSY;

+	if (rcu_access_pointer(bp->prog) && !gem_xdp_valid_mtu(bp, new_mtu)) {
+		netdev_err(dev, "MTU %d too large for XDP", new_mtu);
                                                               ^
This isn't a bug, but the format string is missing a trailing newline.
Every other netdev_err() call in this file ends with '\n', and without it
this message will be concatenated with the next kernel log line.
+		return -EINVAL;
+	}
+
 	WRITE_ONCE(dev->mtu, new_mtu);

 	return 0;
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help