Subject: Re: [PATCH net-next] net: cadence: macb: Implement BQL

From: Jakub Kicinski <[email-masked]>
Date: Tue, 18 Feb 2025 17:57:00 -0800

On Fri, 14 Feb 2025 16:16:43 -0500 Sean Anderson wrote:
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index 48496209fb16..63c65b4bb348 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -1081,6 +1081,9 @@ static void macb_tx_error_task(struct work_struct *work)
>  						      tx_error_task);
>  	bool			halt_timeout = false;
>  	struct macb		*bp = queue->bp;
> +	u32			queue_index = queue - bp->queues;

nit: breaking reverse xmas tree here

> +	u32			packets = 0;
> +	u32			bytes = 0;
>  	struct macb_tx_skb	*tx_skb;
>  	struct macb_dma_desc	*desc;
>  	struct sk_buff		*skb;

> @@ -3019,6 +3033,7 @@ static int macb_close(struct net_device *dev)
>  	netif_tx_stop_all_queues(dev);
>  
>  	for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue) {
> +		netdev_tx_reset_queue(netdev_get_tx_queue(dev, q));
>  		napi_disable(&queue->napi_rx);
>  		napi_disable(&queue->napi_tx);

I think you should reset after napi_disable()? 
Lest NAPI runs after the reset and tries to complete on an empty queue..
-- 
pw-bot: cr