Re: [PATCH net-next v8 09/15] ibmveth: Split RX poll into per-slot helpers for MQ

From
Jakub Kicinski <kuba@kernel.org>
Date
2026-11-17 01:40:23
Also in
linuxppc-dev
Reply to
Mingming Cao, 2026-11-09
On Mon,  9 Nov 2026 15:55:50 -0800 Mingming Cao wrote:
+	if (WARN_ON(queue_index < 0 ||
+		    queue_index >= adapter->num_rx_queues)) {
You add such checks all over the place, why?
The kernel coding style explicitly recommends against defensive
programming.
quoted hunk ↗ jump to hunk
+		if (budget)
+			napi_complete_done(napi, 0);
+		return 0;
+	}
+
+	if (ibmveth_poll_stopping(netdev, napi)) {
Why are you checking if the NAPI is stopping?
Maybe I missed it in the avalanche of words in the commit message,
you mention live resize, which I assume is patch 14. I don't get why
you need to explicitly check this, core already does.
quoted hunk ↗ jump to hunk
+		if (budget)
+			napi_complete_done(napi, 0);
+		return 0;
+	}
+
 	while (frames_processed < budget) {
+		if (ibmveth_poll_stopping(netdev, napi))
+			break;
+
 		if (!ibmveth_rxq_pending_buffer(adapter, queue_index))
 			break;
 
 		smp_rmb();
-		correlator = ibmveth_rxq_read_correlator(adapter, queue_index);
 		if (!ibmveth_rxq_buffer_valid(adapter, queue_index)) {
 			wmb(); /* suggested by larson1 */
-			adapter->rx_invalid_buffer++;
-			netdev_dbg(netdev, "recycling invalid buffer\n");
-			rc = ibmveth_rxq_harvest_buffer(adapter, queue_index,
-							correlator, true);
-			if (unlikely(rc)) {
-				netdev->stats.rx_dropped++;
+			if (ibmveth_poll_recycle_invalid(netdev, adapter,
+							 queue_index))
 				frames_processed++;
-				continue;
-			}
 		} else {
-			struct sk_buff *skb, *new_skb;
-			int length = ibmveth_rxq_frame_length(adapter,
-							      queue_index);
-			int offset = ibmveth_rxq_frame_offset(adapter,
-							      queue_index);
-			int csum_good = ibmveth_rxq_csum_good(adapter,
-							      queue_index);
-			int lrg_pkt = ibmveth_rxq_large_packet(adapter,
You should really factor out the pure code movement to a separate patch.
Thread (34 messages) 34 messages, 3 authors, last reply 19h ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help