All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
To: Christoph Lameter <cl-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org>
Cc: Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Liran Liss <liranl-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Haggai Eran <haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Tal Alon <talal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Majd Dibbiny <majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: Re: [RFC ABI V2 5/8] RDMA/core: Add new ioctl interface
Date: Wed, 20 Jul 2016 21:28:03 -0600	[thread overview]
Message-ID: <20160721032803.GA12093@obsidianresearch.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1607202132080.26260-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>

On Wed, Jul 20, 2016 at 09:41:34PM -0500, Christoph Lameter wrote:
> On Wed, 20 Jul 2016, Jason Gunthorpe wrote:
> 
> > >
> > > But you already have that uniqueness if the ioctl filehandle provides
> > > that.
> >
> > The argument is that ioctls should be self-describing and never rely
> > on the filehandle to uniq them. That is basically standard in the
> > kernel, and why we have Documentation/ioctl/ioctl-number.txt
> > describing how to uniquely assign ioctl numbers.
> 
> Fully agree with that. But this statement does not relate to what we
> were talking about. So I guess I need to restate it one more time:

> device_id is useless if the driver is already determined by the device filehanle.

It isn't useless, it preserves the self describing property that is
the kernel standard for ioctls.

The filehandle major/minor will never uniquely describe the device, we
are not going to give mlx4,mlx5, etc unique major/minor numbers. Yes,
the kernel always implicitly knows what device driver the ioctl will
be delivered to.

But the kernel has that implicit knowledge for ioctls as well and we
still go through the trouble in Documentation/ioctl/ioctl-number.txt
to make them globally unique. device_id is exactly the same thing.

In otherwords, we are going to do something like this:

arg.driver_id = MLX4;
arg.driver_op = MLX4_FROBNICATE;
ioctl(IB_DRIVER_DO_SOMETHING,arg);

Something like strace looks at this and sees
IB_DRIVER_DO_SOMETHING,driver_id,driver_op and knows excatly how to
parse arg (struct mlx4_op_frobincate).

And it can tell it apart from this:

arg.driver_id = MLX5;
arg.driver_op = MLX5_BROBNICATE;
ioctl(IB_DRIVER_DO_SOMETHING,arg);

Which would have a different layout for arg.

Which is *exactly* what you expect for ioctl, and is the basic kernel
standard.

Think of driver_id and driver_op as being a 32 bit globally unique
value assigned to every driver function, run under the
IB_DRIVER_DO_SOMETHING multiplexor.

> > Some do, some don't. The rdma_cm requirement is more like
> > listen(0.0.0.0) which does not require special net device aggregation.
> 
> Well that concept is for a packetized protocol stack. In that kind of a
> system packets can be routed over multiple devices depending on the
> address. We do not have that in the IB stack.

We do have routing, RDMA_CM does it. Only once the connection is
established does it crystalize into specific hardware, which is
basically the same process as the net stack, rdma_cm uses the same
routing table functions to determine the RDMA device to route the QP
too, which is part of the problem with having things spread across all
these distinct FDs. They don't coorporate like they need to.

.. and there is also the issue of namespaces :| People want RDMA
namespaces, which I think really clouds how these per-device file
descriptors would sanely work, esepcially with the separate RDMA CM
fd.

> > /dev/pts/ptmx, /dev/mapper/control, /dev/btrfs-control, etc, etc are
> > all examples of multi-device control fds similar to the proposed
> > single char dev.
> 
> Yes but those are not used for communications. They are used to control a
> subsystem and access to those requires special priviledges. We are talking
> about a device accessible witout special priviledges to do data
> communications. /dev/rdmaXXXX to control global behavior of the stack
> for all processes would be fine. But we are controlling the interaction of
> a process with a device.

Eh? btrfs-control is mutliplexed across all mounted block devices used
by BTRFS, I wouldn't say it is any different than what we are talking
about with rdma.

Do you have an actual use for the currently somewhat broken fine-grained
permissions we have with uverbs0 ?

The only people a single char dev really impacts are users with
multiple cards, and I think that is fairly rare..

> > .. and bear in mind that /dev/uverbs0 doesn't even really make that
> > much sense as it aggregates two physical ports. There is already no
> > way to split permissions up by port, which is a logical thing to want
> > for some dual-rail configurations.
> 
> Right lets get rid of it. device specific files only.

There is a good reason why we bundle ports together - that is part of
how the IN spec works for PDs, APM and connection management. It is
not something we should throw away.

