Skip to contentSkip to conversation

mlx5-next updates 2025-01-09

PATCH Applied Tariq Toukan 4 participants 14 messages Jan 9, 2025 – Jan 12, 2025

Subsystems (5)
lore
Share & tools
lore

Tariq Toukan

author maintainer
#0 lore raw

cover mlx5-next updates 2025-01-09

Hi,

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

Regards,
Tariq

Akiva Goldberger (1):
net/mlx5: Add nic_cap_reg and vhca_icm_ctrl registers

Jianbo Liu (2):
net/mlx5: Update mlx5_ifc to support FEC for 200G per lane link modes net/mlx5: Add support for MRTCQ register

Saeed Mahameed (1):
net/mlx5: SHAMPO: Introduce new SHAMPO specific HCA caps

 drivers/net/ethernet/mellanox/mlx5/core/fw.c  |  6 ++
 .../net/ethernet/mellanox/mlx5/core/main.c    |  5 ++
 include/linux/mlx5/device.h                   |  4 +
 include/linux/mlx5/driver.h                   |  3 +
 include/linux/mlx5/mlx5_ifc.h                 | 73 +++++++++++++++++--
 5 files changed, 86 insertions(+), 5 deletions(-)

base-commit: aeb3ec99026979287266e4b5a1194789c1488c1a

Signature · 1 line
2.45.0
author maintainer
#1 lore raw

PATCH 1/4 net/mlx5: Update mlx5_ifc to support FEC for 200G per lane link modes

From: Jianbo Liu <[email protected]>

Add FEC admin and override related fields in PPLM, and the bit in PCAM to indicate those fields are supported.

---
 include/linux/mlx5/mlx5_ifc.h | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)
