net/mlx5: E-Switch, Refactor eswitch ingress acl codes
[linux-2.6-microblaze.git] / drivers / net / ethernet / mellanox / mlx5 / core / esw / acl / helper.c
index 8b79967..22f4c1c 100644 (file)
@@ -140,3 +140,21 @@ void esw_acl_egress_table_destroy(struct mlx5_vport *vport)
        mlx5_destroy_flow_table(vport->egress.acl);
        vport->egress.acl = NULL;
 }
+
+void esw_acl_ingress_table_destroy(struct mlx5_vport *vport)
+{
+       if (!vport->ingress.acl)
+               return;
+
+       mlx5_destroy_flow_table(vport->ingress.acl);
+       vport->ingress.acl = NULL;
+}
+
+void esw_acl_ingress_allow_rule_destroy(struct mlx5_vport *vport)
+{
+       if (!vport->ingress.allow_rule)
+               return;
+
+       mlx5_del_flow_rules(vport->ingress.allow_rule);
+       vport->ingress.allow_rule = NULL;
+}