All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeedm@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>,
	Doug Ledford <dledford@redhat.com>
Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
	Leon Romanovsky <leonro@mellanox.com>,
	Mark Bloch <markb@mellanox.com>,
	Saeed Mahameed <saeedm@mellanox.com>
Subject: [for-next V3 05/11] net/mlx5: E-Switch, Create a dedicated send to vport rule deletion function
Date: Fri, 29 Dec 2017 01:23:08 +0200	[thread overview]
Message-ID: <20171228232314.13678-6-saeedm@mellanox.com> (raw)
In-Reply-To: <20171228232314.13678-1-saeedm@mellanox.com>

From: Mark Bloch <markb@mellanox.com>

In order for representors to send packets directly to VFs we use an
E-Switch function which insert special rules into the HW. For symmetry
create an E-Switch function that deletes these rules as well.

Signed-off-by: Mark Bloch <markb@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_rep.c           | 2 +-
 drivers/net/ethernet/mellanox/mlx5/core/eswitch.h          | 1 +
 drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 5 +++++
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
index 19edaa155062..01bf4e3c8afa 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
@@ -199,7 +199,7 @@ static void mlx5e_sqs2vport_stop(struct mlx5_eswitch *esw,
 		return;
 
 	list_for_each_entry_safe(esw_sq, tmp, &rep->vport_sqs_list, list) {
-		mlx5_del_flow_rules(esw_sq->send_to_vport_rule);
+		mlx5_eswitch_del_send_to_vport_rule(esw_sq->send_to_vport_rule);
 		list_del(&esw_sq->list);
 		kfree(esw_sq);
 	}
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
index 21b506fd2b67..9ed401225225 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
@@ -225,6 +225,7 @@ int mlx5_eswitch_get_vport_stats(struct mlx5_eswitch *esw,
 struct mlx5_flow_handle *
 mlx5_eswitch_add_send_to_vport_rule(struct mlx5_eswitch *esw, int vport,
 				    u32 sqn);
+void mlx5_eswitch_del_send_to_vport_rule(struct mlx5_flow_handle *rule);
 
 struct mlx5_flow_spec;
 struct mlx5_esw_flow_attr;
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index 90a30c51d92e..121609b823c6 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -339,6 +339,11 @@ mlx5_eswitch_add_send_to_vport_rule(struct mlx5_eswitch *esw, int vport, u32 sqn
 	return flow_rule;
 }
 
+void mlx5_eswitch_del_send_to_vport_rule(struct mlx5_flow_handle *rule)
+{
+	mlx5_del_flow_rules(rule);
+}
+
 static int esw_add_fdb_miss_rule(struct mlx5_eswitch *esw)
 {
 	struct mlx5_flow_act flow_act = {0};
-- 
2.13.0

  parent reply	other threads:[~2017-12-28 23:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-28 23:23 [pull request][for-next V3 00/11] Mellanox, mlx5 E-Switch updates 2017-12-19 Saeed Mahameed
2017-12-28 23:23 ` [for-next V3 02/11] net/mlx5: E-Switch, Refactor load/unload of representors Saeed Mahameed
     [not found] ` <20171228232314.13678-1-saeedm-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-12-28 23:23   ` [for-next V3 01/11] net/mlx5: E-Switch, Refactor vport representors initialization Saeed Mahameed
2017-12-28 23:23   ` [for-next V3 03/11] net/mlx5: E-Switch, Simplify representor load/unload callback API Saeed Mahameed
2017-12-28 23:23   ` [for-next V3 10/11] net/mlx5: Fix ingress/egress naming mistake Saeed Mahameed
2017-12-28 23:23 ` [for-next V3 04/11] net/mlx5: E-Switch, Move mlx5e only logic outside E-Switch Saeed Mahameed
2017-12-28 23:23 ` Saeed Mahameed [this message]
2017-12-28 23:23 ` [for-next V3 06/11] net/mlx5e: Move ethernet representors data into separate struct Saeed Mahameed
2017-12-28 23:23 ` [for-next V3 07/11] net/mlx5: E-Switch, Create generic header struct to be used by representors Saeed Mahameed
2017-12-28 23:23 ` [for-next V3 08/11] net/mlx5e: E-Switch, Move send-to-vport rule struct to en_rep Saeed Mahameed
2017-12-28 23:23 ` [for-next V3 09/11] net/mlx5e: E-Switch, Use the name of static array instead of its address Saeed Mahameed
2017-12-28 23:23 ` [for-next V3 11/11] net/mlx5: Separate ingress/egress namespaces for each vport Saeed Mahameed
2017-12-29  0:46 ` [pull request][for-next V3 00/11] Mellanox, mlx5 E-Switch updates 2017-12-19 David Miller
     [not found]   ` <20171228.194616.2274862427545657993.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2018-01-05 19:07     ` Doug Ledford
     [not found]       ` <1515179254.3403.32.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-01-05 19:26         ` Jason Gunthorpe
2018-01-05 19:33           ` Doug Ledford

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171228232314.13678-6-saeedm@mellanox.com \
    --to=saeedm@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=dledford@redhat.com \
    --cc=leonro@mellanox.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=markb@mellanox.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.