Skip to contentSkip to conversation

memory-provider: disable building dmabuf mp on !CONFIG_PAGE_POOL

PATCH Applied Mina Almasry 3 participants 3 messages Sep 13, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 memory-provider: disable building dmabuf mp on !CONFIG_PAGE_POOL

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':

Quoted 4 lines
Quoted 4 lines

(.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.

---
 net/Kconfig | 1 +
 1 file changed, 1 insertion(+)
net/Kconfig +1 -0
index 7574b066d7cd..a629f92dc86b 100644
@@ -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"
 
Signature · 1 line
2.46.0.662.g92d0881bb0-goog
reviewer Reviewed-by Tested-by on v1 1/1
#1 lore raw
Quoted 19 lines · Mina Almasry

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':

Quoted 4 lines
Quoted 4 lines

(.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.

Quoted 7 lines

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.

#2 lore raw
In reply to Mina Almasry
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 10 lines · 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':

Quoted 4 lines
Quoted 4 lines

(.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!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html