page_pool: check for DMA sync shortcut earlier
authorAlexander Lobakin <aleksander.lobakin@intel.com>
Tue, 7 May 2024 11:20:25 +0000 (13:20 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 8 May 2024 06:51:20 +0000 (08:51 +0200)
commit4321de4497b24fbf22389331f4ecd4039a451aa9
treee0f76978ed7a9adc527fdbb21ebe59df449cdf9d
parent403f11ac9ab72fc3bee0b8c80c16e33212ea8cd9
page_pool: check for DMA sync shortcut earlier

We can save a couple more function calls in the Page Pool code if we
check for dma_need_sync() earlier, just when we test pp->p.dma_sync.
Move both these checks into an inline wrapper and call the PP wrapper
over the generic DMA sync function only when both are true.
You can't cache the result of dma_need_sync() in &page_pool, as it may
change anytime if an SWIOTLB buffer is allocated or mapped.

Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
net/core/page_pool.c