From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 B719ECA4B; Tue, 17 Jun 2025 16:55:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750179322; cv=none; b=PX0z1rSOXnnzdC3lo5gsL84BTqSEjzcFI+ygsBggsxd4oEsQgu4+0otJLD4I/rmERuEXhEc2SB393O82woNXA/Z3KtdwwGD5OuVpcwpjfyEKXIG6PAxqybLP4HvoAZXgF+fDabY8WWSXZbfXxnU8Z2KWyL3M3T0qSt//WOYyT+M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750179322; c=relaxed/simple; bh=eFbGyGdl0JhEZTc3Kf9sh78mgo56FclQAYOfREhMfug=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iaju3N07cckxFFNPb5YQOL1JBEmE63QcSeSzIU85OLGDgvVVWVdl/+qgunor40mnppkTZUCc7GcKocnMgIkVb160AZwdp0kOZFrgiICe/Z3+teC24pPhzeJrNiTjcU4vYWgJcv70lXobRKb/tGvbH/KfK8HfveHOkMtcLJFkqvU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=fskR4T+o; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="fskR4T+o" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2673AC4CEE3; Tue, 17 Jun 2025 16:55:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750179322; bh=eFbGyGdl0JhEZTc3Kf9sh78mgo56FclQAYOfREhMfug=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fskR4T+ozROYsfabg0swr1wO9PEsfukLzPL76SAIoN6+AvOb9znJa3MtjIaQRp2tj 8fSwOtOl7THH5W1Gw9T7wi6ALOvLRp6D8/5hDfvWse50c6ys+VvPX67Y0mBLYB/tu/ VBIvpITzJWJAs6yr6aNRSKk8eqc7URl0zf+uMISU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Gavi Teitz , Roi Dayan , Patrisious Haddad , Tariq Toukan , Mark Bloch , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.15 711/780] net/mlx5: Fix return value when searching for existing flow group Date: Tue, 17 Jun 2025 17:26:59 +0200 Message-ID: <20250617152520.448880437@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250617152451.485330293@linuxfoundation.org> References: <20250617152451.485330293@linuxfoundation.org> User-Agent: quilt/0.68 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.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Patrisious Haddad [ Upstream commit 8ec40e3f1f72bf8f8accf18020d487caa99f46a4 ] When attempting to add a rule to an existing flow group, if a matching flow group exists but is not active, the error code returned should be EAGAIN, so that the rule can be added to the matching flow group once it is active, rather than ENOENT, which indicates that no matching flow group was found. Fixes: bd71b08ec2ee ("net/mlx5: Support multiple updates of steering rules in parallel") Signed-off-by: Gavi Teitz Signed-off-by: Roi Dayan Signed-off-by: Patrisious Haddad Reviewed-by: Tariq Toukan Signed-off-by: Mark Bloch Link: https://patch.msgid.link/20250610151514.1094735-4-mbloch@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c index 6163bc98d94a9..445301ea70426 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c @@ -2207,6 +2207,7 @@ try_add_to_existing_fg(struct mlx5_flow_table *ft, struct mlx5_flow_handle *rule; struct match_list *iter; bool take_write = false; + bool try_again = false; struct fs_fte *fte; u64 version = 0; int err; @@ -2271,6 +2272,7 @@ try_add_to_existing_fg(struct mlx5_flow_table *ft, nested_down_write_ref_node(&g->node, FS_LOCK_PARENT); if (!g->node.active) { + try_again = true; up_write_ref_node(&g->node, false); continue; } @@ -2292,7 +2294,8 @@ try_add_to_existing_fg(struct mlx5_flow_table *ft, tree_put_node(&fte->node, false); return rule; } - rule = ERR_PTR(-ENOENT); + err = try_again ? -EAGAIN : -ENOENT; + rule = ERR_PTR(err); out: kmem_cache_free(steering->ftes_cache, fte); return rule; -- 2.39.5