Re: [PATCH net 1/2] net: macb: reprogram TBQP after shuffling the TX ring on link-up

From: Théo Lebrun

Date: Fri Jul 10 2026 - 09:57:02 EST


Hello Kevin & Christian,

On Wed Jul 8, 2026 at 5:05 AM CEST, Kevin Hao wrote:
>> I agree that the TRM says the transmit pointer is reset while TE is low. My
>> question is whether this describes an internal pointer being reloaded from TBQP,
>> or whether TBQP itself is restored to the original ring base.
>
> The Zynq UltraScale TRM [1] describes the receive-buffer queue pointer as follows:
>
> An internal counter represents the receive-buffer queue pointer and it is not
> visible through the CPU interface.
>
> I could not find a similar description for the transmit-buffer queue pointer,
> but I believe it behaves the same way. From a software perspective, it should
> be safe to assume that the TBQP is reset to point to the start of the transmit
> descriptor list upon reset. This assumption is supported by the description
> of the transmit_q_ptr (GEM) Register [2]:
>
> Reading this register returns the location of the descriptor currently being accessed.
> Since the DMA handles two frames at once, this may not necessarily be pointing to the
> current frame being transmitted.
>
> [1] https://docs.amd.com/v/u/en-US/ug1085-zynq-ultrascale-trm
> [2] https://docs.amd.com/r/en-US/ug1087-zynq-ultrascale-registers/transmit_q_ptr-GEM-Register

For what it's worth, I agree with Kevin.

It should be rather easy to detect if the patch is needed, with more
logging. Dump TBQP before link-down & dump it at link-up. The code
expects TBQP to reset to the ring start automatically whereas this
commit message says the TBQP after link-up is some offset into the ring.

Lastly, the cover letter mentions that [PATCH 1/2] alone isn't enough.
But it doesn't mention that [PATCH 2/2] alone doesn't solve the issue.
This would be a useful test as well.

On Tue Jul 7, 2026 at 3:36 PM CEST, Taedcke, Christian wrote:
> Thank you for the quick review! This is my first Linux kernel
> contribution, so I appreciate your feedback here.

Welcome!

Thanks,

--
Théo Lebrun, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com