# 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 
- List: netdev
- Page: https://ratatoskr.run/netdev/2025/06/3077601
- Thread: https://ratatoskr.run/netdev/2025/05/3072748/t.md

```text
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

```
