Re: [PATCH rdma-next 5/6] RDMA/{cma, core}: Avoid callback on rdma_addr_cancel()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Sep 01, 2018 at 02:36:21PM -0600, Jason Gunthorpe wrote:
> On Tue, Aug 28, 2018 at 02:45:32PM +0300, Leon Romanovsky wrote:
> > From: Parav Pandit <parav@xxxxxxxxxxxx>
> >
> > Currently rdma_addr_cancel() is an async operation, which notifies that
> > cancel is done by executing the callback function given during
> > rdma_resolve_ip(). If resolve_ip request is already completed than
> > callback is not executed.
> >
> > Instead, now rdma_resolve_addr() and rdma_addr_cancel() simplified in
> > following ways.
> > 1. rdma_addr_cancel() now a synchronous method. If request was
> > pending, after it is cancelled, no callback is notified.
> > 2. rdma_resolve_addr() and respective addr_handler() callback doesn't
> > need to hold reference to cm_id.
> >
> > Signed-off-by: Parav Pandit <parav@xxxxxxxxxxxx>
> > Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx>
> >  drivers/infiniband/core/addr.c | 12 +++++++-----
> >  drivers/infiniband/core/cma.c  |  4 ----
> >  2 files changed, 7 insertions(+), 9 deletions(-)
> >
> > diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c
> > index 46b855a42884..94ff38731be8 100644
> > +++ b/drivers/infiniband/core/addr.c
> > @@ -660,6 +660,13 @@ int rdma_resolve_ip_route(struct sockaddr *src_addr,
> >  	return addr_resolve(src_in, dst_addr, addr, false, 0);
> >  }
> >
> > +/**
> > + * rdma_addr_cancel - Cancel resolve ip request
> > + * @addr:	Pointer to address structure given previously
> > + *		during rdma_resolve_ip().
> > + * rdma_addr_cancel() is synchronous function which cancels any pending
> > + * request if there is any.
> > + */
> >  void rdma_addr_cancel(struct rdma_dev_addr *addr)
> >  {
> >  	struct addr_req *req, *temp_req;
> > @@ -687,11 +694,6 @@ void rdma_addr_cancel(struct rdma_dev_addr *addr)
> >  	 * guarentees no work is running and none will be started.
> >  	 */
> >  	cancel_delayed_work_sync(&found->work);
> > -
> > -	if (found->callback)
> > -		found->callback(-ECANCELED, (struct sockaddr *)&found->src_addr,
> > -			      found->addr, found->context);
> > -
>
> I still don't understand why this change is needed, and I dislike it
> from an API design perspective.

I'm a little bit confused, why should we keep the code which is not used?

Thanks

>
> Jason

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux