Skip to contentSkip to conversation

net/mlx5e: Extend TC max ratelimit

PATCH New Tariq Toukan 3 participants 4 messages Feb 3 – Feb 5

Subsystems (5)
lore
Share & tools
lore

Tariq Toukan

author maintainer
#0 lore raw

PATCH 1/1 net/mlx5e: Extend TC max ratelimit

From: Alexei Lazar <[email protected]>

The per-TC rate limit was restricted to 255 Gbps due to the 8-bit max_bw_value field in the QETC register.
This limit is insufficient for newer, higher-bandwidth NICs.

Extend the rate limit by using the full 16-bit max_bw_value field. This allows the finer 100Mbps granularity to be used for rates up to ~6.5 Tbps, instead of switching to 1Gbps granularity at higher rates.

The extended range is only used when the device advertises support via the qetcr_qshr_max_bw_val_msb capability bit in the QCAM register.

---
 .../ethernet/mellanox/mlx5/core/en/dcbnl.h    |  4 ++
 .../ethernet/mellanox/mlx5/core/en_dcbnl.c    | 66 ++++++++++---------
 .../ethernet/mellanox/mlx5/core/mlx5_core.h   |  4 +-
 .../net/ethernet/mellanox/mlx5/core/port.c    |  4 +-
 4 files changed, 44 insertions(+), 34 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en/dcbnl.h +4 -0
index 2c98a5299df3..6bd959f9083d 100644
@@ -29,6 +29,10 @@ struct mlx5e_dcbx {
 	u32                        cable_len;
 	u32                        xoff;
 	u16                        port_buff_cell_sz;
+
+	/* Upper limit for 100Mbps and 1Gbps in Kbps units */
+	u64                        upper_limit_100mbps;
+	u64                        upper_limit_gbps;
 };
 
 #define MLX5E_MAX_DSCP (64)
drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c +36 -30

117 lines not on this page · raw message

drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h +2 -2
index e4b0aa16c1d2..b635b423d972 100644
@@ -345,10 +345,10 @@ int mlx5_set_port_tc_bw_alloc(struct mlx5_core_dev *mdev, u8 *tc_bw);
 int mlx5_query_port_tc_bw_alloc(struct mlx5_core_dev *mdev,
 				u8 tc, u8 *bw_pct);
 int mlx5_modify_port_ets_rate_limit(struct mlx5_core_dev *mdev,
-				    u8 *max_bw_value,
+				    u16 *max_bw_value,
 				    u8 *max_bw_unit);
 int mlx5_query_port_ets_rate_limit(struct mlx5_core_dev *mdev,
-				   u8 *max_bw_value,
+				   u16 *max_bw_value,
 				   u8 *max_bw_unit);
 int mlx5_set_port_wol(struct mlx5_core_dev *mdev, u8 wol_mode);
 int mlx5_query_port_wol(struct mlx5_core_dev *mdev, u8 *wol_mode);
