Thread (8 messages) 8 messages, 3 authors, 2025-01-08

Re: [PATCH net-next v6 1/8] page_pool: introduce page_pool_get_pp() API

From: Jesper Dangaard Brouer <hawk@kernel.org>
Date: 2025-01-07 14:52:30
Also in: bpf, imx, intel-wired-lan, linux-mediatek, linux-rdma, linux-wireless, lkml, netdev

On 06/01/2025 14.01, Yunsheng Lin wrote:
 > introduce page_pool_get_pp() API to avoid caller accessing
 > page->pp directly.
 >
[...]
quoted hunk ↗ jump to hunk
diff --git a/include/net/page_pool/helpers.h b/include/net/page_pool/helpers.h
index 543f54fa3020..9c4dbd2289b1 100644
--- a/include/net/page_pool/helpers.h
+++ b/include/net/page_pool/helpers.h
@@ -83,6 +83,11 @@ static inline u64 *page_pool_ethtool_stats_get(u64 *data, const void *stats)
  }
  #endif
  
+static inline struct page_pool *page_pool_get_pp(struct page *page)
+{
+	return page->pp;
+}
IMHO the function name "page_pool_get_pp" is problematic. As calling it 
"get" indicate to me that we are taking some reference on the pp object. 
Is this you plan in later patches?

If it is simply a dereference of page->pp ... then we could call it 
page2pp ?
... but I'm uncertain why we need this change.

--Jesper

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help