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 7AA0A4F93D8; Tue, 13 Oct 2026 11:59:26 +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=1791892767; cv=none; b=obcgvCGZDl5hs9WyMPrN5sgF57wOyy8F/DXSIxYx7BHTu/rTEzm1PNsAeSsGLLMZ3F4n4FcHiu964z0t/ptoxyr7SrQlAmmJlPgwcwu28F6ClT0oCAjvUYkYcbodfFV9sG2Kg6UXVn/8cwQthLDucTOqXYWgZmOwm00UDjRFGqQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791892767; c=relaxed/simple; bh=4uSQ0dcj5Hn6TMXedvYWqM88rGdruGSDNsvHrnSN3mo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KwMvdZxsDMIi3x5knpZ2a7nANtpoGqDNmu6scwmH1wqll9L3g0IQ3OKxOpmeKiNlnpOwfDqIzWPHP9RWEV0CvNf+H+WJ6uZ+t/F7nH/exsG6dKN8hED0r2EXtVLrjVIYI3cfsQVnOSDhTy4MZGKMZvGI4YZPC/oAI5+fLA5gCog= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=EbL/qxuH; 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="EbL/qxuH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D8B21F00898; Tue, 13 Oct 2026 11:59:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1791892766; bh=JZPGAnMdqWSaHR24gPhEAcN/AJ6Qou3wBi83gcNrtCo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=EbL/qxuHYbM4TiaEq6H2ibqDDBHyfNLOWKXjWqAZihsdM9sqNdP7oTohtKN0f8qlt EkHtTTUvfrIpjXj8sGNIgBMTNgG6wWEOtXNsi4eByDHe4Te6AaJWdlvspLYfoh1UZ/ 5WbaKio2nK54Dv1UQVdi3C6PEz8ysK5ZcShN2Gh4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Li RongQing , Dragos Tatulea , Tariq Toukan , Daniel Machon , Jakub Kicinski , Sasha Levin Subject: [PATCH 7.2 267/281] net/mlx5e: Order ICOSQ cc update after CQ doorbell Date: Tue, 13 Oct 2026 13:39:43 +0200 Message-ID: <20261013112901.620889446@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261013112855.045212108@linuxfoundation.org> References: <20261013112855.045212108@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 7.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Li RongQing [ Upstream commit b056ca4d3742d0769f91137bb1ce3215428398f7 ] mlx5e_poll_ico_cq() requires sq->cc to be updated only after mlx5_cqwq_update_db_record(), otherwise a CQ overrun may occur. The current implementation updates sq->cc before the CQ doorbell record, violating this ordering requirement. Update the CQ doorbell record first and use dma_wmb() before updating sq->cc. This ensures that the CQ space is released to the device before the corresponding ICOSQ consumer index is updated by software. Fixes: fd9b4be8002c ("net/mlx5e: RX, Support multiple outstanding UMR posts") Signed-off-by: Li RongQing Reviewed-by: Dragos Tatulea Signed-off-by: Tariq Toukan Reviewed-by: Daniel Machon Link: https://patch.msgid.link/20261006105820.257208-1-tariqt@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c index 7967a27372981..c75b064b04166 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c @@ -908,10 +908,12 @@ int mlx5e_poll_ico_cq(struct mlx5e_cq *cq) } while (!last_wqe); } while ((++i < MLX5E_TX_CQ_POLL_BUDGET) && (cqe = mlx5_cqwq_get_cqe(&cq->wq))); - sq->cc = sqcc; - mlx5_cqwq_update_db_record(&cq->wq); + /* ensure cq space is freed before enabling more cqes */ + dma_wmb(); + + sq->cc = sqcc; return i; } -- 2.53.0