Subject: Re: [PATCH net-next v2 2/2] net: macb: distribute evenly Tx SRAM segments

From: Jakub Kicinski <[email-masked]>
Date: Thu, 12 Mar 2026 18:30:14 -0700

On Wed, 11 Mar 2026 17:41:54 +0100 Théo Lebrun wrote:
> GEM has registers to configure the Tx SRAM segments distribution across
> queues. The reset value is apprioriate (even spread) but we need to
> care if/when number of active queues is modified (or if we inherited
> unevenly initialised hardware from bootloader).
> 
> To distribute segments, we take as input the number of queues
> (bp->num_queues) and the number of segments (found inside DCFG6).
> Its output is a number of segments for each queue, formatted as
> powers-of-two (eg 2 for queue 0 means it has 2^2=4 segments)

allmodconfig builds are not happy with whatever is going on here:

ld.lld: error: undefined symbol: gem_sram_distribute_segments
>>> referenced by macb_kunit.c:13 (drivers/net/ethernet/cadence/macb_kunit.c:13)
>>>               vmlinux.o:(macb_sram_segments_test)
>>> referenced by macb_kunit.c:51 (drivers/net/ethernet/cadence/macb_kunit.c:51)
>>>               vmlinux.o:(macb_sram_segments_gen_params)

ld.lld: error: undefined symbol: kunit_binary_assert_format
>>> referenced by macb_kunit.c:29 (drivers/net/ethernet/cadence/macb_kunit.c:29)
>>>               vmlinux.o:(macb_sram_segments_test)
>>> referenced by macb_kunit.c:34 (drivers/net/ethernet/cadence/macb_kunit.c:34)
>>>               vmlinux.o:(macb_sram_segments_test)

ld.lld: error: undefined symbol: __kunit_do_failed_assertion
>>> referenced by macb_kunit.c:29 (drivers/net/ethernet/cadence/macb_kunit.c:29)
>>>               vmlinux.o:(macb_sram_segments_test)
>>> referenced by macb_kunit.c:34 (drivers/net/ethernet/cadence/macb_kunit.c:34)
>>>               vmlinux.o:(macb_sram_segments_test)

ld.lld: error: undefined symbol: __kunit_abort
>>> referenced by macb_kunit.c:29 (drivers/net/ethernet/cadence/macb_kunit.c:29)
>>>               vmlinux.o:(macb_sram_segments_test)
>>> referenced by macb_kunit.c:34 (drivers/net/ethernet/cadence/macb_kunit.c:34)
>>>               vmlinux.o:(macb_sram_segments_test)