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 5A203334695; Sat, 30 May 2026 17:27:53 +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=1780162074; cv=none; b=EDdWhN6FI2jxcVDBISuGWvwyE1+oJk9hAXWtdUBestISYCW7sWROi/BfqsFcJY7Av/l38B49uh6B3UiAWc9w/BxrMRj3WA69y5oMBsaC2DftfgpYQDay3G4RrqkLff8xj5cKrofdKkXDVkidWVPeb3JUx0zK/uRfBiHzuWlBFjM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780162074; c=relaxed/simple; bh=HDjzcVJNtfYybBvYCXMelB80Z9K9ORJXYdSpXiFsZ2M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lADn49RJjkiUhPv2F+wI3lWqawCKTC7DjjBMylU6igSuu3gIv+HepPBi5lBsQC0n9dGcbLG9j+szDy2Qp839UiuhEJSNf4GCtAH8jg8s6z2dufunfPqMJ9FZrOLdQNbHSITaCLfvsOdznTH+P3Tb/8HS1JB+RunGaf71OKWdrQk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=LoNBoQrx; 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="LoNBoQrx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9EDA11F00893; Sat, 30 May 2026 17:27:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780162073; bh=w+MKJKvHuZrCtczeLzfjbVK7fi7HwhjJhgy30CEy4JA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=LoNBoQrx6MCdoYDQTAseDnJE+gY/ouM0DMoAyuY/nuJojjOBZXy7aSY/HQ9PKM8qT /rRW9jbrE7afbrlPIFR/IGvkOwAwOF7wcN1ORyDexcB2gDvpoXL9w5H06KlCBFYcwz XFJ43wwCzPPq3smmjCQ6jI51cHWi9VJcTcSCx9QU= 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.1 795/969] net: bcmgenet: fix leaking free_bds Date: Sat, 30 May 2026 18:05:19 +0200 Message-ID: <20260530160322.575029659@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260530160300.485627683@linuxfoundation.org> References: <20260530160300.485627683@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 6.1-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 64bc7b3afb514..cc7bcd0cc7ba8 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -1937,6 +1937,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; @@ -1948,6 +1949,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