Commit 2cf2954b authored by Paul Blakey's avatar Paul Blakey Committed by Saeed Mahameed

net/mlx5: Rename FDB_* tc related defines to FDB_TC_* defines

Rename it to prepare for next patch that will add a
different type of offload to the FDB.
Signed-off-by: default avatarPaul Blakey <paulb@mellanox.com>
Reviewed-by: default avatarMark Bloch <markb@mellanox.com>
Acked-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
parent 12063c2e
...@@ -1074,7 +1074,7 @@ mlx5e_tc_offload_to_slow_path(struct mlx5_eswitch *esw, ...@@ -1074,7 +1074,7 @@ mlx5e_tc_offload_to_slow_path(struct mlx5_eswitch *esw,
memcpy(slow_attr, flow->esw_attr, sizeof(*slow_attr)); memcpy(slow_attr, flow->esw_attr, sizeof(*slow_attr));
slow_attr->action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST; slow_attr->action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
slow_attr->split_count = 0; slow_attr->split_count = 0;
slow_attr->dest_chain = FDB_SLOW_PATH_CHAIN; slow_attr->dest_chain = FDB_TC_SLOW_PATH_CHAIN;
rule = mlx5e_tc_offload_fdb_rules(esw, flow, spec, slow_attr); rule = mlx5e_tc_offload_fdb_rules(esw, flow, spec, slow_attr);
if (!IS_ERR(rule)) if (!IS_ERR(rule))
...@@ -1091,7 +1091,7 @@ mlx5e_tc_unoffload_from_slow_path(struct mlx5_eswitch *esw, ...@@ -1091,7 +1091,7 @@ mlx5e_tc_unoffload_from_slow_path(struct mlx5_eswitch *esw,
memcpy(slow_attr, flow->esw_attr, sizeof(*slow_attr)); memcpy(slow_attr, flow->esw_attr, sizeof(*slow_attr));
slow_attr->action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST; slow_attr->action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
slow_attr->split_count = 0; slow_attr->split_count = 0;
slow_attr->dest_chain = FDB_SLOW_PATH_CHAIN; slow_attr->dest_chain = FDB_TC_SLOW_PATH_CHAIN;
mlx5e_tc_unoffload_fdb_rules(esw, flow, slow_attr); mlx5e_tc_unoffload_fdb_rules(esw, flow, slow_attr);
flow_flag_clear(flow, SLOW); flow_flag_clear(flow, SLOW);
} }
......
...@@ -43,9 +43,9 @@ ...@@ -43,9 +43,9 @@
#include <linux/mlx5/fs.h> #include <linux/mlx5/fs.h>
#include "lib/mpfs.h" #include "lib/mpfs.h"
#define FDB_MAX_CHAIN 3 #define FDB_TC_MAX_CHAIN 3
#define FDB_SLOW_PATH_CHAIN (FDB_MAX_CHAIN + 1) #define FDB_TC_SLOW_PATH_CHAIN (FDB_TC_MAX_CHAIN + 1)
#define FDB_MAX_PRIO 16 #define FDB_TC_MAX_PRIO 16
#ifdef CONFIG_MLX5_ESWITCH #ifdef CONFIG_MLX5_ESWITCH
...@@ -173,7 +173,7 @@ struct mlx5_eswitch_fdb { ...@@ -173,7 +173,7 @@ struct mlx5_eswitch_fdb {
struct { struct {
struct mlx5_flow_table *fdb; struct mlx5_flow_table *fdb;
u32 num_rules; u32 num_rules;
} fdb_prio[FDB_MAX_CHAIN + 1][FDB_MAX_PRIO + 1][PRIO_LEVELS]; } fdb_prio[FDB_TC_MAX_CHAIN + 1][FDB_TC_MAX_PRIO + 1][PRIO_LEVELS];
/* Protects fdb_prio table */ /* Protects fdb_prio table */
struct mutex fdb_prio_lock; struct mutex fdb_prio_lock;
......
...@@ -75,7 +75,7 @@ bool mlx5_eswitch_prios_supported(struct mlx5_eswitch *esw) ...@@ -75,7 +75,7 @@ bool mlx5_eswitch_prios_supported(struct mlx5_eswitch *esw)
u32 mlx5_eswitch_get_chain_range(struct mlx5_eswitch *esw) u32 mlx5_eswitch_get_chain_range(struct mlx5_eswitch *esw)
{ {
if (esw->fdb_table.flags & ESW_FDB_CHAINS_AND_PRIOS_SUPPORTED) if (esw->fdb_table.flags & ESW_FDB_CHAINS_AND_PRIOS_SUPPORTED)
return FDB_MAX_CHAIN; return FDB_TC_MAX_CHAIN;
return 0; return 0;
} }
...@@ -83,7 +83,7 @@ u32 mlx5_eswitch_get_chain_range(struct mlx5_eswitch *esw) ...@@ -83,7 +83,7 @@ u32 mlx5_eswitch_get_chain_range(struct mlx5_eswitch *esw)
u16 mlx5_eswitch_get_prio_range(struct mlx5_eswitch *esw) u16 mlx5_eswitch_get_prio_range(struct mlx5_eswitch *esw)
{ {
if (esw->fdb_table.flags & ESW_FDB_CHAINS_AND_PRIOS_SUPPORTED) if (esw->fdb_table.flags & ESW_FDB_CHAINS_AND_PRIOS_SUPPORTED)
return FDB_MAX_PRIO; return FDB_TC_MAX_PRIO;
return 1; return 1;
} }
...@@ -928,7 +928,7 @@ esw_get_prio_table(struct mlx5_eswitch *esw, u32 chain, u16 prio, int level) ...@@ -928,7 +928,7 @@ esw_get_prio_table(struct mlx5_eswitch *esw, u32 chain, u16 prio, int level)
int table_prio, l = 0; int table_prio, l = 0;
u32 flags = 0; u32 flags = 0;
if (chain == FDB_SLOW_PATH_CHAIN) if (chain == FDB_TC_SLOW_PATH_CHAIN)
return esw->fdb_table.offloads.slow_fdb; return esw->fdb_table.offloads.slow_fdb;
mutex_lock(&esw->fdb_table.offloads.fdb_prio_lock); mutex_lock(&esw->fdb_table.offloads.fdb_prio_lock);
...@@ -953,7 +953,7 @@ esw_get_prio_table(struct mlx5_eswitch *esw, u32 chain, u16 prio, int level) ...@@ -953,7 +953,7 @@ esw_get_prio_table(struct mlx5_eswitch *esw, u32 chain, u16 prio, int level)
flags |= (MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT | flags |= (MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT |
MLX5_FLOW_TABLE_TUNNEL_EN_DECAP); MLX5_FLOW_TABLE_TUNNEL_EN_DECAP);
table_prio = (chain * FDB_MAX_PRIO) + prio - 1; table_prio = (chain * FDB_TC_MAX_PRIO) + prio - 1;
/* create earlier levels for correct fs_core lookup when /* create earlier levels for correct fs_core lookup when
* connecting tables * connecting tables
...@@ -990,7 +990,7 @@ esw_put_prio_table(struct mlx5_eswitch *esw, u32 chain, u16 prio, int level) ...@@ -990,7 +990,7 @@ esw_put_prio_table(struct mlx5_eswitch *esw, u32 chain, u16 prio, int level)
{ {
int l; int l;
if (chain == FDB_SLOW_PATH_CHAIN) if (chain == FDB_TC_SLOW_PATH_CHAIN)
return; return;
mutex_lock(&esw->fdb_table.offloads.fdb_prio_lock); mutex_lock(&esw->fdb_table.offloads.fdb_prio_lock);
......
...@@ -2565,7 +2565,7 @@ static int init_fdb_root_ns(struct mlx5_flow_steering *steering) ...@@ -2565,7 +2565,7 @@ static int init_fdb_root_ns(struct mlx5_flow_steering *steering)
return -ENOMEM; return -ENOMEM;
steering->fdb_sub_ns = kzalloc(sizeof(steering->fdb_sub_ns) * steering->fdb_sub_ns = kzalloc(sizeof(steering->fdb_sub_ns) *
(FDB_MAX_CHAIN + 1), GFP_KERNEL); (FDB_TC_MAX_CHAIN + 1), GFP_KERNEL);
if (!steering->fdb_sub_ns) if (!steering->fdb_sub_ns)
return -ENOMEM; return -ENOMEM;
...@@ -2576,7 +2576,7 @@ static int init_fdb_root_ns(struct mlx5_flow_steering *steering) ...@@ -2576,7 +2576,7 @@ static int init_fdb_root_ns(struct mlx5_flow_steering *steering)
goto out_err; goto out_err;
} }
levels = 2 * FDB_MAX_PRIO * (FDB_MAX_CHAIN + 1); levels = 2 * FDB_TC_MAX_PRIO * (FDB_TC_MAX_CHAIN + 1);
maj_prio = fs_create_prio_chained(&steering->fdb_root_ns->ns, maj_prio = fs_create_prio_chained(&steering->fdb_root_ns->ns,
FDB_FAST_PATH, FDB_FAST_PATH,
levels); levels);
...@@ -2585,14 +2585,14 @@ static int init_fdb_root_ns(struct mlx5_flow_steering *steering) ...@@ -2585,14 +2585,14 @@ static int init_fdb_root_ns(struct mlx5_flow_steering *steering)
goto out_err; goto out_err;
} }
for (chain = 0; chain <= FDB_MAX_CHAIN; chain++) { for (chain = 0; chain <= FDB_TC_MAX_CHAIN; chain++) {
ns = fs_create_namespace(maj_prio, MLX5_FLOW_TABLE_MISS_ACTION_DEF); ns = fs_create_namespace(maj_prio, MLX5_FLOW_TABLE_MISS_ACTION_DEF);
if (IS_ERR(ns)) { if (IS_ERR(ns)) {
err = PTR_ERR(ns); err = PTR_ERR(ns);
goto out_err; goto out_err;
} }
for (prio = 0; prio < FDB_MAX_PRIO * (chain + 1); prio++) { for (prio = 0; prio < FDB_TC_MAX_PRIO * (chain + 1); prio++) {
min_prio = fs_create_prio(ns, prio, 2); min_prio = fs_create_prio(ns, prio, 2);
if (IS_ERR(min_prio)) { if (IS_ERR(min_prio)) {
err = PTR_ERR(min_prio); err = PTR_ERR(min_prio);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment