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 2C292342C80; Tue, 13 Oct 2026 12:54:23 +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=1791896064; cv=none; b=FQEaWuvk4ZKZYBpwigrfddccimrNdld9xrzN/dCoczg9Qp3DD6Ev3NDprrvWm1m9Eb8SCcb71RVZGsNHqXwUzRVpruMi4wdQEctiNgFGf4d/7ZO3TZuDcNej4WrMaAGhRvLVQSAlSBWg+KF/kuzO9Iv2ZS03KQXkZAGNg3TlQNs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791896064; c=relaxed/simple; bh=eDWCSH17UR7PG76HXpNBb4O0mequGZ225afufzEnnBE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uu6+S4yQOf0pkS+xGDgfZUqA2nmZch2zsGmYQ58cSzWSxQavvmbQTw5FIdlnKEnYVqLZElSRjOct59H8pg+SEa36F9JhQWTH+0uAbQ/sN1Fac56A/dXDeWu1/Kuqza+IXHO+kgIbbxOIzE8yiH8JxPG5KIm+9YaQ2Ib3B5cligE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=uLa1EylF; 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="uLa1EylF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79E4E1F000FF; Tue, 13 Oct 2026 12:54:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1791896063; bh=wowfTFuKV94V7fKAwh2jlmJMPMYtTY3ANcur6vH1Uos=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=uLa1EylFPlnqWwu0knMD92QGzdQzQILhoKuf4/qX61+gAQ0dTK3TKXa3IugCO9HOI Wwewn55lzv/L5r/hUnFWiuJfuEq1MiHo11MipzPTOcvW9rf6ZDDzCRvYD5a+CO+Mik qtNdOfiF00f9FiSeOpeTUgO997oQAGjIGteBxpCY= 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 6.12 485/497] net/mlx5e: Order ICOSQ cc update after CQ doorbell Date: Tue, 13 Oct 2026 13:40:52 +0200 Message-ID: <20261013112919.387621283@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261013112907.864180619@linuxfoundation.org> References: <20261013112907.864180619@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.12-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 9ab7d00fc04c3..3fb3d9299528d 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c @@ -1070,10 +1070,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