Even if we wanted to we just don't have the overall infrastructure to
restrict on a port by port basis (SELinux should ultimately fix that,
but SELinux will work the same in both single and multi char dev models)

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

  parent reply	other threads:[~2016-07-21  3:28 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-19 15:23 [RFC ABI V2 0/8] SG-based RDMA ABI Proposal Matan Barak
     [not found] ` <1468941812-32286-1-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-07-19 15:23   ` [RFC ABI V2 1/8] RDMA/core: Export RDMA IOCTL declarations Matan Barak
     [not found]     ` <1468941812-32286-2-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-07-20  1:06       ` Christoph Lameter
     [not found]         ` <alpine.DEB.2.20.1607192004510.5828-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2016-07-20  3:15           ` Leon Romanovsky
2016-07-21  8:07       ` Christoph Hellwig
     [not found]         ` <20160721080719.GB21060-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2016-07-21 10:49           ` Leon Romanovsky
2016-07-19 15:23   ` [RFC ABI V2 2/8] RDMA/core: Refactor IDR to be per-device Matan Barak
     [not found]     ` <1468941812-32286-3-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-07-20  1:15       ` Christoph Lameter
     [not found]         ` <alpine.DEB.2.20.1607192014010.5828-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2016-07-20  3:20           ` Leon Romanovsky
     [not found]             ` <20160720032037.GR20674-2ukJVAZIZ/Y@public.gmane.org>
2016-07-20 17:08               ` Jason Gunthorpe
2016-07-20 17:41       ` Jason Gunthorpe
     [not found]         ` <20160720174122.GJ21460-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-07-21 11:52           ` Matan Barak
     [not found]             ` <13309138-dd3f-7411-d750-4ff370d55daa-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-07-21 16:51               ` Jason Gunthorpe
2016-07-19 15:23   ` [RFC ABI V2 3/8] RDMA/core: Add support for custom types Matan Barak
2016-07-19 15:23   ` [RFC ABI V2 4/8] RDMA/core: Introduce add/remove uobj from types Matan Barak
2016-07-19 15:23   ` [RFC ABI V2 5/8] RDMA/core: Add new ioctl interface Matan Barak
     [not found]     ` <1468941812-32286-6-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-07-20  1:25       ` Christoph Lameter
     [not found]         ` <alpine.DEB.2.20.1607192021500.5828-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2016-07-20  8:11           ` Matan Barak
     [not found]             ` <53dd8337-0779-341e-49f5-ad675269bfe6-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-07-20 10:03               ` Christoph Lameter
     [not found]                 ` <alpine.DEB.2.20.1607200448370.12616-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2016-07-20 11:56                   ` Matan Barak
     [not found]                     ` <0fc727fd-bc35-b2bd-f4a7-04efd937d4c3-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-07-21  0:38                       ` Christoph Lameter
2016-07-20 17:21                   ` Jason Gunthorpe
     [not found]                     ` <20160720172143.GG21460-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-07-21  0:57                       ` Christoph Lameter
     [not found]                         ` <alpine.DEB.2.20.1607201950160.24804-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2016-07-21  1:56                           ` Jason Gunthorpe
     [not found]                             ` <20160721015613.GB8279-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-07-21  2:41                               ` Christoph Lameter
     [not found]                                 ` <alpine.DEB.2.20.1607202132080.26260-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2016-07-21  3:28                                   ` Jason Gunthorpe [this message]
     [not found]                                     ` <20160721032803.GA12093-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-07-21  5:00                                       ` Christoph Lameter
     [not found]                                         ` <alpine.DEB.2.20.1607202340280.26638-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2016-07-21  5:44                                           ` Jason Gunthorpe
     [not found]                                             ` <20160721054439.GA19329-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-07-21  7:11                                               ` Christoph Lameter
     [not found]                                                 ` <alpine.DEB.2.20.1607210202400.29415-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2016-07-21 16:41                                                   ` Jason Gunthorpe
     [not found]                                                     ` <20160721164133.GD19849-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-07-25 16:30                                                       ` Christoph Lameter
     [not found]                                                         ` <alpine.DEB.2.20.1607251104370.23039-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2016-07-25 18:01                                                           ` Jason Gunthorpe
     [not found]                                                             ` <20160725180119.GB18773-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-07-27 15:03                                                               ` Christoph Lameter
     [not found]                                                                 ` <alpine.DEB.2.20.1607270954150.25436-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2016-07-27 17:28                                                                   ` Parav Pandit
     [not found]                                                                     ` <CAG53R5XZ9RVg-2yGFbr-7To1SMbRoGG3xiZHf-vNnGM4K+R4pw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-07-27 18:03                                                                       ` Christoph Lameter
     [not found]                                                                         ` <alpine.DEB.2.20.1607271300150.27032-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2016-07-27 18:56                                                                           ` Parav Pandit
     [not found]                                                                             ` <CAG53R5V07Q-O8cmm3Ad23qsH3oDQiw9nL87yG2=ki=Rgg9LQAA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-07-27 18:58                                                                               ` Christoph Lameter
2016-07-21  8:04                                               ` Christoph Hellwig
     [not found]                                                 ` <20160721080433.GA21060-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2016-07-21 16:20                                                   ` Jason Gunthorpe
     [not found]                                                     ` <20160721162033.GB19849-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-07-25 16:32                                                       ` Christoph Lameter
     [not found]                                                         ` <alpine.DEB.2.20.1607251131000.23039-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2016-07-25 17:39                                                           ` Jason Gunthorpe
2016-07-19 15:23   ` [RFC ABI V2 6/8] RDMA/core: Add initialize and cleanup of common types Matan Barak
     [not found]     ` <1468941812-32286-7-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-07-20 17:40       ` Jason Gunthorpe
     [not found]         ` <20160720174052.GI21460-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-07-21 11:40           ` Matan Barak
2016-07-19 15:23   ` [RFC ABI V2 7/8] RDMA/core: Add common code for querying device and init context Matan Barak
2016-07-19 15:23   ` [RFC ABI V2 8/8] RDMA/mlx5: Add mlx5 initial support of the new infrastructure Matan Barak
     [not found]     ` <1468941812-32286-9-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-07-20 17:39       ` Jason Gunthorpe
     [not found]         ` <20160720173927.GH21460-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-07-21 11:38           ` Matan Barak
     [not found]             ` <8ffd0f92-2564-cc39-10ab-5db287399e82-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-07-21 16:49               ` Jason Gunthorpe
     [not found]                 ` <20160721164952.GE19849-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-07-24  6:18                   ` Matan Barak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160721032803.GA12093@obsidianresearch.com \
    --to=jgunthorpe-epgobjl8dl3ta4ec/59zmfatqe2ktcn/@public.gmane.org \
    --cc=cl-vYTEC60ixJUAvxtiuMwx3w@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=liranl-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=talal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.