Re: [PATCH v2 14/15] net: rnpgbe: Add base rx function
From: Simon Horman <horms@kernel.org>
Date: 2025-07-22 14:14:33
Also in:
linux-doc, lkml
On Mon, Jul 21, 2025 at 07:32:37PM +0800, Dong Yibo wrote:
Initialize rx clean function. Signed-off-by: Dong Yibo <dong100@mucse.com>
...
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_lib.c b/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_lib.c
...
quoted hunk ↗ jump to hunk
@@ -299,12 +707,27 @@ static int rnpgbe_poll(struct napi_struct *napi, int budget) struct mucse_q_vector *q_vector = container_of(napi, struct mucse_q_vector, napi); struct mucse *mucse = q_vector->mucse; + int per_ring_budget, work_done = 0; bool clean_complete = true; struct mucse_ring *ring; - int work_done = 0; + int cleaned_total = 0;
cleaned_total is set but otherwise unused in this function. Flagged by Clang 20.1.8 builds with KCFLAGS=-Wunused-but-set-variable.
mucse_for_each_ring(ring, q_vector->tx)
clean_complete = rnpgbe_clean_tx_irq(q_vector, ring, budget);
+ if (q_vector->rx.count > 1)
+ per_ring_budget = max(budget / q_vector->rx.count, 1);
+ else
+ per_ring_budget = budget;
+
+ mucse_for_each_ring(ring, q_vector->rx) {
+ int cleaned = 0;
+
+ cleaned = rnpgbe_clean_rx_irq(q_vector, ring, per_ring_budget);
+ work_done += cleaned;
+ cleaned_total += cleaned;
+ if (cleaned >= per_ring_budget)
+ clean_complete = false;
+ }
if (!netif_running(mucse->netdev))
clean_complete = true;...
quoted hunk ↗ jump to hunk
@@ -871,6 +1323,8 @@ static int rnpgbe_setup_rx_resources(struct mucse_ring *rx_ring, memset(rx_ring->desc, 0, rx_ring->size); rx_ring->next_to_clean = 0; rx_ring->next_to_use = 0; + if (mucse_alloc_page_pool(rx_ring)
There is a trailing ')' missing from the line above.
+ goto err; return 0; err:
...