Re: [Patch net-next v6 2/7] r8169: add support for multi rx queues
From: Jakub Kicinski
Date: Fri May 29 2026 - 14:09:54 EST
On Fri, 29 May 2026 06:47:00 +0000 Javen wrote:
> >> @@ -74,9 +74,13 @@
> >> #define NUM_TX_DESC 256 /* Number of Tx descriptor registers */
> >> #define NUM_RX_DESC 256 /* Number of Rx descriptor registers */
> >> #define R8169_TX_RING_BYTES (NUM_TX_DESC * sizeof(struct TxDesc))
> >> -#define R8169_RX_RING_BYTES (NUM_RX_DESC * sizeof(struct RxDesc))
> >> +#define R8169_RX_RING_BYTES ((NUM_RX_DESC + 1) * sizeof(struct
> >> +RxDesc))
> >
> >AI bots are asking why the "+ 1"?
>
> This + 1 is a workaround for the hardware DMA prefetcher. The H/W might aggressively fetch one more descriptor even after hitting the RingEnd mark. We allocated this extra dummy space as padding to prevent out-of-bounds access and potential IOMMU faults.
Add a brief comment explaining this please