Thread (41 messages) 41 messages, 9 authors, 2021-05-11

Re: [PATCH net-next v3 3/5] page_pool: Allow drivers to hint on SKB recycling

From: Matteo Croce <hidden>
Date: 2021-04-10 00:40:09
Also in: bpf, linux-mm, linux-rdma, lkml

On Sat, Apr 10, 2021 at 2:11 AM Ilias Apalodimas
[off-list ref] wrote:
Hi Matteo,

[...]
quoted
+bool page_pool_return_skb_page(void *data);
+
 struct page_pool *page_pool_create(const struct page_pool_params *params);

 #ifdef CONFIG_PAGE_POOL
@@ -243,4 +247,13 @@ static inline void page_pool_ring_unlock(struct page_pool *pool)
              spin_unlock_bh(&pool->ring.producer_lock);
 }

+/* Store mem_info on struct page and use it while recycling skb frags */
+static inline
+void page_pool_store_mem_info(struct page *page, struct xdp_mem_info *mem)
+{
+     u32 *xmi = (u32 *)mem;
+
I just noticed this changed from the original patchset I was carrying.
On the original, I had a union containing a u32 member to explicitly avoid
this casting. Let's wait for comments on the rest of the series, but i'd like
to change that back in a v4. Aplogies, I completely missed this on the
previous postings ...
Hi,

I had to change this because including net/xdp.h here caused a
circular dependency.
I think that the safest thing we can do is to use memcpy(), which will
handle the alignments correctly, depending on the architecture.

Cheers,
-- 
per aspera ad upstream
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help