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

From: Stefan Metzmacher
Date: Tue Jun 03 2025 - 05:24:04 EST


Hi Mina,

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