]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: E-switch, Fix rate calculation for overflow
authorParav Pandit <parav@nvidia.com>
Tue, 12 Jan 2021 14:13:22 +0000 (16:13 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Fri, 12 Feb 2021 02:50:09 +0000 (18:50 -0800)
commit94aa2cebf9680c02e8dacf4f23072ada052d73e3
tree818443c291b65816b853894ff025b0461514694d
parent027c233e741007dbfa3ab5ddb259bd812a78f14c
net/mlx5e: E-switch, Fix rate calculation for overflow

rate_bytes_ps is a 64-bit field. It passed as 32-bit field to
apply_police_params(). Due to this when police rate is higher
than 4Gbps, 32-bit calculation ignores the carry. This results
in incorrect rate configurationn the device.

Fix it by performing 64-bit calculation.

Fixes: 3686582e3078 ("net/mlx5: E-Switch, add ingress rate support")
Signed-off-by: Parav Pandit <parav@nvidia.com>
Reviewed-by: Eli Cohen <elic@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c