net/mlx5e: Use query_special_contexts cmd only once per mdev
authorDragos Tatulea <dtatulea@nvidia.com>
Thu, 13 Apr 2023 12:48:30 +0000 (15:48 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Thu, 25 May 2023 03:44:18 +0000 (20:44 -0700)
commit1db1f21caebbb1b6e9b1e7657df613616be3fb49
treeb77224fd5270219f538fe5341d16259b61a711c1
parent341a80de2468f481b1f771683709b5649cbfe513
net/mlx5e: Use query_special_contexts cmd only once per mdev

Don't query the firmware so many times (num rqs * num wqes * wqe frags)
because it slows down linearly the interface creation time when the
product is larger. Do it only once per mdev and store the result in
mlx5e_param.

Due to helper function being called from different files, move it to
an appropriate location. Rename the function with a proper prefix and
add a small cleanup.

This fix applies only for legacy rq.

Fixes: 1b1e4868836a ("net/mlx5e: Use query_special_contexts for mkeys")
Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
Reviewed-by: Or Har-Toov <ohartoov@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en.h
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
drivers/net/ethernet/mellanox/mlx5/core/mr.c
include/linux/mlx5/driver.h