drivers/net/ethernet/mellanox/mlx5/core/port.c +2 -2
index e8a0884ea477..9fca591652f2 100644
@@ -773,7 +773,7 @@ int mlx5_query_port_tc_bw_alloc(struct mlx5_core_dev *mdev,
 }
 
 int mlx5_modify_port_ets_rate_limit(struct mlx5_core_dev *mdev,
-				    u8 *max_bw_value,
+				    u16 *max_bw_value,
 				    u8 *max_bw_units)
 {
 	u32 in[MLX5_ST_SZ_DW(qetc_reg)] = {0};
@@ -796,7 +796,7 @@ int mlx5_modify_port_ets_rate_limit(struct mlx5_core_dev *mdev,
 }
 
 int mlx5_query_port_ets_rate_limit(struct mlx5_core_dev *mdev,
-				   u8 *max_bw_value,
+				   u16 *max_bw_value,
 				   u8 *max_bw_units)
 {
 	u32 out[MLX5_ST_SZ_DW(qetc_reg)];

base-commit: a22f57757f7e88c890499265c383ecb32900b645

Signature · 1 line
2.44.0
author maintainer
#1 lore raw

PATCH 1/1 net/mlx5e: Extend TC max ratelimit using max_bw_value_msb

From: Alexei Lazar <[email protected]>

The per-TC rate limit was restricted to 255 Gbps due to the 8-bit max_bw_value field in the QETC register.
This limit is insufficient for newer, higher-bandwidth NICs.

Extend the rate limit by using the full 16-bit max_bw_value field. This allows the finer 100Mbps granularity to be used for rates up to ~6.5 Tbps, instead of switching to 1Gbps granularity at higher rates.

The extended range is only used when the device advertises support via the qetcr_qshr_max_bw_val_msb capability bit in the QCAM register.

---
 .../ethernet/mellanox/mlx5/core/en/dcbnl.h    |  4 ++
 .../ethernet/mellanox/mlx5/core/en_dcbnl.c    | 66 ++++++++++---------
 .../ethernet/mellanox/mlx5/core/mlx5_core.h   |  4 +-
 .../net/ethernet/mellanox/mlx5/core/port.c    |  4 +-
 4 files changed, 44 insertions(+), 34 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en/dcbnl.h +4 -0
index 2c98a5299df3..6bd959f9083d 100644
@@ -29,6 +29,10 @@ struct mlx5e_dcbx {
 	u32                        cable_len;
 	u32                        xoff;
 	u16                        port_buff_cell_sz;
+
+	/* Upper limit for 100Mbps and 1Gbps in Kbps units */
+	u64                        upper_limit_100mbps;
+	u64                        upper_limit_gbps;
 };
 
 #define MLX5E_MAX_DSCP (64)
drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c +36 -30

117 lines not on this page · raw message

drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h +2 -2
index e4b0aa16c1d2..b635b423d972 100644
@@ -345,10 +345,10 @@ int mlx5_set_port_tc_bw_alloc(struct mlx5_core_dev *mdev, u8 *tc_bw);
 int mlx5_query_port_tc_bw_alloc(struct mlx5_core_dev *mdev,
 				u8 tc, u8 *bw_pct);
 int mlx5_modify_port_ets_rate_limit(struct mlx5_core_dev *mdev,
-				    u8 *max_bw_value,
+				    u16 *max_bw_value,
 				    u8 *max_bw_unit);
 int mlx5_query_port_ets_rate_limit(struct mlx5_core_dev *mdev,
-				   u8 *max_bw_value,
+				   u16 *max_bw_value,
 				   u8 *max_bw_unit);
 int mlx5_set_port_wol(struct mlx5_core_dev *mdev, u8 wol_mode);
 int mlx5_query_port_wol(struct mlx5_core_dev *mdev, u8 *wol_mode);
drivers/net/ethernet/mellanox/mlx5/core/port.c +2 -2
index e8a0884ea477..9fca591652f2 100644
@@ -773,7 +773,7 @@ int mlx5_query_port_tc_bw_alloc(struct mlx5_core_dev *mdev,
 }
 
 int mlx5_modify_port_ets_rate_limit(struct mlx5_core_dev *mdev,
-				    u8 *max_bw_value,
+				    u16 *max_bw_value,
 				    u8 *max_bw_units)
 {
 	u32 in[MLX5_ST_SZ_DW(qetc_reg)] = {0};
@@ -796,7 +796,7 @@ int mlx5_modify_port_ets_rate_limit(struct mlx5_core_dev *mdev,
 }
 
 int mlx5_query_port_ets_rate_limit(struct mlx5_core_dev *mdev,
-				   u8 *max_bw_value,
+				   u16 *max_bw_value,
 				   u8 *max_bw_units)
 {
 	u32 out[MLX5_ST_SZ_DW(qetc_reg)];

base-commit: a22f57757f7e88c890499265c383ecb32900b645

Signature · 1 line
2.44.0
#2 lore raw

Re: [PATCH net-next] net/mlx5e: Extend TC max ratelimit using max_bw_value_msb

Quoted 10 lines · Tariq Toukan

From: Alexei Lazar <[email protected]>

The per-TC rate limit was restricted to 255 Gbps due to the 8-bit max_bw_value field in the QETC register.
This limit is insufficient for newer, higher-bandwidth NICs.

Extend the rate limit by using the full 16-bit max_bw_value field. This allows the finer 100Mbps granularity to be used for rates up to ~6.5 Tbps, instead of switching to 1Gbps granularity at higher rates.

Quoted 7 lines

The extended range is only used when the device advertises support via the qetcr_qshr_max_bw_val_msb capability bit in the QCAM register.

Please ignore this one.
Mistakenly sent two similar patches (with a slight subject change).

Find the other one here:
https://lore.kernel.org/all/[email protected]/

#3 lore raw

Re: [PATCH net-next] net/mlx5e: Extend TC max ratelimit using max_bw_value_msb

In reply to Tariq Toukan
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 11 lines · On Tue, 3 Feb 2026 09:30:21 +0200 you wrote:

From: Alexei Lazar <[email protected]>

The per-TC rate limit was restricted to 255 Gbps due to the 8-bit max_bw_value field in the QETC register.
This limit is insufficient for newer, higher-bandwidth NICs.

Extend the rate limit by using the full 16-bit max_bw_value field. This allows the finer 100Mbps granularity to be used for rates up to ~6.5 Tbps, instead of switching to 1Gbps granularity at higher rates.

[...]

Here is the summary with links:
- [net-next] net/mlx5e: Extend TC max ratelimit using max_bw_value_msb

    https://git.kernel.org/netdev/net-next/c/3e5aa52b45c7

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html