-----linux-rdma-owner@xxxxxxxxxxxxxxx wrote: ----- >To: "Bernard Metzler" <BMT@xxxxxxxxxxxxxx> >From: "Leon Romanovsky" >Sent by: linux-rdma-owner@xxxxxxxxxxxxxxx >Date: 12/09/2019 07:30PM >Cc: "Jason Gunthorpe" <jgg@xxxxxxxx>, linux-rdma@xxxxxxxxxxxxxxx, >krishna2@xxxxxxxxxxx >Subject: [EXTERNAL] Re: [PATCH for-next] RDMA/siw: Simplify QP >representation. > >On Mon, Dec 09, 2019 at 04:50:23PM +0000, Bernard Metzler wrote: >> -----"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)'? > >rdma_is_kernel_res() inside include/rdma/restrack.h > This is great, thanks for the pointer! Let me restructure accordingly. Unfortunately, SRQ's don't have (yet?) restrack info included. So I'll stay with a private flag there, until SRQ's are getting restracked. Many thanks! Bernard.