RE: [PATCH net v2 1/1] i40e: xsk: advance next_to_clean on status descriptors

Sarkar, Tirthendu
2025-10-23T06:11:53Z

> From: Your Name <alessandro.d@gmail.com>
> Sent: 22 October 2025 21:58
>
> On Wed, Oct 22, 2025 at 05:41:06AM +0000, Sarkar, Tirthendu wrote:
> > > From: Jason Xing <kerneljasonxing@gmail.com>
> >
> > I believe the issue is not that status_descriptor is getting into
> > multi-buffer packet but not updating next_to_clean results in
> > I40E_DESC_UNUSED() to return incorrect values.
>
> I don't think this is true? next_to_clean can be < next_to_process by
> design, see
>
> if (next_to_process != next_to_clean)
> first = *i40e_rx_bi(rx_ring, next_to_clean);
>
> at the start of i40e_clean_rx_irq_zc. This condition is normal and means
> when we exited the function - for example because we ran out of budget -
> we were in the middle of a multi-buffer packet and now we must continue.
>

Ah, yes. Missed that. BTW, we won't run out of budget when we see status_descriptor or in the middle of a multi-buffer packet since those do not increase total_rx_packets.
However, if we see a status descriptor and no packets after that (size = 0), we will break the loop thus making next_to_clean and next_to_process out-of-sync with next_to_clean still pointing to status descriptor when we resume.

Thanks,
Tirthendu