diff mbox series

[net-next,v1] memory-provider: disable building dmabuf mp on !CONFIG_PAGE_POOL

Message ID 20240913060746.2574191-1-almasrymina@google.com (mailing list archive)
State Accepted
Commit 26d7460222a0be34ff61a92a1fcc4469797ad937
Delegated to: Netdev Maintainers
Headers show
Series [net-next,v1] memory-provider: disable building dmabuf mp on !CONFIG_PAGE_POOL | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 16 this patch: 16
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 4 of 4 maintainers
netdev/build_clang success Errors and warnings before: 17 this patch: 17
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 22 this patch: 22
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-09-13--15-00 (tests: 764)

Commit Message

Mina Almasry Sept. 13, 2024, 6:07 a.m. UTC
When CONFIG_TRACEPOINTS=y but CONFIG_PAGE_POOL=n, we end up with this
build failure that is reported by the 0-day bot:

ld: vmlinux.o: in function `mp_dmabuf_devmem_alloc_netmems':
>> (.text+0xc37286): undefined reference to `__tracepoint_page_pool_state_hold'
>> ld: (.text+0xc3729a): undefined reference to `__SCT__tp_func_page_pool_state_hold'
>> ld: vmlinux.o:(__jump_table+0x10c48): undefined reference to `__tracepoint_page_pool_state_hold'
>> ld: vmlinux.o:(.static_call_sites+0xb824): undefined reference to `__SCK__tp_func_page_pool_state_hold'

The root cause is that in this configuration, traces are enabled but the
page_pool specific trace_page_pool_state_hold is not registered.

There is no reason to build the dmabuf memory provider when
CONFIG_PAGE_POOL is not present, as it's really a provider to the
page_pool.

In fact the whole NET_DEVMEM is RX path-only at the moment, so we can
make the entire config dependent on the PAGE_POOL.

Note that this may need to be revisited after/while devmem TX is
added,  as devmem TX likely does not need CONFIG_PAGE_POOL. For now this
build fix is sufficient.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202409131239.ysHQh4Tv-lkp@intel.com/
Signed-off-by: Mina Almasry <almasrymina@google.com>

---
 net/Kconfig | 1 +
 1 file changed, 1 insertion(+)

Comments

Simon Horman Sept. 13, 2024, 12:47 p.m. UTC | #1
On Fri, Sep 13, 2024 at 06:07:45AM +0000, Mina Almasry wrote:
> When CONFIG_TRACEPOINTS=y but CONFIG_PAGE_POOL=n, we end up with this
> build failure that is reported by the 0-day bot:
> 
> ld: vmlinux.o: in function `mp_dmabuf_devmem_alloc_netmems':
> >> (.text+0xc37286): undefined reference to `__tracepoint_page_pool_state_hold'
> >> ld: (.text+0xc3729a): undefined reference to `__SCT__tp_func_page_pool_state_hold'
> >> ld: vmlinux.o:(__jump_table+0x10c48): undefined reference to `__tracepoint_page_pool_state_hold'
> >> ld: vmlinux.o:(.static_call_sites+0xb824): undefined reference to `__SCK__tp_func_page_pool_state_hold'
> 
> The root cause is that in this configuration, traces are enabled but the
> page_pool specific trace_page_pool_state_hold is not registered.
> 
> There is no reason to build the dmabuf memory provider when
> CONFIG_PAGE_POOL is not present, as it's really a provider to the
> page_pool.
> 
> In fact the whole NET_DEVMEM is RX path-only at the moment, so we can
> make the entire config dependent on the PAGE_POOL.
> 
> Note that this may need to be revisited after/while devmem TX is
> added,  as devmem TX likely does not need CONFIG_PAGE_POOL. For now this
> build fix is sufficient.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202409131239.ysHQh4Tv-lkp@intel.com/
> Signed-off-by: Mina Almasry <almasrymina@google.com>

Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Simon Horman <horms@kernel.org> # build-tested
patchwork-bot+netdevbpf@kernel.org Sept. 13, 2024, 7 p.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Fri, 13 Sep 2024 06:07:45 +0000 you wrote:
> When CONFIG_TRACEPOINTS=y but CONFIG_PAGE_POOL=n, we end up with this
> build failure that is reported by the 0-day bot:
> 
> ld: vmlinux.o: in function `mp_dmabuf_devmem_alloc_netmems':
> >> (.text+0xc37286): undefined reference to `__tracepoint_page_pool_state_hold'
> >> ld: (.text+0xc3729a): undefined reference to `__SCT__tp_func_page_pool_state_hold'
> >> ld: vmlinux.o:(__jump_table+0x10c48): undefined reference to `__tracepoint_page_pool_state_hold'
> >> ld: vmlinux.o:(.static_call_sites+0xb824): undefined reference to `__SCK__tp_func_page_pool_state_hold'
> 
> [...]

Here is the summary with links:
  - [net-next,v1] memory-provider: disable building dmabuf mp on !CONFIG_PAGE_POOL
    https://git.kernel.org/netdev/net-next/c/26d7460222a0

You are awesome, thank you!
diff mbox series

Patch

diff --git a/net/Kconfig b/net/Kconfig
index 7574b066d7cd..a629f92dc86b 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -70,6 +70,7 @@  config NET_DEVMEM
 	def_bool y
 	depends on DMA_SHARED_BUFFER
 	depends on GENERIC_ALLOCATOR
+	depends on PAGE_POOL
 
 menu "Networking options"