net/mlx5e: SHAMPO, Fix constant expression result
authorBen Ben-Ishay <benishay@nvidia.com>
Sun, 31 Oct 2021 16:31:02 +0000 (18:31 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Wed, 1 Dec 2021 06:35:06 +0000 (22:35 -0800)
commit8c8cf0382257b28378eeff535150c087a653ca19
tree8b2e5979a29baf2bc042e794e6cf844579871d7f
parent502e82b91361955c66c8453b5b7a905b0b5bd5a1
net/mlx5e: SHAMPO, Fix constant expression result

mlx5e_build_shampo_hd_umr uses counters i and index incorrectly
as unsigned, thus the err state err_unmap could stuck in endless loop.
Change i to int to solve the first issue.
Reduce index check to solve the second issue, the caller function
validates that index could not rotate.

Fixes: 64509b052525 ("net/mlx5e: Add data path for SHAMPO feature")
Signed-off-by: Ben Ben-Ishay <benishay@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c