]> git.proxmox.com Git - mirror_ubuntu-focal-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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 24 Mar 2021 10:11:27 +0000 (11:11 +0100)
commitd82e406f8803f2083d8518c31ac0d42418bc9b2a
tree5d48c6ff0586a224671b3c141250ddcd788e866c
parentd268b29d02e0ab9f1111a7afe6e3c99e1d96bda8
net/mlx5e: E-switch, Fix rate calculation for overflow

BugLink: https://bugs.launchpad.net/bugs/1916056
[ Upstream commit 1fe3e3166b35240615ab7f8276af2bbf2e51f559 ]

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: fcb64c0f5640 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c