Re: [RFC mm v5 1/2] page_pool: check nmdesc->pp to see its usage as page pool for net_iov not page-backed

From: Byungchul Park
Date: Sun Nov 16 2025 - 23:27:15 EST


On Fri, Nov 14, 2025 at 05:23:18PM -0800, Jakub Kicinski wrote:
> On Wed, 12 Nov 2025 16:41:18 +0900 Byungchul Park wrote:
> > diff --git a/include/net/netmem.h b/include/net/netmem.h
> > index 651e2c62d1dd..b42d75ecd411 100644
> > --- a/include/net/netmem.h
> > +++ b/include/net/netmem.h
> > @@ -114,10 +114,21 @@ struct net_iov {
> > atomic_long_t pp_ref_count;
> > };
> > };
> > +
> > + unsigned int page_type;
> > struct net_iov_area *owner;
> > enum net_iov_type type;
>
> type is 4B already in net-next, so you may want to reorder @type
> with @owner to avoid a hole and increasing the struct size.

Sure. Better reorder them. I will. Thanks.

Byungchul

> Other than that LGTM!
>
> struct net_iov {
> union {
> struct netmem_desc desc; /* 0 48 */
> struct {
> long unsigned int _flags; /* 0 8 */
> long unsigned int pp_magic; /* 8 8 */
> struct page_pool * pp; /* 16 8 */
> long unsigned int _pp_mapping_pad; /* 24 8 */
> long unsigned int dma_addr; /* 32 8 */
> atomic_long_t pp_ref_count; /* 40 8 */
> }; /* 0 48 */
> }; /* 0 48 */
> struct net_iov_area * owner; /* 48 8 */
> enum net_iov_type type; /* 56 4 */
>
> /* size: 64, cachelines: 1, members: 3 */
> /* padding: 4 */
> };