include/linux/mlx5/mlx5_ifc.h +18 -2
index 43b3cb4bf8d1..c3da1581853c 100644
@@ -10150,7 +10150,21 @@ struct mlx5_ifc_pplm_reg_bits {
 	u8         fec_override_admin_200g_2x[0x10];
 	u8         fec_override_admin_100g_1x[0x10];
 
-	u8         reserved_at_260[0x20];
+	u8         reserved_at_260[0x60];
+
+	u8         fec_override_cap_1600g_8x[0x10];
+	u8         fec_override_cap_800g_4x[0x10];
+
+	u8         fec_override_cap_400g_2x[0x10];
+	u8         fec_override_cap_200g_1x[0x10];
+
+	u8         fec_override_admin_1600g_8x[0x10];
+	u8         fec_override_admin_800g_4x[0x10];
+
+	u8         fec_override_admin_400g_2x[0x10];
+	u8         fec_override_admin_200g_1x[0x10];
+
+	u8         reserved_at_340[0x80];
 };
 
 struct mlx5_ifc_ppcnt_reg_bits {
@@ -10524,7 +10538,9 @@ struct mlx5_ifc_mtutc_reg_bits {
 };
 
 struct mlx5_ifc_pcam_enhanced_features_bits {
-	u8         reserved_at_0[0x48];
+	u8         reserved_at_0[0x1d];
+	u8         fec_200G_per_lane_in_pplm[0x1];
+	u8         reserved_at_1e[0x2a];
 	u8         fec_100G_per_lane_in_pplm[0x1];
 	u8         reserved_at_49[0x1f];
 	u8         fec_50G_per_lane_in_pplm[0x1];
Signature · 1 line
2.45.0
Reviewed-by on v1 1/4
#3 lore raw

Re: [PATCH mlx5-next 1/4] net/mlx5: Update mlx5_ifc to support FEC for 200G per lane link modes

In reply to Tariq Toukan
Quoted 8 lines · Tariq Toukan

From: Jianbo Liu <[email protected]>

Add FEC admin and override related fields in PPLM, and the bit in PCAM to indicate those fields are supported.

Signature · 2 lines
Regards,
Kalesh AP
author maintainer
#4 lore raw

PATCH 2/4 net/mlx5: Add support for MRTCQ register

In reply to Tariq Toukan

From: Jianbo Liu <[email protected]>

Management Real Time Clock Query (MRTCQ) register is used to query hardware clock identity.

---
 include/linux/mlx5/driver.h   |  1 +
 include/linux/mlx5/mlx5_ifc.h | 11 ++++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)
include/linux/mlx5/driver.h +1 -0
index fc7e6153b73d..8f6fe29bc4be 100644
@@ -160,6 +160,7 @@ enum {
 	MLX5_REG_MIRC		 = 0x9162,
 	MLX5_REG_MTPTM		 = 0x9180,
 	MLX5_REG_MTCTR		 = 0x9181,
+	MLX5_REG_MRTCQ		 = 0x9182,
 	MLX5_REG_SBCAM		 = 0xB01F,
 	MLX5_REG_RESOURCE_DUMP   = 0xC000,
 	MLX5_REG_DTOR            = 0xC00E,
include/linux/mlx5/mlx5_ifc.h +10 -1
index c3da1581853c..221146278ac8 100644
@@ -10680,7 +10680,8 @@ struct mlx5_ifc_mcam_access_reg_bits3 {
 
 	u8         regs_63_to_32[0x20];
 
-	u8         regs_31_to_2[0x1e];
+	u8         regs_31_to_3[0x1d];
+	u8         mrtcq[0x1];
 	u8         mtctr[0x1];
 	u8         mtptm[0x1];
 };
@@ -13171,4 +13172,12 @@ struct mlx5_ifc_msees_reg_bits {
 	u8         reserved_at_80[0x180];
 };
 
+struct mlx5_ifc_mrtcq_reg_bits {
+	u8         reserved_at_0[0x40];
+
+	u8         rt_clock_identity[0x40];
+
+	u8         reserved_at_80[0x180];
+};
+
 #endif /* MLX5_IFC_H */
Signature · 1 line
2.45.0
Reviewed-by on v1 2/4
#6 lore raw

Re: [PATCH mlx5-next 2/4] net/mlx5: Add support for MRTCQ register

In reply to Tariq Toukan
Quoted 9 lines · Tariq Toukan

From: Jianbo Liu <[email protected]>

Management Real Time Clock Query (MRTCQ) register is used to query hardware clock identity.

Signature · 2 lines
Regards,
Kalesh AP
author maintainer
#7 lore raw

PATCH 3/4 net/mlx5: SHAMPO: Introduce new SHAMPO specific HCA caps

In reply to Tariq Toukan

From: Saeed Mahameed <[email protected]>

Read and cache SHAMPO specific caps for header data split capabilities. Will be used in downstream patch.

---
 drivers/net/ethernet/mellanox/mlx5/core/fw.c  |  6 ++++++
 .../net/ethernet/mellanox/mlx5/core/main.c    |  5 +++++
 include/linux/mlx5/device.h                   |  4 ++++
 include/linux/mlx5/mlx5_ifc.h                 | 20 ++++++++++++++++++-
 4 files changed, 34 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/fw.c +6 -0
index 76ad46bf477d..b253d1673398 100644
@@ -281,6 +281,12 @@ int mlx5_query_hca_caps(struct mlx5_core_dev *dev)
 			return err;
 	}
 
+	if (MLX5_CAP_GEN(dev, shampo)) {
+		err = mlx5_core_get_caps_mode(dev, MLX5_CAP_SHAMPO, HCA_CAP_OPMOD_GET_CUR);
+		if (err)
+			return err;
+	}
+
 	return 0;
 }
 
