]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit2b51407e1c141bd7d065e2295155b4e5afc10d74
tree8b2e5979a29baf2bc042e794e6cf844579871d7f
parent6bdad87a60032d2ae695db7eb2827869e38d0948
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: 7de3d36bcd47 ("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