On Fri, May 09, 2025 at 10:32:08AM -0700, Mina Almasry wrote:
Currently the only restriction on net_iov is that some of its fields
need to be cache aligned with some of the fields of struct page, but
Cache aligned? Do you mean alias (ie be at the same offset)?
What I would suggest here is, roughly:
1. Add a new struct:
struct netmem_desc {
unsigned long pp_magic;
struct page_pool *pp;
unsigned long _pp_mapping_pad;
unsigned long dma_addr;
atomic_long_t pp_ref_count;
};
2. Then update struct page to include this entry instead of the definitions:
struct page {
...
struct netmem_desc place_holder_1; /* for page pool */
...
}
No, the point is to move these fields out of struct page entirely.
At some point (probably this year), we'll actually kmalloc the netmem_desc
(and shrink struct page), but for now, it'll overlap the other fields
in struct page.
3. And update struct net_iov to also include netmem_desc:
struct net_iov {
struct netmem_desc desc;
struct net_iov_area *owner;
/* More net_iov specific fields in the future */
};
And drop patch 1 which does a rename.
Essentially netmem_desc can be an encapsulation of the shared fields
between struct page and struct net_iov.
That is not the goal.