Re: [PATCH] hw/net: cadence: Return current Cadence GEM queue pointers

Philippe Mathieu-Daudé <[email protected]>
Newsgroups org.nongnu.qemu-arm,org.nongnu.qemu-devel
Message-ID <[email protected]>
On 20/7/26 14:07, Bin Meng wrote:
> Cadence GEM queue pointer registers are programmed with the descriptor
> ring base, but reads return the descriptor currently being accessed.
> The model tracked the current positions separately while continuing to
> return the configured base.
> 
> The Linux macb driver uses the transmit queue pointer when recovering
> from a used-buffer interrupt. A stale priority-queue pointer can make
> the driver restart DMA before that queue handles its completion
> interrupt, causing queue 0 to repeatedly raise TX_USED.
> 
> The primary queue has had this mismatch since the initial model.
> Priority queue support later copied the same register-read behavior.
> 
> A single-queue machine usually handles TX_COMPLETE before TX_USED and
> empties the software queue before the restart check, which kept the
> issue hidden there.
> 
> Return the current RX and TX descriptor positions on queue-pointer reads
> and clear those positions on reset.
> 
> Fixes: e9f186e514a7 ("cadence_gem: initial version of device model")
> Fixes: 6710172501be ("cadence_gem: Add queue support")
> Cc: [email protected]
> Signed-off-by: Bin Meng <[email protected]>
> 
> ---
> 
>   hw/net/cadence_gem.c | 17 ++++++++++++++++-
>   1 file changed, 16 insertions(+), 1 deletion(-)

Reviewed-by: Philippe Mathieu-Daudé <[email protected]>

and queued, thanks.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.