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.

> +             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.

> +             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.

Reply via email to