From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796297031; b=IrSxMU/KiUFb6wllny9xRzKF9rF5OpiGV56JaQwuUzdnrc7q+HrVF31PGXoNTOLa47Kd cuxYA+kkr0Z/VriFK01Q5T5A0qRTBJHP7+f8D7q4Us787x94Qnr/Z2NwsExykPdPT/4jx 68h5XD1M0rSfOBO7sbn6A2AFZ7DJQ9XlUVNYwJrqHO8DpQMorT3TJk123yrxBTogyEBH5 ClNKEaanWfJAsHMmuKWH7Yirl1teCCgQ7j1m59LNo0Xe1GLYToWbwHXfXpstmmSTMZkga czPEccbCeR5CWO473+NWyaQt1+Fh5D6OdI7R0MWIQsSCDWWjLo01nxlkHEe/r8nbUcQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796297031; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=+kEUTmNVOjIXQh29NSNB/CsgvWztiHSdTE5Daa3vqzU=; b=JDZx86zbKuaMWJOvhdKlnF3+gcw0bl5A6UBqq0KU0naz0hibCRzGzbvUevgmVt9aKzZO CJbQQWm7hHXVmMsDVpSSfGiPvR64kZqO1RRRNVmDReEowHNN56FDHIE42xWnRJ1geeQQs kAMnVfGUg5C0uJ+MeGBbvKlsDo7T+zv6/zQadcz6XSzV1Fr58Bb37HzrJr/gtF4V/VhEz lHGQZuHb60kIJmTnlQ7Uj+mJfCuFc6sJw7OSpJ8JWVzNki5RtNhpqZWLF8iu/c8oCZlJn zucknbqLlMx5dl/EOGlI98V5Rjiq2jhgqYIL+uUQNJ4L2b/9mpZEtq1NSYGwoMGz2Lw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ZiK6BGsH; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2887B606A322 for ; Thu, 3 Dec 2026 11:23:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ZiK6BGsH Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4EEE1F00893; Thu, 3 Dec 2026 11:23:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796297030; bh=+kEUTmNVOjIXQh29NSNB/CsgvWztiHSdTE5Daa3vqzU=; h=From:To:Cc:Subject:Date; b=ZiK6BGsH6YR1rI0X2aIr7BMa+usxK0ohan++o5dhN1NTrtgH0ru7W1F3TW13rT5S9 5e631NiTfv8+vcuDZKawuegrAkjDB+wdARFo4xP2tIUyKoiGL0jt8lPKXm1mFfF9hD nrk0Ao102F20T90ZzWELlPl6Kz0ycDZFMnyoWfBeuCW0K6hUyjGJpgdED2LEB349Va 5oemgPK15cmWgxKfFM5OlLGGLA7zGk8mpoE+qNWofiNDai+V4SHw1jQIDTpoeG1RcH lgBzZlcgJ0DDJZjNVesw6yB8grheKlDzZHyAFXffIzCZAna8ZNX/cZC7diHtJxVEoU 0hqylSAIKvfXQ== From: =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= To: Michael Chan , Pavan Chebbi , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Cc: =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= Subject: [PATCH net] bnxt_en: Acknowledge the NQ before completing NAPI Date: Thu, 3 Dec 2026 12:23:39 +0100 Message-ID: <20261203112343.3524699-1-bjorn@kernel.org> X-Mailer: git-send-email 2.56.1 X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On P5 and newer chips, NAPI tells the device how far it read the NQ with a doorbell. Currently, a poll that finds the NQ empty does so only with the IRQ re-arm, after napi_complete_done() returns true. It returns false while busy polling or deferring IRQs, so a NAPI that completes without re-arming never frees the notifications it reads. Once the NQ is full, the device stops notifying of RX and TX completions. TX times out, the reset fails to free and allocate rings, and the device stays down. Acknowledge what was read before completing NAPI, while the poll still owns it. In IRQ mode the re-arm follows with the same index. Found from the console logs of a BCM57504 in real use. Normal traffic with deferred IRQs, e.g napi_defer_hard_irqs 100, gro_flush_timeout 200000, lost the device in 19 seconds at 0.1 Mpps of 1500B UDP to one queue. Also seen on the WIP AF_XDP series running preferred busy polling. Both pass with this patch. Fixes: 0fcec9854ab4 ("bnxt_en: Add new NAPI poll function for 57500 chips.") Signed-off-by: Björn Töpel --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 85ce4b2e297e..9f8ceca047f7 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -3419,7 +3419,14 @@ static int bnxt_poll_p5(struct napi_struct *napi, int budget) __bnxt_poll_cqs_done(bp, bnapi, DBR_TYPE_CQ_ARMALL, budget); - cpr->cp_raw_cons = raw_cons; + /* Busy polling and deferred IRQs keep the NQ disarmed. + * Free what was read while the NAPI is still ours, or + * the NQ fills up and the device stops notifying. + */ + if (raw_cons != cpr->cp_raw_cons) { + cpr->cp_raw_cons = raw_cons; + BNXT_DB_NQ_P5(&cpr->cp_db, raw_cons); + } if (napi_complete_done(napi, work_done)) BNXT_DB_NQ_ARM_P5(&cpr->cp_db, cpr->cp_raw_cons); base-commit: 7c13d5d5afb4ba2e8634fe5aa0a9f2bca235cb4b -- 2.53.1