From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Gunthorpe Subject: Re: [RFC ABI V5 01/10] RDMA/core: Refactor IDR to be per-device Date: Mon, 7 Nov 2016 16:55:16 -0700 Message-ID: <20161107235516.GE7002@obsidianresearch.com> References: <1477579398-6875-1-git-send-email-matanb@mellanox.com> <1477579398-6875-2-git-send-email-matanb@mellanox.com> <1828884A29C6694DAF28B7E6B8A82373AB0A445F@ORSMSX109.amr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1828884A29C6694DAF28B7E6B8A82373AB0A445F-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org> Sender: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: "Hefty, Sean" Cc: Matan Barak , "linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Doug Ledford , Christoph Lameter , Liran Liss , Haggai Eran , Majd Dibbiny , Tal Alon , Leon Romanovsky List-Id: linux-rdma@vger.kernel.org On Fri, Oct 28, 2016 at 10:53:13PM +0000, Hefty, Sean wrote: > > The current code creates an IDR per type. Since types are currently > > common for all vendors and known in advance, this was good enough. > > However, the proposed ioctl based infrastructure allows each vendor > > to declare only some of the common types and declare its own specific > > types. > > > > Thus, we decided to implement IDR to be per device and refactor it to > > use a new file. > > I think this needs to be more abstract. I would consider > introducing the concept of an 'ioctl provider', with the idr per > ioctl provider. You could then make each ib_device an ioctl > provider. (Just embed the structure). I believe this will be > necessary to support the rdma_cm, ib_cm, as well as devices that > export different sets of ioctls, where an ib_device isn't > necessarily available. > > Essentially, I would treat plugging into the uABI independent from > plugging into the kernel verbs API. Otherwise, I think we'll end up > with multiple ioctl 'frameworks'. Matan, I think you should change things so that all the *general* code uses 'urdma_' as a prefix instead of uverbs_. Only use uverbs_ on things that truely only apply to uverbs. This will make things much clearer how the code sharing is expected to work with rdma_cm Sean is right, this shows why having the IDR be per device does not work, rdma-cm really does need a per-file or global IDR - both approaches should really be the same, and I think per-file has better locking characteristics, so I'd recommend that. Jason -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html