On Sun, Feb 03, 2019 at 02:55:51PM +0200, Leon Romanovsky wrote: > From: Leon Romanovsky <leonro@xxxxxxxxxxxx> > > The PD allocations in IB/core allows us to massively simplify drivers > and their error flows in their .alloc_pd() paths. The changes in > .alloc_pd() got hand in had with relevant update in .dealloc_pd(). > > We will use this opportunity and convert .dealloc_pd() to don't fail, > as it was suggested a long time ago. > > Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx> > drivers/infiniband/core/device.c | 3 + > drivers/infiniband/core/uverbs_cmd.c | 15 ++- > drivers/infiniband/core/uverbs_std_types.c | 2 +- > drivers/infiniband/core/verbs.c | 27 +++--- > drivers/infiniband/hw/bnxt_re/ib_verbs.c | 37 +++----- > drivers/infiniband/hw/bnxt_re/ib_verbs.h | 9 +- > drivers/infiniband/hw/bnxt_re/main.c | 1 + > drivers/infiniband/hw/cxgb3/iwch_provider.c | 25 ++--- > drivers/infiniband/hw/cxgb4/provider.c | 25 ++--- > drivers/infiniband/hw/hns/hns_roce_device.h | 7 +- > drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 27 +++--- > drivers/infiniband/hw/hns/hns_roce_main.c | 1 + > drivers/infiniband/hw/hns/hns_roce_pd.c | 25 ++--- > drivers/infiniband/hw/i40iw/i40iw_utils.c | 1 - > drivers/infiniband/hw/i40iw/i40iw_verbs.c | 32 +++---- > drivers/infiniband/hw/mlx4/main.c | 36 +++----- > drivers/infiniband/hw/mlx5/main.c | 48 +++++----- > drivers/infiniband/hw/mthca/mthca_provider.c | 29 ++---- > drivers/infiniband/hw/nes/nes_verbs.c | 32 +++---- > drivers/infiniband/hw/ocrdma/ocrdma_main.c | 1 + > drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 92 ++++++++----------- > drivers/infiniband/hw/ocrdma/ocrdma_verbs.h | 6 +- > drivers/infiniband/hw/qedr/main.c | 1 + > drivers/infiniband/hw/qedr/verbs.c | 34 ++----- > drivers/infiniband/hw/qedr/verbs.h | 6 +- > drivers/infiniband/hw/usnic/usnic_ib_main.c | 1 + > drivers/infiniband/hw/usnic/usnic_ib_verbs.c | 26 ++---- > drivers/infiniband/hw/usnic/usnic_ib_verbs.h | 7 +- > .../infiniband/hw/vmw_pvrdma/pvrdma_main.c | 1 + > .../infiniband/hw/vmw_pvrdma/pvrdma_verbs.c | 43 +++------ > .../infiniband/hw/vmw_pvrdma/pvrdma_verbs.h | 7 +- > drivers/infiniband/sw/rdmavt/pd.c | 29 ++---- > drivers/infiniband/sw/rdmavt/pd.h | 7 +- > drivers/infiniband/sw/rdmavt/vt.c | 1 + > drivers/infiniband/sw/rxe/rxe_pool.c | 60 +++++++++--- > drivers/infiniband/sw/rxe/rxe_pool.h | 4 + > drivers/infiniband/sw/rxe/rxe_verbs.c | 16 ++-- > drivers/infiniband/sw/rxe/rxe_verbs.h | 2 +- > include/rdma/ib_verbs.h | 9 +- > 39 files changed, 326 insertions(+), 409 deletions(-) > > diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c > index 303f4c521b34..72817cf7cf26 100644 > +++ b/drivers/infiniband/core/device.c > @@ -1314,6 +1314,9 @@ void ib_set_device_ops(struct ib_device *dev, const struct ib_device_ops *ops) > SET_DEVICE_OP(dev_ops, set_vf_guid); > SET_DEVICE_OP(dev_ops, set_vf_link_state); > SET_DEVICE_OP(dev_ops, unmap_fmr); > + SET_DEVICE_OP(dev_ops, fill_res_entry); This is a rebasing error, this list, like all the others, is supposed to be sorted. > @@ -424,7 +461,8 @@ void rxe_elem_release(struct kref *kref) > if (pool->cleanup) > pool->cleanup(elem); > > - kmem_cache_free(pool_cache(pool), elem); > + if (!(pool->flags & RXE_POLL_NO_ALLOC)) > + kmem_cache_free(pool_cache(pool), elem); > atomic_dec(&pool->num_elem); > rxe_dev_put(pool->rxe); > rxe_pool_put(pool); > diff --git a/drivers/infiniband/sw/rxe/rxe_pool.h b/drivers/infiniband/sw/rxe/rxe_pool.h > index 72968c29e01f..85fbb6528c95 100644 > +++ b/drivers/infiniband/sw/rxe/rxe_pool.h > @@ -41,6 +41,7 @@ enum rxe_pool_flags { > RXE_POOL_ATOMIC = BIT(0), > RXE_POOL_INDEX = BIT(1), > RXE_POOL_KEY = BIT(2), > + RXE_POLL_NO_ALLOC = BIT(4), POLL = POOL? Jason