Re: [PATCH net-next v16 05/13] page_pool: devmem support

2024-07-11 Thread Jakub Kicinski
On Thu, 11 Jul 2024 13:57:01 -0700 Mina Almasry wrote: > > > Sorry none of those are only used by net/core/*. Pretty much all of > > > these are used by include/net/page_pool/helpers.h, and some have > > > callers in net/core/devmem.c or net/core/skbuff.c > > > > > > Would you like me to move these

Re: [PATCH net-next v16 05/13] page_pool: devmem support

2024-07-11 Thread Mina Almasry
On Wed, Jul 10, 2024 at 6:23 PM Jakub Kicinski wrote: > > On Wed, 10 Jul 2024 16:42:04 -0700 Mina Almasry wrote: > > > > +static inline void netmem_set_pp(netmem_ref netmem, struct page_pool > > > > *pool) > > > > +{ > > > > + __netmem_clear_lsb(netmem)->pp = pool; > > > > +} > > > > > > Why

Re: [PATCH net-next v16 05/13] page_pool: devmem support

2024-07-10 Thread Jakub Kicinski
On Wed, 10 Jul 2024 16:42:04 -0700 Mina Almasry wrote: > > > +static inline void netmem_set_pp(netmem_ref netmem, struct page_pool > > > *pool) > > > +{ > > > + __netmem_clear_lsb(netmem)->pp = pool; > > > +} > > > > Why is all this stuff in the main header? It's really low level. > > Please

Re: [PATCH net-next v16 05/13] page_pool: devmem support

2024-07-10 Thread Jakub Kicinski
On Wed, 10 Jul 2024 13:29:03 -0700 Mina Almasry wrote: > If we want to add __skb_frag_ref() support for net_iov I suggest something > like: > > diff --git a/include/linux/skbuff_ref.h b/include/linux/skbuff_ref.h > index 0f3c58007488a..02f7f4c7d4821 100644 > --- a/include/linux/skbuff_ref.h > +++

Re: [PATCH net-next v16 05/13] page_pool: devmem support

2024-07-10 Thread Mina Almasry
On Wed, Jul 10, 2024 at 9:49 AM Jakub Kicinski wrote: > > On Wed, 10 Jul 2024 00:17:38 + Mina Almasry wrote: > > +static inline struct net_iov *__netmem_clear_lsb(netmem_ref netmem) > > +{ > > + return (struct net_iov *)((__force unsigned long)netmem & ~NET_IOV); > > +} > > + > > +static i

Re: [PATCH net-next v16 05/13] page_pool: devmem support

2024-07-10 Thread Mina Almasry
On Wed, Jul 10, 2024 at 9:49 AM Jakub Kicinski wrote: > > On Wed, 10 Jul 2024 00:17:38 + Mina Almasry wrote: > > @@ -68,17 +107,103 @@ static inline netmem_ref page_to_netmem(struct page > > *page) > > > > static inline int netmem_ref_count(netmem_ref netmem) > > { > > + /* The non-pp r

Re: [PATCH net-next v16 05/13] page_pool: devmem support

2024-07-10 Thread Jakub Kicinski
On Wed, 10 Jul 2024 00:17:38 + Mina Almasry wrote: > @@ -68,17 +107,103 @@ static inline netmem_ref page_to_netmem(struct page > *page) > > static inline int netmem_ref_count(netmem_ref netmem) > { > + /* The non-pp refcount of net_iov is always 1. On net_iov, we only > + * suppor

[PATCH net-next v16 05/13] page_pool: devmem support

2024-07-09 Thread Mina Almasry
Convert netmem to be a union of struct page and struct netmem. Overload the LSB of struct netmem* to indicate that it's a net_iov, otherwise it's a page. Currently these entries in struct page are rented by the page_pool and used exclusively by the net stack: struct { unsigned long pp_mag