Skip to content

Commit 3ac5889

Browse files
nvmmaxKelsey Skunberg
authored andcommitted
net/mlx5e: Prohibit inner indir TIRs in IPoIB
BugLink: https://bugs.launchpad.net/bugs/1946024 [ Upstream commit 9c43f38 ] TIR's rx_hash_field_selector_inner can be enabled only when tunneled_offload_en = 1. tunneled_offload_en is filled according to the tunneled_offload_en field in struct mlx5e_params, which is false in the IPoIB profile. On the other hand, the IPoIB profile passes inner_ttc = true to mlx5e_create_indirect_tirs, which potentially allows the latter function to attempt to create inner indirect TIRs without having tunneled_offload_en set. This commit prohibits this behavior by passing inner_ttc = false to mlx5e_create_indirect_tirs. The latter function won't attempt to create inner indirect TIRs. As inner indirect TIRs are not created in the IPoIB profile (this commit blocks it explicitly, and even before they would have failed to be created), the call to mlx5e_create_inner_ttc_table in mlx5i_create_flow_steering is a no-op and can be removed. Fixes: 46dc933 ("net/mlx5e: Provide explicit directive if to create inner indirect tirs") Fixes: 458821c ("net/mlx5e: IPoIB, Add inner TTC table to IPoIB flow steering") Signed-off-by: Maxim Mikityanskiy <maximmi@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
1 parent 9ff4429 commit 3ac5889

3 files changed

Lines changed: 7 additions & 27 deletions

File tree

drivers/net/ethernet/mellanox/mlx5/core/en/fs.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -234,18 +234,12 @@ struct ttc_params {
234234

235235
void mlx5e_set_ttc_basic_params(struct mlx5e_priv *priv, struct ttc_params *ttc_params);
236236
void mlx5e_set_ttc_ft_params(struct ttc_params *ttc_params);
237-
void mlx5e_set_inner_ttc_ft_params(struct ttc_params *ttc_params);
238237

239238
int mlx5e_create_ttc_table(struct mlx5e_priv *priv, struct ttc_params *params,
240239
struct mlx5e_ttc_table *ttc);
241240
void mlx5e_destroy_ttc_table(struct mlx5e_priv *priv,
242241
struct mlx5e_ttc_table *ttc);
243242

244-
int mlx5e_create_inner_ttc_table(struct mlx5e_priv *priv, struct ttc_params *params,
245-
struct mlx5e_ttc_table *ttc);
246-
void mlx5e_destroy_inner_ttc_table(struct mlx5e_priv *priv,
247-
struct mlx5e_ttc_table *ttc);
248-
249243
void mlx5e_destroy_flow_table(struct mlx5e_flow_table *ft);
250244

251245
void mlx5e_enable_cvlan_filter(struct mlx5e_priv *priv);

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,7 @@ void mlx5e_set_ttc_basic_params(struct mlx5e_priv *priv,
11231123
ttc_params->inner_ttc = &priv->fs.inner_ttc;
11241124
}
11251125

1126-
void mlx5e_set_inner_ttc_ft_params(struct ttc_params *ttc_params)
1126+
static void mlx5e_set_inner_ttc_ft_params(struct ttc_params *ttc_params)
11271127
{
11281128
struct mlx5_flow_table_attr *ft_attr = &ttc_params->ft_attr;
11291129

@@ -1142,8 +1142,8 @@ void mlx5e_set_ttc_ft_params(struct ttc_params *ttc_params)
11421142
ft_attr->prio = MLX5E_NIC_PRIO;
11431143
}
11441144

1145-
int mlx5e_create_inner_ttc_table(struct mlx5e_priv *priv, struct ttc_params *params,
1146-
struct mlx5e_ttc_table *ttc)
1145+
static int mlx5e_create_inner_ttc_table(struct mlx5e_priv *priv, struct ttc_params *params,
1146+
struct mlx5e_ttc_table *ttc)
11471147
{
11481148
struct mlx5e_flow_table *ft = &ttc->ft;
11491149
int err;
@@ -1173,8 +1173,8 @@ int mlx5e_create_inner_ttc_table(struct mlx5e_priv *priv, struct ttc_params *par
11731173
return err;
11741174
}
11751175

1176-
void mlx5e_destroy_inner_ttc_table(struct mlx5e_priv *priv,
1177-
struct mlx5e_ttc_table *ttc)
1176+
static void mlx5e_destroy_inner_ttc_table(struct mlx5e_priv *priv,
1177+
struct mlx5e_ttc_table *ttc)
11781178
{
11791179
if (!mlx5e_tunnel_inner_ft_supported(priv->mdev))
11801180
return;

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

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -319,17 +319,6 @@ static int mlx5i_create_flow_steering(struct mlx5e_priv *priv)
319319
}
320320

321321
mlx5e_set_ttc_basic_params(priv, &ttc_params);
322-
mlx5e_set_inner_ttc_ft_params(&ttc_params);
323-
for (tt = 0; tt < MLX5E_NUM_INDIR_TIRS; tt++)
324-
ttc_params.indir_tirn[tt] = priv->inner_indir_tir[tt].tirn;
325-
326-
err = mlx5e_create_inner_ttc_table(priv, &ttc_params, &priv->fs.inner_ttc);
327-
if (err) {
328-
netdev_err(priv->netdev, "Failed to create inner ttc table, err=%d\n",
329-
err);
330-
goto err_destroy_arfs_tables;
331-
}
332-
333322
mlx5e_set_ttc_ft_params(&ttc_params);
334323
for (tt = 0; tt < MLX5E_NUM_INDIR_TIRS; tt++)
335324
ttc_params.indir_tirn[tt] = priv->indir_tir[tt].tirn;
@@ -338,13 +327,11 @@ static int mlx5i_create_flow_steering(struct mlx5e_priv *priv)
338327
if (err) {
339328
netdev_err(priv->netdev, "Failed to create ttc table, err=%d\n",
340329
err);
341-
goto err_destroy_inner_ttc_table;
330+
goto err_destroy_arfs_tables;
342331
}
343332

344333
return 0;
345334

346-
err_destroy_inner_ttc_table:
347-
mlx5e_destroy_inner_ttc_table(priv, &priv->fs.inner_ttc);
348335
err_destroy_arfs_tables:
349336
mlx5e_arfs_destroy_tables(priv);
350337

@@ -354,7 +341,6 @@ static int mlx5i_create_flow_steering(struct mlx5e_priv *priv)
354341
static void mlx5i_destroy_flow_steering(struct mlx5e_priv *priv)
355342
{
356343
mlx5e_destroy_ttc_table(priv, &priv->fs.ttc);
357-
mlx5e_destroy_inner_ttc_table(priv, &priv->fs.inner_ttc);
358344
mlx5e_arfs_destroy_tables(priv);
359345
}
360346

@@ -379,7 +365,7 @@ static int mlx5i_init_rx(struct mlx5e_priv *priv)
379365
if (err)
380366
goto err_destroy_indirect_rqts;
381367

382-
err = mlx5e_create_indirect_tirs(priv, true);
368+
err = mlx5e_create_indirect_tirs(priv, false);
383369
if (err)
384370
goto err_destroy_direct_rqts;
385371

0 commit comments

Comments
 (0)