[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <35592824-6749-4fa4-89d9-2de9caccc695@gmail.com>
Date: Fri, 18 Jul 2025 10:18:41 +0100
From: Pavel Begunkov <asml.silence@...il.com>
To: Byungchul Park <byungchul@...com>, kernel test robot <lkp@...el.com>
Cc: 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 7/18/25 02:14, Byungchul Park wrote:
...>>>
>>> In file included from include/linux/container_of.h:5,
>>> from include/linux/list.h:5,
>>> from include/linux/timer.h:5,
>>> from include/linux/netdevice.h:24,
>>> from include/trace/events/xdp.h:8,
>>> from include/linux/bpf_trace.h:5,
>>> from include/net/libeth/xdp.h:7,
>>> from drivers/net/ethernet/intel/libeth/tx.c:6:
>>> include/net/libeth/xdp.h: In function 'libeth_xdp_prepare_buff':
>>>>> include/net/libeth/xdp.h:1295:23: warning: passing argument 1 of 'page_pool_page_is_pp' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
>>> pp_page_to_nmdesc(page)->pp->p.offset, len, true);
>>> ^~~~
>>> include/linux/build_bug.h:30:63: note: in definition of macro 'BUILD_BUG_ON_INVALID'
>>> #define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e))))
>>> ^
>>> include/net/netmem.h:301:2: note: in expansion of macro 'DEBUG_NET_WARN_ON_ONCE'
>>> DEBUG_NET_WARN_ON_ONCE(!page_pool_page_is_pp(p)); \
>>> ^~~~~~~~~~~~~~~~~~~~~~
>>> include/net/libeth/xdp.h:1295:5: note: in expansion of macro 'pp_page_to_nmdesc'
>>> pp_page_to_nmdesc(page)->pp->p.offset, len, true);
>>> ^~~~~~~~~~~~~~~~~
>>> In file included from arch/arm/include/asm/cacheflush.h:10,
>>> from include/linux/cacheflush.h:5,
>>> from include/linux/highmem.h:8,
>>> from include/linux/bvec.h:10,
>>> from include/linux/skbuff.h:17,
>>> from include/net/net_namespace.h:43,
>>> from include/linux/netdevice.h:38,
>>> from include/trace/events/xdp.h:8,
>>> from include/linux/bpf_trace.h:5,
>>> from include/net/libeth/xdp.h:7,
>>> from drivers/net/ethernet/intel/libeth/tx.c:6:
>>> 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.
>> How should we resolve the issue? Changing page_pool_page_is_pp() to
>> macro and using _Generic again looks too much. Or should we? Any idea?
page_pool_page_is_pp() doesn't change the page, just make the
argument const.
bool page_pool_page_is_pp(const struct page *page)
--
Pavel Begunkov
Powered by blists - more mailing lists