Thread (20 messages) 20 messages, 5 authors, 2026-03-30

Re: [PATCH net-next v3 4/6] net: bcmgenet: add XDP_TX support

From: Nicolai Buchwitz <hidden>
Date: 2026-03-30 21:28:11
Also in: bpf, lkml

On 30.3.2026 20:15, Mohsin Bashir wrote:
quoted
+static bool
+bcmgenet_xdp_xmit_frame(struct bcmgenet_priv *priv,
+			struct xdp_frame *xdpf, bool dma_map)
+{
+	struct bcmgenet_tx_ring *ring = &priv->tx_rings[DESC_INDEX];
+	struct device *kdev = &priv->pdev->dev;
+	struct enet_cb *tx_cb_ptr;
+	dma_addr_t mapping;
+	unsigned int dma_len;
+	u32 len_stat;
+
+	spin_lock(&ring->lock);
+
So we acquire lock on per-packet basis on the XDP_TX path? Do you think 
we can batch this?
Patch 4 only has one caller so the lock inside was fine. Patch 5
adds ndo_xdp_xmit which needs batching, so it moves the lock out
to the callers. XDP_TX processes one frame at a time in NAPI context
so batching doesn't apply there.

Note: v5 of this series was posted two days ago [1].

[1] 
https://lore.kernel.org/netdev/20260328230513.415790-1-nb@tipi-net.de/ (local)

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