On Tue, Aug 25, 2020 at 11:13 AM Gal Pressman <galpress@xxxxxxxxxx> wrote: > > On 24/08/2020 13:32, Leon Romanovsky wrote: > > From: Leon Romanovsky <leonro@xxxxxxxxxxxx> > > > > Like any other IB verbs objects, AH are refcounted by ib_core. The release > > of those objects is controlled by ib_core with promise that AH destroy > > can't fail. > > > > Being SW object for now, this change makes dealloc_ah() to behave like > > any other destroy IB flows. > > Maybe I'm misreading this, but AH isn't necessarily a software object. It's a HW > object as well in some of the drivers. We are working to introduce AH HW object. > > > diff --git a/drivers/infiniband/hw/efa/efa_verbs.c b/drivers/infiniband/hw/efa/efa_verbs.c > > index 660a69943e02..426c5f687c7b 100644 > > --- a/drivers/infiniband/hw/efa/efa_verbs.c > > +++ b/drivers/infiniband/hw/efa/efa_verbs.c > > @@ -1875,7 +1875,7 @@ int efa_create_ah(struct ib_ah *ibah, > > return err; > > } > > > > -void efa_destroy_ah(struct ib_ah *ibah, u32 flags) > > +int efa_destroy_ah(struct ib_ah *ibah, u32 flags) > > { > > struct efa_dev *dev = to_edev(ibah->pd->device); > > struct efa_ah *ah = to_eah(ibah); > > @@ -1885,10 +1885,11 @@ void efa_destroy_ah(struct ib_ah *ibah, u32 flags) > > if (!(flags & RDMA_DESTROY_AH_SLEEPABLE)) { > > ibdev_dbg(&dev->ibdev, > > "Destroy address handle is not supported in atomic context\n"); > > - return; > > + return -EINVAL; > > -EOPNOTSUPP. Thanks, I'll fix. > > > } > > > > efa_ah_destroy(dev, ah); > > + return 0; > > }