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 8FF8240F734; Mon, 17 Aug 2026 13:54:28 +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=1786974870; cv=none; b=HF1oWdsKgq7jZIYLxql04KAsoI53WrIklD32SLMsL7zQhZMCuAh/05O5vPLvd/RkNiiSmkB8CKivMJQjd5IZBr2XcdOtkRYWEndGBK3VglhLxlCFeecXApsbq08raaunesENOJo7CxTOtGhi4z/1JntX1/yg5i5TRcBd6yzUly4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786974870; c=relaxed/simple; bh=4EQG4d4LwK1Yidfecz5a5O0PWZrlq7HfW6HFi3q/pY8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=d4ObNgq++jr3HQA1JH5a+OH9OU0rsU3Tu7HDXzeKzr5+u97NquowQw0mdZCS0qkwFON6cCoDix0b89l0TzLW8bvdaGPmO1SZx+aHhp7KL1rOUIyU2OH5bi/E/oyrY5VLt4vW9tf9aT0gRCQx0pTjRyAZ5PJKbq6B/BtIwwUuHFs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=AMBS095Q; 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="AMBS095Q" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51F0D1F00A3A; Mon, 17 Aug 2026 13:54:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1786974867; bh=tbsseG7UzzirMcjE5L3EM1hwPM10Q1eKj8/mc3ss8O4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=AMBS095QKW6SyGY3GT2gLkOSKjiaFbzLkbdj+avSgQZ15OW9rG/IxHuPXoPU4Hfdf IiGXs9I4dF30GVpvxVsmKx2F0K9+reyv27ypod0MYnmhwRoM/DgtwDpIwTfdN9PSn1 lg6FVMmneEyiI6eoOaXDvY/ZWdC3Dw4ZXdFtuDAE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Bobby Eshleman , Tariq Toukan , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.18 083/250] net/mlx5e: fix BQL reset on SQ re-activation Date: Mon, 17 Aug 2026 15:30:44 +0200 Message-ID: <20260817132539.838173074@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260817132536.466235697@linuxfoundation.org> References: <20260817132536.466235697@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.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Bobby Eshleman [ Upstream commit e7386770be1bf810bcd6af39d1e4bfeab3408430 ] mlx5e_queue_start() deactivates and re-activates all channels but closes only the queue being restarted. mlx5e_activate_txqsq() then unconditionally calls netdev_tx_reset_queue(), zeroing the BQL counters of channels that kept their in-flight TX WQEs. The next completion then over-charges and trips the BUG_ON() in dql_completed(): kernel BUG at lib/dynamic_queue_limits.c:99! RIP: 0010:dql_completed+0x23d/0x280 Call Trace: mlx5e_poll_tx_cq+0x668/0xa60 mlx5e_napi_poll+0x5b/0x7b0 net_rx_action+0x15a/0x580 Reset BQL only when the SQ has no bytes in flight (sq->cc == sq->pc). In the case that reset is skipped, the outstanding WQEs will eventually complete and rebalance the dql. The dql->limit is carried across the reset. Fixes: b2588ea40ec9 ("net/mlx5e: Implement queue mgmt ops and single channel swap") Signed-off-by: Bobby Eshleman Reviewed-by: Tariq Toukan Link: https://patch.msgid.link/20260803-mlx5-bql-v3-1-a30d4c66fe1d@meta.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index 58e255910c43e..a7d84b540488a 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -1926,8 +1926,10 @@ int mlx5e_open_txqsq(struct mlx5e_channel *c, u32 tisn, int txq_ix, void mlx5e_activate_txqsq(struct mlx5e_txqsq *sq) { sq->txq = netdev_get_tx_queue(sq->netdev, sq->txq_ix); + /* Reset BQL only when the SQ has no bytes in flight. */ + if (sq->cc == sq->pc) + netdev_tx_reset_queue(sq->txq); set_bit(MLX5E_SQ_STATE_ENABLED, &sq->state); - netdev_tx_reset_queue(sq->txq); netif_tx_start_queue(sq->txq); netif_queue_set_napi(sq->netdev, sq->txq_ix, NETDEV_QUEUE_TYPE_TX, sq->cq.napi); } -- 2.53.0