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 B1F3219F485; Tue, 27 Aug 2024 15:05: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=1724771122; cv=none; b=HdynUJXlRso5QbU3TSmj0K/Bs3H4bhtBzRj51Clj7nlrvIyD/vRDPIZ5q2s4VAYgwGs2yaKvelvGtLwpaAoDiirIwhl+Utv7EGHTO3mgKsnxYB2oYtcrWYVAr5vYaGlZ2YwSG+BMlgW7+4xsD938oj5XRCFV/EwLphBb3VT+B/Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724771122; c=relaxed/simple; bh=F3CCdZZFApMxztZ0qBhLp4u4lzJzkgtGETBc+HTtiaY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AHHOvDP3W6H57AKbku+BI/8RAMEDQcFPaVRjqBRBhbK9wACDnucmFkWQTpG6RTLkcudQmyPXXOPRGtVeif+CnHlGDPPZ1ILIy/JFEu3nGLyKUfz5Q50DW6E3U92PRSZZvihG5MCunQbprcktnjRhzCg8PDJ2DmcOuFjsnClTdGs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=aQRHtyCC; 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="aQRHtyCC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3643EC6105F; Tue, 27 Aug 2024 15:05:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1724771122; bh=F3CCdZZFApMxztZ0qBhLp4u4lzJzkgtGETBc+HTtiaY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aQRHtyCCpXuFdihgd8myYBc9+LisKnEhXCYY1usroPAVTX9YN+dMaMxC0oKxTyw7L Y4X2MuCqHjxLGAJxEUIH+X4/2/QGLH+3IfBnc8sBu0m4eByjlD2C6Hu7LdWpsQT/lF G2uarD8gsFqApXjURp+yNQ3EC+OMrnGfdW5uw0jQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Cosmin Ratiu , Saeed Mahameed , Dragos Tatulea , Tariq Toukan , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.10 092/273] net/mlx5e: Correctly report errors for ethtool rx flows Date: Tue, 27 Aug 2024 16:36:56 +0200 Message-ID: <20240827143836.914149763@linuxfoundation.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240827143833.371588371@linuxfoundation.org> References: <20240827143833.371588371@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Cosmin Ratiu [ Upstream commit cbc796be1779c4dbc9a482c7233995e2a8b6bfb3 ] Previously, an ethtool rx flow with no attrs would not be added to the NIC as it has no rules to configure the hw with, but it would be reported as successful to the caller (return code 0). This is confusing for the user as ethtool then reports "Added rule $num", but no rule was actually added. This change corrects that by instead reporting these wrong rules as -EINVAL. Fixes: b29c61dac3a2 ("net/mlx5e: Ethtool steering flow validation refactoring") Signed-off-by: Cosmin Ratiu Reviewed-by: Saeed Mahameed Reviewed-by: Dragos Tatulea Signed-off-by: Tariq Toukan Link: https://patch.msgid.link/20240808144107.2095424-5-tariqt@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c index 3eccdadc03578..773624bb2c5d5 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c @@ -734,7 +734,7 @@ mlx5e_ethtool_flow_replace(struct mlx5e_priv *priv, if (num_tuples <= 0) { netdev_warn(priv->netdev, "%s: flow is not valid %d\n", __func__, num_tuples); - return num_tuples; + return num_tuples < 0 ? num_tuples : -EINVAL; } eth_ft = get_flow_table(priv, fs, num_tuples); -- 2.43.0