]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5: Refactor mlx5_esw_query_functions for modularity
authorParav Pandit <parav@mellanox.com>
Fri, 7 Jun 2019 12:16:58 +0000 (07:16 -0500)
committerSaeed Mahameed <saeedm@mellanox.com>
Wed, 3 Jul 2019 19:50:42 +0000 (12:50 -0700)
commit2f1dfc4a30a96b87cc3b2a6deaf65da433079e5e
tree0a619ef9ad17b0051017ac23b81c3e79e3b30824
parent39151fb6d0075bf5bcc535312066bc846527d18f
net/mlx5: Refactor mlx5_esw_query_functions for modularity

Functions change event output data size changes when functions other
than VFs will be enabled in HCA CAP.
With current API, multiple callers needs to align, calculate accurate
size of the output data depending on number on non VF functions enabled
in the device.
Instead of duplicating such math at multiple places, refactor
mlx5_esw_query_functions() to return raw output allocated by itself.

Caller must free the allocated memory using kvfree() as described in the
function comment section.
This hides calcuation within mlx5_esw_query_functions() and provides
simpler API.

Signed-off-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
drivers/net/ethernet/mellanox/mlx5/core/sriov.c