Re: [PATCH] soc: fsl: qbman: flush the private memory before enabling QMan and BMan

From: Vladimir Oltean

Date: Fri Dec 04 2026 - 12:06:39 EST


On Fri, Dec 04, 2026 at 09:03:29AM -0500, Anthony Pighin wrote:
> Hi Vladimir,
>
> On Fri, Dec 04, 2026 at 12:35:23PM +0200, Vladimir Oltean wrote:
> > The fact is that I don't see how a zeroed FBPR could possibly fit your
> > symptoms.
>
> You are right. I tested it on an LS1043A with a private pool (BPID 1)
> of 4096 dummy addresses. I rewrote one stored FBPR in DRAM through a
> non-cacheable mapping, then drained the pool, with EMCI masked in
> ERR_IER so its status stayed latched:
>
> FBPR rewrite zero addresses EMCI buffers lost
> BP0-BP7 zeroed 8 no 0
> BP0-BP7 and FBPR_BPA zeroed 0 yes 3200
> BP0-BP7 and BPID zeroed 0 yes 2856
> all 64 bytes zeroed 0 yes 2904
>
> Each time, CEAR held the index of the FBPR I had rewritten. A zeroed
> FBPR drops the rest of the list and never yields zero addresses. The
> reproducer behind my commit message zeroed only BP0-BP7, which is the
> crafted case, so it does not support the field symptom. The BMan half
> of the patch has no basis, and I'll drop it.

If I'm right it also means your patch does not fix the bug you're
actually trying to track down, correct?

> > Did you ever reproduce this problem with the upstream driver
> > that you're patching?
>
> We hit it with the upstream dpaa_eth driver (fsl_dpa). The oops was on
> v5.15.135. The NULL buffer log is from v6.6.52, after we added the
> check, which only drops and logs.
>
> > You also didn't mention which interface was receiving traffic, and what
> > BPID it was using?
>
> mgmt/eth0, which is fm1-mac3 and the only DPAA interface on the board.
> Its bpids file reads 0.
>
> > To me, the more mundane explanation that
> > someone is handing buffers with address 0 to bman_release() seems
> > infinitely more likely than such an accidental corruption.
>
> Releasing address 0 does reproduce the symptom, but not by any path I
> can match to the field log. One all-zero FD enqueued to mgmt/eth0's Rx
> error FQ gave:
>
> fsl_dpaa_mac 1ae4000.ethernet mgmt: Err FD status = 0x00000000
> rx_default_dqrr(mgmt): NULL buffer! format=0, offset=256, length=590, status=0x4
>
> dpaa_fd_release() put address 0 into pool 0, and FMan received the next
> frame into it. But that path logs "Err FD status" first, mgmt/eth0's
> message level includes hw, and the field log has only the NULL buffer
> lines. An all-zero FD on a Tx FQ was dropped without releasing
> anything. I have not found what released the zero addresses on the
> failing boot.

There is clearly a misunderstanding here. I never said an all-zero frame
descriptor. I said the buffer address is zero. They are not one and the
same data structure. The FD is a QMan data structure, and its ADDRESS
field may point towards the address of a buffer that FMan acquired from
BMan on RX, or to something else (system memory that was never in BMan; a
scatter/gather table, etc).

I have no idea what "one all-zero FD enqueued to mgmt/eth0's Rx error FQ"
means and therefore what you tested.

I meant that inside the struct bm_buffer that gets passed to bman_release(),
the "hi" and "lo" fields (in a union with "data") are zero. That was my
suspicion. This way, a buffer address of 0 enters the BMan BPID that
fm1-mac3 uses, and FMan will acquire this buffer address when it
receives frames. No all-zero frame descriptor involved - none is needed.
The important caller of bman_release() is dpaa_bp_add_8_bufs(), called
from dpaa_bp_seed() and dpaa_eth_refill_bpool(). I am ignoring the other
callers from dpaa_fd_release(), those are just some opportunistic buffer
recycling schemes added for received packets that are otherwise errored
and their underlying buffers shouldn't be delivered to the network
stack, so what else to do better with them than to send them back to
BMan right away, shunting the kernel memory allocator. I was never
suspecting these other call paths, as there would have been other signs
you would have noticed first.

Anyway, the explanation from the previous paragraph is irrelevant,
because what I didn't take into consideration in my previous email is
the fact that bman_release() itself may be buggy, not the caller. That
you may tell it to release a valid buffer address in the pool and it
puts zero instead. After reviewing bman_release() itself, that seems
even more likely.

I have a suspicion that your problem may be fixed by the patch below.
Please try.

------------------------ >8 ------------------------