]> Gentwo Git Trees - linux/.git/commit
net/mlx5e: Use standard unit definitions for bandwidth conversion
authorGal Pressman <gal@nvidia.com>
Sun, 30 Nov 2025 10:25:34 +0000 (12:25 +0200)
committerJakub Kicinski <kuba@kernel.org>
Mon, 1 Dec 2025 22:56:28 +0000 (14:56 -0800)
commit87a5112bfc406a72c6bf1e8cdef9b0169dc1df6a
treec3e397a6e033ee9ac04c89fc6f65f84683594daa
parent53f7a771285182be7bfba6d59ccdd0d47fc1a097
net/mlx5e: Use standard unit definitions for bandwidth conversion

MLX5E_100MB and MLX5E_1GB defines are confusing, MLX5E_100MB is not
equal to 100 * MEGA, and MLX5E_1GB is not equal to one GIGA, as they
hide the Kbps rate conversion required for ieee_maxrate.

Replace hardcoded bandwidth conversion values with standard unit
definitions from linux/units.h. Rename MLX5E_100MB/MLX5E_1GB to
MLX5E_100MB_TO_KB/MLX5E_1GB_TO_KB to clarify these are conversion
factors to Kbps, not absolute bandwidth values.

Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Nimrod Oren <noren@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/1764498334-1327918-5-git-send-email-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c