Skip to content

Commit

Permalink
Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/mellanox/linux

Tariq Toukan says:

====================
mlx5-next updates 2025-02-24

The following pull-request contains common mlx5 updates
for your *net-next* tree.

* 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux:
  net/mlx5: Change POOL_NEXT_SIZE define value and make it global
  net/mlx5: Add new health syndrome error and crr bit offset
====================

Link: https://patch.msgid.link/20250224212446.523259-1-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Jakub Kicinski committed Feb 26, 2025
2 parents 8fa19c2 + 80df31f commit ef4a47a
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/esw/legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ static int esw_create_legacy_fdb_table(struct mlx5_eswitch *esw)
if (!flow_group_in)
return -ENOMEM;

ft_attr.max_fte = POOL_NEXT_SIZE;
ft_attr.max_fte = MLX5_FS_MAX_POOL_SIZE;
ft_attr.prio = LEGACY_FDB_PRIO;
fdb = mlx5_create_flow_table(root_ns, &ft_attr);
if (IS_ERR(fdb)) {
Expand Down
6 changes: 4 additions & 2 deletions drivers/net/ethernet/mellanox/mlx5/core/fs_ft_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,12 @@ mlx5_ft_pool_get_avail_sz(struct mlx5_core_dev *dev, enum fs_flow_table_type tab
int i, found_i = -1;

for (i = ARRAY_SIZE(FT_POOLS) - 1; i >= 0; i--) {
if (dev->priv.ft_pool->ft_left[i] && FT_POOLS[i] >= desired_size &&
if (dev->priv.ft_pool->ft_left[i] &&
(FT_POOLS[i] >= desired_size ||
desired_size == MLX5_FS_MAX_POOL_SIZE) &&
FT_POOLS[i] <= max_ft_size) {
found_i = i;
if (desired_size != POOL_NEXT_SIZE)
if (desired_size != MLX5_FS_MAX_POOL_SIZE)
break;
}
}
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/ethernet/mellanox/mlx5/core/fs_ft_pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
#include <linux/mlx5/driver.h>
#include "fs_core.h"

#define POOL_NEXT_SIZE 0

int mlx5_ft_pool_init(struct mlx5_core_dev *dev);
void mlx5_ft_pool_destroy(struct mlx5_core_dev *dev);

Expand Down
3 changes: 2 additions & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/lib/fs_chains.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ mlx5_chains_create_table(struct mlx5_fs_chains *chains,
ft_attr.flags |= (MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT |
MLX5_FLOW_TABLE_TUNNEL_EN_DECAP);

sz = (chain == mlx5_chains_get_nf_ft_chain(chains)) ? FT_TBL_SZ : POOL_NEXT_SIZE;
sz = (chain == mlx5_chains_get_nf_ft_chain(chains)) ?
FT_TBL_SZ : MLX5_FS_MAX_POOL_SIZE;
ft_attr.max_fte = sz;

/* We use chains_default_ft(chains) as the table's next_ft till
Expand Down
1 change: 1 addition & 0 deletions include/linux/mlx5/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ struct mlx5_cmd_layout {
};

enum mlx5_rfr_severity_bit_offsets {
MLX5_CRR_BIT_OFFSET = 0x6,
MLX5_RFR_BIT_OFFSET = 0x7,
};

Expand Down
2 changes: 2 additions & 0 deletions include/linux/mlx5/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@

#define MLX5_SET_CFG(p, f, v) MLX5_SET(create_flow_group_in, p, f, v)

#define MLX5_FS_MAX_POOL_SIZE BIT(30)

enum mlx5_flow_destination_type {
MLX5_FLOW_DESTINATION_TYPE_NONE,
MLX5_FLOW_DESTINATION_TYPE_VPORT,
Expand Down
1 change: 1 addition & 0 deletions include/linux/mlx5/mlx5_ifc.h
Original file line number Diff line number Diff line change
Expand Up @@ -11119,6 +11119,7 @@ enum {
MLX5_INITIAL_SEG_HEALTH_SYNDROME_FFSER_ERR = 0xf,
MLX5_INITIAL_SEG_HEALTH_SYNDROME_HIGH_TEMP_ERR = 0x10,
MLX5_INITIAL_SEG_HEALTH_SYNDROME_ICM_PCI_POISONED_ERR = 0x12,
MLX5_INITIAL_SEG_HEALTH_SYNDROME_TRUST_LOCKDOWN_ERR = 0x13,
};

struct mlx5_ifc_initial_seg_bits {
Expand Down

0 comments on commit ef4a47a

Please sign in to comment.