Skip to contentSkip to conversation

rtase: Reset TX subqueue when clearing TX ring

PATCH Applied Justin Lai 3 participants 4 messages Jun 2 – Jun 4

Subsystems (4)
lore
Share & tools
lore

Justin Lai

author maintainer
#0 lore raw

PATCH v2 1/1 rtase: Reset TX subqueue when clearing TX ring

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.

Fixes 5a2a2f15244c ("rtase: Implement the rtase_down function")

---
v1 -> v2:
- Target net tree.
- Add Fixes tag.

---
 drivers/net/ethernet/realtek/rtase/rtase_main.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/realtek/rtase/rtase_main.c +2 -0
index ef13109c49cf..6ccbefb5acf2 100644
@@ -239,6 +239,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);
 	}
 }
 
Signature · 1 line
2.40.1
author maintainer
#1 lore raw
Quoted 37 lines · 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.

Fixes 5a2a2f15244c ("rtase: Implement the rtase_down function")

---
v1 -> v2:
- Target net tree.
- Add Fixes tag.

---
 drivers/net/ethernet/realtek/rtase/rtase_main.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/realtek/rtase/rtase_main.c +2 -1
index ef13109c49cf..6ccbefb5acf2 100644
@@ -239,6 +239,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);
 	}
 }
 
--
Quoted 1 line

2.40.1

Adding Olek, who was accidentally missed from the CC list.

Reviewed-by
#2 lore raw

From: Justin Lai <[email protected]>
Date: Wed, 3 Jun 2026 03:21:34 +0000

Quoted 37 lines
Quoted 36 lines · 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.

Fixes 5a2a2f15244c ("rtase: Implement the rtase_down function")

---
v1 -> v2:
- Target net tree.
- Add Fixes tag.

---
 drivers/net/ethernet/realtek/rtase/rtase_main.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/realtek/rtase/rtase_main.c +2 -0
index ef13109c49cf..6ccbefb5acf2 100644
@@ -239,6 +239,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);
 	}
 }
 
Quoted 4 lines
Quoted 2 lines

--
2.40.1

Adding Olek, who was accidentally missed from the CC list.

Thanks,
Olek

#3 lore raw
In reply to Justin Lai
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Tue, 2 Jun 2026 19:46:59 +0800 you wrote:

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.

[...]

Here is the summary with links:
- [net,v2] rtase: Reset TX subqueue when clearing TX ring
https://git.kernel.org/netdev/net/c/ab1ecaabe74b

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html