linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: "Bryan O'Sullivan" <bos@pathscale.com>
Cc: Andrew Morton <akpm@osdl.org>, Roland Dreier <rdreier@cisco.com>,
	linux-kernel@vger.kernel.org, openib-general@openib.org
Subject: Re: RFC: ipath ioctls and their replacements
Date: Wed, 18 Jan 2006 21:39:40 -0800	[thread overview]
Message-ID: <20060119053940.GB21467@kroah.com> (raw)
In-Reply-To: <1137646957.25584.17.camel@localhost.localdomain>

On Wed, Jan 18, 2006 at 09:02:37PM -0800, Bryan O'Sullivan wrote:
> On Wed, 2006-01-18 at 18:57 -0800, Greg KH wrote:
> 
> > Shouldn't you just open the proper chip device and port device itself?
> > That drops one ioctl.
> 
> There isn't usually a "right" chip device and port.  On a NUMA system,
> you want to open the chip that is topologically closest to you, but
> failing that, you want to open something that will at least work.  You
> may *also* want to be able to open a specific unit/port pair, but that
> would not be the normal mode of operation.
> 
> The reason for doing this through a single open syscall, instead of
> making userland try each appropriate device in turn, is the same as
> why /dev/ptmx exists: it guarantees that userland can't do something
> stupid or racy.  The driver checks all units and ports under a single
> mutex, so it doesn't have to retry to see if something got closed behind
> its back, for example.

Ok, that's fair enough.  But if you want to do something like ptys, then
why not just have your own filesystem for this driver?

> > Why not just use mmap?  What's the special needs?
> 
> mmap just maps the hardware MMIO area into user memory.  The ioctl (or
> netlink message, or whatever it's going to be) does quite a lot more,
> such as tell the chip where user buffers are.

Ok.

> > >         UPDM_TID and FREE_TID are used for RDMA context management.
> > 
> > sysfs files.
> 
> Really?  Not netlink messages for these?  It is rightly only the process
> that has a unit/port open that should be able to modify these; can I
> enforce that through sysfs without jumping through too many hoops?

I really don't know your application enough to be sure.  If you want to
use netlink, that's fine too.

> Yes, it does.  There's such a profusion of disconnected interfaces in
> 2.6 for driver authors to get their heads around, it is a big help to
> get some directions through the thicket.

Well, for 99% of the drivers, there is no problem, as there is already a
specified and documented way to interact (like network, tty, block,
etc.)  You are just making your own type of special interface up as you
go, so the complexity is also there (this complexity would normally be
in some core code, which I am hoping that your code will turn into for
other devices of the same type, right?)

thanks,

greg k-h

  reply	other threads:[~2006-01-19  5:39 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-19  0:43 RFC: ipath ioctls and their replacements Bryan O'Sullivan
2006-01-19  0:48 ` David S. Miller
2006-01-19  1:14   ` Bryan O'Sullivan
2006-01-19  1:17     ` David S. Miller
2006-01-19  5:17       ` Bryan O'Sullivan
2006-01-19  5:43         ` Greg KH
2006-01-19  0:53 ` Greg KH
2006-01-19  1:17   ` Bryan O'Sullivan
2006-01-19  2:54     ` Greg KH
2006-01-19  2:57 ` Greg KH
2006-01-19  3:49   ` Andrew Morton
2006-01-19  4:03     ` Greg KH
2006-01-19  5:02   ` Bryan O'Sullivan
2006-01-19  5:39     ` Greg KH [this message]
2006-01-19  5:53       ` Bryan O'Sullivan
2006-01-19 22:57         ` Greg KH
2006-01-19 23:44           ` Bryan O'Sullivan
2006-01-20  0:02             ` [openib-general] " Sean Hefty
2006-01-19  8:25 ` Eric W. Biederman
2006-01-19  8:39   ` David S. Miller
2006-02-24 20:19     ` [PATCH 1/1] Topology c fix Zachary Amsden
2006-02-25  0:17       ` Andrew Vasquez
2006-01-19 16:29   ` RFC: ipath ioctls and their replacements Bryan O'Sullivan
2006-01-19 18:20     ` Eric W. Biederman
2006-01-19 18:50       ` [openib-general] " Sean Hefty
2006-01-19 18:55         ` Bryan O'Sullivan
2006-01-19 20:31           ` Eric W. Biederman
2006-01-19 21:53             ` Bryan O'Sullivan
2006-01-19 21:08           ` Sean Hefty
2006-01-19 21:52             ` Bryan O'Sullivan
2006-01-19 18:50       ` Bryan O'Sullivan
2006-01-19 20:29         ` Eric W. Biederman
2006-01-19 20:47           ` [openib-general] " Steve Wise
2006-01-19 22:13           ` Bryan O'Sullivan
2006-01-21  4:40   ` Roland Dreier
2006-01-25 22:32 ` Bryan O'Sullivan
2006-01-25 22:43   ` [openib-general] " Muli Ben-Yehuda
2006-01-25 22:55     ` Bryan O'Sullivan

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=20060119053940.GB21467@kroah.com \
    --to=greg@kroah.com \
    --cc=akpm@osdl.org \
    --cc=bos@pathscale.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=openib-general@openib.org \
    --cc=rdreier@cisco.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).