Blame SOURCES/0304-netdrv-net-mlx5e-replace-EINVAL-in-mlx5e_flower_pars.patch

d8f823
From 4fedc08dc4ec7fcbcc3311a2fb10af94b10bbb55 Mon Sep 17 00:00:00 2001
d8f823
From: Alaa Hleihel <ahleihel@redhat.com>
d8f823
Date: Mon, 1 Jun 2020 15:40:59 -0400
d8f823
Subject: [PATCH 304/312] [netdrv] net/mlx5e: replace EINVAL in
d8f823
 mlx5e_flower_parse_meta()
d8f823
d8f823
Message-id: <20200601154102.25980-37-ahleihel@redhat.com>
d8f823
Patchwork-id: 315740
d8f823
Patchwork-instance: patchwork
d8f823
O-Subject: [RHEL8.3 BZ 1842258 36/39] net/mlx5e: replace EINVAL in mlx5e_flower_parse_meta()
d8f823
Bugzilla: 1842258
d8f823
RH-Acked-by: Honggang Li <honli@redhat.com>
d8f823
RH-Acked-by: Kamal Heib <kheib@redhat.com>
d8f823
RH-Acked-by: Marcelo Leitner <mleitner@redhat.com>
d8f823
RH-Acked-by: Jarod Wilson <jarod@redhat.com>
d8f823
d8f823
Bugzilla: http://bugzilla.redhat.com/1842258
d8f823
Upstream: v5.7
d8f823
d8f823
commit a683012a8e77675a1947cc8f11f97cdc1d5bb769
d8f823
Author: Pablo Neira Ayuso <pablo@netfilter.org>
d8f823
Date:   Sun Apr 19 14:12:35 2020 +0200
d8f823
d8f823
    net/mlx5e: replace EINVAL in mlx5e_flower_parse_meta()
d8f823
d8f823
    The drivers reports EINVAL to userspace through netlink on invalid meta
d8f823
    match. This is confusing since EINVAL is usually reserved for malformed
d8f823
    netlink messages. Replace it by more meaningful codes.
d8f823
d8f823
    Fixes: 6d65bc64e232 ("net/mlx5e: Add mlx5e_flower_parse_meta support")
d8f823
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
d8f823
    Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
d8f823
d8f823
Signed-off-by: Alaa Hleihel <ahleihel@redhat.com>
d8f823
Signed-off-by: Frantisek Hrbata <fhrbata@redhat.com>
d8f823
---
d8f823
 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 6 +++---
d8f823
 1 file changed, 3 insertions(+), 3 deletions(-)
d8f823
d8f823
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
d8f823
index 22b67563412d..2df19165a78a 100644
d8f823
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
d8f823
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
d8f823
@@ -2078,7 +2078,7 @@ static int mlx5e_flower_parse_meta(struct net_device *filter_dev,
d8f823
 	flow_rule_match_meta(rule, &match);
d8f823
 	if (match.mask->ingress_ifindex != 0xFFFFFFFF) {
d8f823
 		NL_SET_ERR_MSG_MOD(extack, "Unsupported ingress ifindex mask");
d8f823
-		return -EINVAL;
d8f823
+		return -EOPNOTSUPP;
d8f823
 	}
d8f823
 
d8f823
 	ingress_dev = __dev_get_by_index(dev_net(filter_dev),
d8f823
@@ -2086,13 +2086,13 @@ static int mlx5e_flower_parse_meta(struct net_device *filter_dev,
d8f823
 	if (!ingress_dev) {
d8f823
 		NL_SET_ERR_MSG_MOD(extack,
d8f823
 				   "Can't find the ingress port to match on");
d8f823
-		return -EINVAL;
d8f823
+		return -ENOENT;
d8f823
 	}
d8f823
 
d8f823
 	if (ingress_dev != filter_dev) {
d8f823
 		NL_SET_ERR_MSG_MOD(extack,
d8f823
 				   "Can't match on the ingress filter port");
d8f823
-		return -EINVAL;
d8f823
+		return -EOPNOTSUPP;
d8f823
 	}
d8f823
 
d8f823
 	return 0;
d8f823
-- 
d8f823
2.13.6
d8f823