-----"Jason Gunthorpe" <jgg@xxxxxxxx> wrote: ----- >To: "Bernard Metzler" <bmt@xxxxxxxxxxxxxx> >From: "Jason Gunthorpe" <jgg@xxxxxxxx> >Date: 12/09/2019 05:07PM >Cc: linux-rdma@xxxxxxxxxxxxxxx, krishna2@xxxxxxxxxxx, leon@xxxxxxxxxx >Subject: [EXTERNAL] Re: [PATCH for-next] RDMA/siw: Simplify QP >representation. > >On Fri, Nov 29, 2019 at 05:25:09PM +0100, Bernard Metzler wrote: >> Change siw_qp to contain ib_qp. Use ib_qp's uobject pointer >> to distinguish kernel level and user level applications. >> Apply same mechanism for kerne/user level application >> detection to shared receive queues and completion queues. > >Drivers should not touch the uobject. If I recall you can use >restrack >to tell if it is kernel or user created > 'bool res->user' would probably be it, but I stumbled upon this comment (e.g. in struct ib_qp): /* * Implementation details of the RDMA core, don't use in drivers: */ struct rdma_restrack_entry res; So we shall not use restrack information in drivers..? Shall restrack better export a query such as 'rdma_restrack_is_user(resource)'? After a quick investigation, current drivers do have their own solution for the issue: mlx5, mlx4, mthca, hns, cxgb4, qedr: tests ib_xx->uobject as I proposed here for siw as well. bnxt_re, qedr, hfi, i40iw, vmw_pvrdma: use their own local resource flag ('is_user', 'is_kernel', whatever), as siw does it until now, and what is not preferred as well. How shall we proceed? Thanks, Bernard.