Blame SOURCES/0084-netdrv-net-mlx5-Restrict-metadata-disablement-to-off.patch

d8f823
From 807c9a6c1824b43987f92a40a7ef47bd582a38e6 Mon Sep 17 00:00:00 2001
d8f823
From: Alaa Hleihel <ahleihel@redhat.com>
d8f823
Date: Sun, 10 May 2020 15:04:01 -0400
d8f823
Subject: [PATCH 084/312] [netdrv] net/mlx5: Restrict metadata disablement to
d8f823
 offloads mode
d8f823
d8f823
Message-id: <20200510150452.10307-37-ahleihel@redhat.com>
d8f823
Patchwork-id: 306660
d8f823
Patchwork-instance: patchwork
d8f823
O-Subject: [RHEL8.3 BZ 1789380 v2 36/87] net/mlx5: Restrict metadata disablement to offloads mode
d8f823
Bugzilla: 1789380
d8f823
RH-Acked-by: Kamal Heib <kheib@redhat.com>
d8f823
RH-Acked-by: Jarod Wilson <jarod@redhat.com>
d8f823
RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
d8f823
RH-Acked-by: Jonathan Toppins <jtoppins@redhat.com>
d8f823
d8f823
Bugzilla: http://bugzilla.redhat.com/1789380
d8f823
Upstream: v5.5-rc1
d8f823
d8f823
commit a962d7a61e2404cda6a89bfa5cc193c62223bb5e
d8f823
Author: Parav Pandit <parav@mellanox.com>
d8f823
Date:   Mon Oct 28 23:35:24 2019 +0000
d8f823
d8f823
    net/mlx5: Restrict metadata disablement to offloads mode
d8f823
d8f823
    Now that there is clear separation for acl setup/cleanup between legacy
d8f823
    and offloads mode, limit metdata disablement to offloads mode.
d8f823
d8f823
    Signed-off-by: Parav Pandit <parav@mellanox.com>
d8f823
    Reviewed-by: Vu Pham <vuhuong@mellanox.com>
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/eswitch.c          | 2 --
d8f823
 drivers/net/ethernet/mellanox/mlx5/core/eswitch.h          | 2 --
d8f823
 drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 9 ++++++---
d8f823
 3 files changed, 6 insertions(+), 7 deletions(-)
d8f823
d8f823
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
d8f823
index 91b5ec6c3e13..97af7d793435 100644
d8f823
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
d8f823
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
d8f823
@@ -1209,8 +1209,6 @@ void esw_vport_cleanup_ingress_rules(struct mlx5_eswitch *esw,
d8f823
 		mlx5_del_flow_rules(vport->ingress.allow_rule);
d8f823
 		vport->ingress.allow_rule = NULL;
d8f823
 	}
d8f823
-
d8f823
-	esw_vport_del_ingress_acl_modify_metadata(esw, vport);
d8f823
 }
d8f823
 
d8f823
 void esw_vport_disable_ingress_acl(struct mlx5_eswitch *esw,
d8f823
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
d8f823
index 0927019062d2..777224ed18bc 100644
d8f823
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
d8f823
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
d8f823
@@ -282,8 +282,6 @@ void esw_vport_disable_egress_acl(struct mlx5_eswitch *esw,
d8f823
 				  struct mlx5_vport *vport);
d8f823
 void esw_vport_disable_ingress_acl(struct mlx5_eswitch *esw,
d8f823
 				   struct mlx5_vport *vport);
d8f823
-void esw_vport_del_ingress_acl_modify_metadata(struct mlx5_eswitch *esw,
d8f823
-					       struct mlx5_vport *vport);
d8f823
 int mlx5_esw_modify_vport_rate(struct mlx5_eswitch *esw, u16 vport_num,
d8f823
 			       u32 rate_mbps);
d8f823
 
d8f823
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
d8f823
index 2485c2a7ad9d..767993b10110 100644
d8f823
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
d8f823
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
d8f823
@@ -1849,8 +1849,8 @@ static int esw_vport_add_ingress_acl_modify_metadata(struct mlx5_eswitch *esw,
d8f823
 	return err;
d8f823
 }
d8f823
 
d8f823
-void esw_vport_del_ingress_acl_modify_metadata(struct mlx5_eswitch *esw,
d8f823
-					       struct mlx5_vport *vport)
d8f823
+static void esw_vport_del_ingress_acl_modify_metadata(struct mlx5_eswitch *esw,
d8f823
+						      struct mlx5_vport *vport)
d8f823
 {
d8f823
 	if (vport->ingress.offloads.modify_metadata_rule) {
d8f823
 		mlx5_del_flow_rules(vport->ingress.offloads.modify_metadata_rule);
d8f823
@@ -1976,8 +1976,10 @@ esw_vport_create_offloads_acl_tables(struct mlx5_eswitch *esw,
d8f823
 
d8f823
 	if (mlx5_eswitch_is_vf_vport(esw, vport->vport)) {
d8f823
 		err = esw_vport_egress_config(esw, vport);
d8f823
-		if (err)
d8f823
+		if (err) {
d8f823
+			esw_vport_del_ingress_acl_modify_metadata(esw, vport);
d8f823
 			esw_vport_disable_ingress_acl(esw, vport);
d8f823
+		}
d8f823
 	}
d8f823
 	return err;
d8f823
 }
d8f823
@@ -1987,6 +1989,7 @@ esw_vport_destroy_offloads_acl_tables(struct mlx5_eswitch *esw,
d8f823
 				      struct mlx5_vport *vport)
d8f823
 {
d8f823
 	esw_vport_disable_egress_acl(esw, vport);
d8f823
+	esw_vport_del_ingress_acl_modify_metadata(esw, vport);
d8f823
 	esw_vport_disable_ingress_acl(esw, vport);
d8f823
 }
d8f823
 
d8f823
-- 
d8f823
2.13.6
d8f823