Skip to content
  • Parav Pandit's avatar
    net/mlx5: Refactor mlx5_esw_query_functions for modularity · dd28087c
    Parav Pandit authored
    
    
    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: default avatarParav Pandit <parav@mellanox.com>
    Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
    dd28087c