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 ECF773BE642; Wed, 30 Sep 2026 19:15:16 +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=1790795718; cv=none; b=PYvzoEutobGODi21cwqnZy6CPk8NqZbLhdIwIy1x0xkmC42NvkmbjRJraYl8Af5RfrUyEt/MNtCHi08mlndOFBEIizdUXgcFkb3ZDvMXvfA8neskirLxu2lDbP5ivP7lYrGoXqfbUarNcwfL9uCw/44MmVe0FegJEwmherWRtSI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790795718; c=relaxed/simple; bh=DF45NBezyu29zcJAOcrWwsIG5sQinblpHnRnYUNL204=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NCrdFAm9fSrw9/J3u2jty6GktB4EdrPdeP2UXHUIbtEMypO09SYs0KQnk12SJC/CAkFvtp2WKVP0c4wsINJSIhhJyQALdtelPDkWZsQRsjI9TMMZl7yulrRWG9jukpHF+KsGFdg81O+PC69elhRfnwgg5W7COh8g9Xm6igabXjQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=W3HQpwDV; 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="W3HQpwDV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 527D31F000FF; Wed, 30 Sep 2026 19:15:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790795716; bh=rSCq992IQK24mcHDZBgYNB9ykXN1MTqtD0iRcLuGucI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=W3HQpwDVpAaw9PB33HxdmMgPLLK+vrNGp4rfgu5XurjhUnR/nhCEKQ/ELUD4iGY36 IGbaSd8Iyf9GVdMI6XAXTYLN3Jvr10i85APSLyU6ZpIQWwrV+k7/0yoszTAL6OTtGO R7Oek4ZFfvseqO8N5BoLje6cOBhL8mAtVGcq0Gdg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sashiko , Joe Damato , Paolo Abeni Subject: [PATCH 6.6 0657/1193] bnxt_en: Handle buffer allocation failure in bnxt_rx_ring_reset() Date: Wed, 30 Sep 2026 17:22:21 +0200 Message-ID: <20260930152448.839725234@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152434.301151190@linuxfoundation.org> References: <20260930152434.301151190@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.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Joe Damato commit 961e2a17c5e3559b3f8654d2daabdd25a42e770a upstream. bnxt_rx_ring_reset() frees the ring buffers and then reallocates them, ignoring the result. bnxt_alloc_one_rx_ring() can fail in bnxt_alloc_one_tpa_info_data(), which returns -ENOMEM on the first failed allocation and leaves the remaining rxr->rx_tpa[] entries zeroed. The error isn't propagated up, so the loop in bnxt_rx_ring_reset continues and at the end the code re-enables TPA with partially unallocated rx_tpa array. This means that when the agg_id from hardware is mapped to a SW index in rxr->rx_tpa[], an uninitialized slot can be chosen which would hand a zero DMA address to the device. Fix this by falling back to a global reset, which is what the existing code already does when other functions fail, but unlike the other failure cases this particular failure has to return because TPA can't be re-enabled since the allocation failed. Fixes: 8fbf58e17dce ("bnxt_en: Implement RX ring reset in response to buffer errors.") Reported-by: Sashiko Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260828190900.1767611-1-joe%40dama.to Cc: stable@vger.kernel.org Signed-off-by: Joe Damato Link: https://patch.msgid.link/20260902015652.2421609-5-joe@dama.to Signed-off-by: Paolo Abeni Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -11827,7 +11827,14 @@ static void bnxt_rx_ring_reset(struct bn rxr->rx_sw_agg_prod = 0; rxr->rx_next_cons = 0; rxr->bnapi->in_reset = false; - bnxt_alloc_one_rx_ring(bp, i); + rc = bnxt_alloc_one_rx_ring(bp, i); + if (rc) { + netdev_warn(bp->dev, "RX ring reset failed to allocate buffers, rc = %d, falling back to global reset\n", + rc); + bnxt_reset_task(bp, true); + bnxt_rtnl_unlock_sp(bp); + return; + } cpr = &rxr->bnapi->cp_ring; cpr->sw_stats.rx.rx_resets++; if (bp->flags & BNXT_FLAG_AGG_RINGS)