[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250721010313.GA21807@system.software.com>
Date: Mon, 21 Jul 2025 10:03:13 +0900
From: Byungchul Park <byungchul@...com>
To: Pavel Begunkov <asml.silence@...il.com>
Cc: kernel test robot <lkp@...el.com>, willy@...radead.org,
netdev@...r.kernel.org, oe-kbuild-all@...ts.linux.dev,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
kernel_team@...ynix.com, almasrymina@...gle.com,
ilias.apalodimas@...aro.org, harry.yoo@...cle.com,
akpm@...ux-foundation.org, andrew+netdev@...n.ch, toke@...hat.com,
david@...hat.com, Liam.Howlett@...cle.com, vbabka@...e.cz,
rppt@...nel.org, surenb@...gle.com, mhocko@...e.com,
linux-rdma@...r.kernel.org, bpf@...r.kernel.org,
vishal.moola@...il.com, hannes@...xchg.org, ziy@...dia.com,
jackmanb@...gle.com, wei.fang@....com, shenwei.wang@....com,
xiaoning.wang@....com, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org
Subject: Re: [Intel-wired-lan] [PATCH net-next v11 12/12] libeth: xdp: access
->pp through netmem_desc instead of page
On Fri, Jul 18, 2025 at 10:32:38AM +0100, Pavel Begunkov wrote:
> On 7/18/25 10:18, Pavel Begunkov wrote:
> > On 7/18/25 02:14, Byungchul Park wrote:
> ...>>>> include/linux/mm.h:4176:54: note: expected 'struct page *' but argument is of type 'const struct page *'
> > > > > static inline bool page_pool_page_is_pp(struct page *page)
> > > > > ~~~~~~~~~~~~~^~~~
> > > >
> > > > Oh. page_pool_page_is_pp() in the mainline code already has this issue
> > > > that the helper cannot take const struct page * as argument.
> >
> > Probably not, and probably for wrong reasons. netmem_ref is define
> > as an integer, compilers cast away such const unlike const pointers.
>
> Taking a look libeth, at least at the reported spot it does
> page->pp->p.offset, that should be fine. And your problem
> is caused by the is_pp check in pp_page_to_nmdesc().
Exactly, but you asked me to add the check,
DEBUG_NET_WARN_ON_ONCE(!page_pool_page_is_pp(p)) in pp_page_to_nmdesc().
What I meant was, in order to apply that, page_pool_page_is_pp() should
take 'const struct page *' as argument.
I think it's good idea to change the proto type like, as you said:
static inline bool page_pool_page_is_pp(const struct page *page);
Thanks.
Byungchul
>
> --
> Pavel Begunkov
>
Powered by blists - more mailing lists