On Wed, Jan 30, 2019 at 09:22:44PM -0700, Jason Gunthorpe wrote: > On Wed, Jan 30, 2019 at 12:48:56PM +0200, Leon Romanovsky wrote: > > From: Leon Romanovsky <leonro@xxxxxxxxxxxx> > > > > Ensure that users won't provide port values on resource entry > > allocated in per-device mode needed for .doit callback. > > > > Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx> > > drivers/infiniband/core/nldev.c | 9 +++++++++ > > 1 file changed, 9 insertions(+) > > > > diff --git a/drivers/infiniband/core/nldev.c b/drivers/infiniband/core/nldev.c > > index 1867449ee0ac..8ad1116c72de 100644 > > +++ b/drivers/infiniband/core/nldev.c > > @@ -908,6 +908,11 @@ struct nldev_fill_res_entry { > > struct rdma_restrack_entry *res, u32 port); > > enum rdma_nldev_attr nldev_attr; > > enum rdma_nldev_command nldev_cmd; > > + u8 flags; > > +}; > > + > > +enum nldev_res_flags { > > + NLDEV_PER_DEV = 1 << 0, > > }; > > > > static const struct nldev_fill_res_entry fill_entries[RDMA_RESTRACK_MAX] = { > > @@ -925,16 +930,20 @@ static const struct nldev_fill_res_entry fill_entries[RDMA_RESTRACK_MAX] = { > > .fill_res_func = fill_res_cq_entry, > > .nldev_cmd = RDMA_NLDEV_CMD_RES_CQ_GET, > > .nldev_attr = RDMA_NLDEV_ATTR_RES_CQ, > > + .flags = NLDEV_PER_DEV, > > }, > > [RDMA_RESTRACK_MR] = { > > .fill_res_func = fill_res_mr_entry, > > .nldev_cmd = RDMA_NLDEV_CMD_RES_MR_GET, > > .nldev_attr = RDMA_NLDEV_ATTR_RES_MR, > > + .flags = NLDEV_PER_DEV, > > + > > }, > > [RDMA_RESTRACK_PD] = { > > .fill_res_func = fill_res_pd_entry, > > .nldev_cmd = RDMA_NLDEV_CMD_RES_PD_GET, > > .nldev_attr = RDMA_NLDEV_ATTR_RES_PD, > > + .flags = NLDEV_PER_DEV, > > }, > > }; > > I don't think this makes sense as a stand alone patch?? flags is never read. I'll squash it into "RDMA/nldev: Add resource tracker doit callback" Thanks > > Jason
Attachment:
signature.asc
Description: PGP signature