Skip to content

Commit 4c71ce5

Browse files
maorgottliebSaeed Mahameed
authored andcommitted
net/mlx5: Support partial TTC rules
Add bitmasks to ttc_params to indicate if rule is valid or not. It will allow to create TTC table with support only in part of the traffic types. In later patches which introduce the steering based LAG port selection, TTC will be created with only part of the rules according to the hash type. Signed-off-by: Maor Gottlieb <maorg@nvidia.com> Reviewed-by: Mark Bloch <mbloch@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
1 parent 939a656 commit 4c71ce5

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

drivers/net/ethernet/mellanox/mlx5/core/lib/fs_ttc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,8 @@ static int mlx5_generate_ttc_table_rules(struct mlx5_core_dev *dev,
247247
for (tt = 0; tt < MLX5_NUM_TT; tt++) {
248248
struct mlx5_ttc_rule *rule = &rules[tt];
249249

250+
if (test_bit(tt, params->ignore_dests))
251+
continue;
250252
rule->rule = mlx5_generate_ttc_rule(dev, ft, &params->dests[tt],
251253
ttc_rules[tt].etype,
252254
ttc_rules[tt].proto);
@@ -266,6 +268,8 @@ static int mlx5_generate_ttc_table_rules(struct mlx5_core_dev *dev,
266268
if (!mlx5_tunnel_proto_supported_rx(dev,
267269
ttc_tunnel_rules[tt].proto))
268270
continue;
271+
if (test_bit(tt, params->ignore_tunnel_dests))
272+
continue;
269273
trules[tt] = mlx5_generate_ttc_rule(dev, ft,
270274
&params->tunnel_dests[tt],
271275
ttc_tunnel_rules[tt].etype,

drivers/net/ethernet/mellanox/mlx5/core/lib/fs_ttc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ struct ttc_params {
4343
struct mlx5_flow_namespace *ns;
4444
struct mlx5_flow_table_attr ft_attr;
4545
struct mlx5_flow_destination dests[MLX5_NUM_TT];
46+
DECLARE_BITMAP(ignore_dests, MLX5_NUM_TT);
4647
bool inner_ttc;
48+
DECLARE_BITMAP(ignore_tunnel_dests, MLX5_NUM_TUNNEL_TT);
4749
struct mlx5_flow_destination tunnel_dests[MLX5_NUM_TUNNEL_TT];
4850
};
4951

0 commit comments

Comments
 (0)