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 5ACA32C1B4; Sun, 1 Sep 2024 16:19:37 +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=1725207577; cv=none; b=FLlAji+Fx3eJkdsmNR5aFQ2Ao1Ohn2BFwq2s6DQPo0ZrZamzhirIXBhVJ3X1DfyH/OVM/zhBjE+48RIq0sbFzw4ixABKBJ3Xo7xg1HZHKM7sThnzsEpGBzEQIpzjmaRAj8FU9l/NNGKLqCsAlIwMTfRfFEUJqCo+M4eaQYvxyIE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725207577; c=relaxed/simple; bh=GSZq1BGO+FXLwlVKTapthMf507S29LnmU+iVa02Q1bU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Rzd+3qawDCbFWN+Rl+p4kLrWCkoIY/5ekeDin3dpw4EGi1xw9hMJ7tMkcCVeHxT2vzBVuRsy0xo6hjJ/hHKd3iMg83EyRimOLRAIR9GuNp3aIItbxATEI7rPZCGWFU3D3Yl7DFHRXTEy3f1eQ3W2c6+TDP8EvCuuEFJKSFs7wmw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Q0/gHmrs; 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="Q0/gHmrs" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85CD1C4CEC3; Sun, 1 Sep 2024 16:19:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1725207577; bh=GSZq1BGO+FXLwlVKTapthMf507S29LnmU+iVa02Q1bU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q0/gHmrsxfonfqBmoVBm7S5ePA4C1TlG9lvMQFL8eRaj1QhVaRavKuMoD/9DOcspd azC52pDlg39f0CUH28x9f50fzK3toV4xns8cQpSoHviZt7M+bV9Kl47vfFSzYrC6AH 49irx3POwnjKWXuOe+PKAj00+eSB7/QDzBkej3tE= 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 4.19 14/98] net/mlx5e: Correctly report errors for ethtool rx flows Date: Sun, 1 Sep 2024 18:15:44 +0200 Message-ID: <20240901160804.224594786@linuxfoundation.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240901160803.673617007@linuxfoundation.org> References: <20240901160803.673617007@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 4.19-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 41cde926cdab6..48ae9c201af46 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c @@ -689,7 +689,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