On Mon, May 20, 2019 at 03:05:29PM +0300, Leon Romanovsky wrote: > On Mon, May 20, 2019 at 02:50:10PM +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: > > > > > > > + 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. > > > > I tested with only 1 context per pd (what we have today). Thanks for > > comment. I'll try to follow what you wrote here. > > Leon, what is your expectation here? I see 2 options: 1. Code will build same NL message in case of single context id and nested table in case of multiple context ids 2. Code always build nested table with context id(s) If taking option (1) we can postpone the iproute2 matching commits to some extent but if we take option (2) I guess I have to add iproute2 commits as well - right? Also, what's the best way to add the changes in both given what you choose above? Thanks