Re: [RFC v3 01/18] netmem: introduce struct netmem_desc mirroring struct page

From
Stefan Metzmacher <metze@samba.org>
Date
2025-06-03 09:23:19
Also in
bpf, linux-mm, linux-rdma, lkml
Reply to
Mina Almasry, 2025-05-30
Hi Mina,
quoted
Do you mean?

   struct net_iov {
     /* Union for anonymous aliasing: */
     union {
       struct netmem_desc desc;
       struct {
          unsigned long _flags;
          unsigned long pp_magic;
          struct page_pool *pp;
          unsigned long _pp_mapping_pad;
          unsigned long dma_addr;
          atomic_long_t pp_ref_count;
       };
     };
     struct net_iov_area *owner;
     enum net_iov_type type;
   };

Right?  If so, I will.
Yes, sounds good.

Also, maybe having a union with the same fields for anonymous aliasing
can be error prone if someone updates netmem_desc and forgets to
update the mirror in struct net_iov. If you can think of a way to deal
with that, great, if not lets maybe put a comment on top of struct
netmem_desc:
I haven't looked at the patch in detail, but to me it sounds
a bit like the checks io_uring_init is doing.

I hope this is in same way helpful here :-)

metze
Thread (28 messages) 28 messages, 5 authors, last reply 2025-06-03
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help