From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8C6063BD63C; Wed, 20 May 2026 16:35:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779294902; cv=none; b=lShJZFJk520YYfVKF8ZHNAuHmuZvaHAgdQEecei750rW85ZZtiCZBh4dkydb1NPUYqRm9DtBOfI+kHl4G3XLqYRDDTdVjwD3anr1stP/++FuiiVpCormSXX9D+YR3+54uFSft26wH2L4ifLH8aWyplBYAgLkNJ1TKqWySKs3nAU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779294902; c=relaxed/simple; bh=5rwyw9CN8GJk5CGRCnWc1xT2kt+Rnt5I2JeUkDk7crs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KxDYkc4YAvf1Ap16xhGnZgi9rOzciwgQ3Uhon3aCErvzrkNqRW3+gwJ2eB2CSi25MkfpriYZY/RvR2n38ZbccCO2QXRq5BAcnobbfbJDRUFuHwdwvwPC2E6rIFKX5MybhLm0G8dV0D0goXtp+E59XxUO/xlwwZ3QWNv86qXSmug= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=cK/2QWlc; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="cK/2QWlc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F0C231F000E9; Wed, 20 May 2026 16:34:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779294900; bh=kFQH6zcF6vGHBhoVs+O7xPWw3KXV5qB7rQVRRGq3/0Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=cK/2QWlcOugqCek3EG9eGJnPiw2P/xmUmnWowId/sf8K1cmovl7sTwvLMHq8+/y3t WyS/fw04bQyC4rj1CPkuiQmS8Mo36qDXhtIBNg3r062fRxwlMcDtsLR/4Lh59RBNXV eF1fSagPkB+pNEmQUaLW91NqMCBB05/Smzm2C7KE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Justin Chen , Florian Fainelli , Nicolai Buchwitz , Jakub Kicinski , Sasha Levin Subject: [PATCH 7.0 0174/1146] net: bcmgenet: fix leaking free_bds Date: Wed, 20 May 2026 18:07:04 +0200 Message-ID: <20260520162152.221625008@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260520162148.390695140@linuxfoundation.org> References: <20260520162148.390695140@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.0-stable review patch. If anyone has any objections, please let me know. ------------------ From: Justin Chen [ Upstream commit 3f3168300efb839028328d720ab3962f91d6a0d0 ] 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: f1bacae8b655 ("net: bcmgenet: support reclaiming unsent Tx packets") Signed-off-by: Justin Chen Reviewed-by: Florian Fainelli Reviewed-by: Nicolai Buchwitz Tested-by: Nicolai Buchwitz Link: https://patch.msgid.link/20260406175756.134567-3-justin.chen@broadcom.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c index 0f6e4baba25b9..e89126a0c20ea 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -1985,6 +1985,7 @@ static unsigned int bcmgenet_tx_reclaim(struct net_device *dev, drop = (ring->prod_index - ring->c_index) & DMA_C_INDEX_MASK; released += drop; ring->prod_index = ring->c_index & DMA_C_INDEX_MASK; + ring->free_bds += drop; while (drop--) { cb_ptr = bcmgenet_put_txcb(priv, ring); skb = cb_ptr->skb; @@ -1996,6 +1997,7 @@ static unsigned int bcmgenet_tx_reclaim(struct net_device *dev, } if (skb) dev_consume_skb_any(skb); + netdev_tx_reset_queue(netdev_get_tx_queue(dev, ring->index)); bcmgenet_tdma_ring_writel(priv, ring->index, ring->prod_index, TDMA_PROD_INDEX); wr_ptr = ring->write_ptr * WORDS_PER_BD(priv); -- 2.53.0