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 778D53D6673; Wed, 20 May 2026 17:21:54 +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=1779297715; cv=none; b=J3H+jdho6T1ef1gyht5olsJOAIDXEX0lBLW+oWpYrq8q92NHlPo50CewZgKeuislHLQOlHduzCS2gcoO2/A9s+1vAM04OLKifSmju1MkoCzfd/24Cgl6r7xvV38GVDpxBSykJSAdQykxob3Z0CnUYFRO4H8UidFuKGOkekFScuI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779297715; c=relaxed/simple; bh=YUqr6ki/RvyDYJ6ig6O1XAVA4t6+7XPpqTN4l3NXBX0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gwJzntcAyDAKMbhanXAZA22hffbzw8W341atpvrM0glINM0Rl4TwO9c/73Sm/L6UTH+GDe8G4lZr/IlPb8Rd0WemHoWylZdbxiZu0KW6z9KOomiNNBbgbDCLQqvoUIw/qCyb7bG9+SejxXIMtkX/HIAduqVwyvkRoJPq4hOriKg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ZwSTm68F; 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="ZwSTm68F" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC9481F000E9; Wed, 20 May 2026 17:21:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779297714; bh=qE6tvlUQ5oRGxw6llZjpSnElFwt6+5jgWkg1RQiRhRg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ZwSTm68FCe+Nr/rbV9++6gvK+HIJb1lJRrJlW2wvpt0Om9MWOT+ntWSIT4FRY5gZ4 bcSBqrj8bhNrRH2WPXWdCPeAEvZJOta68k6H67ix7yNaQKZcvInF7Ng3jUYAmsBTd8 YdEk32aVeaPap6adPffbyyTnpcgKIUpMwCN1ur68= 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 6.18 137/957] net: bcmgenet: fix leaking free_bds Date: Wed, 20 May 2026 18:10:20 +0200 Message-ID: <20260520162137.526638185@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260520162134.554764788@linuxfoundation.org> References: <20260520162134.554764788@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-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 1791523b83383..7d4d394c6ab1e 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -1981,6 +1981,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; @@ -1992,6 +1993,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