[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHS8izOb59+Z4phe=nJNVOTjOy2HByuh4N-RBgJd5dvhLC9F0A@mail.gmail.com>
Date: Mon, 6 Jan 2025 14:17:49 -0800
From: Mina Almasry <almasrymina@...gle.com>
To: Pavel Begunkov <asml.silence@...il.com>
Cc: Jakub Kicinski <kuba@...nel.org>, David Wei <dw@...idwei.uk>, io-uring@...r.kernel.org,
netdev@...r.kernel.org, Jens Axboe <axboe@...nel.dk>, Paolo Abeni <pabeni@...hat.com>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jesper Dangaard Brouer <hawk@...nel.org>, David Ahern <dsahern@...nel.org>,
Stanislav Fomichev <stfomichev@...il.com>, Joe Damato <jdamato@...tly.com>,
Pedro Tammela <pctammela@...atatu.com>
Subject: Re: [PATCH net-next v9 08/20] net: expose page_pool_{set,clear}_pp_info
On Thu, Jan 2, 2025 at 8:20 AM Pavel Begunkov <asml.silence@...il.com> wrote:
>
> On 12/21/24 02:23, Jakub Kicinski wrote:
> > On Sat, 21 Dec 2024 01:07:44 +0000 Pavel Begunkov wrote:
> >>>> Memory providers need to set page pool to its net_iovs on allocation, so
> >>>> expose page_pool_{set,clear}_pp_info to providers outside net/.
> >>>
> >>> I'd really rather not expose such low level functions in a header
> >>> included by every single user of the page pool API.
> >>
> >> Are you fine if it's exposed in a new header file?
> >
> > I guess.
> >
> > I'm uncomfortable with the "outside net/" phrasing of the commit
> > message. Nothing outside net should used this stuff. Next we'll have
> > a four letter subsystem abusing it and claiming that it's in a header
> > so it's a public.
>
> By net/ I purely meant the folder, even though it also dictates
> the available API. io_uring is outside, having some glue API
> between them is the only way I can think of, even if it looks
> different from the current series.
>
> Since there are strong opinions would make sense to shove it into
> a new file and name helpers more appropriately, like net_mp_*.
>
I guess I'm a bit sorry here because I think I suggested this
approach. I think the root of the issue is that the io_uring memory
provider (and future mps) need to set_pp_info/clear_pp_info the
netmems. dmabuf mp has no issue because it's defined under net/core so
it can easily include net/core/page_pool_priv.h.
I guess more options I see here are:
1. move the io_uring mp to somewhere under net/core. Moving only the
mp should be sufficient here I think.
2. Do some mp refactor such that the mp gives the page_pool the
netmems but the page_pool is responsible for
set_pp_info/clear_pp_info.
3. Revert back to earlier versions of the code where page_pool.c
exposed a helper that did all the memory processing. I had pushed back
against that version of the code because the helper seemed like
io_uring mp specific code masquerading as a generic helper that wasn't
very reusable :shrug:
For what little it's worth I'm having trouble imagining how
set_pp_info/clear_pp_info can be abused if exposed, so this approach
is fine by me, but I'm probably missing something if there is huge
concern about this.
--
Thanks,
Mina
Powered by blists - more mailing lists