Skip to content

Commit 2cf2954

Browse files
Paul BlakeySaeed Mahameed
authored andcommitted
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: Paul Blakey <[email protected]> Reviewed-by: Mark Bloch <[email protected]> Acked-by: Pablo Neira Ayuso <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 12063c2 commit 2cf2954

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_tc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,7 @@ mlx5e_tc_offload_to_slow_path(struct mlx5_eswitch *esw,
10741074
memcpy(slow_attr, flow->esw_attr, sizeof(*slow_attr));
10751075
slow_attr->action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
10761076
slow_attr->split_count = 0;
1077-
slow_attr->dest_chain = FDB_SLOW_PATH_CHAIN;
1077+
slow_attr->dest_chain = FDB_TC_SLOW_PATH_CHAIN;
10781078

10791079
rule = mlx5e_tc_offload_fdb_rules(esw, flow, spec, slow_attr);
10801080
if (!IS_ERR(rule))
@@ -1091,7 +1091,7 @@ mlx5e_tc_unoffload_from_slow_path(struct mlx5_eswitch *esw,
10911091
memcpy(slow_attr, flow->esw_attr, sizeof(*slow_attr));
10921092
slow_attr->action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
10931093
slow_attr->split_count = 0;
1094-
slow_attr->dest_chain = FDB_SLOW_PATH_CHAIN;
1094+
slow_attr->dest_chain = FDB_TC_SLOW_PATH_CHAIN;
10951095
mlx5e_tc_unoffload_fdb_rules(esw, flow, slow_attr);
10961096
flow_flag_clear(flow, SLOW);
10971097
}

drivers/net/ethernet/mellanox/mlx5/core/eswitch.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
4343
#include <linux/mlx5/fs.h>
4444
#include "lib/mpfs.h"
4545

46-
#define FDB_MAX_CHAIN 3
47-
#define FDB_SLOW_PATH_CHAIN (FDB_MAX_CHAIN + 1)
48-
#define FDB_MAX_PRIO 16
46+
#define FDB_TC_MAX_CHAIN 3
47+
#define FDB_TC_SLOW_PATH_CHAIN (FDB_TC_MAX_CHAIN + 1)
48+
#define FDB_TC_MAX_PRIO 16
4949

5050
#ifdef CONFIG_MLX5_ESWITCH
5151

@@ -173,7 +173,7 @@ struct mlx5_eswitch_fdb {
173173
struct {
174174
struct mlx5_flow_table *fdb;
175175
u32 num_rules;
176-
} fdb_prio[FDB_MAX_CHAIN + 1][FDB_MAX_PRIO + 1][PRIO_LEVELS];
176+
} fdb_prio[FDB_TC_MAX_CHAIN + 1][FDB_TC_MAX_PRIO + 1][PRIO_LEVELS];
177177
/* Protects fdb_prio table */
178178
struct mutex fdb_prio_lock;
179179

drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,15 @@ bool mlx5_eswitch_prios_supported(struct mlx5_eswitch *esw)
7575
u32 mlx5_eswitch_get_chain_range(struct mlx5_eswitch *esw)
7676
{
7777
if (esw->fdb_table.flags & ESW_FDB_CHAINS_AND_PRIOS_SUPPORTED)
78-
return FDB_MAX_CHAIN;
78+
return FDB_TC_MAX_CHAIN;
7979

8080
return 0;
8181
}
8282

8383
u16 mlx5_eswitch_get_prio_range(struct mlx5_eswitch *esw)
8484
{
8585
if (esw->fdb_table.flags & ESW_FDB_CHAINS_AND_PRIOS_SUPPORTED)
86-
return FDB_MAX_PRIO;
86+
return FDB_TC_MAX_PRIO;
8787

8888
return 1;
8989
}
@@ -928,7 +928,7 @@ esw_get_prio_table(struct mlx5_eswitch *esw, u32 chain, u16 prio, int level)
928928
int table_prio, l = 0;
929929
u32 flags = 0;
930930

931-
if (chain == FDB_SLOW_PATH_CHAIN)
931+
if (chain == FDB_TC_SLOW_PATH_CHAIN)
932932
return esw->fdb_table.offloads.slow_fdb;
933933

934934
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)
953953
flags |= (MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT |
954954
MLX5_FLOW_TABLE_TUNNEL_EN_DECAP);
955955

956-
table_prio = (chain * FDB_MAX_PRIO) + prio - 1;
956+
table_prio = (chain * FDB_TC_MAX_PRIO) + prio - 1;
957957

958958
/* create earlier levels for correct fs_core lookup when
959959
* connecting tables
@@ -990,7 +990,7 @@ esw_put_prio_table(struct mlx5_eswitch *esw, u32 chain, u16 prio, int level)
990990
{
991991
int l;
992992

993-
if (chain == FDB_SLOW_PATH_CHAIN)
993+
if (chain == FDB_TC_SLOW_PATH_CHAIN)
994994
return;
995995

996996
mutex_lock(&esw->fdb_table.offloads.fdb_prio_lock);

drivers/net/ethernet/mellanox/mlx5/core/fs_core.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2565,7 +2565,7 @@ static int init_fdb_root_ns(struct mlx5_flow_steering *steering)
25652565
return -ENOMEM;
25662566

25672567
steering->fdb_sub_ns = kzalloc(sizeof(steering->fdb_sub_ns) *
2568-
(FDB_MAX_CHAIN + 1), GFP_KERNEL);
2568+
(FDB_TC_MAX_CHAIN + 1), GFP_KERNEL);
25692569
if (!steering->fdb_sub_ns)
25702570
return -ENOMEM;
25712571

@@ -2576,7 +2576,7 @@ static int init_fdb_root_ns(struct mlx5_flow_steering *steering)
25762576
goto out_err;
25772577
}
25782578

2579-
levels = 2 * FDB_MAX_PRIO * (FDB_MAX_CHAIN + 1);
2579+
levels = 2 * FDB_TC_MAX_PRIO * (FDB_TC_MAX_CHAIN + 1);
25802580
maj_prio = fs_create_prio_chained(&steering->fdb_root_ns->ns,
25812581
FDB_FAST_PATH,
25822582
levels);
@@ -2585,14 +2585,14 @@ static int init_fdb_root_ns(struct mlx5_flow_steering *steering)
25852585
goto out_err;
25862586
}
25872587

2588-
for (chain = 0; chain <= FDB_MAX_CHAIN; chain++) {
2588+
for (chain = 0; chain <= FDB_TC_MAX_CHAIN; chain++) {
25892589
ns = fs_create_namespace(maj_prio, MLX5_FLOW_TABLE_MISS_ACTION_DEF);
25902590
if (IS_ERR(ns)) {
25912591
err = PTR_ERR(ns);
25922592
goto out_err;
25932593
}
25942594

2595-
for (prio = 0; prio < FDB_MAX_PRIO * (chain + 1); prio++) {
2595+
for (prio = 0; prio < FDB_TC_MAX_PRIO * (chain + 1); prio++) {
25962596
min_prio = fs_create_prio(ns, prio, 2);
25972597
if (IS_ERR(min_prio)) {
25982598
err = PTR_ERR(min_prio);

0 commit comments

Comments
 (0)