From: "Bryan O'Sullivan" <bos@pathscale.com>
To: Andrew Morton <akpm@osdl.org>, Roland Dreier <rdreier@cisco.com>,
linux-kernel@vger.kernel.org, Greg Kroah-Hartman <greg@kroah.com>
Cc: openib-general@openib.org
Subject: RFC: ipath ioctls and their replacements
Date: Wed, 18 Jan 2006 16:43:31 -0800 [thread overview]
Message-ID: <1137631411.4757.218.camel@serpentine.pathscale.com> (raw)
When I posted the last round of ipath driver code for review, people
objected to the number of ioctls we had. I'd like to get feedback on
what would be acceptable replacements.
We have four kinds of ioctl right now:
* Interfacing with userspace
* Infiniband subnet management
* Flash/EEPROM management
* Diagnostics
There are currently 36 ioctls in total. I think that I can reduce this
number dramatically, but we're having some contentious internal debate
about whether and how some of the ioctls should be replaced. I'd like
to see what's most likely to get accepted. Obviously, we'd prefer the
number to be zero, but I don't think we can do that without submitting a
driver that isn't very useful.
Unless I indicate otherwise, I cannot think of clean replacements for
the ioctls listed below, and would appreciate suggestions.
For user access:
Opening the /dev/ipath special file assigns an appropriate free
unit (chip) and port (context on a chip) to a user process.
Think of it as similar to /dev/ptmx for ttys, except there isn't
a devpts-like filesystem behind it. Once a process has
opened /dev/ipath, it needs to find out which unit and port it
has opened, so that it can access other attributes in /sys. To
do this, we provide a GETPORT ioctl.
USERINIT and BASEINFO work with mmap to set up direct access to
the hardware for user processes. We intend to turn these into a
single ioctl, USERINIT. This copies a substantial amount of
information to and from userspace.
RCVCTRL enables/disables receipt of packets.
SET_PKEY sets a partition key, essentially telling hardware
which packets are interesting to userspace.
UPDM_TID and FREE_TID are used for RDMA context management.
WAIT waits for incoming packets, and can clearly be replaced by
file_ops->poll.
GETCOUNTERS, GETUNITCOUNTERS and GETSTATS can all be replaced by
files in sysfs.
For subnet management:
GETLID, SET_LID, SET_MTU, SET_GUID, SET_MLID, GET_MLID,
GET_DEVSTATUS, GET_PORTINFO and GET_NODEINFO can all be replaced
by files in sysfs.
SET_LINKSTATE changes the link state.
SEND_SMA_PKT and RCV_SMA_PKT send and receive subnet management
packets. I *think* they could be replaced by read and write
methods on a new special file, although the semantics aren't a
super-clean match.
For EEPROM/flash management:
READ_EEPROM reads the flash. WRITE_EEPROM writes it. I don't
see a standard way of doing this in the kernel; many drivers
provide their own private ioctls, some on dedicated special
files. I think that using read and write instead would be okay
(with a small qualm about semantics), but this idea makes an
influential coworker barf violently. I can't see how we could
use the ethtool flash interface: the low-level driver doesn't
look like a regular net device, and we support partial updates
of the flash.
For diagnostics:
DIAGENTER and DIAGLEAVE put the driver into and out of diag
mode. These could be replaced by open/close of a special file.
DIAGREAD and DIAGWRITE perform direct accesses to the device's
PCI memory space. I think these could be replaced by read and
write, but they are again subject to the make-coworker-barf
problem.
HTREAD and HTREAD perform direct accesses to the device's PCI
config space. Same disagreement problem as DIAGREAD and
DIAGWRITE.
SEND_DIAG_PKT can be replaced with whatever sends and receives
subnet management packets, as above.
DIAG_RD_I2C is synonymous with READ_EEPROM, and will go away.
Depending on how you look at it, we can slim our list of ioctls down to
somewhere between 6 and 10. This isn't zero, but it's not 36, either.
What do people think?
<b
next reply other threads:[~2006-01-19 0:43 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-19 0:43 Bryan O'Sullivan [this message]
2006-01-19 0:48 ` RFC: ipath ioctls and their replacements 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
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=1137631411.4757.218.camel@serpentine.pathscale.com \
--to=bos@pathscale.com \
--cc=akpm@osdl.org \
--cc=greg@kroah.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