Re: [PATCH 1/4] IB/{sw,hw}: ib_pd should not be used to get the ib_ucontext

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

 



On Sun, Oct 07, 2018 at 11:14:03AM +0300, Shamir Rabinovitch wrote:
> prepare the code for shared ib_x model.
> 
> ib_ucontext is currently taken from ib_pd uobject pointer. having single
> uobject pointer in ib_x object is not aligned with future shared ib_x
> model. in future shared ib_x model each ib_x object can belong to 1 or
> more ib_uobject. the current ib_context that is used should thus come from
> uverbs. convey the ib_ucontext via ib_udata that is used in (almost) all
> the places where ib_ucontext is needed.
> 
> Signed-off-by: Shamir Rabinovitch <shamir.rabinovitch@xxxxxxxxxx>
>  drivers/infiniband/hw/bnxt_re/ib_verbs.c      |  8 +-
>  drivers/infiniband/hw/cxgb3/iwch_provider.c   |  4 +-
>  drivers/infiniband/hw/cxgb4/mem.c             |  2 +-
>  drivers/infiniband/hw/cxgb4/qp.c              |  4 +-
>  drivers/infiniband/hw/i40iw/i40iw_verbs.c     | 10 +--
>  drivers/infiniband/hw/mlx4/mr.c               |  2 +-
>  drivers/infiniband/hw/mlx4/qp.c               | 11 +--
>  drivers/infiniband/hw/mlx4/srq.c              |  6 +-
>  drivers/infiniband/hw/mlx5/mlx5_ib.h          |  3 +-
>  drivers/infiniband/hw/mlx5/mr.c               | 10 +--
>  drivers/infiniband/hw/mlx5/odp.c              |  5 +-
>  drivers/infiniband/hw/mlx5/qp.c               | 82 ++++++++++---------
>  drivers/infiniband/hw/mlx5/srq.c              | 13 +--
>  drivers/infiniband/hw/mthca/mthca_dev.h       |  3 +-
>  drivers/infiniband/hw/mthca/mthca_provider.c  | 14 ++--
>  drivers/infiniband/hw/mthca/mthca_srq.c       | 35 ++++----
>  drivers/infiniband/hw/nes/nes_verbs.c         | 16 ++--
>  drivers/infiniband/hw/ocrdma/ocrdma_verbs.c   |  2 +-
>  drivers/infiniband/hw/qedr/verbs.c            |  8 +-
>  drivers/infiniband/hw/usnic/usnic_ib_verbs.c  |  2 +-
>  drivers/infiniband/hw/vmw_pvrdma/pvrdma_mr.c  |  2 +-
>  drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c  |  4 +-
>  drivers/infiniband/hw/vmw_pvrdma/pvrdma_srq.c |  2 +-
>  drivers/infiniband/sw/rdmavt/mr.c             |  2 +-
>  drivers/infiniband/sw/rdmavt/qp.c             |  2 +-
>  drivers/infiniband/sw/rdmavt/srq.c            |  2 +-
>  drivers/infiniband/sw/rxe/rxe_loc.h           |  3 +-
>  drivers/infiniband/sw/rxe/rxe_mr.c            |  2 +-
>  drivers/infiniband/sw/rxe/rxe_qp.c            |  5 +-
>  drivers/infiniband/sw/rxe/rxe_verbs.c         |  4 +-
>  30 files changed, 144 insertions(+), 124 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
> index d5ee75a2eff2..570f1e81233e 100644
> +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
> @@ -730,7 +730,7 @@ struct ib_ah *bnxt_re_create_ah(struct ib_pd *ib_pd,
>  
>  	/* Write AVID to shared page. */
>  	if (rdma_is_user_pd(ib_pd)) {
> -		struct ib_ucontext *ib_uctx = ib_pd->uobject->context;
> +		struct ib_ucontext *ib_uctx = udata->context;

I'd like a function call here please.

The function call should return udata->context if it not NULL,
otherwise it should (someday, I guess) call ib_uverbs_get_ucontext()
on the ufile?

.. and this needs to think about what to do if context is NULL, even
though in most cases that is not possible..

Jason



[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