Skip to content

Commit 25ff3a3

Browse files
Ryceancurrygregkh
authored andcommitted
net: bcmgenet: fix leaking free_bds
[ Upstream commit 3f31683 ] While reclaiming the tx queue we fast forward the write pointer to drop any data in flight. These dropped frames are not added back to the pool of free bds. We also need to tell the netdev that we are dropping said data. Fixes: f1bacae ("net: bcmgenet: support reclaiming unsent Tx packets") Signed-off-by: Justin Chen <justin.chen@broadcom.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de> Tested-by: Nicolai Buchwitz <nb@tipi-net.de> Link: https://patch.msgid.link/20260406175756.134567-3-justin.chen@broadcom.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 4cab761 commit 25ff3a3

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/net/ethernet/broadcom/genet/bcmgenet.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1981,6 +1981,7 @@ static unsigned int bcmgenet_tx_reclaim(struct net_device *dev,
19811981
drop = (ring->prod_index - ring->c_index) & DMA_C_INDEX_MASK;
19821982
released += drop;
19831983
ring->prod_index = ring->c_index & DMA_C_INDEX_MASK;
1984+
ring->free_bds += drop;
19841985
while (drop--) {
19851986
cb_ptr = bcmgenet_put_txcb(priv, ring);
19861987
skb = cb_ptr->skb;
@@ -1992,6 +1993,7 @@ static unsigned int bcmgenet_tx_reclaim(struct net_device *dev,
19921993
}
19931994
if (skb)
19941995
dev_consume_skb_any(skb);
1996+
netdev_tx_reset_queue(netdev_get_tx_queue(dev, ring->index));
19951997
bcmgenet_tdma_ring_writel(priv, ring->index,
19961998
ring->prod_index, TDMA_PROD_INDEX);
19971999
wr_ptr = ring->write_ptr * WORDS_PER_BD(priv);

0 commit comments

Comments
 (0)