• Maher Sanalla's avatar
    net/mlx5: Allocate completion EQs dynamically · f14c1a14
    Maher Sanalla authored
    This commit enables the dynamic allocation of EQs at runtime, allowing
    for more flexibility in managing completion EQs and reducing the memory
    overhead of driver load. Whenever a CQ is created for a given vector
    index, the driver will lookup to see if there is an already mapped
    completion EQ for that vector, if so, utilize it. Otherwise, allocate a
    new EQ on demand and then utilize it for the CQ completion events.
    
    Add a protection lock to the EQ table to protect from concurrent EQ
    creation attempts.
    
    While at it, replace mlx5_vector2irqn()/mlx5_vector2eqn() with
    mlx5_comp_eqn_get() and mlx5_comp_irqn_get() which will allocate an
    EQ on demand if no EQ is found for the given vector.
    Signed-off-by: default avatarMaher Sanalla <msanalla@nvidia.com>
    Reviewed-by: default avatarShay Drory <shayd@nvidia.com>
    Reviewed-by: default avatarMoshe Shemesh <moshe@nvidia.com>
    Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
    f14c1a14
driver.h 35.3 KB