Commit dd9398cf authored by Roland Dreier's avatar Roland Dreier Committed by Linus Torvalds

[PATCH] InfiniBand/core: add IsSM userspace support

Implement setting/clearing IsSM port capability bit from userspace via "issm"
special files (set IsSM bit on open, clear on close).
Signed-off-by: default avatarRoland Dreier <roland@topspin.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent ff8353aa
...@@ -2,9 +2,10 @@ USERSPACE MAD ACCESS ...@@ -2,9 +2,10 @@ USERSPACE MAD ACCESS
Device files Device files
Each port of each InfiniBand device has a "umad" device attached. Each port of each InfiniBand device has a "umad" device and an
For example, a two-port HCA will have two devices, while a switch "issm" device attached. For example, a two-port HCA will have two
will have one device (for switch port 0). umad devices and two issm devices, while a switch will have one
device of each type (for switch port 0).
Creating MAD agents Creating MAD agents
...@@ -63,19 +64,36 @@ Sending MADs ...@@ -63,19 +64,36 @@ Sending MADs
if (ret != sizeof mad) if (ret != sizeof mad)
perror("write"); perror("write");
Setting IsSM Capability Bit
To set the IsSM capability bit for a port, simply open the
corresponding issm device file. If the IsSM bit is already set,
then the open call will block until the bit is cleared (or return
immediately with errno set to EAGAIN if the O_NONBLOCK flag is
passed to open()). The IsSM bit will be cleared when the issm file
is closed. No read, write or other operations can be performed on
the issm file.
/dev files /dev files
To create the appropriate character device files automatically with To create the appropriate character device files automatically with
udev, a rule like udev, a rule like
KERNEL="umad*", NAME="infiniband/%k" KERNEL="umad*", NAME="infiniband/%k"
KERNEL="issm*", NAME="infiniband/%k"
can be used. This will create a device node named can be used. This will create device nodes named
/dev/infiniband/umad0 /dev/infiniband/umad0
/dev/infiniband/issm0
for the first port, and so on. The InfiniBand device and port for the first port, and so on. The InfiniBand device and port
associated with this device can be determined from the files associated with these devices can be determined from the files
/sys/class/infiniband_mad/umad0/ibdev /sys/class/infiniband_mad/umad0/ibdev
/sys/class/infiniband_mad/umad0/port /sys/class/infiniband_mad/umad0/port
and
/sys/class/infiniband_mad/issm0/ibdev
/sys/class/infiniband_mad/issm0/port
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment