]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
net/mlx5: E-Switch, don't use hardcoded values for FDB prios
authorMark Bloch <markb@mellanox.com>
Thu, 28 Mar 2019 13:27:31 +0000 (15:27 +0200)
committerLeon Romanovsky <leonro@mellanox.com>
Wed, 10 Apr 2019 06:28:41 +0000 (09:28 +0300)
When creating the FDB prios, use the enum values already defined and not
the hardcoded values.

Signed-off-by: Mark Bloch <markb@mellanox.com>
Reviewed-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
include/linux/mlx5/fs.h

index 1496e82b51085b6e50805268b5fb254158b27874..8a214ada2424a55149f4afe4042796bb956fc8b1 100644 (file)
 #include "fs_core.h"
 #include "lib/devcom.h"
 
-enum {
-       FDB_FAST_PATH = 0,
-       FDB_SLOW_PATH
-};
-
 /* There are two match-all miss flows, one for unicast dst mac and
  * one for multicast.
  */
index 8d199c5e7c81528d92a1628813d5faa5630eb49f..8b96f71332d8299a10f24f4db12acd7325ab5b2a 100644 (file)
@@ -2479,7 +2479,8 @@ static int init_fdb_root_ns(struct mlx5_flow_steering *steering)
                return -ENOMEM;
 
        levels = 2 * FDB_MAX_PRIO * (FDB_MAX_CHAIN + 1);
-       maj_prio = fs_create_prio_chained(&steering->fdb_root_ns->ns, 0,
+       maj_prio = fs_create_prio_chained(&steering->fdb_root_ns->ns,
+                                         FDB_FAST_PATH,
                                          levels);
        if (IS_ERR(maj_prio)) {
                err = PTR_ERR(maj_prio);
@@ -2504,7 +2505,7 @@ static int init_fdb_root_ns(struct mlx5_flow_steering *steering)
                steering->fdb_sub_ns[chain] = ns;
        }
 
-       maj_prio = fs_create_prio(&steering->fdb_root_ns->ns, 1, 1);
+       maj_prio = fs_create_prio(&steering->fdb_root_ns->ns, FDB_SLOW_PATH, 1);
        if (IS_ERR(maj_prio)) {
                err = PTR_ERR(maj_prio);
                goto out_err;
index 9df51da04621bc51cea8bc0c4495869bd73c47e6..3eeb041543174fd57da7a7f8498b94a09644a9b7 100644 (file)
@@ -75,6 +75,11 @@ enum mlx5_flow_namespace_type {
        MLX5_FLOW_NAMESPACE_EGRESS,
 };
 
+enum {
+       FDB_FAST_PATH,
+       FDB_SLOW_PATH,
+};
+
 struct mlx5_flow_table;
 struct mlx5_flow_group;
 struct mlx5_flow_namespace;