Thread (3 messages) 3 messages, 2 authors, 2025-08-14

Re: [PATCH net-next v4] net: mana: Use page pool fragments for RX buffers instead of full pages to improve memory efficiency.

From: Jakub Kicinski <kuba@kernel.org>
Date: 2025-08-13 23:48:48
Also in: bpf, linux-hyperv, linux-rdma, lkml

On Mon, 11 Aug 2025 15:29:19 -0700 Dipayaan Roy wrote:
-	if (apc->port_is_up)
+	if (apc->port_is_up) {
+		/* Re-create rxq's after xdp prog was loaded or unloaded.
+		 * Ex: re create rxq's to switch from full pages to smaller
+		 * size page fragments when xdp prog is unloaded and
+		 * vice-versa.
+		 */
+
+		/* Pre-allocate buffers to prevent failure in mana_attach */
+		err = mana_pre_alloc_rxbufs(apc, ndev->mtu, apc->num_queues);
+		if (err) {
+			NL_SET_ERR_MSG_MOD
+			    (extack,
+			    "XDP: Insufficient memory for tx/rx re-config");
This weird line breaking is not necessary, checkpatch understands that
string can go over line limit:

			NL_SET_ERR_MSG_MOD(extack,
					   "XDP: Insufficient memory for tx/rx re-config");
+			return err;
I think you already replaced the bpf program at this point? 
So the allocation should happen earlier. On failure changes
to the driver state should be undone.
-- 
pw-bot: cr
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help