On Wed, May 22, 2019 at 03:25:32PM +0300, Shamir Rabinovitch wrote: > On Mon, May 20, 2019 at 12:18:40PM +0300, Leon Romanovsky wrote: > > On Mon, May 20, 2019 at 10:53:20AM +0300, Shamir Rabinovitch wrote: > > > In shared object model ib_pd can belong to 1 or more ib_ucontext. > > > Fix the nldev code so it could report multiple context ids. > > > > > > Signed-off-by: Shamir Rabinovitch <shamir.rabinovitch@xxxxxxxxxx> > > > --- > > [...] > > > > + if (!rdma_is_kernel_res(res)) { > > > + pd_context(pd, &pd_context_ids); > > > + list_for_each_entry(ctx_id, &pd_context_ids, list) { > > > + if (nla_put_u32(msg, RDMA_NLDEV_ATTR_RES_CTXN, > > > + ctx_id->id)) > > > > Did it work? You are overwriting RDMA_NLDEV_ATTR_RES_CTXN entry in the > > loop. You need to add RDMA_NLDEV_ATTR_RES_CTX and > > RDMA_NLDEV_ATTR_RES_CTX_ENTRY to include/uapi/rdma_netlink.h and > > open nested table here (inside of PD) with list of contexts. > > > > > + goto err; > > > + } > > Hi Leon, > > Just to clarify the above nesting... > > Do you expect the below NL attribute nesting in case of shared pd dump? > > RDMA_NLDEV_ATTR_RES_CTX > RDMA_NLDEV_ATTR_RES_CTX_ENTRY > RDMA_NLDEV_ATTR_RES_CTXN #1 > RDMA_NLDEV_ATTR_RES_CTXN #2 > ... > RDMA_NLDEV_ATTR_RES_CTXN #N > > > I tried this and rdmatool reported: > > [root@qemu-fc29 iproute2]# rdma/rdma res show pd dev mlx4_0 > dev mlx4_0 pdn 0 local_dma_lkey 0x8000 users 4 comm [ib_core] > dev mlx4_0 pdn 1 local_dma_lkey 0x8000 users 4 comm [ib_core] > error: Operation not supported > > Is this the expected behaviour from unmodified latest rdmatool? > > Thanks Leon, I tried this nesting (which make more sense to me) and results are the same as above. RDMA_NLDEV_ATTR_RES_CTX RDMA_NLDEV_ATTR_RES_CTX_ENTRY RDMA_NLDEV_ATTR_RES_CTXN RDMA_NLDEV_ATTR_RES_CTX_ENTRY RDMA_NLDEV_ATTR_RES_CTXN ... Which is the nesting you expect ? Is it OK that we get the rdma tool "error: Operation not supported" ? Thanks