mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH mlx5-next 0/2] mlx5-next updates 2025-02-19
@ 2025-02-19  8:58 Tariq Toukan
  2025-02-19  8:58 ` [PATCH mlx5-next 1/2] net/mlx5: Add new health syndrome error and crr bit offset Tariq Toukan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Tariq Toukan @ 2025-02-19  8:58 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Gal Pressman, Mark Bloch, Saeed Mahameed, Leon Romanovsky,
	Tariq Toukan, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, netdev, linux-rdma, linux-kernel

Hi,

This series contains mlx5 shared updates as preparation for upcoming
features.

Regards,
Tariq

Patrisious Haddad (1):
  net/mlx5: Change POOL_NEXT_SIZE define value and make it global

Shahar Shitrit (1):
  net/mlx5: Add new health syndrome error and crr bit offset

 drivers/net/ethernet/mellanox/mlx5/core/esw/legacy.c    | 2 +-
 drivers/net/ethernet/mellanox/mlx5/core/fs_ft_pool.c    | 6 ++++--
 drivers/net/ethernet/mellanox/mlx5/core/fs_ft_pool.h    | 2 --
 drivers/net/ethernet/mellanox/mlx5/core/lib/fs_chains.c | 3 ++-
 include/linux/mlx5/device.h                             | 1 +
 include/linux/mlx5/fs.h                                 | 2 ++
 include/linux/mlx5/mlx5_ifc.h                           | 1 +
 7 files changed, 11 insertions(+), 6 deletions(-)


base-commit: a64dcfb451e254085a7daee5fe51bf22959d52d3
-- 
2.45.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH mlx5-next 1/2] net/mlx5: Add new health syndrome error and crr bit offset
  2025-02-19  8:58 [PATCH mlx5-next 0/2] mlx5-next updates 2025-02-19 Tariq Toukan
@ 2025-02-19  8:58 ` Tariq Toukan
  2025-02-19  8:58 ` [PATCH mlx5-next 2/2] net/mlx5: Change POOL_NEXT_SIZE define value and make it global Tariq Toukan
  2025-02-23  9:43 ` [PATCH mlx5-next 0/2] mlx5-next updates 2025-02-19 Leon Romanovsky
  2 siblings, 0 replies; 4+ messages in thread
From: Tariq Toukan @ 2025-02-19  8:58 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Gal Pressman, Mark Bloch, Saeed Mahameed, Leon Romanovsky,
	Tariq Toukan, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, netdev, linux-rdma, linux-kernel,
	Shahar Shitrit

From: Shahar Shitrit <shshitrit@nvidia.com>

Add new error value for trust lockdown in health syndrome enum.
Also, include the offset for crr bit in the health buffer layout.

These changes prepare for downstream patches that update health
event handling.

Signed-off-by: Shahar Shitrit <shshitrit@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
 include/linux/mlx5/device.h   | 1 +
 include/linux/mlx5/mlx5_ifc.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h
