[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250528081737.GC28116@system.software.com>
Date: Wed, 28 May 2025 17:17:37 +0900
From: Byungchul Park <byungchul@...com>
To: Pavel Begunkov <asml.silence@...il.com>
Cc: Mina Almasry <almasrymina@...gle.com>, willy@...radead.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, kernel_team@...ynix.com, kuba@...nel.org,
ilias.apalodimas@...aro.org, harry.yoo@...cle.com, hawk@...nel.org,
akpm@...ux-foundation.org, davem@...emloft.net,
john.fastabend@...il.com, andrew+netdev@...n.ch, toke@...hat.com,
tariqt@...dia.com, edumazet@...gle.com, pabeni@...hat.com,
saeedm@...dia.com, leon@...nel.org, ast@...nel.org,
daniel@...earbox.net, david@...hat.com, lorenzo.stoakes@...cle.com,
Liam.Howlett@...cle.com, vbabka@...e.cz, rppt@...nel.org,
surenb@...gle.com, mhocko@...e.com, horms@...nel.org,
linux-rdma@...r.kernel.org, bpf@...r.kernel.org,
vishal.moola@...il.com
Subject: Re: [PATCH 01/18] netmem: introduce struct netmem_desc
struct_group_tagged()'ed on struct net_iov
On Wed, May 28, 2025 at 08:43:34AM +0100, Pavel Begunkov wrote:
> On 5/28/25 06:03, Byungchul Park wrote:
> ...>> Thus abstractly different things maybe should not share the same
> > > in-kernel struct.
> > >
> > > One thing that maybe could work is if struct net_iov has a field in it
> > > which tells us whether it's actually a struct page that can be passed
> > > to mm apis, or not a struct page which cannot be passed to mm apis.
> > >
> > > > Or I should introduce another struct
> > >
> > > maybe introducing another struct is the answer. I'm not sure. The net
> >
> > The final form should be like:
> >
> > struct netmem_desc {
> > struct page_pool *pp;
> > unsigned long dma_addr;
> > atomic_long_t ref_count;
> > };
> >
> > struct net_iov {
> > struct netmem_desc;
> > enum net_iov_type type;
> > struct net_iov_area *owner;
> > ...
> > };
> >
> > However, now that overlaying on struct page is required, struct
> > netmem_desc should be almost same as struct net_iov. So I'm not sure if
> > we should introduce struct netmem_desc as a new struct along with struct
> > net_iov.
>
> Yes, you should. Mina already explained that net_iov is not the same
> thing as the net specific sub-struct of the page. They have common
> fields, but there are also net_iov (memory provider) specific fields
> as well.
Okay then. I will introduce a separate struct, netmem_desc, that has
similar fields to net_iov, and related static assert for the offsets.
Byungchul
>
> --
> Pavel Begunkov
Powered by blists - more mailing lists