OSDN Git Service

net/mlx5: E-Switch, fix changing vf VLANID
authorAlaa Hleihel <alaa@nvidia.com>
Mon, 4 Jan 2021 10:54:40 +0000 (12:54 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Thu, 7 Jan 2021 20:22:49 +0000 (12:22 -0800)
Adding vf VLANID for the first time, or after having cleared previously
defined VLANID works fine, however, attempting to change an existing vf
VLANID clears the rules on the firmware, but does not add new rules for
the new vf VLANID.

Fix this by changing the logic in function esw_acl_egress_lgcy_setup()
so that it will always configure egress rules.

Fixes: ea651a86d468 ("net/mlx5: E-Switch, Refactor eswitch egress acl codes")
Signed-off-by: Alaa Hleihel <alaa@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/esw/acl/egress_lgcy.c

index 2b85d47..3e19b17 100644 (file)
@@ -95,22 +95,21 @@ int esw_acl_egress_lgcy_setup(struct mlx5_eswitch *esw,
                return 0;
        }
 
-       if (!IS_ERR_OR_NULL(vport->egress.acl))
-               return 0;
-
-       vport->egress.acl = esw_acl_table_create(esw, vport->vport,
-                                                MLX5_FLOW_NAMESPACE_ESW_EGRESS,
-                                                table_size);
-       if (IS_ERR(vport->egress.acl)) {
-               err = PTR_ERR(vport->egress.acl);
-               vport->egress.acl = NULL;
-               goto out;
+       if (!vport->egress.acl) {
+               vport->egress.acl = esw_acl_table_create(esw, vport->vport,
+                                                        MLX5_FLOW_NAMESPACE_ESW_EGRESS,
+                                                        table_size);
+               if (IS_ERR(vport->egress.acl)) {
+                       err = PTR_ERR(vport->egress.acl);
+                       vport->egress.acl = NULL;
+                       goto out;
+               }
+
+               err = esw_acl_egress_lgcy_groups_create(esw, vport);
+               if (err)
+                       goto out;
        }
 
-       err = esw_acl_egress_lgcy_groups_create(esw, vport);
-       if (err)
-               goto out;
-
        esw_debug(esw->dev,
                  "vport[%d] configure egress rules, vlan(%d) qos(%d)\n",
                  vport->vport, vport->info.vlan, vport->info.qos);