netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v1] page_pool: check for dma_sync_size earlier
@ 2024-10-10 11:40 Furong Xu
  2024-10-10 11:53 ` Yunsheng Lin
  0 siblings, 1 reply; 17+ messages in thread
From: Furong Xu @ 2024-10-10 11:40 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: Jesper Dangaard Brouer, Ilias Apalodimas, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, xfr, Furong Xu

Setting dma_sync_size to 0 is not illegal, and several drivers already did.
We can save a couple of function calls if check for dma_sync_size earlier.

Signed-off-by: Furong Xu <0x1207@gmail.com>
---
 net/core/page_pool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/page_pool.c b/net/core/page_pool.c
index a813d30d2135..fac52ba3f7c4 100644
--- a/net/core/page_pool.c
+++ b/net/core/page_pool.c
@@ -454,7 +454,7 @@ page_pool_dma_sync_for_device(const struct page_pool *pool,
 			      netmem_ref netmem,
 			      u32 dma_sync_size)
 {
-	if (pool->dma_sync && dma_dev_need_sync(pool->p.dev))
+	if (dma_sync_size && pool->dma_sync && dma_dev_need_sync(pool->p.dev))
 		__page_pool_dma_sync_for_device(pool, netmem, dma_sync_size);
 }
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2024-10-16  9:09 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-10 11:40 [PATCH net-next v1] page_pool: check for dma_sync_size earlier Furong Xu
2024-10-10 11:53 ` Yunsheng Lin
2024-10-11  2:14   ` Furong Xu
2024-10-11  5:06     ` Ilias Apalodimas
2024-10-11  6:31       ` Furong Xu
2024-10-11  8:55         ` Yunsheng Lin
2024-10-11  9:26           ` Furong Xu
2024-10-11 15:49             ` Jakub Kicinski
2024-10-11 12:13           ` Ilias Apalodimas
2024-10-12  6:14             ` Yunsheng Lin
2024-10-14  6:35               ` Furong Xu
2024-10-14 12:38                 ` Yunsheng Lin
2024-10-15  7:43                   ` Ilias Apalodimas
2024-10-15 11:06                     ` Yunsheng Lin
2024-10-15 13:25                       ` Ilias Apalodimas
2024-10-16  2:32                         ` Furong Xu
2024-10-16  9:09                         ` Yunsheng Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).