Thread (13 messages) flat view 13 messages, 2 authors, 2025-08-26

Re: [v4, net-next 5/9] bng_en: Allocate packet buffers

From: ALOK TIWARI <hidden>
Date: 2025-08-26 15:21:34
Also in: lkml


On 8/26/2025 10:14 PM, Bhargava Marreddy wrote:
+static void bnge_alloc_one_rx_ring_netmem(struct bnge_net *bn,
+					  struct bnge_rx_ring_info *rxr,
+					  int ring_nr)
+{
+	u32 prod;
+	int i;
+
+	prod = rxr->rx_agg_prod;
+	for (i = 0; i < bn->rx_agg_ring_size; i++) {
+		if (bnge_alloc_rx_netmem(bn, rxr, prod, GFP_KERNEL)) {
+			netdev_warn(bn->netdev, "init'ed rx ring %d with %d/%d pages only\n",
+				    ring_nr, i, bn->rx_ring_size);
Looks good, but would bn->rx_agg_ring_size be more accurate here instead 
of bn->rx_ring_size? since this loop is allocating the AGG ring.
+			break;
+		}
+		prod = NEXT_RX_AGG(prod);
+	}
+	rxr->rx_agg_prod = prod;
+}

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