index 0c48b20f818a..fd37f4e54d76 100644
--- a/include/linux/mlx5/device.h
+++ b/include/linux/mlx5/device.h
@@ -538,6 +538,7 @@ struct mlx5_cmd_layout {
 };
 
 enum mlx5_rfr_severity_bit_offsets {
+	MLX5_CRR_BIT_OFFSET = 0x6,
 	MLX5_RFR_BIT_OFFSET = 0x7,
 };
 
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index 4f3716e124c9..cc2875e843f7 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -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 {
-- 
2.45.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH mlx5-next 2/2] net/mlx5: Change POOL_NEXT_SIZE define value and make it global
  2025-02-19  8:58 [PATCH mlx5-next 0/2] mlx5-next updates 2025-02-19 Tariq Toukan
  2025-02-19  8:58 ` [PATCH mlx5-next 1/2] net/mlx5: Add new health syndrome error and crr bit offset Tariq Toukan
@ 2025-02-19  8:58 ` Tariq Toukan
  2025-02-23  9:43 ` [PATCH mlx5-next 0/2] mlx5-next updates 2025-02-19 Leon Romanovsky
  2 siblings, 0 replies; 4+ messages in thread
From: Tariq Toukan @ 2025-02-19  8:58 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Gal Pressman, Mark Bloch, Saeed Mahameed, Leon Romanovsky,
	Tariq Toukan, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, netdev, linux-rdma, linux-kernel,
	Patrisious Haddad, Maor Gottlieb

From: Patrisious Haddad <phaddad@nvidia.com>

Change POOL_NEXT_SIZE define value from 0 to BIT(30), since this define
is used to request the available maximum sized flow table, and zero doesn't
make sense for it, whereas some places in the driver use zero explicitly
expecting the smallest table size possible but instead due to this
define they end up allocating the biggest table size unawarely.

In addition move the definition to "include/linux/mlx5/fs.h" to expose the
define to IB driver as well, while appropriately renaming it.

Signed-off-by: Patrisious Haddad <phaddad@nvidia.com>
Reviewed-by: Maor Gottlieb <maorg@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/esw/legacy.c    | 2 +-
 drivers/net/ethernet/mellanox/mlx5/core/fs_ft_pool.c    | 6 ++++--
 drivers/net/ethernet/mellanox/mlx5/core/fs_ft_pool.h    | 2 --
 drivers/net/ethernet/mellanox/mlx5/core/lib/fs_chains.c | 3 ++-
 include/linux/mlx5/fs.h                                 | 2 ++
 5 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/legacy.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/legacy.c
index 45183de424f3..76382626ad41 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/esw/legacy.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/legacy.c
@@ -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)) {
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_ft_pool.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_ft_pool.c
index c14590acc772..f6abfd00d7e6 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_ft_pool.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_ft_pool.c
@@ -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;
 		}
 	}
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_ft_pool.h b/drivers/net/ethernet/mellanox/mlx5/core/fs_ft_pool.h
index 25f4274b372b..173e312db720 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_ft_pool.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_ft_pool.h
@@ -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);
 
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/fs_chains.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/fs_chains.c
index a80ecb672f33..c862dd28c466 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/fs_chains.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/fs_chains.c
@@ -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
diff --git a/include/linux/mlx5/fs.h b/include/linux/mlx5/fs.h
index 2a69d9d71276..01cb72d68c23 100644
--- a/include/linux/mlx5/fs.h
+++ b/include/linux/mlx5/fs.h
@@ -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,
-- 
2.45.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH mlx5-next 0/2] mlx5-next updates 2025-02-19
  2025-02-19  8:58 [PATCH mlx5-next 0/2] mlx5-next updates 2025-02-19 Tariq Toukan
  2025-02-19  8:58 ` [PATCH mlx5-next 1/2] net/mlx5: Add new health syndrome error and crr bit offset Tariq Toukan
  2025-02-19  8:58 ` [PATCH mlx5-next 2/2] net/mlx5: Change POOL_NEXT_SIZE define value and make it global Tariq Toukan
@ 2025-02-23  9:43 ` Leon Romanovsky
  2 siblings, 0 replies; 4+ messages in thread
From: Leon Romanovsky @ 2025-02-23  9:43 UTC (permalink / raw)
  To: Leon Romanovsky, Tariq Toukan
  Cc: Gal Pressman, Mark Bloch, Saeed Mahameed, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	netdev, linux-rdma, linux-kernel


On Wed, 19 Feb 2025 10:58:06 +0200, Tariq Toukan wrote:
> This series contains mlx5 shared updates as preparation for upcoming
> features.
> 
> Regards,
> Tariq
> 
> Patrisious Haddad (1):
>   net/mlx5: Change POOL_NEXT_SIZE define value and make it global
> 
> [...]

Applied, thanks!

[1/2] net/mlx5: Add new health syndrome error and crr bit offset
      https://git.kernel.org/rdma/rdma/c/531ca2b9a215d0
[2/2] net/mlx5: Change POOL_NEXT_SIZE define value and make it global
      https://git.kernel.org/rdma/rdma/c/80df31f384b414

Best regards,
-- 
Leon Romanovsky <leon@kernel.org>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-02-23  9:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-19  8:58 [PATCH mlx5-next 0/2] mlx5-next updates 2025-02-19 Tariq Toukan
2025-02-19  8:58 ` [PATCH mlx5-next 1/2] net/mlx5: Add new health syndrome error and crr bit offset Tariq Toukan
2025-02-19  8:58 ` [PATCH mlx5-next 2/2] net/mlx5: Change POOL_NEXT_SIZE define value and make it global Tariq Toukan
2025-02-23  9:43 ` [PATCH mlx5-next 0/2] mlx5-next updates 2025-02-19 Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®