Commit e66cbc96 authored by Paul Blakey's avatar Paul Blakey Committed by Saeed Mahameed

net/mlx5: ft: Use getter function to get ft chain

FT chain is defined as the next chain after tc.

To prepare for next patches that will increase the number of tc
chains available at runtime, use a getter function to get this
value.

The define is still used in static fs_core allocation,
to calculate the number of chains. This static allocation
will be used if the relevant capabilities won't be available
to support dynamic chains.
Signed-off-by: default avatarPaul Blakey <paulb@mellanox.com>
Reviewed-by: default avatarRoi Dayan <roid@mellanox.com>
Reviewed-by: default avatarMark Bloch <markb@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
parent 79cdb0aa
...@@ -1268,7 +1268,7 @@ static int mlx5e_rep_setup_ft_cb(enum tc_setup_type type, void *type_data, ...@@ -1268,7 +1268,7 @@ static int mlx5e_rep_setup_ft_cb(enum tc_setup_type type, void *type_data,
* reserved ft chain. * reserved ft chain.
*/ */
memcpy(&cls_flower, f, sizeof(*f)); memcpy(&cls_flower, f, sizeof(*f));
cls_flower.common.chain_index = FDB_FT_CHAIN; cls_flower.common.chain_index = mlx5_eswitch_get_ft_chain(esw);
err = mlx5e_rep_setup_tc_cls_flower(priv, &cls_flower, flags); err = mlx5e_rep_setup_tc_cls_flower(priv, &cls_flower, flags);
memcpy(&f->stats, &cls_flower.stats, sizeof(f->stats)); memcpy(&f->stats, &cls_flower.stats, sizeof(f->stats));
return err; return err;
......
...@@ -364,6 +364,9 @@ mlx5_eswitch_get_prio_range(struct mlx5_eswitch *esw); ...@@ -364,6 +364,9 @@ mlx5_eswitch_get_prio_range(struct mlx5_eswitch *esw);
u32 u32
mlx5_eswitch_get_chain_range(struct mlx5_eswitch *esw); mlx5_eswitch_get_chain_range(struct mlx5_eswitch *esw);
unsigned int
mlx5_eswitch_get_ft_chain(struct mlx5_eswitch *esw);
struct mlx5_flow_handle * struct mlx5_flow_handle *
mlx5_eswitch_create_vport_rx_rule(struct mlx5_eswitch *esw, u16 vport, mlx5_eswitch_create_vport_rx_rule(struct mlx5_eswitch *esw, u16 vport,
struct mlx5_flow_destination *dest); struct mlx5_flow_destination *dest);
......
...@@ -80,6 +80,11 @@ u32 mlx5_eswitch_get_chain_range(struct mlx5_eswitch *esw) ...@@ -80,6 +80,11 @@ u32 mlx5_eswitch_get_chain_range(struct mlx5_eswitch *esw)
return 0; return 0;
} }
u32 mlx5_eswitch_get_ft_chain(struct mlx5_eswitch *esw)
{
return mlx5_eswitch_get_chain_range(esw) + 1;
}
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)
......
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