aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKal Conley <[email protected]>2023-04-23 20:01:56 +0200
committerDaniel Borkmann <[email protected]>2023-04-27 22:24:51 +0200
commit6ec7be9a2d2b09815f69fc2183ec31857eaa6e27 (patch)
tree6bf5f263e108d9ec9e418a2d088de890834f700f /include
parenta4644119208444f84d9ffcd4d0af630046c2de98 (diff)
xsk: Use pool->dma_pages to check for DMA
Compare pool->dma_pages instead of pool->dma_pages_cnt to check for an active DMA mapping. pool->dma_pages needs to be read anyway to access the map so this compiles to more efficient code. Signed-off-by: Kal Conley <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Reviewed-by: Xuan Zhuo <[email protected]> Acked-by: Magnus Karlsson <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'include')
-rw-r--r--include/net/xsk_buff_pool.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/xsk_buff_pool.h b/include/net/xsk_buff_pool.h
index d318c769b445..a8d7b8a3688a 100644
--- a/include/net/xsk_buff_pool.h
+++ b/include/net/xsk_buff_pool.h
@@ -180,7 +180,7 @@ static inline bool xp_desc_crosses_non_contig_pg(struct xsk_buff_pool *pool,
if (likely(!cross_pg))
return false;
- return pool->dma_pages_cnt &&
+ return pool->dma_pages &&
!(pool->dma_pages[addr >> PAGE_SHIFT] & XSK_NEXT_PG_CONTIG_MASK);
}