common/mlx5: optimize read of general capabilities
authorDekel Peled <dekelp@nvidia.com>
Tue, 4 May 2021 17:54:48 +0000 (20:54 +0300)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 4 May 2021 20:41:38 +0000 (22:41 +0200)
commit876d4702b141daabba3f5bc7ee378572573e5642
treeebe892bef46bd92861f93075a89e92c62c3286f7
parent753a7c08e2d4dbc4dc6709d48f30db9e691c3bc4
common/mlx5: optimize read of general capabilities

General object types support is indicated in bitmap general_obj_types,
which is part of HCA capabilities list.
Currently this bitmap is read multiple times, and each time a different
bit is extracted.

This patch optimizes the code, reading the bitmap once into a local
variable, and then extracting the required bits.

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
drivers/common/mlx5/mlx5_devx_cmds.c