Re: [PATCH net-next 6/7] xsk: add helper to get &xdp_desc's DMA and meta pointer in one go

From: Jakub Kicinski
Date: Thu Dec 19 2024 - 22:51:13 EST


On Wed, 18 Dec 2024 18:44:34 +0100 Alexander Lobakin wrote:
> + ret = (typeof(ret)){
> + /* Same logic as in xp_raw_get_dma() */
> + .dma = (pool->dma_pages[addr >> PAGE_SHIFT] &
> + ~XSK_NEXT_PG_CONTIG_MASK) + (addr & ~PAGE_MASK),
> + };

This is quite ugly IMHO