drivers/net/ethernet/mellanox/mlx5/core/main.c +5 -0
index 220a9ac75c8b..a670e4538a13 100644
@@ -368,6 +368,10 @@ int mlx5_core_get_caps_mode(struct mlx5_core_dev *dev, enum mlx5_cap_type cap_ty
 	u16 opmod = (cap_type << 1) | (cap_mode & 0x01);
 	int err;
 
+	if (WARN_ON(!dev->caps.hca[cap_type]))
+		/* this cap_type must be added to mlx5_hca_caps_alloc() */
+		return -EINVAL;
+
 	memset(in, 0, sizeof(in));
 	out = kzalloc(out_sz, GFP_KERNEL);
 	if (!out)
@@ -1788,6 +1792,7 @@ static const int types[] = {
 	MLX5_CAP_MACSEC,
 	MLX5_CAP_ADV_VIRTUALIZATION,
 	MLX5_CAP_CRYPTO,
+	MLX5_CAP_SHAMPO,
 };
 
 static void mlx5_hca_caps_free(struct mlx5_core_dev *dev)
include/linux/mlx5/device.h +4 -0
index cc647992f3d1..0c48b20f818a 100644
@@ -1245,6 +1245,7 @@ enum mlx5_cap_type {
 	MLX5_CAP_DEV_EVENT = 0x14,
 	MLX5_CAP_IPSEC,
 	MLX5_CAP_CRYPTO = 0x1a,
+	MLX5_CAP_SHAMPO = 0x1d,
 	MLX5_CAP_MACSEC = 0x1f,
 	MLX5_CAP_GENERAL_2 = 0x20,
 	MLX5_CAP_PORT_SELECTION = 0x25,
@@ -1470,6 +1471,9 @@ enum mlx5_qcam_feature_groups {
 #define MLX5_CAP_MACSEC(mdev, cap)\
 	MLX5_GET(macsec_cap, (mdev)->caps.hca[MLX5_CAP_MACSEC]->cur, cap)
 
+#define MLX5_CAP_SHAMPO(mdev, cap) \
+	MLX5_GET(shampo_cap, mdev->caps.hca[MLX5_CAP_SHAMPO]->cur, cap)
+
 enum {
 	MLX5_CMD_STAT_OK			= 0x0,
 	MLX5_CMD_STAT_INT_ERR			= 0x1,
include/linux/mlx5/mlx5_ifc.h +19 -1
index 221146278ac8..d7c91f152735 100644
@@ -2327,7 +2327,9 @@ struct mlx5_ifc_wq_bits {
 	u8         headers_mkey[0x20];
 
 	u8         shampo_enable[0x1];
-	u8         reserved_at_1e1[0x4];
+	u8         reserved_at_1e1[0x1];
+	u8         shampo_mode[0x2];
+	u8         reserved_at_1e4[0x1];
 	u8         log_reservation_size[0x3];
 	u8         reserved_at_1e8[0x5];
 	u8         log_max_num_of_packets_per_reservation[0x3];
@@ -3699,6 +3701,22 @@ struct mlx5_ifc_crypto_cap_bits {
 	u8    reserved_at_80[0x780];
 };
 
+struct mlx5_ifc_shampo_cap_bits {
+	u8    reserved_at_0[0x3];
+	u8    shampo_log_max_reservation_size[0x5];
+	u8    reserved_at_8[0x3];
+	u8    shampo_log_min_reservation_size[0x5];
+	u8    shampo_min_mss_size[0x10];
+
+	u8    shampo_header_split[0x1];
+	u8    shampo_header_split_data_merge[0x1];
+	u8    reserved_at_22[0x1];
+	u8    shampo_log_max_headers_entry_size[0x5];
+	u8    reserved_at_28[0x18];
+
+	u8    reserved_at_40[0x7c0];
+};
+
 union mlx5_ifc_hca_cap_union_bits {
 	struct mlx5_ifc_cmd_hca_cap_bits cmd_hca_cap;
 	struct mlx5_ifc_cmd_hca_cap_2_bits cmd_hca_cap_2;
Signature · 1 line
2.45.0
Reviewed-by on v1 3/4
#8 lore raw

Re: [PATCH mlx5-next 3/4] net/mlx5: SHAMPO: Introduce new SHAMPO specific HCA caps

Quoted 9 lines · Tariq Toukan

From: Saeed Mahameed <[email protected]>

Read and cache SHAMPO specific caps for header data split capabilities. Will be used in downstream patch.

---

Reviewed-by on v1 3/4
#9 lore raw

Re: [PATCH mlx5-next 3/4] net/mlx5: SHAMPO: Introduce new SHAMPO specific HCA caps

In reply to Tariq Toukan
Quoted 9 lines · Tariq Toukan

From: Saeed Mahameed <[email protected]>

Read and cache SHAMPO specific caps for header data split capabilities. Will be used in downstream patch.

Signature · 2 lines
Regards,
Kalesh AP
author maintainer
#10 lore raw

PATCH 4/4 net/mlx5: Add nic_cap_reg and vhca_icm_ctrl registers

In reply to Tariq Toukan

From: Akiva Goldberger <[email protected]>

Add nic_cap_reg and vhca_icm_ctrl registers interfaces for exposing ICM consumption.

---
 include/linux/mlx5/driver.h   |  2 ++
 include/linux/mlx5/mlx5_ifc.h | 22 +++++++++++++++++++++-
 2 files changed, 23 insertions(+), 1 deletion(-)
include/linux/mlx5/driver.h +2 -0
index 8f6fe29bc4be..b957391529b3 100644
@@ -163,7 +163,9 @@ enum {
 	MLX5_REG_MRTCQ		 = 0x9182,
 	MLX5_REG_SBCAM		 = 0xB01F,
 	MLX5_REG_RESOURCE_DUMP   = 0xC000,
+	MLX5_REG_NIC_CAP	 = 0xC00D,
 	MLX5_REG_DTOR            = 0xC00E,
+	MLX5_REG_VHCA_ICM_CTRL	 = 0xC010,
 };
 
 enum mlx5_qpts_trust_state {
include/linux/mlx5/mlx5_ifc.h +21 -1
index d7c91f152735..2a40b1fd50e8 100644
@@ -1830,7 +1830,7 @@ struct mlx5_ifc_cmd_hca_cap_bits {
 	u8         regexp_params[0x1];
 	u8         uar_sz[0x6];
 	u8         port_selection_cap[0x1];
-	u8         reserved_at_251[0x1];
+	u8         nic_cap_reg[0x1];
 	u8         umem_uid_0[0x1];
 	u8         reserved_at_253[0x5];
 	u8         log_pg_sz[0x8];
@@ -3327,6 +3327,14 @@ struct mlx5_ifc_dropped_packet_logged_bits {
 	u8         reserved_at_0[0xe0];
 };
 
+struct mlx5_ifc_nic_cap_reg_bits {
+	u8	   reserved_at_0[0x1a];
+	u8	   vhca_icm_ctrl[0x1];
+	u8	   reserved_at_1b[0x5];
+
+	u8	   reserved_at_20[0x60];
+};
+
 struct mlx5_ifc_default_timeout_bits {
 	u8         to_multiplier[0x3];
 	u8         reserved_at_3[0x9];
@@ -3363,6 +3371,18 @@ struct mlx5_ifc_dtor_reg_bits {
 	u8         reserved_at_1c0[0x20];
 };
 
+struct mlx5_ifc_vhca_icm_ctrl_reg_bits {
+	u8	   vhca_id_valid[0x1];
+	u8	   reserved_at_1[0xf];
+	u8	   vhca_id[0x10];
+
+	u8	   reserved_at_20[0xa0];
+
+	u8	   cur_alloc_icm[0x20];
+
+	u8	   reserved_at_e0[0x120];
+};
+
 enum {
 	MLX5_CQ_ERROR_SYNDROME_CQ_OVERRUN                 = 0x1,
 	MLX5_CQ_ERROR_SYNDROME_CQ_ACCESS_VIOLATION_ERROR  = 0x2,
Signature · 1 line
2.45.0
Reviewed-by on v1 4/4
#11 lore raw

Re: [PATCH mlx5-next 4/4] net/mlx5: Add nic_cap_reg and vhca_icm_ctrl registers

Quoted 9 lines · Tariq Toukan

From: Akiva Goldberger <[email protected]>

Add nic_cap_reg and vhca_icm_ctrl registers interfaces for exposing ICM consumption.

---

Reviewed-by on v1 4/4
#12 lore raw

Re: [PATCH mlx5-next 4/4] net/mlx5: Add nic_cap_reg and vhca_icm_ctrl registers

In reply to Tariq Toukan
Quoted 9 lines · Tariq Toukan

From: Akiva Goldberger <[email protected]>

Add nic_cap_reg and vhca_icm_ctrl registers interfaces for exposing ICM consumption.

Signature · 2 lines
Regards,
Kalesh AP
#13 lore raw
In reply to Tariq Toukan
Quoted 10 lines · Tariq Toukan

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

Regards,
Tariq

Akiva Goldberger (1):
net/mlx5: Add nic_cap_reg and vhca_icm_ctrl registers

[...]

Applied, thanks!

[1/4] net/mlx5: Update mlx5_ifc to support FEC for 200G per lane link modes

      https://git.kernel.org/rdma/rdma/c/387bef82d0b4af
[2/4] net/mlx5: Add support for MRTCQ register
      https://git.kernel.org/rdma/rdma/c/e2685ef5f56295
[3/4] net/mlx5: SHAMPO: Introduce new SHAMPO specific HCA caps
      https://git.kernel.org/rdma/rdma/c/df75ad562a6f9a
[4/4] net/mlx5: Add nic_cap_reg and vhca_icm_ctrl registers
      https://git.kernel.org/rdma/rdma/c/6ca00ec47b70ac

Best regards,

Signature · 1 line
Leon Romanovsky <[email protected]>