Netdev List
 help / color / mirror / Atom feed
* [PATCH] rtase: Reset TX subqueue when clearing TX ring
@ 2026-06-01  6:24 Justin Lai
  2026-06-01 13:19 ` Alexander Lobakin
  0 siblings, 1 reply; 3+ messages in thread
From: Justin Lai @ 2026-06-01  6:24 UTC (permalink / raw)
  To: kuba
  Cc: davem, edumazet, pabeni, andrew+netdev, linux-kernel, netdev,
	horms, pkshih, larry.chiu, Justin Lai

rtase_tx_clear() clears the TX ring and resets the ring indexes.
However, the TX queue state and BQL accounting are not reset at
the same time.

This may leave __QUEUE_STATE_STACK_XOFF asserted after
rtase_sw_reset(), preventing new TX packets from being scheduled.

Reset the TX subqueue when clearing the TX ring so the TX queue
state and BQL accounting are restored together.

Signed-off-by: Justin Lai <justinlai0215@realtek.com>
---
 drivers/net/ethernet/realtek/rtase/rtase_main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/realtek/rtase/rtase_main.c b/drivers/net/ethernet/realtek/rtase/rtase_main.c
index 43a4aa275b62..11e9d0feea68 100644
--- a/drivers/net/ethernet/realtek/rtase/rtase_main.c
+++ b/drivers/net/ethernet/realtek/rtase/rtase_main.c
@@ -240,6 +240,8 @@ static void rtase_tx_clear(struct rtase_private *tp)
 		rtase_tx_clear_range(ring, ring->dirty_idx, RTASE_NUM_DESC);
 		ring->cur_idx = 0;
 		ring->dirty_idx = 0;
+
+		netdev_tx_reset_subqueue(tp->dev, i);
 	}
 }
 
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] rtase: Reset TX subqueue when clearing TX ring
  2026-06-01  6:24 [PATCH] rtase: Reset TX subqueue when clearing TX ring Justin Lai
@ 2026-06-01 13:19 ` Alexander Lobakin
  2026-06-02 10:06   ` Justin Lai
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Lobakin @ 2026-06-01 13:19 UTC (permalink / raw)
  To: Justin Lai
  Cc: kuba, davem, edumazet, pabeni, andrew+netdev, linux-kernel,
	netdev, horms, pkshih, larry.chiu

From: Justin Lai <justinlai0215@realtek.com>
Date: Mon, 1 Jun 2026 14:24:18 +0800

> rtase_tx_clear() clears the TX ring and resets the ring indexes.
> However, the TX queue state and BQL accounting are not reset at
> the same time.
> 
> This may leave __QUEUE_STATE_STACK_XOFF asserted after
> rtase_sw_reset(), preventing new TX packets from being scheduled.
> 
> Reset the TX subqueue when clearing the TX ring so the TX queue
> state and BQL accounting are restored together.
> 
> Signed-off-by: Justin Lai <justinlai0215@realtek.com>

You need to:

1. Specify the target branch in the subject prefix ([PATCH net]
   for critical fixes, [PATCH net-next] for features and misc
   non-critical fixes and improvements).
2. If this is a fix targeting "net", you need to provide a "Fixes:"
   tag pointing to the commit which introduced this issue.
3. If this is a fix and the bug is present in older supported kernels
   (LTSes etc), you need to add "Cc: stable@vger.kernel.org" right
   after the "Fixes:" tag.

> ---
>  drivers/net/ethernet/realtek/rtase/rtase_main.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/ethernet/realtek/rtase/rtase_main.c b/drivers/net/ethernet/realtek/rtase/rtase_main.c
> index 43a4aa275b62..11e9d0feea68 100644
> --- a/drivers/net/ethernet/realtek/rtase/rtase_main.c
> +++ b/drivers/net/ethernet/realtek/rtase/rtase_main.c
> @@ -240,6 +240,8 @@ static void rtase_tx_clear(struct rtase_private *tp)
>  		rtase_tx_clear_range(ring, ring->dirty_idx, RTASE_NUM_DESC);
>  		ring->cur_idx = 0;
>  		ring->dirty_idx = 0;
> +
> +		netdev_tx_reset_subqueue(tp->dev, i);

The fix itself looks ok.

>  	}
>  }

Thanks,
Olek

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] rtase: Reset TX subqueue when clearing TX ring
  2026-06-01 13:19 ` Alexander Lobakin
@ 2026-06-02 10:06   ` Justin Lai
  0 siblings, 0 replies; 3+ messages in thread
From: Justin Lai @ 2026-06-02 10:06 UTC (permalink / raw)
  To: Alexander Lobakin
  Cc: kuba@kernel.org, davem@davemloft.net, edumazet@google.com,
	pabeni@redhat.com, andrew+netdev@lunn.ch,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	horms@kernel.org, Ping-Ke Shih, Larry Chiu

> From: Justin Lai <justinlai0215@realtek.com>
> Date: Mon, 1 Jun 2026 14:24:18 +0800
> 
> > rtase_tx_clear() clears the TX ring and resets the ring indexes.
> > However, the TX queue state and BQL accounting are not reset at the
> > same time.
> >
> > This may leave __QUEUE_STATE_STACK_XOFF asserted after
> > rtase_sw_reset(), preventing new TX packets from being scheduled.
> >
> > Reset the TX subqueue when clearing the TX ring so the TX queue state
> > and BQL accounting are restored together.
> >
> > Signed-off-by: Justin Lai <justinlai0215@realtek.com>
> 
> You need to:
> 
> 1. Specify the target branch in the subject prefix ([PATCH net]
>    for critical fixes, [PATCH net-next] for features and misc
>    non-critical fixes and improvements).
> 2. If this is a fix targeting "net", you need to provide a "Fixes:"
>    tag pointing to the commit which introduced this issue.
> 3. If this is a fix and the bug is present in older supported kernels
>    (LTSes etc), you need to add "Cc: stable@vger.kernel.org" right
>    after the "Fixes:" tag.
> 
> > ---
> >  drivers/net/ethernet/realtek/rtase/rtase_main.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/net/ethernet/realtek/rtase/rtase_main.c
> > b/drivers/net/ethernet/realtek/rtase/rtase_main.c
> > index 43a4aa275b62..11e9d0feea68 100644
> > --- a/drivers/net/ethernet/realtek/rtase/rtase_main.c
> > +++ b/drivers/net/ethernet/realtek/rtase/rtase_main.c
> > @@ -240,6 +240,8 @@ static void rtase_tx_clear(struct rtase_private *tp)
> >               rtase_tx_clear_range(ring, ring->dirty_idx,
> RTASE_NUM_DESC);
> >               ring->cur_idx = 0;
> >               ring->dirty_idx = 0;
> > +
> > +             netdev_tx_reset_subqueue(tp->dev, i);
> 
> The fix itself looks ok.
> 
> >       }
> >  }
> 
> Thanks,
> Olek

Hi Olek,

Thanks for the review.

This is a bug fix. I'll resend it targeting the net tree with
the proper Fixes tag and Cc stable@vger.kernel.org.

Thanks,
Justin

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-06-02 10:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-01  6:24 [PATCH] rtase: Reset TX subqueue when clearing TX ring Justin Lai
2026-06-01 13:19 ` Alexander Lobakin
2026-06-02 10:06   ` Justin Lai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox