From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matan Barak Subject: Re: [RFC ABI V2 5/8] RDMA/core: Add new ioctl interface Date: Wed, 20 Jul 2016 11:11:09 +0300 Message-ID: <53dd8337-0779-341e-49f5-ad675269bfe6@mellanox.com> References: <1468941812-32286-1-git-send-email-matanb@mellanox.com> <1468941812-32286-6-git-send-email-matanb@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Christoph Lameter Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Doug Ledford , Jason Gunthorpe , Sean Hefty , Liran Liss , Haggai Eran , Tal Alon , Majd Dibbiny , Leon Romanovsky List-Id: linux-rdma@vger.kernel.org On 20/07/2016 04:25, Christoph Lameter wrote: > On Tue, 19 Jul 2016, Matan Barak wrote: > >> diff --git a/include/uapi/rdma/rdma_user_ioctl.h b/include/uapi/rdma/rdma_user_ioctl.h >> index 5c1117a..f6927fc 100644 >> --- a/include/uapi/rdma/rdma_user_ioctl.h >> +++ b/include/uapi/rdma/rdma_user_ioctl.h >> @@ -42,6 +42,29 @@ >> */ >> #define IB_IOCTL_MAGIC RDMA_IOCTL_MAGIC >> >> +#define RDMA_VERBS_IOCTL \ >> + _IOWR(RDMA_IOCTL_MAGIC, 1, struct ib_uverbs_ioctl_hdr) >> + >> +#define RDMA_DIRECT_IOCTL \ >> + _IOWR(RDMA_IOCTL_MAGIC, 2, struct ib_uverbs_ioctl_hdr) >> + >> +struct ib_uverbs_attr { >> + __u16 attr_id; /* command specific type attribute */ >> + __u16 len; /* NA for idr */ >> + __u32 reserved; >> + __u64 ptr_idr; /* ptr typeo command/idr handle */ >> +}; >> + >> +struct ib_uverbs_ioctl_hdr { >> + __u16 length; >> + __u16 flags; >> + __u16 object_type; >> + __u16 driver_id; > > driver id??? I would have expected that the driver to be used is > already selected through the file handle as passed to the ioctl. > If I recall, Jason proposed that. I think the main reason here is for strace and debugging. Since the ABI is now driver specific, this helps you parse the structs via strace. > Having the ability to issue ioctls to multiple drivers via a > single file handle is unusual and will likely trigger security concerns. > In particular various access mechanisms rely on policing access through > file handles. > This is actually an ongoing discussion we have in the OFVWG. The benefit of unifying rdma-cm and uverbs is that sharing objects (and opening a device through rdma-cm and pass it to user-space) becomes easier. That means that security should be handled via selinux. > I guess we have a good reason for doing so? If so then please document > that somewhere. Or did I not see that? > > The current v2 approach only adds the driver_id for information and strace only. I would really like to hear your insights about using a single file (rdma_uapi) vs multiple files as we have today. > + __u16 action; > + __u16 num_attrs; >> + struct ib_uverbs_attr attrs[0]; >> +}; >> + >> /* Legacy part >> * !!!! NOTE: It uses the same command index as VERBS >> */ >> Matan -- 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