• Leon Romanovsky's avatar
    RDMA: Restore ability to fail on PD deallocate · 91a7c58f
    Leon Romanovsky authored
    The IB verbs objects are counted by the kernel and ib_core ensures that
    deallocate PD will success so it will be called once all other objects
    that depends on PD will be released. This is achieved by managing various
    reference counters on such objects.
    
    The mlx5 driver didn't follow this standard flow when allowed DEVX objects
    that are not managed by ib_core to be interleaved with the ones under
    ib_core responsibility.
    
    In such interleaved scenarios deallocate command can fail and ib_core will
    leave uobject in internal DB and attempt to clean it later to free
    resources anyway.
    
    This change partially restores returned value from dealloc_pd() for all
    drivers, but keeping in mind that non-DEVX devices and kernel verbs paths
    shouldn't fail.
    
    Fixes: 21a428a0 ("RDMA: Handle PD allocations by IB/core")
    Link: https://lore.kernel.org/r/20200907120921.476363-2-leon@kernel.orgSigned-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
    Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
    91a7c58f
efa.h 4.35 KB