net/mlx5: E-Switch, Create a dedicated send to vport rule deletion function
authorMark Bloch <markb@mellanox.com>
Thu, 7 Dec 2017 15:36:59 +0000 (15:36 +0000)
committerSaeed Mahameed <saeedm@mellanox.com>
Thu, 28 Dec 2017 10:36:33 +0000 (12:36 +0200)
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
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c

index 19edaa155062b4e87939ce9aed4e9f9623432d88..01bf4e3c8afae40a060c28b1ef5095a09ea6599a 100644 (file)
@@ -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);
        }
index 21b506fd2b67610348ef4c3a42919d6055b350fc..9ed40122522523af551004f5b312d4a33166ce36 100644 (file)
@@ -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;
index 90a30c51d92e6188790f381c0b985f0acb281650..121609b823c6ea5c95dab3e3665ee399634644c9 100644 (file)
@@ -339,6 +339,11 @@ out:
        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};