Skip to content

Commit 34b13cb

Browse files
Paul BlakeySaeed Mahameed
authored andcommitted
net/mlx5: Accumulate levels for chains prio namespaces
Tc chains are implemented by creating a chained prio steering type, and inside it there is a namespace for each chain (FDB_TC_MAX_CHAINS). Each of those has a list of priorities. Currently, all namespaces in a prio start at the parent prio level. But since we can jump from chain (namespace) to another chain in the same prio, we need the levels for higher chains to be higher as well. So we created unused prios to account for levels in previous namespaces. Fix that by accumulating the namespaces levels if we are inside a chained type prio, and removing the unused prios. Fixes: 328edb4 ('net/mlx5: Split FDB fast path prio to multiple namespaces') 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 4db7b98 commit 34b13cb

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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_TC_MAX_PRIO) + prio - 1;
956+
table_prio = prio - 1;
957957

958958
/* create earlier levels for correct fs_core lookup when
959959
* connecting tables

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2359,9 +2359,17 @@ static void set_prio_attrs_in_prio(struct fs_prio *prio, int acc_level)
23592359
int acc_level_ns = acc_level;
23602360

23612361
prio->start_level = acc_level;
2362-
fs_for_each_ns(ns, prio)
2362+
fs_for_each_ns(ns, prio) {
23632363
/* This updates start_level and num_levels of ns's priority descendants */
23642364
acc_level_ns = set_prio_attrs_in_ns(ns, acc_level);
2365+
2366+
/* If this a prio with chains, and we can jump from one chain
2367+
* (namepsace) to another, so we accumulate the levels
2368+
*/
2369+
if (prio->node.type == FS_TYPE_PRIO_CHAINS)
2370+
acc_level = acc_level_ns;
2371+
}
2372+
23652373
if (!prio->num_levels)
23662374
prio->num_levels = acc_level_ns - prio->start_level;
23672375
WARN_ON(prio->num_levels < acc_level_ns - prio->start_level);

0 commit comments

Comments
 (0)