components/open-fabrics/libibverbs/patches/base.patch
author boris.chiu@oracle.com
Tue, 17 Feb 2015 13:04:40 -0800
branchs11u2-sru
changeset 3821 5a4c2272210e
parent 2871 899d41b03a8e
child 4996 739983ef315c
permissions -rw-r--r--
18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work 18117487 saquery -m -t 50000 failed with multiple VFs created 19195181 wrong handling of getaddrinfo() retval in open-fabrics dumps core 19187537 iberror() of open-fabrics dumps core because of buffer overrun 18247164 SUNBT7167127 Some OFED tools print errors with a connect-x VPI card (userland) 19448949 libibverbs cleanup incomplete
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3821
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
     1
# This patch was developed in-house. Since it is Solaris-specific,
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
     2
# it is not suitable for upstream.
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
     3
#
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
     4
diff -r -u /tmp/846623/libibverbs-1.1.4/Makefile.am libibverbs-1.1.4/Makefile.am
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
     5
--- /tmp/846623/libibverbs-1.1.4/Makefile.am	Thu Feb  3 01:53:17 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
     6
+++ libibverbs-1.1.4/Makefile.am	Fri Feb 11 04:02:12 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
     7
@@ -4,13 +4,13 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
     8
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
     9
 AM_CFLAGS = -g -Wall -D_GNU_SOURCE
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    10
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    11
-src_libibverbs_la_CFLAGS = $(AM_CFLAGS) -DIBV_CONFIG_DIR=\"$(sysconfdir)/libibverbs.d\"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    12
+src_libibverbs_la_CFLAGS = $(AM_CFLAGS) -DIBV_CONFIG_DIR=\"$(datadir)/libibverbs.d\"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    13
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    14
 libibverbs_version_script = @LIBIBVERBS_VERSION_SCRIPT@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    15
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    16
 src_libibverbs_la_SOURCES = src/cmd.c src/compat-1_0.c src/device.c src/init.c \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    17
 			    src/marshall.c src/memory.c src/sysfs.c src/verbs.c \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    18
-			    src/enum_strs.c
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    19
+			    src/enum_strs.c src/solaris_compatibility.c
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    20
 src_libibverbs_la_LDFLAGS = -version-info 1 -export-dynamic \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    21
     $(libibverbs_version_script)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    22
 src_libibverbs_la_DEPENDENCIES = $(srcdir)/src/libibverbs.map
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    23
@@ -37,7 +37,7 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    24
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    25
 libibverbsinclude_HEADERS = include/infiniband/arch.h include/infiniband/driver.h \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    26
     include/infiniband/kern-abi.h include/infiniband/opcode.h include/infiniband/verbs.h \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    27
-    include/infiniband/sa-kern-abi.h include/infiniband/sa.h include/infiniband/marshall.h
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    28
+    include/infiniband/sa-kern-abi.h include/infiniband/sa.h include/infiniband/marshall.h include/infiniband/ofa_solaris.h
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    29
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    30
 man_MANS = man/ibv_asyncwatch.1 man/ibv_devices.1 man/ibv_devinfo.1	\
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    31
     man/ibv_rc_pingpong.1 man/ibv_uc_pingpong.1 man/ibv_ud_pingpong.1	\
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    32
@@ -65,6 +65,7 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    33
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    34
 EXTRA_DIST = include/infiniband/driver.h include/infiniband/kern-abi.h \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    35
     include/infiniband/opcode.h include/infiniband/verbs.h include/infiniband/marshall.h \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    36
+	 include/infiniband/ofa_solaris.h \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    37
     include/infiniband/sa-kern-abi.h include/infiniband/sa.h \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    38
     src/ibverbs.h examples/pingpong.h \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    39
     src/libibverbs.map libibverbs.spec.in $(man_MANS)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    40
diff -r -u /tmp/846623/libibverbs-1.1.4/man/ibv_get_device_name.3 libibverbs-1.1.4/man/ibv_get_device_name.3
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    41
--- /tmp/846623/libibverbs-1.1.4/man/ibv_get_device_name.3	Thu Mar 10 04:51:46 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    42
+++ libibverbs-1.1.4/man/ibv_get_device_name.3	Mon Mar 28 03:11:46 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    43
@@ -2,7 +2,7 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    44
 .\"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    45
 .TH IBV_GET_DEVICE_NAME 3  2006-10-31 libibverbs "Libibverbs Programmer's Manual"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    46
 .SH "NAME"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    47
-ibv_get_device_name \- get an RDMA device's name
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    48
+ibv_get_device_name \- get an InfiniBand device's name
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    49
 .SH "SYNOPSIS"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    50
 .nf
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    51
 .B #include <infiniband/verbs.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    52
@@ -11,7 +11,7 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    53
 .fi
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    54
 .SH "DESCRIPTION"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    55
 .B ibv_get_device_name()
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    56
-returns a human-readable name associated with the RDMA device
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    57
+returns a human-readable name associated with the InfiniBand device
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    58
 .I device\fR.
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    59
 .SH "RETURN VALUE"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    60
 .B ibv_get_device_name()
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    61
diff -r -u /tmp/846623/libibverbs-1.1.4/man/ibv_attach_mcast.3 libibverbs-1.1.4/man/ibv_attach_mcast.3
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    62
--- /tmp/846623/libibverbs-1.1.4/man/ibv_attach_mcast.3	Thu Mar 10 06:58:21 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    63
+++ libibverbs-1.1.4/man/ibv_attach_mcast.3	Tue May  3 13:50:06 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    64
@@ -38,9 +38,6 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    65
 .SH "NOTES"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    66
 Only QPs of Transport Service Type
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    67
 .BR IBV_QPT_UD
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    68
-or
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    69
-.BR IBV_QPT_RAW_PACKET
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    70
-may be attached to multicast groups.
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    71
 .PP
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    72
 If a QP is attached to the same multicast group multiple times, the QP will still receive a single copy of a multicast message.
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    73
 .PP
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    74
@@ -48,22 +45,6 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    75
 multicast group must be sent to the subnet administrator (SA), so that
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    76
 the fabric's multicast routing is configured to deliver messages to
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    77
 the local port.
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    78
-.SH EXAMPLE
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    79
-	An example of the use of ibv_attach_mcast with RAW ETH QP:
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    80
-.nf
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    81
-
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    82
-	union ibv_gid mgid;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    83
-
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    84
-	memset(&mgid, 0, sizeof(union ibv_gid));
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    85
-
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    86
-	memcpy(&mgid.raw[10], mmac, 6);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    87
-
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    88
-	if (ibv_attach_mcast(qp, &mgid, 0)) {
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    89
-		printf ("Failed to attach qp to mcast. Errno: %d\\n",errno);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    90
-		return 1;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    91
-	}
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    92
-.fi
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    93
-
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    94
 .SH "SEE ALSO"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    95
 .BR ibv_create_qp (3)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    96
 .SH "AUTHORS"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    97
diff -r -u /tmp/846623/libibverbs-1.1.4/man/ibv_modify_qp.3 libibverbs-1.1.4/man/ibv_modify_qp.3
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    98
--- /tmp/846623/libibverbs-1.1.4/man/ibv_modify_qp.3	Thu Mar 10 06:58:21 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
    99
+++ libibverbs-1.1.4/man/ibv_modify_qp.3	Tue May  3 13:50:06 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   100
@@ -161,7 +161,7 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   101
 .fi
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   102
 .PP
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   103
 .nf
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   104
-For QP Transport Service Type \fB IBV_QPT_RAW_PACKET\fR:
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   105
+For QP Transport Service Type:
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   106
 .sp
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   107
 Next state     Required attributes
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   108
 \-\-\-\-\-\-\-\-\-\-     \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   109
diff -r -u /tmp/846623/libibverbs-1.1.4/man/ibv_devinfo.1 libibverbs-1.1.4/man/ibv_devinfo.1
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   110
--- /tmp/846623/libibverbs-1.1.4/man/ibv_devinfo.1	Thu Mar 10 04:51:46 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   111
+++ libibverbs-1.1.4/man/ibv_devinfo.1	Mon Mar 28 03:11:46 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   112
@@ -1,7 +1,7 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   113
 .TH IBV_DEVINFO 1 "August 30, 2005" "libibverbs" "USER COMMANDS"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   114
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   115
 .SH NAME
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   116
-ibv_devinfo \- query RDMA devices
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   117
+ibv_devinfo \- query InfiniBand devices
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   118
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   119
 .SH SYNOPSIS
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   120
 .B ibv_devinfo
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   121
@@ -9,7 +9,7 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   122
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   123
 .SH DESCRIPTION
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   124
 .PP
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   125
-Print information about RDMA devices available for use from userspace.
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   126
+Print information about InfiniBand devices available for use from userspace.
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   127
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   128
 .SH OPTIONS
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   129
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   130
@@ -22,10 +22,10 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   131
 query port \fIPORT\fR (default all ports)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   132
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   133
 \fB\-l\fR, \fB\-\-list\fR
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   134
-only list names of RDMA devices
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   135
+only list names of InfiniBand devices
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   136
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   137
 \fB\-v\fR, \fB\-\-verbose\fR
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   138
-print all available information about RDMA devices
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   139
+print all available information about InfiniBand devices
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   140
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   141
 .SH SEE ALSO
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   142
 .BR ibv_devices (1)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   143
diff -r -u /tmp/846623/libibverbs-1.1.4/man/ibv_query_qp.3 libibverbs-1.1.4/man/ibv_query_qp.3
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   144
--- /tmp/846623/libibverbs-1.1.4/man/ibv_query_qp.3	Thu Mar 10 04:51:46 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   145
+++ libibverbs-1.1.4/man/ibv_query_qp.3	Mon Mar 28 03:11:47 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   146
@@ -68,7 +68,7 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   147
 The argument
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   148
 .I attr_mask
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   149
 is a hint that specifies the minimum list of attributes to retrieve.
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   150
-Some RDMA devices may return extra attributes not requested, for
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   151
+Some InfiniBand devices may return extra attributes not requested, for
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   152
 example if the value can be returned cheaply. This has the same
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   153
 form as in
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   154
 .B ibv_modify_qp()\fR.
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   155
diff -r -u /tmp/846623/libibverbs-1.1.4/man/ibv_get_device_guid.3 libibverbs-1.1.4/man/ibv_get_device_guid.3
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   156
--- /tmp/846623/libibverbs-1.1.4/man/ibv_get_device_guid.3	Thu Mar 10 04:51:46 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   157
+++ libibverbs-1.1.4/man/ibv_get_device_guid.3	Mon Mar 28 03:11:46 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   158
@@ -2,7 +2,7 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   159
 .\"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   160
 .TH IBV_GET_DEVICE_GUID 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   161
 .SH "NAME"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   162
-ibv_get_device_guid \- get an RDMA device's GUID
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   163
+ibv_get_device_guid \- get an InfiniBand device's GUID
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   164
 .SH "SYNOPSIS"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   165
 .nf
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   166
 .B #include <infiniband/verbs.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   167
@@ -11,7 +11,7 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   168
 .fi
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   169
 .SH "DESCRIPTION"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   170
 .B ibv_get_device_name()
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   171
-returns the Global Unique IDentifier (GUID) of the RDMA device
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   172
+returns the Global Unique IDentifier (GUID) of the InfiniBand device
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   173
 .I device\fR.
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   174
 .SH "RETURN VALUE"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   175
 .B ibv_get_device_guid()
2448
c1b40b77a1ae 15963508 SUNBT7202723 ibv_post_send(3) needs to be updated
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 869
diff changeset
   176
diff -r -u /tmp/846623/libibverbs-1.1.4/man/ibv_post_send.3 libibverbs-1.1.4/man/ibv_post_send.3
c1b40b77a1ae 15963508 SUNBT7202723 ibv_post_send(3) needs to be updated
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 869
diff changeset
   177
--- /tmp/846623/libibverbs-1.1.4/man/ibv_post_send.3	Thu Mar 10 06:58:20 2011
2550
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
   178
+++ libibverbs-1.1.4/man/ibv_post_send.3	Wed Mar 13 07:28:54 2013
2448
c1b40b77a1ae 15963508 SUNBT7202723 ibv_post_send(3) needs to be updated
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 869
diff changeset
   179
@@ -91,14 +91,17 @@
c1b40b77a1ae 15963508 SUNBT7202723 ibv_post_send(3) needs to be updated
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 869
diff changeset
   180
 The attribute send_flags describes the properties of the \s-1WR\s0. It is either 0 or the bitwise \s-1OR\s0 of one or more of the following flags:
c1b40b77a1ae 15963508 SUNBT7202723 ibv_post_send(3) needs to be updated
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 869
diff changeset
   181
 .PP
c1b40b77a1ae 15963508 SUNBT7202723 ibv_post_send(3) needs to be updated
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 869
diff changeset
   182
 .TP
c1b40b77a1ae 15963508 SUNBT7202723 ibv_post_send(3) needs to be updated
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 869
diff changeset
   183
-.B IBV_SEND_FENCE \fR Set the fence indicator.  Valid only for QPs with Transport Service Type \fBIBV_QPT_RC
c1b40b77a1ae 15963508 SUNBT7202723 ibv_post_send(3) needs to be updated
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 869
diff changeset
   184
+.B IBV_SEND_FENCE \fR
c1b40b77a1ae 15963508 SUNBT7202723 ibv_post_send(3) needs to be updated
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 869
diff changeset
   185
+Set the fence indicator.  Valid only for QPs with Transport Service Type \fBIBV_QPT_RC
c1b40b77a1ae 15963508 SUNBT7202723 ibv_post_send(3) needs to be updated
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 869
diff changeset
   186
 .TP
c1b40b77a1ae 15963508 SUNBT7202723 ibv_post_send(3) needs to be updated
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 869
diff changeset
   187
-.B IBV_SEND_SIGNALED \fR Set the completion notification indicator.  Relevant only if QP was created with sq_sig_all=0
c1b40b77a1ae 15963508 SUNBT7202723 ibv_post_send(3) needs to be updated
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 869
diff changeset
   188
+.B IBV_SEND_SIGNALED \fR
c1b40b77a1ae 15963508 SUNBT7202723 ibv_post_send(3) needs to be updated
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 869
diff changeset
   189
+Set the completion notification indicator.  Relevant only if QP was created with sq_sig_all=0
c1b40b77a1ae 15963508 SUNBT7202723 ibv_post_send(3) needs to be updated
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 869
diff changeset
   190
 .TP
c1b40b77a1ae 15963508 SUNBT7202723 ibv_post_send(3) needs to be updated
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 869
diff changeset
   191
-.B IBV_SEND_SOLICITED \fR Set the solicited event indicator.  Valid only for Send and RDMA Write with immediate
c1b40b77a1ae 15963508 SUNBT7202723 ibv_post_send(3) needs to be updated
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 869
diff changeset
   192
+.B IBV_SEND_SOLICITED \fR
c1b40b77a1ae 15963508 SUNBT7202723 ibv_post_send(3) needs to be updated
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 869
diff changeset
   193
+Set the solicited event indicator.  Valid only for Send and RDMA Write with immediate
c1b40b77a1ae 15963508 SUNBT7202723 ibv_post_send(3) needs to be updated
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 869
diff changeset
   194
 .TP
c1b40b77a1ae 15963508 SUNBT7202723 ibv_post_send(3) needs to be updated
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 869
diff changeset
   195
-.B IBV_SEND_INLINE \fR Send data in given gather list as inline data
c1b40b77a1ae 15963508 SUNBT7202723 ibv_post_send(3) needs to be updated
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 869
diff changeset
   196
-in a send WQE.  Valid only for Send and RDMA Write.  The L_Key will not be checked.
c1b40b77a1ae 15963508 SUNBT7202723 ibv_post_send(3) needs to be updated
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 869
diff changeset
   197
+.B IBV_SEND_INLINE \fR
c1b40b77a1ae 15963508 SUNBT7202723 ibv_post_send(3) needs to be updated
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 869
diff changeset
   198
+Send data in given gather list as inline data in a send WQE.  Valid only for Send and RDMA Write.  The L_Key will not be checked.
c1b40b77a1ae 15963508 SUNBT7202723 ibv_post_send(3) needs to be updated
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 869
diff changeset
   199
 .SH "RETURN VALUE"
c1b40b77a1ae 15963508 SUNBT7202723 ibv_post_send(3) needs to be updated
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 869
diff changeset
   200
 .B ibv_post_send()
c1b40b77a1ae 15963508 SUNBT7202723 ibv_post_send(3) needs to be updated
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 869
diff changeset
   201
 returns 0 on success, or the value of errno on failure (which indicates the failure reason).
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   202
diff -r -u /tmp/846623/libibverbs-1.1.4/man/ibv_alloc_pd.3 libibverbs-1.1.4/man/ibv_alloc_pd.3
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   203
--- /tmp/846623/libibverbs-1.1.4/man/ibv_alloc_pd.3	Thu Mar 10 04:51:46 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   204
+++ libibverbs-1.1.4/man/ibv_alloc_pd.3	Mon Mar 28 03:11:45 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   205
@@ -13,7 +13,7 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   206
 .fi
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   207
 .SH "DESCRIPTION"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   208
 .B ibv_alloc_pd()
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   209
-allocates a PD for the RDMA device context 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   210
+allocates a PD for the InfiniBand device context 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   211
 .I context\fR.
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   212
 .PP
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   213
 .B ibv_dealloc_pd()
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   214
diff -r -u /tmp/846623/libibverbs-1.1.4/man/ibv_get_async_event.3 libibverbs-1.1.4/man/ibv_get_async_event.3
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   215
--- /tmp/846623/libibverbs-1.1.4/man/ibv_get_async_event.3	Thu Mar 10 04:51:46 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   216
+++ libibverbs-1.1.4/man/ibv_get_async_event.3	Mon Mar 28 03:11:46 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   217
@@ -14,7 +14,7 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   218
 .fi
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   219
 .SH "DESCRIPTION"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   220
 .B ibv_get_async_event()
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   221
-waits for the next async event of the RDMA device context
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   222
+waits for the next async event of the InfiniBand device context
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   223
 .I context
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   224
 and returns it through the pointer
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   225
 .I event\fR,
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   226
@@ -29,6 +29,8 @@
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   227
 struct ibv_qp  *qp;             /* QP that got the event */
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   228
 struct ibv_srq *srq;            /* SRQ that got the event */
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   229
 int             port_num;       /* port number that got the event */
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   230
+uint32_t        xrc_qp_num;     /* XRC QP that got the event */
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   231
+union ibv_gid   gid;            /* list of guids that got the event */
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   232
 .in -8
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   233
 } element;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   234
 enum ibv_event_type     event_type;     /* type of the event */
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   235
@@ -86,6 +88,16 @@
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   236
 .TP
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   237
 .B IBV_EVENT_DEVICE_FATAL \fR CA is in FATAL state
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   238
 .PP
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   239
+.I Subnet events:
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   240
+.TP
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   241
+.B IBV_SM_EVENT_MCG_CREATED \fR notification of MCG creation
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   242
+.TP
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   243
+.B IBV_SM_EVENT_MCG_DELETED \fR notification of MCG deletion
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   244
+.TP
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   245
+.B IBV_SM_EVENT_GID_AVAIL \fR notification of GID available events
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   246
+.TP
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   247
+.B IBV_SM_EVENT_GID_UNAVAIL \fR notification of GID unavailable events
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   248
+.PP
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   249
 .B ibv_ack_async_event()
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   250
 acknowledge the async event
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   251
 .I event\fR.
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   252
diff -r -u /tmp/846623/libibverbs-1.1.4/man/ibv_get_device_list.3 libibverbs-1.1.4/man/ibv_get_device_list.3
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   253
--- /tmp/846623/libibverbs-1.1.4/man/ibv_get_device_list.3	Thu Mar 10 04:51:46 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   254
+++ libibverbs-1.1.4/man/ibv_get_device_list.3	Mon Mar 28 03:11:46 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   255
@@ -2,7 +2,7 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   256
 .\"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   257
 .TH IBV_GET_DEVICE_LIST 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   258
 .SH "NAME"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   259
-ibv_get_device_list, ibv_free_device_list \- get and release list of available RDMA devices
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   260
+ibv_get_device_list, ibv_free_device_list \- get and release list of available InfiniBand devices
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   261
 .SH "SYNOPSIS"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   262
 .nf
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   263
 .B #include <infiniband/verbs.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   264
@@ -13,7 +13,7 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   265
 .fi
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   266
 .SH "DESCRIPTION"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   267
 .B ibv_get_device_list()
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   268
-returns a NULL-terminated array of RDMA devices currently available.
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   269
+returns a NULL-terminated array of InfiniBand devices currently available.
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   270
 The argument
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   271
 .I num_devices
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   272
 is optional; if not NULL, it is set to the number of devices returned in the array.
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   273
@@ -25,7 +25,7 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   274
 .B ibv_get_device_list()\fR.
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   275
 .SH "RETURN VALUE"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   276
 .B ibv_get_device_list()
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   277
-returns the array of available RDMA devices, or sets
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   278
+returns the array of available InfiniBand devices, or sets
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   279
 .I errno
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   280
 and returns NULL if the request fails. If no devices are found then
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   281
 .I num_devices
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   282
diff -r -u /tmp/846623/libibverbs-1.1.4/man/ibv_query_device.3 libibverbs-1.1.4/man/ibv_query_device.3
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   283
--- /tmp/846623/libibverbs-1.1.4/man/ibv_query_device.3	Thu Mar 10 04:51:46 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   284
+++ libibverbs-1.1.4/man/ibv_query_device.3	Mon Mar 28 03:11:47 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   285
@@ -2,7 +2,7 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   286
 .\"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   287
 .TH IBV_QUERY_DEVICE 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   288
 .SH "NAME"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   289
-ibv_query_device \- query an RDMA device's attributes
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   290
+ibv_query_device \- query an InfiniBand device's attributes
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   291
 .SH "SYNOPSIS"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   292
 .nf
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   293
 .B #include <infiniband/verbs.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   294
diff -r -u /tmp/846623/libibverbs-1.1.4/man/ibv_query_port.3 libibverbs-1.1.4/man/ibv_query_port.3
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   295
--- /tmp/846623/libibverbs-1.1.4/man/ibv_query_port.3	Thu Mar 10 06:58:21 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   296
+++ libibverbs-1.1.4/man/ibv_query_port.3	Mon Mar 28 03:11:47 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   297
@@ -2,7 +2,7 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   298
 .\"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   299
 .TH IBV_QUERY_PORT 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   300
 .SH "NAME"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   301
-ibv_query_port \- query an RDMA port's attributes
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   302
+ibv_query_port \- query an InfiniBand port's attributes
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   303
 .SH "SYNOPSIS"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   304
 .nf
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   305
 .B #include <infiniband/verbs.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   306
diff -r -u /tmp/846623/libibverbs-1.1.4/man/ibv_asyncwatch.1 libibverbs-1.1.4/man/ibv_asyncwatch.1
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   307
--- /tmp/846623/libibverbs-1.1.4/man/ibv_asyncwatch.1	Thu Mar 10 04:51:46 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   308
+++ libibverbs-1.1.4/man/ibv_asyncwatch.1	Mon Mar 28 03:11:45 2011
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   309
@@ -1,16 +1,78 @@
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   310
-.TH IBV_ASYNCWATCH 1 "August 30, 2005" "libibverbs" "USER COMMANDS"
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   311
+'\" te
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   312
+.TH IBV_ASYNCWATCH 1 "August 8, 2012" "libibverbs" "USER COMMANDS"
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   313
 
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   314
 .SH NAME
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   315
 ibv_asyncwatch \- display asynchronous events
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   316
 
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   317
 .SH SYNOPSIS
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   318
-.B ibv_asyncwatch
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   319
-
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   320
+.sp
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   321
+.nf
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   322
+\fIibv_asyncwatch\fR [\-G | \-M] [\-s[<guid>]] [\-p port]
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   323
+\fIibv_asyncwactch\fR \-s
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   324
+\fIibv_asyncwatch\fR \-G \-s
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   325
+\fIibv_asyncwatch\fR \-M \-s
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   326
+\fIibv_asyncwatch\fR \-G [\-p port] \-s<guid1>,<guid2>,...
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   327
+\fIibv_asyncwatch\fR \-M [\-p port] \-s<mgid1>,<mgid2>,...
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   328
+.fi
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   329
+.sp
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   330
 .SH DESCRIPTION
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   331
 .PP
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   332
-Display asynchronous events forwarded to userspace for an RDMA device.
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   333
+Display asynchronous events forwarded to userspace for an InfiniBand device.
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   334
+SM events can be monitored using the '-s' option, which optionally
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   335
+takes a remote port GUID, or list of remote port GUIDS separated by ','.
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   336
+If '-s' is specified with no argument then all remote nodes reachable
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   337
+form device 0 are monitored, otherwise only the specified remote
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   338
+nodes are monitored. The following SM events are monitored using
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   339
+the '-s' option: 
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   340
 
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   341
-.SH AUTHORS
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   342
-.TP
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   343
-Roland Dreier
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   344
-.RI < [email protected] >
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   345
+    IBV_SM_EVENT_MCG_CREATED
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   346
+         An MCG specified by the "mgid" has been created
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   347
+         on this subnet.
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   348
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   349
+    IBV_SM_EVENT_MCG_DELETED
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   350
+         The MCG specified by the "mgid" has been deleted
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   351
+         on this subnet.
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   352
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   353
+    IBV_SM_EVENT_GID_AVAIL
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   354
+         The GID specified by the "guid" is available
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   355
+         on this subnet.
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   356
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   357
+    IBV_SM_EVENT_GID_UNAVAIL
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   358
+         The GID specified by the "guid" is no longer
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   359
+         available on this subnet.
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   360
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   361
+.SH OPTIONS
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   362
+.pp
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   363
+\-G               Monitor SM event for Unicast GIDs
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   364
+.sp
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   365
+.pp
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   366
+\-M               Monitor SM event for Multicast GIDs
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   367
+.pp
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   368
+\-s<GUID>         Takes as an optional argument a comma separated list of remote port GUIDs if \-G is specified or Multicast GIDs if \-M is specified.
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   369
+.sp
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   370
+.PP
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   371
+\-p <port>        use the specified ca_port.
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   372
+.sp
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   373
+.pp
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   374
+.SH EXAMPLES
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   375
+.PP
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   376
+To monitor event=IBV_SM_EVENT_ALL
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   377
+.sp
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   378
+ibv_asyncwatch -s
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   379
+.sp
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   380
+To monitor event=IBV_SM_EVENT_UGID_ALL
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   381
+.sp
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   382
+ibv_asyncwatch -G -s
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   383
+.sp
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   384
+To monitor event=IBV_SM_EVENT_MGID_ALL
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   385
+.sp
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   386
+ibv_asyncwatch -M -s
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   387
+.sp
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   388
+To monitor event=IBV_SM_EVENT_UGID
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   389
+.sp
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   390
+ibv_asyncwatch -G -s0x0021280001a0e4d9,0x0021280001a0e4da
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   391
+.sp
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   392
+To monitor event=IBV_SM_EVENT_MGID
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   393
+.sp
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   394
+ibv_asyncwatch -M -s0xff12:4001:ffff::c:2238
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   395
+.sp
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   396
diff -r -u /tmp/846623/libibverbs-1.1.4/man/ibv_open_device.3 libibverbs-1.1.4/man/ibv_open_device.3
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   397
--- /tmp/846623/libibverbs-1.1.4/man/ibv_open_device.3	Thu Mar 10 04:51:46 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   398
+++ libibverbs-1.1.4/man/ibv_open_device.3	Mon Mar 28 03:11:46 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   399
@@ -2,7 +2,7 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   400
 .\"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   401
 .TH IBV_OPEN_DEVICE 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   402
 .SH "NAME"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   403
-ibv_open_device, ibv_close_device \- open and close an RDMA device context
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   404
+ibv_open_device, ibv_close_device \- open and close an InfiniBand device context
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   405
 .SH "SYNOPSIS"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   406
 .nf
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   407
 .B #include <infiniband/verbs.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   408
diff -r -u /tmp/846623/libibverbs-1.1.4/man/ibv_create_comp_channel.3 libibverbs-1.1.4/man/ibv_create_comp_channel.3
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   409
--- /tmp/846623/libibverbs-1.1.4/man/ibv_create_comp_channel.3	Thu Mar 10 04:51:46 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   410
+++ libibverbs-1.1.4/man/ibv_create_comp_channel.3	Mon Mar 28 03:11:45 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   411
@@ -15,7 +15,7 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   412
 .fi
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   413
 .SH "DESCRIPTION"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   414
 .B ibv_create_comp_channel()
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   415
-creates a completion event channel for the RDMA device context
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   416
+creates a completion event channel for the InfiniBand device context
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   417
 .I context\fR.
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   418
 .PP
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   419
 .B ibv_destroy_comp_channel()
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   420
diff -r -u /tmp/846623/libibverbs-1.1.4/man/ibv_create_cq.3 libibverbs-1.1.4/man/ibv_create_cq.3
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   421
--- /tmp/846623/libibverbs-1.1.4/man/ibv_create_cq.3	Thu Mar 10 04:51:46 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   422
+++ libibverbs-1.1.4/man/ibv_create_cq.3	Mon Mar 28 03:11:45 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   423
@@ -18,7 +18,7 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   424
 .B ibv_create_cq()
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   425
 creates a completion queue (CQ) with at least
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   426
 .I cqe
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   427
-entries for the RDMA device context
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   428
+entries for the InfiniBand device context
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   429
 .I context\fR.
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   430
 The pointer
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   431
 .I cq_context
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   432
diff -r -u /tmp/846623/libibverbs-1.1.4/man/ibv_devices.1 libibverbs-1.1.4/man/ibv_devices.1
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   433
--- /tmp/846623/libibverbs-1.1.4/man/ibv_devices.1	Thu Mar 10 04:51:46 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   434
+++ libibverbs-1.1.4/man/ibv_devices.1	Mon Mar 28 03:11:45 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   435
@@ -1,7 +1,7 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   436
 .TH IBV_DEVICES 1 "August 30, 2005" "libibverbs" "USER COMMANDS"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   437
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   438
 .SH NAME
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   439
-ibv_devices \- list RDMA devices
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   440
+ibv_devices \- list InfiniBand devices
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   441
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   442
 .SH SYNOPSIS
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   443
 .B ibv_devices
869
ab908b713ec5 7176714 ibv_devices man page needs to be updated to show PF or VF
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 851
diff changeset
   444
@@ -8,8 +8,37 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   445
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   446
 .SH DESCRIPTION
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   447
 .PP
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   448
-List RDMA devices available for use from userspace.
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   449
+List InfiniBand devices available for use from userspace.
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   450
 
869
ab908b713ec5 7176714 ibv_devices man page needs to be updated to show PF or VF
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 851
diff changeset
   451
+On SR-IOV capable systems, if a domain is configured with
ab908b713ec5 7176714 ibv_devices man page needs to be updated to show PF or VF
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 851
diff changeset
   452
+VFs (Virtual Function), ibv_devices lists for each IB device
ab908b713ec5 7176714 ibv_devices man page needs to be updated to show PF or VF
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 851
diff changeset
   453
+the node GUID and the type (PF or VF).  In this case, the PF
ab908b713ec5 7176714 ibv_devices man page needs to be updated to show PF or VF
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 851
diff changeset
   454
+devices are displayed before the VF devices.  The following
ab908b713ec5 7176714 ibv_devices man page needs to be updated to show PF or VF
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 851
diff changeset
   455
+shows the results of running ibv_devices on a domain with
ab908b713ec5 7176714 ibv_devices man page needs to be updated to show PF or VF
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 851
diff changeset
   456
+one PF and two VFs:
ab908b713ec5 7176714 ibv_devices man page needs to be updated to show PF or VF
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 851
diff changeset
   457
+
ab908b713ec5 7176714 ibv_devices man page needs to be updated to show PF or VF
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 851
diff changeset
   458
+    device                 node GUID            type
ab908b713ec5 7176714 ibv_devices man page needs to be updated to show PF or VF
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 851
diff changeset
   459
+    ------              ----------------        ----
ab908b713ec5 7176714 ibv_devices man page needs to be updated to show PF or VF
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 851
diff changeset
   460
+    mlx4_2              00212800013f3126         PF
ab908b713ec5 7176714 ibv_devices man page needs to be updated to show PF or VF
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 851
diff changeset
   461
+    mlx4_0              00212d00013f3126         VF
ab908b713ec5 7176714 ibv_devices man page needs to be updated to show PF or VF
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 851
diff changeset
   462
+    mlx4_1              00212900013f3126         VF
ab908b713ec5 7176714 ibv_devices man page needs to be updated to show PF or VF
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 851
diff changeset
   463
+
ab908b713ec5 7176714 ibv_devices man page needs to be updated to show PF or VF
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 851
diff changeset
   464
+If all of the IB devices are PFs, only node GUIDs are
ab908b713ec5 7176714 ibv_devices man page needs to be updated to show PF or VF
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 851
diff changeset
   465
+listed.  The following shows the results of running
ab908b713ec5 7176714 ibv_devices man page needs to be updated to show PF or VF
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 851
diff changeset
   466
+ibv_devices on a domain with one PF and no VFs:
ab908b713ec5 7176714 ibv_devices man page needs to be updated to show PF or VF
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 851
diff changeset
   467
+
ab908b713ec5 7176714 ibv_devices man page needs to be updated to show PF or VF
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 851
diff changeset
   468
+    device                 node GUID
ab908b713ec5 7176714 ibv_devices man page needs to be updated to show PF or VF
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 851
diff changeset
   469
+    ------              ----------------
ab908b713ec5 7176714 ibv_devices man page needs to be updated to show PF or VF
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 851
diff changeset
   470
+    mlx4_0              00212800013f3126
ab908b713ec5 7176714 ibv_devices man page needs to be updated to show PF or VF
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 851
diff changeset
   471
+
ab908b713ec5 7176714 ibv_devices man page needs to be updated to show PF or VF
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 851
diff changeset
   472
+On systems which are not SR-IOV capable only node GUIDs are
ab908b713ec5 7176714 ibv_devices man page needs to be updated to show PF or VF
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 851
diff changeset
   473
+listed.
ab908b713ec5 7176714 ibv_devices man page needs to be updated to show PF or VF
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 851
diff changeset
   474
+
ab908b713ec5 7176714 ibv_devices man page needs to be updated to show PF or VF
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 851
diff changeset
   475
+    device                 node GUID
ab908b713ec5 7176714 ibv_devices man page needs to be updated to show PF or VF
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 851
diff changeset
   476
+    ------              ----------------
ab908b713ec5 7176714 ibv_devices man page needs to be updated to show PF or VF
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 851
diff changeset
   477
+    mlx4_0              0021280001a0e4d8
ab908b713ec5 7176714 ibv_devices man page needs to be updated to show PF or VF
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 851
diff changeset
   478
+    mlx4_1              0021280001a0e754
ab908b713ec5 7176714 ibv_devices man page needs to be updated to show PF or VF
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 851
diff changeset
   479
+
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   480
 .SH SEE ALSO
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   481
 .BR ibv_devinfo (1)
869
ab908b713ec5 7176714 ibv_devices man page needs to be updated to show PF or VF
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 851
diff changeset
   482
 
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   483
diff -r -u /tmp/846623/libibverbs-1.1.4/man/ibv_create_qp.3 libibverbs-1.1.4/man/ibv_create_qp.3
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   484
--- /tmp/846623/libibverbs-1.1.4/man/ibv_create_qp.3	Thu Mar 10 06:58:21 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   485
+++ libibverbs-1.1.4/man/ibv_create_qp.3	Tue May  3 13:50:06 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   486
@@ -28,7 +28,7 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   487
 struct ibv_cq          *recv_cq;        /* CQ to be associated with the Receive Queue (RQ) */
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   488
 struct ibv_srq         *srq;            /* SRQ handle if QP is to be associated with an SRQ, otherwise NULL */
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   489
 struct ibv_qp_cap       cap;            /* QP capabilities */
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   490
-enum ibv_qp_type        qp_type;        /* QP Transport Service Type: IBV_QPT_RC, IBV_QPT_UC, IBV_QPT_UD, IBV_QPT_XRC or IBV_QPT_RAW_PACKET */
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   491
+enum ibv_qp_type        qp_type;        /* QP Transport Service Type: IBV_QPT_RC, IBV_QPT_UC, IBV_QPT_UD, IBV_QPT_XRC */
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   492
 int                     sq_sig_all;     /* If set, each Work Request (WR) submitted to the SQ generates a completion entry */
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   493
 struct ibv_xrc_domain  *xrc_domain;     /* XRC domain the QP will be associated with (valid only for IBV_QPT_XRC QP), otherwise NULL */
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   494
 .in -8
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   495
diff -r -u /tmp/846623/libibverbs-1.1.4/man/ibv_create_ah_from_wc.3 libibverbs-1.1.4/man/ibv_create_ah_from_wc.3
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   496
--- /tmp/846623/libibverbs-1.1.4/man/ibv_create_ah_from_wc.3	Thu Mar 10 04:51:46 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   497
+++ libibverbs-1.1.4/man/ibv_create_ah_from_wc.3	Mon Mar 28 03:11:45 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   498
@@ -21,7 +21,7 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   499
 .B ibv_init_ah_from_wc()
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   500
 initializes the address handle (AH) attribute structure
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   501
 .I ah_attr
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   502
-for the RDMA device context
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   503
+for the InfiniBand device context
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   504
 .I context
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   505
 using the port number
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   506
 .I port_num\fR,
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   507
diff -r -u /tmp/846623/libibverbs-1.1.4/src/kern_abi.h libibverbs-1.1.4/src/kern_abi.h
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   508
--- /tmp/846623/libibverbs-1.1.4/src/kern_abi.h	Wed Sep 16 04:27:22 2009
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   509
+++ libibverbs-1.1.4/src/kern_abi.h	Fri Feb 11 04:02:32 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   510
@@ -33,7 +33,11 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   511
 #ifndef KERN_ABI_H
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   512
 #define KERN_ABI_H
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   513
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   514
+#if !(defined(__SVR4) && defined(__sun))
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   515
 #include <linux/types.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   516
+#else
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   517
+#include <infiniband/ofa_solaris.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   518
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   519
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   520
 /*
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   521
  * Increment this value if any changes that break userspace ABI
817
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   522
@@ -47,7 +51,10 @@
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   523
 	IB_USER_VERBS_CMD_ALLOC_PD,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   524
 	IB_USER_VERBS_CMD_DEALLOC_PD,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   525
 	IB_USER_VERBS_CMD_REG_MR,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   526
-	IB_USER_VERBS_CMD_DEREG_MR
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   527
+	IB_USER_VERBS_CMD_DEREG_MR,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   528
+	IB_USER_VERBS_CMD_REG_MR_RELAXED,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   529
+	IB_USER_VERBS_CMD_DEREG_MR_RELAXED,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   530
+	IB_USER_VERBS_CMD_FLUSH_RELAXED_MR
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   531
 };
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   532
 
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   533
 /*
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   534
diff -r -u /tmp/846623/libibverbs-1.1.4/src/verbs.c libibverbs-1.1.4/src/verbs.c
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   535
--- /tmp/846623/libibverbs-1.1.4/src/verbs.c	Thu Feb  3 01:53:17 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   536
+++ libibverbs-1.1.4/src/verbs.c	Fri Feb 11 04:02:33 2011
2871
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   537
@@ -41,9 +41,24 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   538
 #include <stdlib.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   539
 #include <errno.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   540
 #include <string.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   541
+#if defined(__SVR4) && defined(__sun)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   542
+#include <fcntl.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   543
+#include <sys/stat.h>
851
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
   544
+#include <sys/mkdev.h>
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   545
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   546
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   547
 #include "ibverbs.h"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   548
 
2871
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   549
+#define	IBV_IS_VALID_UGID(gid)	\
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   550
+	(gid->raw[0] != 0xff)
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   551
+
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   552
+#define	IBV_IS_VALID_MGID(gid)					\
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   553
+	((gids->raw[0] == 0xff) &&				\
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   554
+	((gids->raw[1] == 0x0e) || (gids->raw[1] == 0x02) ||	\
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   555
+	(gids->raw[1] == 0x05)  || (gids->raw[1] == 0x08) ||	\
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   556
+	(gids->raw[1] == 0x1e)  || (gids->raw[1] == 0x12) ||	\
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   557
+	(gids->raw[1] == 0x15)  || (gids->raw[1] == 0x18)))
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   558
+
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   559
 int ibv_rate_to_mult(enum ibv_rate rate)
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   560
 {
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   561
 	switch (rate) {
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   562
@@ -93,6 +108,12 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   563
 int __ibv_query_gid(struct ibv_context *context, uint8_t port_num,
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   564
 		    int index, union ibv_gid *gid)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   565
 {
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   566
+#if defined(__SVR4) && defined(__sun)
715
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
   567
+	extern int sol_ibv_query_gid();
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   568
+
715
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
   569
+	return sol_ibv_query_gid(context, port_num, index, gid);
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   570
+
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   571
+#else
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   572
 	char name[24];
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   573
 	char attr[41];
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   574
 	uint16_t val;
2871
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   575
@@ -112,6 +133,7 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   576
 	}
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   577
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   578
 	return 0;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   579
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   580
 }
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   581
 default_symver(__ibv_query_gid, ibv_query_gid);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   582
 
2871
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   583
@@ -118,6 +140,12 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   584
 int __ibv_query_pkey(struct ibv_context *context, uint8_t port_num,
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   585
 		     int index, uint16_t *pkey)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   586
 {
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   587
+#if defined(__SVR4) && defined(__sun)
715
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
   588
+	extern int sol_ibv_query_pkey();
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   589
+
715
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
   590
+	return sol_ibv_query_pkey(context, port_num, index, pkey);
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   591
+
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   592
+#else
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   593
 	char name[24];
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   594
 	char attr[8];
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   595
 	uint16_t val;
2871
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   596
@@ -133,9 +161,159 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   597
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   598
 	*pkey = htons(val);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   599
 	return 0;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   600
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   601
 }
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   602
 default_symver(__ibv_query_pkey, ibv_query_pkey);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   603
 
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   604
+int ibv_register_sm_events(struct ibv_context *context,
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   605
+    ibv_sm_event_type_t event, uint_t gid_num, union ibv_gid *gids)
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   606
+{
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   607
+	struct ibv_reg_sm_event		*cmd;
2871
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   608
+	int				cmd_size, data_size;
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   609
+	void				*data_p;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   610
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   611
+	if (((gid_num > 0) && (gids == NULL)) ||
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   612
+	   ((gid_num == 0) && (gids != NULL))) {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   613
+		errno = EINVAL;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   614
+		return (-1);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   615
+	}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   616
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   617
+	if ((event != IBV_SM_EVENT_UGID) && (event != IBV_SM_EVENT_UGID_ALL) &&
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   618
+	    (event != IBV_SM_EVENT_MGID) && (event != IBV_SM_EVENT_MGID_ALL) &&
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   619
+	    (event != IBV_SM_EVENT_ALL)) {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   620
+		errno = EINVAL;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   621
+		return (-1);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   622
+	}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   623
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   624
+	if (((event == IBV_SM_EVENT_UGID) || (event == IBV_SM_EVENT_MGID)) &&
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   625
+	    (gid_num == 0)) {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   626
+		errno = EINVAL;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   627
+		return (-1);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   628
+	}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   629
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   630
+	if (((event == IBV_SM_EVENT_UGID_ALL) ||
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   631
+	    (event == IBV_SM_EVENT_MGID_ALL) || (event == IBV_SM_EVENT_ALL)) &&
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   632
+	    (gid_num != 0)) {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   633
+		errno = EINVAL;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   634
+		return (-1);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   635
+	}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   636
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   637
+	data_size = gid_num * (sizeof (union ibv_gid));
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   638
+	cmd_size = (sizeof (struct ibv_reg_sm_event)) + data_size;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   639
+	data_p = (void *)gids;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   640
+	cmd  = alloca(cmd_size);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   641
+	cmd->data_num = gid_num;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   642
+
2871
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   643
+	if ((event == IBV_SM_EVENT_UGID) && (!IBV_IS_VALID_UGID(gids))) { 
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   644
+		errno = EINVAL;
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   645
+		return (-1);
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   646
+	}
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   647
+
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   648
+	if ((event == IBV_SM_EVENT_MGID) && (!IBV_IS_VALID_MGID(gids))) { 
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   649
+		errno = EINVAL;
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   650
+		return (-1);
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   651
+	}
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   652
+
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   653
+	IBV_INIT_CMD(cmd, cmd_size, REG_SM_EVENT);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   654
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   655
+	cmd->events = event;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   656
+	if (gid_num > 0)
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   657
+		memcpy(cmd->driver_data, data_p, data_size);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   658
+
2871
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   659
+	if (write(context->cmd_fd, cmd, cmd_size) != cmd_size) {
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   660
+		errno = EINVAL;
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   661
+		return (-1);
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   662
+	}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   663
+
2871
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   664
+	return (0);
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   665
+}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   666
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   667
+int ibv_unregister_sm_events(struct ibv_context *context,
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   668
+    ibv_sm_event_type_t event, uint_t gid_num, union ibv_gid *gids)
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   669
+{
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   670
+	struct ibv_unreg_sm_event	*cmd;
2871
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   671
+	int				cmd_size, data_size;
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   672
+	void				*data_p;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   673
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   674
+	if (((gid_num > 0) && (gids == NULL)) ||
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   675
+	   ((gid_num == 0) && (gids != NULL))) {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   676
+		errno = EINVAL;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   677
+		return (-1);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   678
+	}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   679
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   680
+	if ((event != IBV_SM_EVENT_UGID) && (event != IBV_SM_EVENT_UGID_ALL) &&
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   681
+	    (event != IBV_SM_EVENT_MGID) && (event != IBV_SM_EVENT_MGID_ALL) &&
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   682
+	    (event != IBV_SM_EVENT_ALL)) {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   683
+		errno = EINVAL;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   684
+		return (-1);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   685
+	}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   686
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   687
+	if (((event == IBV_SM_EVENT_UGID) || (event == IBV_SM_EVENT_MGID)) &&
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   688
+	    (gid_num == 0)) {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   689
+		errno = EINVAL;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   690
+		return (-1);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   691
+	}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   692
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   693
+	if (((event == IBV_SM_EVENT_UGID_ALL) ||
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   694
+	    (event == IBV_SM_EVENT_MGID_ALL) || (event == IBV_SM_EVENT_ALL)) &&
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   695
+	    (gid_num != 0)) {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   696
+		errno = EINVAL;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   697
+		return (-1);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   698
+	}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   699
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   700
+	data_size = gid_num*(sizeof (union ibv_gid));
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   701
+	cmd_size = (sizeof (struct ibv_unreg_sm_event)) + data_size;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   702
+	data_p = (void *)gids;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   703
+	cmd  = alloca(cmd_size);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   704
+	cmd->data_num = gid_num;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   705
+
2871
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   706
+	if ((event == IBV_SM_EVENT_UGID) && (!IBV_IS_VALID_UGID(gids))) { 
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   707
+		errno = EINVAL;
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   708
+		return (-1);
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   709
+	}
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   710
+
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   711
+	if ((event == IBV_SM_EVENT_MGID) && (!IBV_IS_VALID_MGID(gids))) { 
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   712
+		errno = EINVAL;
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   713
+		return (-1);
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   714
+	}
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   715
+
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   716
+	IBV_INIT_CMD(cmd, cmd_size, UNREG_SM_EVENT);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   717
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   718
+	cmd->events = event;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   719
+	if (gid_num > 0)
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   720
+		memcpy(cmd->driver_data, data_p, data_size);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   721
+
2871
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   722
+	if (write(context->cmd_fd, cmd, cmd_size) != cmd_size) {
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   723
+		errno = EINVAL;
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   724
+		return (-1);
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   725
+	}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   726
+
2871
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   727
+	return (0);
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   728
+}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   729
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   730
+int ibv_gid_reachable(struct ibv_context *context,
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   731
+    uint_t port, union ibv_gid *gid_p, int timeout)
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   732
+{
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   733
+	struct ibv_gid_reachable	*cmd;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   734
+	int				rc;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   735
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   736
+	cmd = alloca((sizeof (struct ibv_gid_reachable)));
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   737
+	cmd->port_num = port;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   738
+	cmd->timeout = timeout;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   739
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   740
+	IBV_INIT_CMD(cmd, sizeof (struct ibv_gid_reachable),
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   741
+	    GID_REACHABLE);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   742
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   743
+	memcpy(cmd->gid, gid_p, sizeof (*gid_p));
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   744
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   745
+	rc = write(context->cmd_fd, cmd, sizeof(struct ibv_gid_reachable));
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   746
+	if (rc < 0) {
2871
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   747
+		return (-1);
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   748
+	}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   749
+
2871
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   750
+	return (0);
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   751
+}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   752
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   753
 struct ibv_pd *__ibv_alloc_pd(struct ibv_context *context)
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   754
 {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   755
 	struct ibv_pd *pd;
2871
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   756
@@ -148,6 +326,27 @@
817
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   757
 }
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   758
 default_symver(__ibv_alloc_pd, ibv_alloc_pd);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   759
 
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   760
+struct ibv_shpd *__ibv_alloc_shpd(struct ibv_pd *pd, uint64_t share_key, struct ibv_shpd *shpd)
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   761
+{
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   762
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   763
+	shpd = pd->context->ops.alloc_shpd(pd, share_key, shpd);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   764
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   765
+	return shpd;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   766
+}
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   767
+default_symver(__ibv_alloc_shpd, ibv_alloc_shpd);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   768
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   769
+struct ibv_pd *__ibv_share_pd(struct ibv_context *context, struct ibv_shpd *shpd, uint64_t share_key)
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   770
+{
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   771
+	struct ibv_pd *pd;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   772
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   773
+	pd = context->ops.share_pd(context, shpd, share_key);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   774
+	if (pd)
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   775
+		pd->context = context;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   776
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   777
+	return pd;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   778
+}
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   779
+default_symver(__ibv_share_pd, ibv_share_pd);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   780
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   781
 int __ibv_dealloc_pd(struct ibv_pd *pd)
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   782
 {
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   783
 	return pd->context->ops.dealloc_pd(pd);
2871
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   784
@@ -175,6 +374,27 @@
817
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   785
 }
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   786
 default_symver(__ibv_reg_mr, ibv_reg_mr);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   787
 
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   788
+struct ibv_mr *__ibv_reg_mr_relaxed(struct ibv_pd *pd, void *addr,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   789
+			    size_t length, int access)
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   790
+{
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   791
+	struct ibv_mr *mr;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   792
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   793
+	if (ibv_dontfork_range(addr, length))
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   794
+		return NULL;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   795
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   796
+	mr = pd->context->ops.reg_mr_relaxed(pd, addr, length, access);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   797
+	if (mr) {
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   798
+		mr->context = pd->context;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   799
+		mr->pd      = pd;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   800
+		mr->addr    = addr;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   801
+		mr->length  = length;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   802
+	} else
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   803
+		ibv_dofork_range(addr, length);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   804
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   805
+	return mr;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   806
+}
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   807
+default_symver(__ibv_reg_mr_relaxed, ibv_reg_mr_relaxed);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   808
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   809
 int __ibv_dereg_mr(struct ibv_mr *mr)
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   810
 {
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   811
 	int ret;
2871
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   812
@@ -189,6 +409,26 @@
817
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   813
 }
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   814
 default_symver(__ibv_dereg_mr, ibv_dereg_mr);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   815
 
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   816
+int __ibv_dereg_mr_relaxed(struct ibv_mr *mr)
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   817
+{
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   818
+	int ret;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   819
+	void *addr	= mr->addr;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   820
+	size_t length	= mr->length;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   821
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   822
+	ret = mr->context->ops.dereg_mr_relaxed(mr);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   823
+	if (!ret)
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   824
+		ibv_dofork_range(addr, length);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   825
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   826
+	return ret;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   827
+}
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   828
+default_symver(__ibv_dereg_mr_relaxed, ibv_dereg_mr_relaxed);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   829
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   830
+int __ibv_flush_relaxed_mr(struct ibv_pd *pd)
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   831
+{
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   832
+	return pd->context->ops.flush_relaxed_mr(pd);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   833
+}
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   834
+default_symver(__ibv_flush_relaxed_mr, ibv_flush_relaxed_mr);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   835
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   836
 static struct ibv_comp_channel *ibv_create_comp_channel_v2(struct ibv_context *context)
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   837
 {
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
   838
 	struct ibv_abi_compat_v2 *t = context->abi_compat;
2871
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   839
@@ -212,6 +452,10 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   840
 	struct ibv_comp_channel            *channel;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   841
 	struct ibv_create_comp_channel      cmd;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   842
 	struct ibv_create_comp_channel_resp resp;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   843
+#if defined(__SVR4) && defined(__sun)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   844
+	int		event_fd;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   845
+	struct stat	fstat_buf;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   846
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   847
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   848
 	if (abi_ver <= 2)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   849
 		return ibv_create_comp_channel_v2(context);
2871
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   850
@@ -221,7 +465,23 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   851
 		return NULL;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   852
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   853
 	IBV_INIT_CMD_RESP(&cmd, sizeof cmd, CREATE_COMP_CHANNEL, &resp, sizeof resp);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   854
+#if defined(__SVR4) && defined(__sun)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   855
+	event_fd = open("/dev/infiniband/ofs/uverbs:event", O_RDWR);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   856
+	if (event_fd < 0) {
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   857
+		free(channel);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   858
+		return NULL;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   859
+	}
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   860
+
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   861
+	if (fstat(event_fd, &fstat_buf)) {
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   862
+		free(channel);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   863
+		return NULL;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   864
+	}
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   865
+	resp.fd = minor(fstat_buf.st_rdev);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   866
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   867
 	if (write(context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd) {
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   868
+#if defined(__SVR4) && defined(__sun)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   869
+		close(event_fd);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   870
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   871
 		free(channel);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   872
 		return NULL;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   873
 	}
2871
899d41b03a8e 16223428 ibv_register_sm_events/ibv_gid_reachable should return 0 if succeeds
Boris Chiu <boris.chiu@oracle.com>
parents: 2760
diff changeset
   874
@@ -228,6 +488,9 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   875
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   876
 	VALGRIND_MAKE_MEM_DEFINED(&resp, sizeof resp);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   877
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   878
+#if defined(__SVR4) && defined(__sun)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   879
+	resp.fd = event_fd;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   880
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   881
 	channel->context = context;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   882
 	channel->fd      = resp.fd;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   883
 	channel->refcnt  = 0;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   884
diff -r -u /tmp/846623/libibverbs-1.1.4/src/device.c libibverbs-1.1.4/src/device.c
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   885
--- /tmp/846623/libibverbs-1.1.4/src/device.c	Thu Feb  3 01:53:17 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   886
+++ libibverbs-1.1.4/src/device.c	Fri Feb 11 04:02:31 2011
851
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
   887
@@ -122,6 +122,28 @@
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
   888
 }
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
   889
 default_symver(__ibv_get_device_guid, ibv_get_device_guid);
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
   890
 
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
   891
+uint64_t __ibv_get_device_guid_external(struct ibv_device *device)
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
   892
+{
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
   893
+	char attr[24];
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
   894
+	uint64_t guid = 0;
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
   895
+	uint16_t parts[4];
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
   896
+	int i;
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
   897
+
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
   898
+	if (ibv_read_sysfs_file(device->ibdev_path, "node_guid_external",
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
   899
+				attr, sizeof attr) < 0)
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
   900
+		return 0;
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
   901
+
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
   902
+	if (sscanf(attr, "%hx:%hx:%hx:%hx",
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
   903
+		   parts, parts + 1, parts + 2, parts + 3) != 4)
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
   904
+		return 0;
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
   905
+
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
   906
+	for (i = 0; i < 4; ++i)
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
   907
+		guid = (guid << 16) | parts[i];
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
   908
+
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
   909
+	return htonll(guid);
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
   910
+}
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
   911
+default_symver(__ibv_get_device_guid_external, ibv_get_device_guid_external);
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
   912
+
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
   913
 struct ibv_context *__ibv_open_device(struct ibv_device *device)
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
   914
 {
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
   915
 	char *devpath;
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
   916
@@ -128,8 +150,13 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   917
 	int cmd_fd;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   918
 	struct ibv_context *context;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   919
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   920
+#if !(defined(__SVR4) && defined(__sun))
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   921
 	if (asprintf(&devpath, "/dev/infiniband/%s", device->dev_name) < 0)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   922
 		return NULL;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   923
+#else
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   924
+	if (asprintf(&devpath, "/dev/infiniband/ofs/%s", device->dev_name) < 0)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   925
+		return NULL;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   926
+#endif		
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   927
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   928
 	/*
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   929
 	 * We'll only be doing writes, but we need O_RDWR in case the
2760
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
   930
@@ -141,6 +168,15 @@
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
   931
 	if (cmd_fd < 0)
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
   932
 		return NULL;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
   933
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
   934
+#if defined(__SVR4) && defined(__sun)
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
   935
+	/* We don't support parent-child sharing of IB resources on Solaris */
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
   936
+	if (fcntl(cmd_fd, F_SETFD, FD_CLOEXEC) < 0) {
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
   937
+		fprintf(stderr, "ibv_open_device: FD_CLOEXEC failed: %s\n",
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
   938
+		    strerror(errno));
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
   939
+		goto err;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
   940
+	}
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
   941
+#endif
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
   942
+
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
   943
 	context = device->ops.alloc_context(device, cmd_fd);
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
   944
 	if (!context)
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
   945
 		goto err;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
   946
@@ -163,6 +199,9 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   947
 	int async_fd = context->async_fd;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   948
 	int cmd_fd   = context->cmd_fd;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   949
 	int cq_fd    = -1;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   950
+#if defined(__SVR4) && defined(__sun)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   951
+	int mmap_fd   = context->mmap_fd;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   952
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   953
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   954
 	if (abi_ver <= 2) {
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   955
 		struct ibv_abi_compat_v2 *t = context->abi_compat;
2760
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
   956
@@ -172,6 +211,11 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   957
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   958
 	context->device->ops.free_context(context);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   959
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   960
+#if defined(__SVR4) && defined(__sun)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   961
+	if (mmap_fd > 0) {
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   962
+		close(mmap_fd);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   963
+	}
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   964
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   965
 	close(async_fd);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   966
 	close(cmd_fd);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   967
 	if (abi_ver <= 2)
2760
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
   968
@@ -214,6 +258,15 @@
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   969
 		case IBV_EVENT_SRQ_LIMIT_REACHED:
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   970
 			event->element.srq = (void *) (uintptr_t) ev.element;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   971
 			break;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   972
+		case IBV_EVENT_GID_AVAIL:
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   973
+		case IBV_EVENT_GID_UNAVAIL:
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   974
+		case IBV_EVENT_MCG_CREATED:
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   975
+		case IBV_EVENT_MCG_DELETED:
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   976
+			event->element.gid.global.subnet_prefix
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   977
+			    = ev.subnet_prefix;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   978
+                        event->element.gid.global.interface_id
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   979
+			    = ev.interface_id;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   980
+			break;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   981
 		default:
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   982
 			event->element.port_num = ev.element;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
   983
 			break;
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   984
diff -r -u /tmp/846623/libibverbs-1.1.4/src/ibverbs.h libibverbs-1.1.4/src/ibverbs.h
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   985
--- /tmp/846623/libibverbs-1.1.4/src/ibverbs.h	Wed Sep 16 04:27:22 2009
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   986
+++ libibverbs-1.1.4/src/ibverbs.h	Fri Feb 11 04:02:31 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   987
@@ -52,7 +52,12 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   988
 #  define VALGRIND_MAKE_MEM_DEFINED(addr, len)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   989
 #endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   990
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   991
-#define HIDDEN		__attribute__((visibility ("hidden")))
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   992
+#if defined(__SVR4) && defined(__sun)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   993
+#define	HIDDEN
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   994
+#undef HAVE_SYMVER_SUPPORT
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   995
+#else
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   996
+#define	HIDDEN		__attribute__((visibility ("hidden")))
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   997
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   998
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
   999
 #define INIT		__attribute__((constructor))
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1000
 #define FINI		__attribute__((destructor))
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1001
diff -r -u /tmp/846623/libibverbs-1.1.4/src/libibverbs.map libibverbs-1.1.4/src/libibverbs.map
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1002
--- /tmp/846623/libibverbs-1.1.4/src/libibverbs.map	Thu Mar 10 06:58:21 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1003
+++ libibverbs-1.1.4/src/libibverbs.map	Mon Mar 28 13:44:44 2011
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1004
@@ -12,10 +12,18 @@
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1005
 		ibv_query_port;
817
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1006
 		ibv_query_gid;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1007
 		ibv_query_pkey;
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1008
+		ibv_register_sm_events;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1009
+		ibv_unregister_sm_events;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1010
+		ibv__gid_reachable;
817
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1011
 		ibv_alloc_pd;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1012
+		ibv_alloc_shpd;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1013
+		ibv_share_pd;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1014
 		ibv_dealloc_pd;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1015
 		ibv_reg_mr;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1016
+		ibv_reg_mr_relaxed;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1017
 		ibv_dereg_mr;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1018
+		ibv_dereg_mr_relaxed;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1019
+		ibv_flush_relaxed_mr;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1020
 		ibv_create_comp_channel;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1021
 		ibv_destroy_comp_channel;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1022
 		ibv_create_cq;
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1023
@@ -41,9 +49,14 @@
817
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1024
 		ibv_cmd_query_gid;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1025
 		ibv_cmd_query_pkey;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1026
 		ibv_cmd_alloc_pd;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1027
+		ibv_cmd_alloc_shpd;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1028
+		ibv_cmd_share_pd;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1029
 		ibv_cmd_dealloc_pd;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1030
 		ibv_cmd_reg_mr;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1031
+		ibv_cmd_reg_mr_relaxed;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1032
 		ibv_cmd_dereg_mr;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1033
+		ibv_cmd_dereg_mr_relaxed;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1034
+		ibv_cmd_flush_relaxed_mr;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1035
 		ibv_cmd_create_cq;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1036
 		ibv_cmd_poll_cq;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1037
 		ibv_cmd_req_notify_cq;
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1038
@@ -71,6 +84,7 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1039
 		mult_to_ibv_rate;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1040
 		ibv_get_sysfs_path;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1041
 		ibv_read_sysfs_file;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1042
+		sol_get_cpu_info;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1043
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1044
 	local: *;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1045
 };
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1046
diff -r -u /tmp/846623/libibverbs-1.1.4/src/cmd.c libibverbs-1.1.4/src/cmd.c
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1047
--- /tmp/846623/libibverbs-1.1.4/src/cmd.c	Thu Feb  3 01:53:17 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1048
+++ libibverbs-1.1.4/src/cmd.c	Fri Feb 11 04:02:31 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1049
@@ -42,9 +42,34 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1050
 #include <errno.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1051
 #include <alloca.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1052
 #include <string.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1053
+#if defined(__SVR4) && defined(__sun)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1054
+#include <fcntl.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1055
+#include <sys/stat.h>
851
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  1056
+#include <sys/mkdev.h>
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1057
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1058
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1059
 #include "ibverbs.h"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1060
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1061
+#if defined(__SVR4) && defined(__sun)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1062
+extern int ibv_open_mmap_driver(char *dev_name);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1063
+
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1064
+/*
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1065
+ * Event file creation for GET_CONTEXT & CREATE_COMP_CHANNEL :
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1066
+ * 	Solaris Uverbs driver supports creation of event file
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1067
+ * 	from the open(2) system call only. Event file will not
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1068
+ * 	be created by the write(2) syscall, for the above commands
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1069
+ *	as in Linux OFED.
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1070
+ *
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1071
+ * Sequence of operations for GET_CONTEXT &  CREATE_COMP_CHANNEL :
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1072
+ *	event_fd = open(UVERBS_EVENT_FILE, O_RDWR);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1073
+ *	fstat(event_fd, &fstat_buf);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1074
+ *	NOTE : Minor number of event file passed to driver 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1075
+ *	cmd.resp.fd = minor(fstat_buf.st_rdev);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1076
+ *	write(verbs_fd);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1077
+ *	NOTE : Initialize the fd to one got by opening event file
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1078
+ *	cmd.resp.fd = event_fd;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1079
+ */
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1080
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1081
 static int ibv_cmd_get_context_v2(struct ibv_context *context,
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1082
 				  struct ibv_get_context *new_cmd,
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1083
 				  size_t new_cmd_size,
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1084
@@ -55,6 +80,10 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1085
 	struct ibv_get_context_v2 *cmd;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1086
 	size_t cmd_size;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1087
 	uint32_t cq_fd;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1088
+#if defined(__SVR4) && defined(__sun)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1089
+	int			event_fd;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1090
+	struct stat		fstat_buf;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1091
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1092
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1093
 	t = malloc(sizeof *t);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1094
 	if (!t)
2760
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1095
@@ -67,12 +96,36 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1096
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1097
 	IBV_INIT_CMD_RESP(cmd, cmd_size, GET_CONTEXT, resp, resp_size);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1098
 	cmd->cq_fd_tab = (uintptr_t) &cq_fd;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1099
+#if defined(__SVR4) && defined(__sun)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1100
+	event_fd = open("/dev/infiniband/ofs/uverbs:event", O_RDWR);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1101
+	if (event_fd < 0)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1102
+		return (errno);	
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1103
+	if (fstat(event_fd, &fstat_buf))
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1104
+		return (errno);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1105
+	resp->async_fd = minor(fstat_buf.st_rdev);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1106
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1107
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1108
 	if (write(context->cmd_fd, cmd, cmd_size) != cmd_size)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1109
 		return errno;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1110
+#if defined(__SVR4) && defined(__sun)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1111
+	resp->async_fd = event_fd;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1112
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1113
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1114
 	VALGRIND_MAKE_MEM_DEFINED(resp, resp_size);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1115
 
2760
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1116
+#if defined(__SVR4) && defined(__sun)
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1117
+	/* We don't support parent-child sharing of IB resources on Solaris */
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1118
+	if (fcntl(resp->async_fd, F_SETFD, FD_CLOEXEC) < 0) {
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1119
+		fprintf(stderr, "ibv_get_context: FD_CLOEXEC failed "
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1120
+		    "for async_fd: %s\n", strerror(errno));
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1121
+		return errno;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1122
+	}
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1123
+	if (fcntl(cq_fd, F_SETFD, FD_CLOEXEC) < 0) {
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1124
+		fprintf(stderr, "ibv_get_context: FD_CLOEXEC failed "
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1125
+		    "for cq_fd: %s\n", strerror(errno));
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1126
+		return errno;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1127
+	}
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1128
+#endif
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1129
 	context->async_fd         = resp->async_fd;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1130
 	context->num_comp_vectors = 1;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1131
 	t->channel.context        = context;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1132
@@ -87,19 +140,53 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1133
 			size_t cmd_size, struct ibv_get_context_resp *resp,
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1134
 			size_t resp_size)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1135
 {
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1136
+#if defined(__SVR4) && defined(__sun)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1137
+	int			event_fd;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1138
+	struct stat		fstat_buf;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1139
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1140
 	if (abi_ver <= 2)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1141
 		return ibv_cmd_get_context_v2(context, cmd, cmd_size, resp, resp_size);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1142
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1143
 	IBV_INIT_CMD_RESP(cmd, cmd_size, GET_CONTEXT, resp, resp_size);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1144
+#if defined(__SVR4) && defined(__sun)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1145
+	event_fd = open("/dev/infiniband/ofs/uverbs:event", O_RDWR);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1146
+	if (event_fd < 0)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1147
+		return (errno);	
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1148
+	if (fstat(event_fd, &fstat_buf))
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1149
+		return (errno);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1150
+	resp->async_fd = minor(fstat_buf.st_rdev);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1151
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1152
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1153
 	if (write(context->cmd_fd, cmd, cmd_size) != cmd_size)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1154
 		return errno;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1155
+#if defined(__SVR4) && defined(__sun)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1156
+	resp->async_fd = event_fd;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1157
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1158
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1159
 	VALGRIND_MAKE_MEM_DEFINED(resp, resp_size);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1160
 
2760
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1161
+#if defined(__SVR4) && defined(__sun)
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1162
+	/* We don't support parent-child sharing of IB resources on Solaris */
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1163
+	if (fcntl(resp->async_fd, F_SETFD, FD_CLOEXEC) < 0) {
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1164
+		fprintf(stderr, "ibv_get_context: FD_CLOEXEC failed: %s\n",
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1165
+		    strerror(errno));
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1166
+		return errno;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1167
+	}
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1168
+#endif
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1169
+
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1170
 	context->async_fd         = resp->async_fd;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1171
 	context->num_comp_vectors = resp->num_comp_vectors;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1172
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1173
+#if defined(__SVR4) && defined(__sun)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1174
+	/*
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1175
+	 * Open the underlying kernel hardware driver that will
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1176
+	 * provide the mmap function for this context.
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1177
+	 */
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1178
+	context->mmap_fd = ibv_open_mmap_driver(context->device->dev_name);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1179
+	if (context->mmap_fd < 0) {
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1180
+		fprintf(stderr, PFX "ibv_cmd_get_context: Mmap open failed\n");
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1181
+	}
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1182
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1183
 	return 0;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1184
 }
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1185
 
2760
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1186
@@ -120,6 +207,7 @@
851
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  1187
 	memset(device_attr->fw_ver, 0, sizeof device_attr->fw_ver);
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  1188
 	*raw_fw_ver			       = resp.fw_ver;
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  1189
 	device_attr->node_guid 		       = resp.node_guid;
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  1190
+	device_attr->node_guid_external	       = resp.node_guid_external;
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  1191
 	device_attr->sys_image_guid 	       = resp.sys_image_guid;
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  1192
 	device_attr->max_mr_size 	       = resp.max_mr_size;
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  1193
 	device_attr->page_size_cap 	       = resp.page_size_cap;
2760
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1194
@@ -207,6 +295,8 @@
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1195
 {
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1196
 	IBV_INIT_CMD_RESP(cmd, cmd_size, ALLOC_PD, resp, resp_size);
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1197
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1198
+	cmd->user_handle     = (uintptr_t) pd;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1199
+
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1200
 	if (write(context->cmd_fd, cmd, cmd_size) != cmd_size)
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1201
 		return errno;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1202
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1203
@@ -218,6 +308,47 @@
817
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1204
 	return 0;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1205
 }
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1206
 
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1207
+int ibv_cmd_alloc_shpd(struct ibv_context *context, struct ibv_pd *pd,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1208
+         uint64_t share_key, struct ibv_shpd *shpd,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1209
+		     struct ibv_alloc_shpd *cmd, size_t cmd_size,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1210
+		     struct ibv_alloc_shpd_resp *resp, size_t resp_size)
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1211
+{
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1212
+	IBV_INIT_CMD_RESP(cmd, cmd_size, ALLOC_SHPD, resp, resp_size);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1213
+        cmd->pd_handle = pd->handle;
2760
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1214
+	cmd->user_handle = (uintptr_t) pd;
817
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1215
+	cmd->share_key = share_key;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1216
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1217
+	if (write(context->cmd_fd, cmd, cmd_size) != cmd_size)
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1218
+		return errno;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1219
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1220
+	VALGRIND_MAKE_MEM_DEFINED(resp, resp_size);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1221
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1222
+	shpd->handle  = resp->shpd_handle;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1223
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1224
+	return 0;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1225
+}
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1226
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1227
+int ibv_cmd_share_pd(struct ibv_context *context, struct ibv_shpd *shpd,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1228
+         uint64_t share_key, struct ibv_pd *pd,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1229
+		     struct ibv_share_pd *cmd, size_t cmd_size,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1230
+		     struct ibv_share_pd_resp *resp, size_t resp_size)
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1231
+{
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1232
+	IBV_INIT_CMD_RESP(cmd, cmd_size, SHARE_PD, resp, resp_size);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1233
+	cmd->shpd_handle = shpd->handle;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1234
+	cmd->share_key = share_key;
2760
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1235
+	cmd->user_handle     = (uintptr_t) pd;
817
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1236
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1237
+	if (write(context->cmd_fd, cmd, cmd_size) != cmd_size)
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1238
+		return errno;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1239
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1240
+	VALGRIND_MAKE_MEM_DEFINED(resp, resp_size);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1241
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1242
+	pd->handle  = resp->pd_handle;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1243
+	pd->context = context;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1244
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1245
+	return 0;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1246
+}
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1247
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1248
 int ibv_cmd_dealloc_pd(struct ibv_pd *pd)
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1249
 {
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1250
 	struct ibv_dealloc_pd cmd;
2760
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1251
@@ -224,6 +355,7 @@
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1252
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1253
 	IBV_INIT_CMD(&cmd, sizeof cmd, DEALLOC_PD);
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1254
 	cmd.pd_handle = pd->handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1255
+	cmd.user_handle = (uintptr_t) pd;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1256
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1257
 	if (write(pd->context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd)
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1258
 		return errno;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1259
@@ -244,6 +376,7 @@
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1260
 	cmd->length 	  = length;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1261
 	cmd->hca_va 	  = hca_va;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1262
 	cmd->pd_handle 	  = pd->handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1263
+	cmd->user_handle  = (uintptr_t) mr;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1264
 	cmd->access_flags = access;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1265
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1266
 	if (write(pd->context->cmd_fd, cmd, cmd_size) != cmd_size)
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1267
@@ -259,6 +392,35 @@
817
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1268
 	return 0;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1269
 }
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1270
 
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1271
+int ibv_cmd_reg_mr_relaxed(struct ibv_pd *pd, void *addr, size_t length,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1272
+		   uint64_t hca_va, int access,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1273
+		   struct ibv_mr *mr, struct ibv_reg_mr *cmd,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1274
+		   size_t cmd_size,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1275
+		   struct ibv_reg_mr_resp *resp, size_t resp_size)
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1276
+{
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1277
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1278
+	IBV_INIT_CMD_RESP(cmd, cmd_size, REG_MR_RELAXED, resp, resp_size);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1279
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1280
+	cmd->start 	  = (uintptr_t) addr;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1281
+	cmd->length 	  = length;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1282
+	cmd->hca_va 	  = hca_va;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1283
+	cmd->pd_handle 	  = pd->handle;
2760
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1284
+	cmd->user_handle  = (uintptr_t) mr;
817
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1285
+	cmd->access_flags = access;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1286
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1287
+	if (write(pd->context->cmd_fd, cmd, cmd_size) != cmd_size)
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1288
+		return errno;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1289
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1290
+	VALGRIND_MAKE_MEM_DEFINED(resp, resp_size);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1291
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1292
+	mr->handle  = resp->mr_handle;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1293
+	mr->lkey    = resp->lkey;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1294
+	mr->rkey    = resp->rkey;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1295
+	mr->context = pd->context;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1296
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1297
+	return 0;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1298
+}
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1299
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1300
 int ibv_cmd_dereg_mr(struct ibv_mr *mr)
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1301
 {
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1302
 	struct ibv_dereg_mr cmd;
2760
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1303
@@ -265,6 +427,7 @@
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1304
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1305
 	IBV_INIT_CMD(&cmd, sizeof cmd, DEREG_MR);
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1306
 	cmd.mr_handle = mr->handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1307
+	cmd.user_handle  = (uintptr_t) mr;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1308
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1309
 	if (write(mr->context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd)
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1310
 		return errno;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1311
@@ -272,6 +435,34 @@
817
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1312
 	return 0;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1313
 }
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1314
 
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1315
+int ibv_cmd_dereg_mr_relaxed(struct ibv_mr *mr)
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1316
+{
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1317
+	struct ibv_dereg_mr cmd;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1318
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1319
+	IBV_INIT_CMD(&cmd, sizeof cmd, DEREG_MR_RELAXED);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1320
+	cmd.mr_handle = mr->handle;
2760
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1321
+	cmd.user_handle  = (uintptr_t) mr;
817
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1322
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1323
+	if (write(mr->context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd)
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1324
+		return errno;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1325
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1326
+	return 0;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1327
+}
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1328
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1329
+int ibv_cmd_flush_relaxed_mr(struct ibv_pd *pd)
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1330
+{
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1331
+	struct ibv_flush_relaxed_mr cmd;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1332
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1333
+	IBV_INIT_CMD(&cmd, sizeof cmd, FLUSH_RELAXED_MR);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1334
+	cmd.pd_handle = pd->handle;
2760
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1335
+	cmd.user_handle  = (uintptr_t) pd;
817
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1336
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1337
+	if (write(pd->context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd)
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1338
+		return errno;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1339
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1340
+	return 0;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1341
+}
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1342
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1343
 static int ibv_cmd_create_cq_v2(struct ibv_context *context, int cqe,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1344
 				struct ibv_cq *cq,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1345
 				struct ibv_create_cq *new_cmd, size_t new_cmd_size,
2760
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1346
@@ -315,7 +506,19 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1347
 	cmd->user_handle   = (uintptr_t) cq;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1348
 	cmd->cqe           = cqe;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1349
 	cmd->comp_vector   = comp_vector;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1350
+#if defined(__SVR4) && defined(__sun)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1351
+	if (channel) {
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1352
+		struct stat	fstat_buf;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1353
+
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1354
+		if (fstat(channel->fd, &fstat_buf))
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1355
+			return (errno);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1356
+		else
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1357
+			cmd->comp_channel = minor(fstat_buf.st_rdev);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1358
+	} else 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1359
+		cmd->comp_channel = 0;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1360
+#else
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1361
 	cmd->comp_channel  = channel ? channel->fd : -1;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1362
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1363
 	cmd->reserved      = 0;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1364
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1365
 	if (write(context->cmd_fd, cmd, cmd_size) != cmd_size)
2760
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1366
@@ -346,6 +549,7 @@
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1367
 	IBV_INIT_CMD_RESP(&cmd, sizeof cmd, POLL_CQ, resp, rsize);
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1368
 	cmd.cq_handle = ibcq->handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1369
 	cmd.ne        = ne;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1370
+	cmd.user_handle  = (uintptr_t) ibcq;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1371
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1372
 	if (write(ibcq->context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd) {
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1373
 		ret = -1;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1374
@@ -384,6 +588,7 @@
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1375
 	IBV_INIT_CMD(&cmd, sizeof cmd, REQ_NOTIFY_CQ);
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1376
 	cmd.cq_handle = ibcq->handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1377
 	cmd.solicited = !!solicited_only;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1378
+	cmd.user_handle  = (uintptr_t) ibcq;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1379
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1380
 	if (write(ibcq->context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd)
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1381
 		return errno;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1382
@@ -399,6 +604,7 @@
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1383
 	IBV_INIT_CMD_RESP(cmd, cmd_size, RESIZE_CQ, resp, resp_size);
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1384
 	cmd->cq_handle = cq->handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1385
 	cmd->cqe       = cqe;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1386
+	cmd->user_handle   = (uintptr_t) cq;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1387
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1388
 	if (write(cq->context->cmd_fd, cmd, cmd_size) != cmd_size)
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1389
 		return errno;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1390
@@ -434,6 +640,7 @@
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1391
 	IBV_INIT_CMD_RESP(&cmd, sizeof cmd, DESTROY_CQ, &resp, sizeof resp);
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1392
 	cmd.cq_handle = cq->handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1393
 	cmd.reserved  = 0;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1394
+	cmd.user_handle  = (uintptr_t) cq;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1395
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1396
 	if (write(cq->context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd)
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1397
 		return errno;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1398
@@ -555,6 +762,7 @@
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1399
 	cmd->attr_mask	= srq_attr_mask;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1400
 	cmd->max_wr	= srq_attr->max_wr;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1401
 	cmd->srq_limit	= srq_attr->srq_limit;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1402
+	cmd->user_handle   = (uintptr_t) srq;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1403
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1404
 	if (write(srq->context->cmd_fd, cmd, cmd_size) != cmd_size)
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1405
 		return errno;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1406
@@ -569,6 +777,7 @@
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1407
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1408
 	IBV_INIT_CMD_RESP(cmd, cmd_size, QUERY_SRQ, &resp, sizeof resp);
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1409
 	cmd->srq_handle = srq->handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1410
+	cmd->user_handle   = (uintptr_t) srq;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1411
 	cmd->reserved   = 0;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1412
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1413
 	if (write(srq->context->cmd_fd, cmd, cmd_size) != cmd_size)
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1414
@@ -606,6 +815,7 @@
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1415
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1416
 	IBV_INIT_CMD_RESP(&cmd, sizeof cmd, DESTROY_SRQ, &resp, sizeof resp);
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1417
 	cmd.srq_handle = srq->handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1418
+	cmd.user_handle  = (uintptr_t) srq;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1419
 	cmd.reserved   = 0;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1420
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1421
 	if (write(srq->context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd)
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1422
@@ -637,7 +847,20 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1423
 	cmd->max_send_sge    = attr->cap.max_send_sge;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1424
 	cmd->max_recv_sge    = attr->cap.max_recv_sge;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1425
 	cmd->max_inline_data = attr->cap.max_inline_data;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1426
+
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1427
+#if defined(__SVR4) && defined(__sun)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1428
+	if (attr->sq_sig_all & LIB_RDMACM_QP_BIT) {
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1429
+		cmd->sq_sig_all =
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1430
+		    (uint8_t)(attr->sq_sig_all & ~LIB_RDMACM_QP_BIT);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1431
+		cmd->sq_sig_all |= 0x80;
2448
c1b40b77a1ae 15963508 SUNBT7202723 ibv_post_send(3) needs to be updated
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 869
diff changeset
  1432
+		attr->sq_sig_all &= ~LIB_RDMACM_QP_BIT;
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1433
+	} else {
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1434
+		cmd->sq_sig_all = (uint8_t)attr->sq_sig_all;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1435
+	}
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1436
+#else
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1437
 	cmd->sq_sig_all	     = attr->sq_sig_all;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1438
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1439
+
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1440
 	cmd->qp_type 	     = attr->qp_type;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1441
 	cmd->is_srq 	     = !!attr->srq;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1442
 	cmd->srq_handle      = attr->qp_type == IBV_QPT_XRC ?
2760
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1443
@@ -691,6 +914,7 @@
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1444
 	IBV_INIT_CMD_RESP(cmd, cmd_size, QUERY_QP, &resp, sizeof resp);
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1445
 	cmd->qp_handle = qp->handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1446
 	cmd->attr_mask = attr_mask;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1447
+	cmd->user_handle   = (uintptr_t) qp;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1448
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1449
 	if (write(qp->context->cmd_fd, cmd, cmd_size) != cmd_size)
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1450
 		return errno;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1451
@@ -772,6 +996,7 @@
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1452
 	IBV_INIT_CMD(cmd, cmd_size, MODIFY_QP);
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1453
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1454
 	cmd->qp_handle 		 = qp->handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1455
+	cmd->user_handle   	 = (uintptr_t) qp;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1456
 	cmd->attr_mask 		 = attr_mask;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1457
 	cmd->qkey 		 = attr->qkey;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1458
 	cmd->rq_psn 		 = attr->rq_psn;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1459
@@ -1292,6 +1517,7 @@
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1460
 	IBV_INIT_CMD_RESP(&cmd, sizeof cmd, DESTROY_QP, &resp, sizeof resp);
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1461
 	cmd.qp_handle = qp->handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1462
 	cmd.reserved  = 0;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1463
+	cmd.user_handle  = (uintptr_t) qp;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1464
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1465
 	if (write(qp->context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd)
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1466
 		return errno;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1467
@@ -1313,6 +1539,7 @@
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1468
 	IBV_INIT_CMD(&cmd, sizeof cmd, ATTACH_MCAST);
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1469
 	memcpy(cmd.gid, gid->raw, sizeof cmd.gid);
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1470
 	cmd.qp_handle = qp->handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1471
+	cmd.user_handle  = (uintptr_t) qp;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1472
 	cmd.mlid      = lid;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1473
 	cmd.reserved  = 0;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1474
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1475
@@ -1329,6 +1556,7 @@
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1476
 	IBV_INIT_CMD(&cmd, sizeof cmd, DETACH_MCAST);
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1477
 	memcpy(cmd.gid, gid->raw, sizeof cmd.gid);
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1478
 	cmd.qp_handle = qp->handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1479
+	cmd.user_handle  = (uintptr_t) qp;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1480
 	cmd.mlid      = lid;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1481
 	cmd.reserved  = 0;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1482
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1483
@@ -1406,4 +1634,3 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1484
 		return errno;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1485
 	return 0;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1486
 }
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1487
-
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1488
diff -r -u /tmp/846623/libibverbs-1.1.4/src/init.c libibverbs-1.1.4/src/init.c
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1489
--- /tmp/846623/libibverbs-1.1.4/src/init.c	Sun Nov  1 06:47:19 2009
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1490
+++ libibverbs-1.1.4/src/init.c	Fri Feb 11 04:02:32 2011
2550
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  1491
@@ -77,8 +77,13 @@
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  1492
 static struct ibv_driver_name *driver_name_list;
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  1493
 static struct ibv_driver *head_driver, *tail_driver;
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1494
 
2550
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  1495
+static uint blueflame_enabled = 0;
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  1496
+
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1497
 static int find_sysfs_devs(void)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1498
 {
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1499
+#if defined(__SVR4) && defined(__sun)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1500
+	char device_path[IBV_SYSFS_PATH_MAX];
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1501
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1502
 	char class_path[IBV_SYSFS_PATH_MAX];
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1503
 	DIR *class_dir;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1504
 	struct dirent *dent;
2550
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  1505
@@ -86,19 +91,35 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1506
 	char value[8];
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1507
 	int ret = 0;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1508
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1509
+#if defined(__SVR4) && defined(__sun)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1510
+	snprintf(device_path, sizeof device_path, "/dev/infiniband/ofs");
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1511
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1512
 	snprintf(class_path, sizeof class_path, "%s/class/infiniband_verbs",
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1513
 		 ibv_get_sysfs_path());
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1514
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1515
+#if defined(__SVR4) && defined(__sun)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1516
+	class_dir = opendir(device_path);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1517
+#else
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1518
 	class_dir = opendir(class_path);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1519
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1520
 	if (!class_dir)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1521
 		return ENOSYS;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1522
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1523
 	while ((dent = readdir(class_dir))) {
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1524
+#if defined(__SVR4) && defined(__sun)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1525
+		int adapter_num;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1526
+#else
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1527
 		struct stat buf;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1528
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1529
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1530
 		if (dent->d_name[0] == '.')
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1531
 			continue;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1532
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1533
+#if defined(__SVR4) && defined(__sun)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1534
+		if (sscanf(dent->d_name, "uverbs%d",
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1535
+		    &adapter_num) != 1)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1536
+			continue;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1537
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1538
 		if (!sysfs_dev)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1539
 			sysfs_dev = malloc(sizeof *sysfs_dev);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1540
 		if (!sysfs_dev) {
2550
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  1541
@@ -109,6 +130,7 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1542
 		snprintf(sysfs_dev->sysfs_path, sizeof sysfs_dev->sysfs_path,
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1543
 			 "%s/%s", class_path, dent->d_name);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1544
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1545
+#if !(defined(__SVR4) && defined(__sun))
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1546
 		if (stat(sysfs_dev->sysfs_path, &buf)) {
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1547
 			fprintf(stderr, PFX "Warning: couldn't stat '%s'.\n",
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1548
 				sysfs_dev->sysfs_path);
2550
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  1549
@@ -117,6 +139,7 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1550
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1551
 		if (!S_ISDIR(buf.st_mode))
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1552
 			continue;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1553
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1554
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1555
 		snprintf(sysfs_dev->sysfs_name, sizeof sysfs_dev->sysfs_name,
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1556
 			"%s", dent->d_name);
2550
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  1557
@@ -280,6 +303,13 @@
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  1558
 
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  1559
 			driver_name->next = driver_name_list;
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  1560
 			driver_name_list  = driver_name;
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  1561
+		} else if (strcmp(field, "blueflame") == 0) {
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  1562
+			config += strspn(config, "\t ");
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  1563
+			field = strsep(&config, "\n\t ");
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  1564
+			if (strcmp(field, "enable") == 0)
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  1565
+				blueflame_enabled = 1;
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  1566
+			if (strcmp(field, "disable") == 0)
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  1567
+				blueflame_enabled = 0;
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  1568
 		} else
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  1569
 			fprintf(stderr, PFX "Warning: ignoring bad config directive "
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  1570
 				"'%s' in file '%s'.\n", field, path);
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  1571
@@ -367,6 +397,7 @@
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  1572
 	strcpy(dev->dev_path,   sysfs_dev->sysfs_path);
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  1573
 	strcpy(dev->name,       sysfs_dev->ibdev_name);
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  1574
 	strcpy(dev->ibdev_path, sysfs_dev->ibdev_path);
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  1575
+	dev->blueflame_enabled = blueflame_enabled;
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  1576
 
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  1577
 	return dev;
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  1578
 }
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  1579
@@ -409,6 +440,7 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1580
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1581
 static void check_memlock_limit(void)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1582
 {
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1583
+#if !(defined(__SVR4) && defined(__sun))
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1584
 	struct rlimit rlim;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1585
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1586
 	if (!geteuid())
2550
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  1587
@@ -423,6 +455,7 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1588
 		fprintf(stderr, PFX "Warning: RLIMIT_MEMLOCK is %lu bytes.\n"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1589
 			"    This will severely limit memory registrations.\n",
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1590
 			rlim.rlim_cur);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1591
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1592
 }
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1593
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1594
 static void add_device(struct ibv_device *dev,
741
83cb76377624 7154908 IB_EVENT_LID_CHANGE should be IB_EVENT_GID_CHANGE
Boris Chiu <Boris.Chiu@Sun.COM>
parents: 715
diff changeset
  1595
diff -r -u /tmp/846623/libibverbs-1.1.4/src/enum_strs.c libibverbs-1.1.4/src/enum_strs.c
83cb76377624 7154908 IB_EVENT_LID_CHANGE should be IB_EVENT_GID_CHANGE
Boris Chiu <Boris.Chiu@Sun.COM>
parents: 715
diff changeset
  1596
--- /tmp/846623/libibverbs-1.1.4/src/enum_strs.c	Wed Sep 16 04:27:22 2009
817
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1597
+++ libibverbs-1.1.4/src/enum_strs.c	Tue Mar 20 16:27:45 2012
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1598
@@ -85,9 +85,14 @@
741
83cb76377624 7154908 IB_EVENT_LID_CHANGE should be IB_EVENT_GID_CHANGE
Boris Chiu <Boris.Chiu@Sun.COM>
parents: 715
diff changeset
  1599
 		[IBV_EVENT_SRQ_LIMIT_REACHED]	= "SRQ limit reached",
83cb76377624 7154908 IB_EVENT_LID_CHANGE should be IB_EVENT_GID_CHANGE
Boris Chiu <Boris.Chiu@Sun.COM>
parents: 715
diff changeset
  1600
 		[IBV_EVENT_QP_LAST_WQE_REACHED]	= "last WQE reached",
83cb76377624 7154908 IB_EVENT_LID_CHANGE should be IB_EVENT_GID_CHANGE
Boris Chiu <Boris.Chiu@Sun.COM>
parents: 715
diff changeset
  1601
 		[IBV_EVENT_CLIENT_REREGISTER]	= "client reregistration",
83cb76377624 7154908 IB_EVENT_LID_CHANGE should be IB_EVENT_GID_CHANGE
Boris Chiu <Boris.Chiu@Sun.COM>
parents: 715
diff changeset
  1602
+		[IBV_EVENT_GID_CHANGE]		= "GID change",
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1603
+		[IBV_EVENT_MCG_CREATED]		= "MCG created",
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1604
+		[IBV_EVENT_MCG_DELETED]		= "MCG deleted",
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1605
+		[IBV_EVENT_GID_AVAIL]		= "GID available",
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1606
+		[IBV_EVENT_GID_UNAVAIL]		= "GID unavailable",
741
83cb76377624 7154908 IB_EVENT_LID_CHANGE should be IB_EVENT_GID_CHANGE
Boris Chiu <Boris.Chiu@Sun.COM>
parents: 715
diff changeset
  1607
 	};
83cb76377624 7154908 IB_EVENT_LID_CHANGE should be IB_EVENT_GID_CHANGE
Boris Chiu <Boris.Chiu@Sun.COM>
parents: 715
diff changeset
  1608
 
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1609
-	if (event < IBV_EVENT_CQ_ERR || event > IBV_EVENT_CLIENT_REREGISTER)
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1610
+	if (event < IBV_EVENT_CQ_ERR || event > IBV_EVENT_GID_UNAVAIL)
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1611
 		return "unknown";
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1612
 
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1613
 	return event_type_str[event];
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1614
diff -r -u /tmp/846623/libibverbs-1.1.4/src/sysfs.c libibverbs-1.1.4/src/sysfs.c
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1615
--- /tmp/846623/libibverbs-1.1.4/src/sysfs.c	Wed Sep 16 04:27:22 2009
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1616
+++ libibverbs-1.1.4/src/sysfs.c	Fri Feb 11 04:02:33 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1617
@@ -44,6 +44,10 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1618
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1619
 #include "ibverbs.h"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1620
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1621
+#if defined(__SVR4) && defined(__sun)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1622
+int sol_read_sysfs_file(char *path, char *buf, size_t size);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1623
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1624
+
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1625
 static char *sysfs_path;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1626
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1627
 const char *ibv_get_sysfs_path(void)
715
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
  1628
@@ -79,12 +83,18 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1629
 			char *buf, size_t size)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1630
 {
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1631
 	char *path;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1632
+#if !(defined(__SVR4) && defined(__sun))
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1633
 	int fd;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1634
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1635
 	int len;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1636
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1637
 	if (asprintf(&path, "%s/%s", dir, file) < 0)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1638
 		return -1;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1639
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1640
+#if defined(__SVR4) && defined(__sun)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1641
+	len = sol_read_sysfs_file(path, buf, size);
715
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
  1642
+	free(path);
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1643
+#else
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1644
 	fd = open(path, O_RDONLY);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1645
 	if (fd < 0) {
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1646
 		free(path);
715
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
  1647
@@ -98,6 +108,7 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1648
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1649
 	if (len > 0 && buf[len - 1] == '\n')
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1650
 		buf[--len] = '\0';
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1651
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1652
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1653
 	return len;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1654
 }
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1655
diff -r -u /tmp/846623/libibverbs-1.1.4/configure libibverbs-1.1.4/configure
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1656
--- /tmp/846623/libibverbs-1.1.4/configure	Thu Feb  3 01:53:23 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1657
+++ libibverbs-1.1.4/configure	Fri Feb 11 04:02:14 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1658
@@ -3173,6 +3173,7 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1659
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1660
 $as_echo_n "checking whether the C compiler works... " >&6; }
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1661
 ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1662
+ac_link_default=`$as_echo "$ac_link" | sed 's/ \$LIBS//'`
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1663
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1664
 # The possible output files:
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1665
 ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1666
@@ -3258,6 +3259,7 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1667
 ac_clean_files=$ac_clean_files_save
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1668
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1669
 $as_echo_n "checking for suffix of executables... " >&6; }
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1670
+ac_link_nolibs=`$as_echo "$ac_link" | sed 's/ \$LIBS//'`
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1671
 if { { ac_try="$ac_link"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1672
 case "(($ac_try" in
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1673
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1674
@@ -3265,7 +3267,7 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1675
 esac
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1676
 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1677
 $as_echo "$ac_try_echo"; } >&5
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1678
-  (eval "$ac_link") 2>&5
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1679
+  (eval "$ac_link_nolibs") 2>&5
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1680
   ac_status=$?
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1681
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1682
   test $ac_status = 0; }; then :
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1683
@@ -3321,7 +3323,7 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1684
 esac
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1685
 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1686
 $as_echo "$ac_try_echo"; } >&5
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1687
-  (eval "$ac_link") 2>&5
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1688
+  (eval "$ac_link_nolibs") 2>&5
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1689
   ac_status=$?
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1690
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1691
   test $ac_status = 0; }
715
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
  1692
@@ -3509,13 +3511,13 @@
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
  1693
   CFLAGS=$ac_save_CFLAGS
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
  1694
 elif test $ac_cv_prog_cc_g = yes; then
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
  1695
   if test "$GCC" = yes; then
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
  1696
-    CFLAGS="-g -O2"
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
  1697
+    CFLAGS="-g -O3"
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
  1698
   else
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
  1699
     CFLAGS="-g"
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
  1700
   fi
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
  1701
 else
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
  1702
   if test "$GCC" = yes; then
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
  1703
-    CFLAGS="-O2"
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
  1704
+    CFLAGS="-O3"
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
  1705
   else
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
  1706
     CFLAGS=
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
  1707
   fi
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1708
@@ -8721,6 +8723,7 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1709
 	;;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1710
       esac
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1711
       link_all_deplibs=yes
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1712
+	 hardcode_libdir_flag_spec=
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1713
       ;;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1714
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1715
     sunos4*)
715
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
  1716
@@ -10945,13 +10948,13 @@
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
  1717
   CFLAGS=$ac_save_CFLAGS
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
  1718
 elif test $ac_cv_prog_cc_g = yes; then
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
  1719
   if test "$GCC" = yes; then
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
  1720
-    CFLAGS="-g -O2"
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
  1721
+    CFLAGS="-g -O3"
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
  1722
   else
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
  1723
     CFLAGS="-g"
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
  1724
   fi
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
  1725
 else
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
  1726
   if test "$GCC" = yes; then
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
  1727
-    CFLAGS="-O2"
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
  1728
+    CFLAGS="-O3"
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
  1729
   else
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
  1730
     CFLAGS=
eed3ed08f692 6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents: 369
diff changeset
  1731
   fi
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1732
@@ -11198,7 +11201,7 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1733
   $as_echo_n "(cached) " >&6
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1734
 else
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1735
   ac_check_lib_save_LIBS=$LIBS
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1736
-LIBS="-ldl  $LIBS"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1737
+LIBS="-ldl"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1738
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1739
 /* end confdefs.h.  */
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1740
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1741
@@ -11245,7 +11248,7 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1742
   $as_echo_n "(cached) " >&6
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1743
 else
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1744
   ac_check_lib_save_LIBS=$LIBS
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1745
-LIBS="-lpthread  $LIBS"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1746
+LIBS="-lpthread"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1747
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1748
 /* end confdefs.h.  */
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1749
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1750
diff -r -u /tmp/846623/libibverbs-1.1.4/include/infiniband/sa-kern-abi.h libibverbs-1.1.4/include/infiniband/sa-kern-abi.h
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1751
--- /tmp/846623/libibverbs-1.1.4/include/infiniband/sa-kern-abi.h	Wed Sep 16 04:27:22 2009
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1752
+++ libibverbs-1.1.4/include/infiniband/sa-kern-abi.h	Fri Feb 11 04:02:21 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1753
@@ -33,7 +33,11 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1754
 #ifndef INFINIBAND_SA_KERN_ABI_H
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1755
 #define INFINIBAND_SA_KERN_ABI_H
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1756
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1757
+#if !(defined(__SVR4) && defined(__sun))
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1758
 #include <linux/types.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1759
+#else
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1760
+#include <infiniband/ofa_solaris.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1761
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1762
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1763
 /*
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1764
  * Obsolete, deprecated names.  Will be removed in libibverbs 1.1.
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1765
diff -r -u /tmp/846623/libibverbs-1.1.4/include/infiniband/kern-abi.h libibverbs-1.1.4/include/infiniband/kern-abi.h
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1766
--- /tmp/846623/libibverbs-1.1.4/include/infiniband/kern-abi.h	Thu Feb  3 01:53:17 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1767
+++ libibverbs-1.1.4/include/infiniband/kern-abi.h	Fri Feb 11 04:02:20 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1768
@@ -35,7 +35,11 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1769
 #ifndef KERN_ABI_H
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1770
 #define KERN_ABI_H
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1771
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1772
+#if !(defined(__SVR4) && defined(__sun))
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1773
 #include <linux/types.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1774
+#else
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1775
+#include <infiniband/ofa_solaris.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1776
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1777
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1778
 /*
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1779
  * This file must be kept in sync with the kernel's version of
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1780
@@ -94,6 +98,14 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1781
 	IB_USER_VERBS_CMD_QUERY_XRC_RCV_QP,
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1782
 	IB_USER_VERBS_CMD_REG_XRC_RCV_QP,
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1783
 	IB_USER_VERBS_CMD_UNREG_XRC_RCV_QP,
817
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1784
+	IB_USER_VERBS_CMD_REG_MR_RELAXED,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1785
+	IB_USER_VERBS_CMD_DEREG_MR_RELAXED,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1786
+	IB_USER_VERBS_CMD_FLUSH_RELAXED_MR,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1787
+	IB_USER_VERBS_CMD_ALLOC_SHPD,
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1788
+	IB_USER_VERBS_CMD_SHARE_PD,
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1789
+	IB_USER_VERBS_CMD_REG_SM_EVENT,
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1790
+	IB_USER_VERBS_CMD_UNREG_SM_EVENT,
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1791
+	IB_USER_VERBS_CMD_GID_REACHABLE
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1792
 };
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1793
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1794
 /*
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1795
@@ -111,6 +123,8 @@
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1796
 	__u64 element;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1797
 	__u32 event_type;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1798
 	__u32 reserved;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1799
+	__u64 subnet_prefix;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1800
+	__u64 interface_id;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1801
 };
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1802
 
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1803
 struct ibv_comp_event {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1804
@@ -160,6 +174,7 @@
851
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  1805
 struct ibv_query_device_resp {
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  1806
 	__u64 fw_ver;
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  1807
 	__u64 node_guid;
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  1808
+	__u64 node_guid_external;
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  1809
 	__u64 sys_image_guid;
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  1810
 	__u64 max_mr_size;
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  1811
 	__u64 page_size_cap;
2760
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1812
@@ -235,23 +250,103 @@
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1813
 	__u8  reserved[2];
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1814
 };
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1815
 
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1816
+struct ibv_reg_sm_event {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1817
+	__u32 command;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1818
+	__u16 in_words;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1819
+	__u16 out_words;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1820
+	__u32 events;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1821
+	__u32 data_num;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1822
+	__u64 driver_data[0];
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1823
+};
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1824
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1825
+struct ibv_unreg_sm_event {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1826
+	__u32 command;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1827
+	__u16 in_words;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1828
+	__u16 out_words;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1829
+	__u32 events;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1830
+	__u32 data_num;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1831
+	__u64 driver_data[0];
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1832
+};
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1833
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1834
+struct ibv_gid_reachable {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1835
+	__u32 command;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1836
+	__u16 in_words;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1837
+	__u16 out_words;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1838
+	__u32 timeout;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1839
+	__u8  port_num;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1840
+	__u8  reserved[3];
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1841
+	__u8  gid[16];
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1842
+};
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1843
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1844
 struct ibv_alloc_pd {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1845
 	__u32 command;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  1846
 	__u16 in_words;
2760
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1847
 	__u16 out_words;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1848
 	__u64 response;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1849
+	__u64 user_handle;
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1850
 	__u64 driver_data[0];
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1851
 };
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1852
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1853
+#if defined(__SVR4) && defined(__sun)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1854
+/*
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1855
+ * PD responses may pass opaque data to userspace drivers, we choose a value
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1856
+ * larger than what any HCA requires.
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1857
+ */
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1858
+#define SOL_UVERBS_PD_DATA_OUT_SIZE          24
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1859
+typedef __u64 ofuv_pd_drv_data_out_t[SOL_UVERBS_PD_DATA_OUT_SIZE];
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1860
+
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1861
 struct ibv_alloc_pd_resp {
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1862
+        __u32 pd_handle;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1863
+        __u32 reserved;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1864
+        ofuv_pd_drv_data_out_t drv_out;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1865
+};
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1866
+#else
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1867
+struct ibv_alloc_pd_resp {
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1868
 	__u32 pd_handle;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1869
 };
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1870
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1871
 
817
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1872
+struct ibv_alloc_shpd {
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1873
+	__u32 command;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1874
+	__u16 in_words;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1875
+	__u16 out_words;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1876
+	__u64 response;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1877
+	__u32 pd_handle;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1878
+	__u32 reserved;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1879
+	__u64 share_key;
2760
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1880
+	__u64 user_handle;
817
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1881
+	__u64 driver_data[0];
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1882
+};
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1883
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1884
+struct ibv_alloc_shpd_resp {
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1885
+	__u32 shpd_handle;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1886
+};
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1887
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1888
+struct ibv_share_pd {
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1889
+	__u32 command;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1890
+	__u16 in_words;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1891
+	__u16 out_words;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1892
+	__u64 response;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1893
+	__u32 shpd_handle;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1894
+	__u32 reserved;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1895
+	__u64 share_key;
2760
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1896
+	__u64 user_handle;
817
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1897
+	__u64 driver_data[0];
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1898
+};
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1899
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1900
+struct ibv_share_pd_resp {
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1901
+	__u32 pd_handle;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1902
+        __u32 reserved;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1903
+        ofuv_pd_drv_data_out_t drv_out;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1904
+};
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1905
+
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1906
 struct ibv_dealloc_pd {
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1907
 	__u32 command;
817
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1908
 	__u16 in_words;
2760
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1909
 	__u16 out_words;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1910
 	__u32 pd_handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1911
+	__u32 reserved;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1912
+	__u64 user_handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1913
 };
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1914
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1915
 struct ibv_reg_mr {
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1916
@@ -264,6 +359,7 @@
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1917
 	__u64 hca_va;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1918
 	__u32 pd_handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1919
 	__u32 access_flags;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1920
+	__u64 user_handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1921
 	__u64 driver_data[0];
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1922
 };
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1923
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1924
@@ -278,8 +374,19 @@
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1925
 	__u16 in_words;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1926
 	__u16 out_words;
817
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1927
 	__u32 mr_handle;
2760
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1928
+	__u32 reserved;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1929
+	__u64 user_handle;
817
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1930
 };
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1931
 
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1932
+struct ibv_flush_relaxed_mr {
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1933
+	__u32 command;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1934
+	__u16 in_words;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1935
+	__u16 out_words;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1936
+	__u32 pd_handle;
2760
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1937
+	__u32 reserved;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1938
+	__u64 user_handle;
817
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1939
+};
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1940
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1941
 struct ibv_create_comp_channel {
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1942
 	__u32 command;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  1943
 	__u16 in_words;
2760
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1944
@@ -304,10 +411,25 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1945
 	__u64 driver_data[0];
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1946
 };
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1947
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1948
+#if defined(__SVR4) && defined(__sun)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1949
+/*
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1950
+ * CQ responses pass opaque data to userspace drivers, we choose a value
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1951
+ * larger than what any HCA requires.
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1952
+ */
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1953
+#define SOL_UVERBS_CQ_DATA_OUT_SIZE          24
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1954
+typedef __u64 ofuv_cq_drv_data_out_t[SOL_UVERBS_CQ_DATA_OUT_SIZE];
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1955
+
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1956
 struct ibv_create_cq_resp {
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1957
 	__u32 cq_handle;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1958
 	__u32 cqe;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1959
+	ofuv_cq_drv_data_out_t   drv_out;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1960
 };
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1961
+#else
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1962
+struct ibv_create_cq_resp {
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1963
+	__u32 cq_handle;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1964
+	__u32 cqe;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1965
+};
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1966
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1967
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1968
 struct ibv_kern_wc {
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1969
 	__u64  wr_id;
2760
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1970
@@ -334,6 +456,7 @@
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1971
 	__u64 response;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1972
 	__u32 cq_handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1973
 	__u32 ne;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1974
+	__u64 user_handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1975
 };
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1976
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1977
 struct ibv_poll_cq_resp {
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1978
@@ -348,6 +471,7 @@
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1979
 	__u16 out_words;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1980
 	__u32 cq_handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1981
 	__u32 solicited;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1982
+	__u64 user_handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1983
 };
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1984
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1985
 struct ibv_resize_cq {
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1986
@@ -357,6 +481,7 @@
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1987
 	__u64 response;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1988
 	__u32 cq_handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1989
 	__u32 cqe;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1990
+	__u64 user_handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1991
 	__u64 driver_data[0];
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1992
 };
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1993
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  1994
@@ -363,7 +488,11 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1995
 struct ibv_resize_cq_resp {
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1996
 	__u32 cqe;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1997
 	__u32 reserved;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1998
+#if defined(__SVR4) && defined(__sun)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  1999
+        ofuv_cq_drv_data_out_t   drv_out;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2000
+#else
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2001
 	__u64 driver_data[0];
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2002
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2003
 };
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2004
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2005
 struct ibv_destroy_cq {
2760
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2006
@@ -373,6 +502,7 @@
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2007
 	__u64 response;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2008
 	__u32 cq_handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2009
 	__u32 reserved;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2010
+	__u64 user_handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2011
 };
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2012
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2013
 struct ibv_destroy_cq_resp {
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2014
@@ -460,6 +590,14 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2015
 	__u64 driver_data[0];
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2016
 };
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2017
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2018
+#if defined(__SVR4) && defined(__sun)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2019
+/*
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2020
+ * QP responses pass opaque data to userspace drivers, we choose a value
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2021
+ * larger than what any HCA requires.
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2022
+ */
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2023
+#define SOL_UVERBS_QP_DATA_OUT_SIZE          24
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2024
+typedef __u64 ofuv_qp_drv_data_out_t[SOL_UVERBS_QP_DATA_OUT_SIZE];
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2025
+
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2026
 struct ibv_create_qp_resp {
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2027
 	__u32 qp_handle;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2028
 	__u32 qpn;
2760
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2029
@@ -469,7 +607,20 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2030
 	__u32 max_recv_sge;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2031
 	__u32 max_inline_data;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2032
 	__u32 reserved;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2033
+	ofuv_qp_drv_data_out_t drv_out;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2034
 };
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2035
+#else
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2036
+struct ibv_create_qp_resp {
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2037
+	__u32 qp_handle;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2038
+	__u32 qpn;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2039
+	__u32 max_send_wr;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2040
+	__u32 max_recv_wr;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2041
+	__u32 max_send_sge;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2042
+	__u32 max_recv_sge;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2043
+	__u32 max_inline_data;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2044
+	__u32 reserved;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2045
+};
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2046
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2047
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2048
 struct ibv_qp_dest {
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2049
 	__u8  dgid[16];
2760
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2050
@@ -493,6 +644,7 @@
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2051
 	__u64 response;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2052
 	__u32 qp_handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2053
 	__u32 attr_mask;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2054
+	__u64 user_handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2055
 	__u64 driver_data[0];
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2056
 };
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2057
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2058
@@ -560,6 +712,7 @@
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2059
 	__u8  alt_port_num;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2060
 	__u8  alt_timeout;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2061
 	__u8  reserved[2];
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2062
+	__u64 user_handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2063
 	__u64 driver_data[0];
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2064
 };
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2065
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2066
@@ -570,6 +723,7 @@
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2067
 	__u64 response;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2068
 	__u32 qp_handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2069
 	__u32 reserved;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2070
+	__u64 user_handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2071
 };
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2072
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2073
 struct ibv_destroy_qp_resp {
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2074
@@ -775,6 +929,7 @@
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2075
 	__u32 qp_handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2076
 	__u16 mlid;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2077
 	__u16 reserved;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2078
+	__u64 user_handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2079
 	__u64 driver_data[0];
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2080
 };
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2081
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2082
@@ -786,6 +941,7 @@
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2083
 	__u32 qp_handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2084
 	__u16 mlid;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2085
 	__u16 reserved;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2086
+	__u64 user_handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2087
 	__u64 driver_data[0];
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2088
 };
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2089
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2090
@@ -817,12 +973,29 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2091
 	__u64 driver_data[0];
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2092
 };
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2093
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2094
+#if defined(__SVR4) && defined(__sun)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2095
+/*
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2096
+ * QP responses pass opaque data to userspace drivers, we choose a value
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2097
+ * larger than what any HCA requires.
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2098
+ */
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2099
+#define SOL_UVERBS_SRQ_DATA_OUT_SIZE          24
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2100
+typedef __u64 ofuv_srq_drv_data_out_t[SOL_UVERBS_SRQ_DATA_OUT_SIZE];
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2101
+
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2102
 struct ibv_create_srq_resp {
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2103
 	__u32 srq_handle;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2104
 	__u32 max_wr;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2105
 	__u32 max_sge;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2106
 	__u32 reserved;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2107
+	ofuv_srq_drv_data_out_t drv_out;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2108
 };
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2109
+#else
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2110
+struct ibv_create_srq_resp {
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2111
+	__u32 srq_handle;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2112
+	__u32 max_wr;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2113
+	__u32 max_sge;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2114
+	__u32 reserved;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2115
+};
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2116
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2117
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2118
 struct ibv_modify_srq {
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2119
 	__u32 command;
2760
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2120
@@ -832,6 +1005,7 @@
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2121
 	__u32 attr_mask;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2122
 	__u32 max_wr;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2123
 	__u32 srq_limit;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2124
+	__u64 user_handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2125
 	__u64 driver_data[0];
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2126
 };
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2127
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2128
@@ -842,6 +1016,7 @@
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2129
 	__u64 response;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2130
 	__u32 srq_handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2131
 	__u32 reserved;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2132
+	__u64 user_handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2133
 	__u64 driver_data[0];
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2134
 };
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2135
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2136
@@ -859,6 +1034,7 @@
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2137
 	__u64 response;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2138
 	__u32 srq_handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2139
 	__u32 reserved;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2140
+	__u64 user_handle;
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2141
 };
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2142
 
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2143
 struct ibv_destroy_srq_resp {
d8617e86d47d 17199356 The ibv_devinfo command cannot print the board_id of CX-3 IB-HCA (userland)
Chris Juhasz <chris.juhasz@oracle.com>
parents: 2550
diff changeset
  2144
@@ -946,6 +1122,14 @@
817
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2145
 	IB_USER_VERBS_CMD_QUERY_XRC_RCV_QP_V2 = -1,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2146
 	IB_USER_VERBS_CMD_REG_XRC_RCV_QP_V2 = -1,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2147
 	IB_USER_VERBS_CMD_UNREG_XRC_RCV_QP_V2 = -1,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2148
+	IB_USER_VERBS_CMD_REG_MR_RELAXED_V2 = -1,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2149
+	IB_USER_VERBS_CMD_DEREG_MR_RELAXED_V2 = -1,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2150
+	IB_USER_VERBS_CMD_FLUSH_RELAXED_MR_V2 = -1,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2151
+  	IB_USER_VERBS_CMD_ALLOC_SHPD_V2 = -1,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2152
+  	IB_USER_VERBS_CMD_SHARE_PD_V2 = -1,
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2153
+	IB_USER_VERBS_CMD_REG_SM_EVENT_V2 = -1,
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2154
+	IB_USER_VERBS_CMD_UNREG_SM_EVENT_V2 = -1,
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2155
+	IB_USER_VERBS_CMD_GID_REACHABLE_V2 = -1,
817
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2156
 };
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2157
 
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2158
 struct ibv_destroy_cq_v1 {
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2159
diff -r -u /tmp/846623/libibverbs-1.1.4/include/infiniband/driver.h libibverbs-1.1.4/include/infiniband/driver.h
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2160
--- /tmp/846623/libibverbs-1.1.4/include/infiniband/driver.h	Thu Feb  3 01:53:17 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2161
+++ libibverbs-1.1.4/include/infiniband/driver.h	Fri Feb 11 04:02:20 2011
817
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2162
@@ -74,6 +74,14 @@
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2163
 int ibv_cmd_alloc_pd(struct ibv_context *context, struct ibv_pd *pd,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2164
 		     struct ibv_alloc_pd *cmd, size_t cmd_size,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2165
 		     struct ibv_alloc_pd_resp *resp, size_t resp_size);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2166
+int ibv_cmd_alloc_shpd(struct ibv_context *context, struct ibv_pd *pd,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2167
+		     uint64_t share_key, struct ibv_shpd *shpd,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2168
+		     struct ibv_alloc_shpd *cmd, size_t cmd_size,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2169
+		     struct ibv_alloc_shpd_resp *resp, size_t resp_size);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2170
+int ibv_cmd_share_pd(struct ibv_context *context, struct ibv_shpd *shpd,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2171
+		     uint64_t share_key, struct ibv_pd *pd,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2172
+		     struct ibv_share_pd *cmd, size_t cmd_size,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2173
+		     struct ibv_share_pd_resp *resp, size_t resp_size);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2174
 int ibv_cmd_dealloc_pd(struct ibv_pd *pd);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2175
 #define IBV_CMD_REG_MR_HAS_RESP_PARAMS
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2176
 int ibv_cmd_reg_mr(struct ibv_pd *pd, void *addr, size_t length,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2177
@@ -81,7 +89,15 @@
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2178
 		   struct ibv_mr *mr, struct ibv_reg_mr *cmd,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2179
 		   size_t cmd_size,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2180
 		   struct ibv_reg_mr_resp *resp, size_t resp_size);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2181
+#define IBV_CMD_REG_MR_RELAXED_HAS_RESP_PARAMS
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2182
+int ibv_cmd_reg_mr_relaxed(struct ibv_pd *pd, void *addr, size_t length,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2183
+		   uint64_t hca_va, int access,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2184
+		   struct ibv_mr *mr, struct ibv_reg_mr *cmd,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2185
+		   size_t cmd_size,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2186
+		   struct ibv_reg_mr_resp *resp, size_t resp_size);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2187
 int ibv_cmd_dereg_mr(struct ibv_mr *mr);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2188
+int ibv_cmd_dereg_mr_relaxed(struct ibv_mr *mr);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2189
+int ibv_cmd_flush_relaxed_mr(struct ibv_pd *pd);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2190
 int ibv_cmd_create_cq(struct ibv_context *context, int cqe,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2191
 		      struct ibv_comp_channel *channel,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2192
 		      int comp_vector, struct ibv_cq *cq,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2193
@@ -164,8 +180,8 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2194
 int ibv_read_sysfs_file(const char *dir, const char *file,
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2195
 			char *buf, size_t size);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2196
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2197
-int ibv_resolve_eth_gid(const struct ibv_pd *pd, uint8_t port_num,
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2198
-			union ibv_gid *dgid, uint8_t sgid_index,
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2199
+int ibv_resolve_eth_gid(struct ibv_pd *pd, uint8_t port_num,
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2200
+			const union ibv_gid *dgid, uint8_t sgid_index,
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2201
 			uint8_t mac[], uint16_t *vlan, uint8_t *tagged,
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2202
 			uint8_t *is_mcast);
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2203
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2204
diff -r -u /tmp/846623/libibverbs-1.1.4/include/infiniband/verbs.h libibverbs-1.1.4/include/infiniband/verbs.h
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2205
--- /tmp/846623/libibverbs-1.1.4/include/infiniband/verbs.h	Thu Feb  3 01:53:17 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2206
+++ libibverbs-1.1.4/include/infiniband/verbs.h	Fri Feb 11 04:02:21 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2207
@@ -38,6 +38,9 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2208
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2209
 #include <stdint.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2210
 #include <pthread.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2211
+#if defined(__SVR4) && defined(__sun)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2212
+#include <infiniband/ofa_solaris.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2213
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2214
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2215
 #ifdef __cplusplus
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2216
 #  define BEGIN_C_DECLS extern "C" {
851
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  2217
@@ -105,6 +108,7 @@
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  2218
 struct ibv_device_attr {
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  2219
 	char			fw_ver[64];
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  2220
 	uint64_t		node_guid;
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  2221
+	uint64_t		node_guid_external;
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  2222
 	uint64_t		sys_image_guid;
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  2223
 	uint64_t		max_mr_size;
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  2224
 	uint64_t		page_size_cap;
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2225
@@ -212,6 +216,10 @@
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2226
 	IBV_EVENT_QP_LAST_WQE_REACHED,
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2227
 	IBV_EVENT_CLIENT_REREGISTER,
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2228
 	IBV_EVENT_GID_CHANGE,
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2229
+	IBV_EVENT_MCG_CREATED,
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2230
+	IBV_EVENT_MCG_DELETED,
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2231
+	IBV_EVENT_GID_AVAIL,
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2232
+	IBV_EVENT_GID_UNAVAIL,
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2233
 };
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2234
 
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2235
 enum ibv_event_flags {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2236
@@ -225,10 +233,20 @@
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2237
 		struct ibv_srq *srq;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2238
 		int		port_num;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2239
 		uint32_t	xrc_qp_num;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2240
+		union ibv_gid	gid;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2241
 	} element;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2242
 	enum ibv_event_type	event_type;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2243
 };
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2244
 
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2245
+typedef enum ibv_sm_event_type_e {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2246
+	IBV_SM_EVENT_MGID	= 1,
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2247
+	IBV_SM_EVENT_MGID_ALL	= 1 << 2,
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2248
+	IBV_SM_EVENT_UGID	= 1 << 3,
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2249
+	IBV_SM_EVENT_UGID_ALL	= 1 << 4,
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2250
+        IBV_SM_EVENT_ALL	= 1 << 5
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2251
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2252
+} ibv_sm_event_type_t;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2253
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2254
 enum ibv_wc_status {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2255
 	IBV_WC_SUCCESS,
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2256
 	IBV_WC_LOC_LEN_ERR,
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2257
@@ -297,7 +315,8 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2258
 	IBV_ACCESS_REMOTE_WRITE		= (1<<1),
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2259
 	IBV_ACCESS_REMOTE_READ		= (1<<2),
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2260
 	IBV_ACCESS_REMOTE_ATOMIC	= (1<<3),
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2261
-	IBV_ACCESS_MW_BIND		= (1<<4)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2262
+	IBV_ACCESS_MW_BIND		= (1<<4),
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2263
+	IBV_ACCESS_SO			= (1<<5)	/* Strong Order */
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2264
 };
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2265
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2266
 struct ibv_pd {
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2267
@@ -305,6 +324,10 @@
817
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2268
 	uint32_t		handle;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2269
 };
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2270
 
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2271
+struct ibv_shpd {
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2272
+	uint32_t		handle;
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2273
+};
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2274
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2275
 enum ibv_rereg_mr_flags {
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2276
 	IBV_REREG_MR_CHANGE_TRANSLATION	= (1 << 0),
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2277
 	IBV_REREG_MR_CHANGE_PD		= (1 << 1),
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2278
@@ -425,6 +448,14 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2279
 	uint32_t		max_inline_data;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2280
 };
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2281
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2282
+#if defined(__SVR4) && defined(__sun)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2283
+/*
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2284
+ * The 31st bit of sq_sig_all is set for QPs allocated
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2285
+ * using librdmacm. Consumers use sq_sig_all 0 /1.
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2286
+ */
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2287
+#define LIB_RDMACM_QP_BIT	0x8000
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2288
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2289
+
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2290
 struct ibv_qp_init_attr {
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2291
 	void		       *qp_context;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2292
 	struct ibv_cq	       *send_cq;
2550
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  2293
@@ -659,6 +690,7 @@
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  2294
 	char			dev_path[IBV_SYSFS_PATH_MAX];
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  2295
 	/* Path to infiniband class device in sysfs */
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  2296
 	char			ibdev_path[IBV_SYSFS_PATH_MAX];
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  2297
+	uint			blueflame_enabled;
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  2298
 };
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  2299
 
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  2300
 struct ibv_more_ops {
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  2301
@@ -743,6 +775,12 @@
817
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2302
 	int			(*detach_mcast)(struct ibv_qp *qp, const union ibv_gid *gid,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2303
 						uint16_t lid);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2304
 	void			(*async_event)(struct ibv_async_event *event);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2305
+	struct ibv_mr *		(*reg_mr_relaxed)(struct ibv_pd *pd, void *addr, size_t length,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2306
+					  int access);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2307
+	int			(*dereg_mr_relaxed)(struct ibv_mr *mr);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2308
+	int			(*flush_relaxed_mr)(struct ibv_pd *pd);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2309
+	struct ibv_shpd *	(*alloc_shpd)(struct ibv_pd *pd, uint64_t share_key, struct ibv_shpd *shpd);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2310
+	struct ibv_pd *		(*share_pd)(struct ibv_context *context, struct ibv_shpd *shpd, uint64_t share_key);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2311
 };
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2312
 
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2313
 struct ibv_context {
2550
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  2314
@@ -749,6 +787,13 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2315
 	struct ibv_device      *device;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2316
 	struct ibv_context_ops	ops;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2317
 	int			cmd_fd;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2318
+#if defined(__SVR4) && defined(__sun)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2319
+	/*
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2320
+	 * Solaris user libraries use this FD for mmap operations. It is an
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2321
+	 * open to the underlying kernel hardware specific driver.
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2322
+	 */
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2323
+	int			mmap_fd;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2324
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2325
 	int			async_fd;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2326
 	int			num_comp_vectors;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2327
 	pthread_mutex_t		mutex;
2550
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  2328
@@ -797,6 +842,11 @@
851
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  2329
 uint64_t ibv_get_device_guid(struct ibv_device *device);
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  2330
 
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  2331
 /**
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  2332
+ * ibv_get_device_guid_external - Return device's node external GUID
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  2333
+ */
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  2334
+uint64_t ibv_get_device_guid_external(struct ibv_device *device);
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  2335
+
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  2336
+/**
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  2337
  * ibv_open_device - Initialize device for use
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  2338
  */
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  2339
 struct ibv_context *ibv_open_device(struct ibv_device *device);
2550
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  2340
@@ -853,11 +903,44 @@
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2341
 		   int index, uint16_t *pkey);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2342
 
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2343
 /**
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2344
+ * ibv_register_sm_events - Register subnet event for GID change
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2345
+ */
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2346
+int ibv_register_sm_events(struct ibv_context *context,
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2347
+    ibv_sm_event_type_t event, uint_t gid_num, union ibv_gid *gids);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2348
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2349
+/**
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2350
+ * ibv_unregister_sm_events - Unregister subnet event for GID change
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2351
+ */
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2352
+int ibv_unregister_sm_events(struct ibv_context *context,
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2353
+    ibv_sm_event_type_t event, uint_t gid_num, union ibv_gid *gids);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2354
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2355
+/**
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2356
+ * ibv_gid_reachable - To contact subnet agent for GID status; reachable or
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2357
+ * not reachable
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2358
+ */
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2359
+int ibv_gid_reachable(struct ibv_context *context,
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2360
+    uint port, union ibv_gid *gid_p, int timeout);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2361
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2362
+/**
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2363
  * ibv_alloc_pd - Allocate a protection domain
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2364
  */
817
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2365
 struct ibv_pd *ibv_alloc_pd(struct ibv_context *context);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2366
 
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2367
 /**
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2368
+ * ibv_alloc_shpd - Mark given protection domain as shareable & return shpd structure
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2369
+ *                  that identify it.
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2370
+ *                  the storage for shpd structure needs to be provided by client.
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2371
+ */
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2372
+struct ibv_shpd *ibv_alloc_shpd(struct ibv_pd *pd, uint64_t share_key, struct ibv_shpd *shpd);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2373
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2374
+/**
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2375
+ * ibv_share_pd - share the protection domain identified by given shpd struct & return a
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2376
+ *                process linked ibv_pd struct.
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2377
+ *                the share_key given should match with the share_key specifed in alloc_shpd().
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2378
+ */
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2379
+struct ibv_pd *ibv_share_pd(struct ibv_context *context, struct ibv_shpd *shpd, uint64_t share_key);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2380
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2381
+/**
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2382
  * ibv_dealloc_pd - Free a protection domain
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2383
  */
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2384
 int ibv_dealloc_pd(struct ibv_pd *pd);
2550
02b339f70efd 16485129 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 2532
diff changeset
  2385
@@ -869,11 +952,27 @@
817
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2386
 			  size_t length, int access);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2387
 
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2388
 /**
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2389
+ * ibv_reg_mr_relaxed - Register a memory region using FMR
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2390
+ */
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2391
+struct ibv_mr *ibv_reg_mr_relaxed(struct ibv_pd *pd, void *addr,
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2392
+			  size_t length, int access);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2393
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2394
+/**
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2395
  * ibv_dereg_mr - Deregister a memory region
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2396
  */
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2397
 int ibv_dereg_mr(struct ibv_mr *mr);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2398
 
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2399
 /**
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2400
+ * ibv_dereg_mr_relaxed - Deregister a memory region registered using FMR
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2401
+ */
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2402
+int ibv_dereg_mr_relaxed(struct ibv_mr *mr);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2403
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2404
+/**
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2405
+ * ibv_flush_relaxed_mr - Flush all free mr's in the protection domain
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2406
+ */
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2407
+int ibv_flush_relaxed_mr(struct ibv_pd *pd);
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2408
+
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2409
+/**
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2410
  * ibv_create_comp_channel - Create a completion event channel
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2411
  */
f45ca7242301 7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents: 741
diff changeset
  2412
 struct ibv_comp_channel *ibv_create_comp_channel(struct ibv_context *context);
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2413
diff -r -u /tmp/846623/libibverbs-1.1.4/include/infiniband/arch.h libibverbs-1.1.4/include/infiniband/arch.h
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2414
--- /tmp/846623/libibverbs-1.1.4/include/infiniband/arch.h	Wed Sep 16 04:27:22 2009
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2415
+++ libibverbs-1.1.4/include/infiniband/arch.h	Fri Feb 11 04:02:20 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2416
@@ -34,6 +34,7 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2417
 #define INFINIBAND_ARCH_H
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2418
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2419
 #include <stdint.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2420
+#if !(defined(__SVR4) && defined(__sun))
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2421
 #include <endian.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2422
 #include <byteswap.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2423
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2424
@@ -46,6 +47,9 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2425
 #else
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2426
 #error __BYTE_ORDER is neither __LITTLE_ENDIAN nor __BIG_ENDIAN
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2427
 #endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2428
+#else
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2429
+#include <infiniband/ofa_solaris.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2430
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2431
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2432
 /*
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2433
  * Architecture-specific defines.  Currently, an architecture is
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2434
diff -r -u /tmp/846623/libibverbs-1.1.4/Makefile.in libibverbs-1.1.4/Makefile.in
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2435
--- /tmp/846623/libibverbs-1.1.4/Makefile.in	Thu Feb  3 01:53:23 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2436
+++ libibverbs-1.1.4/Makefile.in	Fri Feb 11 05:27:45 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2437
@@ -90,7 +90,8 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2438
 	src_libibverbs_la-compat-1_0.lo src_libibverbs_la-device.lo \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2439
 	src_libibverbs_la-init.lo src_libibverbs_la-marshall.lo \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2440
 	src_libibverbs_la-memory.lo src_libibverbs_la-sysfs.lo \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2441
-	src_libibverbs_la-verbs.lo src_libibverbs_la-enum_strs.lo
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2442
+	src_libibverbs_la-verbs.lo src_libibverbs_la-enum_strs.lo \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2443
+	src_libibverbs_la-solaris.lo
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2444
 src_libibverbs_la_OBJECTS = $(am_src_libibverbs_la_OBJECTS)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2445
 AM_V_lt = $(am__v_lt_$(V))
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2446
 am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2447
@@ -313,11 +314,11 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2448
 INCLUDES = -I$(srcdir)/include
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2449
 lib_LTLIBRARIES = src/libibverbs.la
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2450
 AM_CFLAGS = -g -Wall -D_GNU_SOURCE
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2451
-src_libibverbs_la_CFLAGS = $(AM_CFLAGS) -DIBV_CONFIG_DIR=\"$(sysconfdir)/libibverbs.d\"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2452
+src_libibverbs_la_CFLAGS = $(AM_CFLAGS) -DIBV_CONFIG_DIR=\"$(datadir)/libibverbs.d\"
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2453
 libibverbs_version_script = @LIBIBVERBS_VERSION_SCRIPT@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2454
 src_libibverbs_la_SOURCES = src/cmd.c src/compat-1_0.c src/device.c src/init.c \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2455
 			    src/marshall.c src/memory.c src/sysfs.c src/verbs.c \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2456
-			    src/enum_strs.c
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2457
+			    src/enum_strs.c src/solaris_compatability src/verbs.c
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2458
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2459
 src_libibverbs_la_LDFLAGS = -version-info 1 -export-dynamic \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2460
     $(libibverbs_version_script)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2461
@@ -340,6 +341,7 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2462
 libibverbsincludedir = $(includedir)/infiniband
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2463
 libibverbsinclude_HEADERS = include/infiniband/arch.h include/infiniband/driver.h \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2464
     include/infiniband/kern-abi.h include/infiniband/opcode.h include/infiniband/verbs.h \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2465
+	include/infiniband/ofa_solaris.h \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2466
     include/infiniband/sa-kern-abi.h include/infiniband/sa.h include/infiniband/marshall.h
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2467
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2468
 man_MANS = man/ibv_asyncwatch.1 man/ibv_devices.1 man/ibv_devinfo.1	\
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2469
@@ -368,6 +370,7 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2470
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2471
 EXTRA_DIST = include/infiniband/driver.h include/infiniband/kern-abi.h \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2472
     include/infiniband/opcode.h include/infiniband/verbs.h include/infiniband/marshall.h \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2473
+	 include/infiniband/ofa_solaris.h \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2474
     include/infiniband/sa-kern-abi.h include/infiniband/sa.h \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2475
     src/ibverbs.h examples/pingpong.h \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2476
     src/libibverbs.map libibverbs.spec.in $(man_MANS)
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2477
@@ -440,8 +443,8 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2478
 	  else :; fi; \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2479
 	done; \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2480
 	test -z "$$list2" || { \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2481
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2482
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2483
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) -m 755 $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2484
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) -m 755 $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2485
 	}
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2486
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2487
 uninstall-libLTLIBRARIES:
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2488
@@ -486,8 +489,8 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2489
 	while read type dir files; do \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2490
 	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2491
 	    test -z "$$files" || { \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2492
-	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2493
-	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2494
+	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) -m 755 $$files '$(DESTDIR)$(bindir)$$dir'"; \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2495
+	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) -m 755 $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2496
 	    } \
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2497
 	; done
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2498
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2499
@@ -554,6 +557,7 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2500
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/src_libibverbs_la-memory.Plo@am__quote@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2501
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/src_libibverbs_la-sysfs.Plo@am__quote@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2502
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/src_libibverbs_la-verbs.Plo@am__quote@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2503
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/src_libibverbs_la-solaris.Plo@am__quote@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2504
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/srq_pingpong.Po@am__quote@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2505
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uc_pingpong.Po@am__quote@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2506
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ud_pingpong.Po@am__quote@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2507
@@ -654,6 +658,14 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2508
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2509
 @am__fastdepCC_FALSE@	$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libibverbs_la_CFLAGS) $(CFLAGS) -c -o src_libibverbs_la-enum_strs.lo `test -f 'src/enum_strs.c' || echo '$(srcdir)/'`src/enum_strs.c
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2510
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2511
+src_libibverbs_la-solaris.lo: src/solaris_compatibility.c
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2512
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libibverbs_la_CFLAGS) $(CFLAGS) -MT src_libibverbs_la-solaris.lo -MD -MP -MF $(DEPDIR)/src_libibverbs_la-solaris.Tpo -c -o src_libibverbs_la-solaris.lo `test -f 'src/solaris_compatibility.c' || echo '$(srcdir)/'`src/solaris_compatibility.c
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2513
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/src_libibverbs_la-solaris.Tpo $(DEPDIR)/src_libibverbs_la-solaris.Plo
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2514
+@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2515
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/solaris_compatibility.c' object='src_libibverbs_la-solaris.lo' libtool=yes @AMDEPBACKSLASH@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2516
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2517
+@am__fastdepCC_FALSE@	$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libibverbs_la_CFLAGS) $(CFLAGS) -c -o src_libibverbs_la-solaris.lo `test -f 'src/solaris_compatibility.c' || echo '$(srcdir)/'`src/solaris_compatibility.c
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2518
+
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2519
 asyncwatch.o: examples/asyncwatch.c
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2520
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT asyncwatch.o -MD -MP -MF $(DEPDIR)/asyncwatch.Tpo -c -o asyncwatch.o `test -f 'examples/asyncwatch.c' || echo '$(srcdir)/'`examples/asyncwatch.c
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2521
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/asyncwatch.Tpo $(DEPDIR)/asyncwatch.Po
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2522
@@ -669,7 +681,6 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2523
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='examples/asyncwatch.c' object='asyncwatch.obj' libtool=no @AMDEPBACKSLASH@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2524
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2525
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o asyncwatch.obj `if test -f 'examples/asyncwatch.c'; then $(CYGPATH_W) 'examples/asyncwatch.c'; else $(CYGPATH_W) '$(srcdir)/examples/asyncwatch.c'; fi`
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2526
-
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2527
 device_list.o: examples/device_list.c
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2528
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT device_list.o -MD -MP -MF $(DEPDIR)/device_list.Tpo -c -o device_list.o `test -f 'examples/device_list.c' || echo '$(srcdir)/'`examples/device_list.c
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2529
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/device_list.Tpo $(DEPDIR)/device_list.Po
3821
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2530
diff -r -u /tmp/846623/libibverbs-1.1.4/examples/uc_pingpong.c libibverbs-1.1.4/examples/uc_pingpong.c
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2531
--- /tmp/846623/libibverbs-1.1.4/examples/uc_pingpong.c	Thu Mar 10 06:58:21 2011
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2532
+++ libibverbs-1.1.4/examples/uc_pingpong.c	Tue Jan  6 10:05:55 2015
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2533
@@ -144,7 +144,7 @@
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2534
 
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2535
 	n = getaddrinfo(servername, service, &hints, &res);
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2536
 
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2537
-	if (n < 0) {
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2538
+	if (n != 0) {
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2539
 		fprintf(stderr, "%s for %s:%d\n", gai_strerror(n), servername, port);
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2540
 		free(service);
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2541
 		return NULL;
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2542
@@ -219,7 +219,7 @@
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2543
 
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2544
 	n = getaddrinfo(NULL, service, &hints, &res);
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2545
 
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2546
-	if (n < 0) {
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2547
+	if (n != 0) {
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2548
 		fprintf(stderr, "%s for port %d\n", gai_strerror(n), port);
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2549
 		free(service);
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2550
 		return NULL;
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2551
diff -r -u /tmp/846623/libibverbs-1.1.4/examples/asyncwatch.c libibverbs-1.1.4/examples/asyncwatch.c
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2552
--- /tmp/846623/libibverbs-1.1.4/examples/asyncwatch.c	Thu Mar 10 06:58:21 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2553
+++ libibverbs-1.1.4/examples/asyncwatch.c	Fri Feb 11 04:02:18 2011
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2554
@@ -35,11 +35,72 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2555
 #endif /* HAVE_CONFIG_H */
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2556
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2557
 #include <stdio.h>
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2558
+#include <stdlib.h>
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2559
+#include <ctype.h>
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2560
+#include <getopt.h>
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2561
+#include <signal.h>
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2562
+#include <string.h>
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2563
+#include <strings.h>
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2564
+#if !(defined(__SVR4) && defined(__sun))
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2565
 #include <endian.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2566
 #include <byteswap.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2567
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2568
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2569
 #include <infiniband/verbs.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2570
 
2532
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2571
+#define IS_PORT_EVENT(event)				\
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2572
+	((event == IBV_EVENT_PORT_ACTIVE) ||		\
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2573
+	(event == IBV_EVENT_PORT_ERR ) ||		\
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2574
+	(event == IBV_EVENT_LID_CHANGE) ||		\
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2575
+	(event == IBV_EVENT_PKEY_CHANGE) ||		\
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2576
+	(event == IBV_EVENT_SM_CHANGE) ||		\
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2577
+	(event == IBV_EVENT_GID_CHANGE) ||		\
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2578
+	(event == IBV_EVENT_CLIENT_REREGISTER))
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2579
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2580
+#define IS_SM_EVENT(event)				\
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2581
+	((event == IBV_EVENT_MCG_CREATED) ||		\
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2582
+	(event == IBV_EVENT_MCG_DELETED) ||		\
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2583
+	(event == IBV_EVENT_GID_AVAIL) ||		\
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2584
+	(event == IBV_EVENT_GID_UNAVAIL))
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2585
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2586
+#define IS_QP_EVENT(event)				\
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2587
+	((event == IBV_EVENT_CQ_ERR) ||			\
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2588
+	(event == IBV_EVENT_QP_FATAL) ||		\
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2589
+	(event == IBV_EVENT_QP_REQ_ERR) ||		\
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2590
+	(event == IBV_EVENT_COMM_EST) ||		\
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2591
+	(event == IBV_EVENT_SQ_DRAINED) ||		\
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2592
+	(event == IBV_EVENT_PATH_MIG) ||		\
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2593
+	(event == IBV_EVENT_PATH_MIG_ERR) ||		\
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2594
+	(event == IBV_EVENT_QP_LAST_WQE_REACHED) ||	\
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2595
+	(event == IBV_EVENT_QP_ACCESS_ERR))
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2596
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2597
+#define IS_CQ_EVENT(event)				\
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2598
+	(event == IBV_EVENT_CQ_ERR)
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2599
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2600
+#define IS_SRQ_EVENT(event)				\
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2601
+	((event == IBV_EVENT_SRQ_ERR) ||		\
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2602
+	(event == IBV_EVENT_SRQ_LIMIT_REACHED))
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2603
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2604
+#define IS_CA_EVENT(event)				\
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2605
+	(event == IBV_EVENT_DEVICE_FATAL)
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2606
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2607
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2608
+struct ibv_device	**dev_list;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2609
+struct ibv_context	*context;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2610
+struct ibv_async_event	event;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2611
+union ibv_gid		*gids = NULL;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2612
+uint_t			num_gids = 0;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2613
+ibv_sm_event_type_t	events;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2614
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2615
+static struct option long_options[] = {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2616
+    {"sm",		0, 0, 's'},
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2617
+    {"GUID",		0, 0, 'G'},
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2618
+    {"MCG",		0, 0, 'M'},
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2619
+    {"port",		1, 0, 'p'},
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2620
+    {0, 0, 0, 0}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2621
+};
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2622
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2623
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2624
 static const char *event_name_str(enum ibv_event_type event_type)
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2625
 {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2626
 	switch (event_type) {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2627
@@ -59,7 +120,14 @@
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2628
 		return "IBV_EVENT_CLIENT_REREGISTER";
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2629
 	case IBV_EVENT_GID_CHANGE:
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2630
 		return "IBV_EVENT_GID_CHANGE";
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2631
-
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2632
+	case IBV_EVENT_MCG_CREATED:
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2633
+		return "IBV_EVENT_MCG_CREATED";
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2634
+	case IBV_EVENT_MCG_DELETED:
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2635
+		return "IBV_EVENT_MCG_DELETED";
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2636
+	case IBV_EVENT_GID_AVAIL:
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2637
+		return "IBV_EVENT_GID_AVAIL";
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2638
+	case IBV_EVENT_GID_UNAVAIL:
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2639
+		return "IBV_EVENT_GID_UNAVAIL";
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2640
 	case IBV_EVENT_CQ_ERR:
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2641
 	case IBV_EVENT_QP_FATAL:
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2642
 	case IBV_EVENT_QP_REQ_ERR:
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2643
@@ -76,15 +144,173 @@
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2644
 	}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2645
 }
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2646
 
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2647
-int main(int argc, char *argv[])
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2648
+static void catch_signal(int sig_num)
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2649
 {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2650
-	struct ibv_device **dev_list;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2651
-	struct ibv_context *context;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2652
-	struct ibv_async_event event;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2653
+	ibv_unregister_sm_events(context, events, num_gids, gids);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2654
+	if (gids)
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2655
+		free(gids);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2656
+	ibv_close_device(context);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2657
+	(void) ibv_free_device_list(dev_list);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2658
+	exit (0);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2659
+}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2660
 
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2661
-	/* Force line-buffering in case stdout is redirected */
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2662
-	setvbuf(stdout, NULL, _IOLBF, 0);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2663
+static void usage(const char *argv0)
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2664
+{
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2665
+	printf("Usage:\n");
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2666
+	printf("\n");
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2667
+	printf("Options:\n");
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2668
+	printf("[ -s, --sm<gid> ]\t\tsm event\n");
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2669
+	printf("[ -M, --M ]\t\t\tsm event for MGID (multicast)\n");
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2670
+	printf("[ -G, --G ]\t\t\tsm event for UGID (unicast)\n");
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2671
+	printf("[ -p, --port=<port> ]\t\t(default 1)\n");
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2672
+	printf("\nExamples;\n");
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2673
+	printf("ibv_asyncwatch -s\t\t# monitor event=IBV_SM_EVENT_ALL\n");
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2674
+	printf("ibv_asyncwatch -G -s\t\t# monitor event="
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2675
+	    "IBV_SM_EVENT_UGID_ALL\n");
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2676
+	printf("ibv_asyncwatch -M -s\t\t# monitor event="
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2677
+	    "IBV_SM_EVENT_MGID_ALL\n");
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2678
+	printf("ibv_asyncwatch -G -s0x0021280001a0e4d9,0x0021280001a0e4da\n");
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2679
+	printf("\t\t\t\t# monitor event=IBV_SM_EVENT_UGID\n");
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2680
+	printf("ibv_asyncwatch -M -s0xff12:4001:ffff::c:2238,");
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2681
+	printf("0xff12:ffff::38:220c\n");
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2682
+	printf("\t\t\t\t# monitor event=IBV_SM_EVENT_MGID\n");
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2683
+}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2684
 
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2685
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2686
+uint_t get_gids(char *argptr, uint64_t subnet_prefix)
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2687
+{
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2688
+	char		*curr, *next;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2689
+	char		*guid_str_p1, *guid_str_p2 = NULL;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2690
+	int		i = 0;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2691
+	int		data_num;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2692
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2693
+	for (curr = argptr; curr; curr = next, i++) {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2694
+		next = strchr(curr, ',');
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2695
+		if (next)
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2696
+			next++;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2697
+        }
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2698
+	data_num = i;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2699
+	if (data_num == 0)
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2700
+		return (0);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2701
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2702
+	gids = (union ibv_gid *)calloc(data_num, sizeof (union ibv_gid));
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2703
+	guid_str_p1 = malloc(strlen(argptr));
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2704
+	strncpy(guid_str_p1, argptr, strlen(argptr));
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2705
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2706
+	i = 0;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2707
+	guid_str_p2 = strtok(guid_str_p1, (const char *)",");
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2708
+	while (guid_str_p2 != NULL) {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2709
+		gids[i].global.subnet_prefix = subnet_prefix;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2710
+		gids[i].global.interface_id =
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2711
+		    htonll((uint64_t)strtoull(guid_str_p2, 0, 0));
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2712
+		i++;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2713
+		guid_str_p2 = strtok(NULL, (const char *)",");
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2714
+	}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2715
+	free (guid_str_p1);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2716
+	return (data_num);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2717
+}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2718
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2719
+void process_one_mcg_gid(union ibv_gid *gid, char *mcg_str)
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2720
+{
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2721
+	char		*token, *token_p, half_token[3];
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2722
+	uint8_t		mcg_gid[16];
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2723
+	int		i, j = 0, num_data = -1;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2724
+	char		*curr, *next;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2725
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2726
+	/* find out how many two-byte data from command line input */
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2727
+	for (curr = mcg_str; curr; curr = next, num_data++) {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2728
+		next = strchr(curr, ':');
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2729
+		if (next)
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2730
+			next++;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2731
+        }
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2732
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2733
+	if (num_data > 8) {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2734
+		fprintf(stderr, "Invalid MGID input format: %s\n", mcg_str);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2735
+		exit (-1);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2736
+	}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2737
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2738
+	curr = mcg_str + 2;	/* Skip past 0x */
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2739
+	while ((token = strsep(&curr, ":")) != NULL && j < 15) {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2740
+		if (strncmp(token, "\0", 1) == 0) {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2741
+			/* We have :: in the input */
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2742
+			for (i = 0; i < 8 - num_data; i++) {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2743
+				mcg_gid[j++] = 0;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2744
+				mcg_gid[j++] = 0;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2745
+			}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2746
+		} else {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2747
+			if (strlen(token) < 3) {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2748
+				mcg_gid[j++] = 0;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2749
+				mcg_gid[j++] =
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2750
+				    (uint8_t)strtoll(token, NULL, 16);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2751
+			} else {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2752
+				memset(half_token, 0, 3);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2753
+				token_p = token;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2754
+				if (strlen(token) == 3) {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2755
+					strncpy(half_token, token, 1);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2756
+					token_p += 1;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2757
+				} else {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2758
+					strncpy(half_token, token, 2);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2759
+					token_p += 2;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2760
+				}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2761
+				mcg_gid[j++] = (uint8_t)strtol(half_token,
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2762
+				    NULL, 16);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2763
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2764
+				mcg_gid[j++] = (uint8_t)strtol(token_p,
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2765
+				    NULL, 16);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2766
+			}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2767
+		}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2768
+	}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2769
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2770
+	memcpy(gid->raw, mcg_gid, 16);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2771
+}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2772
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2773
+uint_t get_mcgs(char *argptr, uint64_t subnet_prefix)
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2774
+{
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2775
+	char            *curr, *next;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2776
+	char		*mcg_str_p1, *mcg_str_p2 = NULL;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2777
+	int		i = 0;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2778
+	int		data_num;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2779
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2780
+	for (curr = argptr; curr; curr = next, i++) {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2781
+		next = strchr(curr, ',');
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2782
+		if (next)
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2783
+			next++;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2784
+        }
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2785
+	data_num = i;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2786
+	if (data_num == 0)
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2787
+		return (0);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2788
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2789
+	gids = (union ibv_gid *)calloc(data_num, sizeof (union ibv_gid));
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2790
+	mcg_str_p1 = malloc(strlen(argptr));
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2791
+	strncpy(mcg_str_p1, argptr, strlen(argptr));
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2792
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2793
+	i = 0;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2794
+	mcg_str_p2 = strtok(mcg_str_p1, (const char *)",");
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2795
+	while (mcg_str_p2 != NULL) {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2796
+		if (strncmp(mcg_str_p2, "0xff", 4) != 0) {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2797
+			fprintf(stderr, "Invalid MGID input format: %s\n",
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2798
+			    mcg_str_p2);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2799
+			exit (-1);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2800
+		}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2801
+		process_one_mcg_gid(&gids[i], mcg_str_p2);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2802
+		i++;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2803
+		mcg_str_p2 = strtok(NULL, (const char *)",");
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2804
+	}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2805
+	free(mcg_str_p1);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2806
+	return (data_num);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2807
+}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2808
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2809
+int main(int argc, char *argv[])
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2810
+{
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2811
+	int		c;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2812
+	int		ret;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2813
+	uint_t		port = 1;	/* default */
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2814
+	uint_t		do_sm_event_register = 0;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2815
+	union ibv_gid	sgid;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2816
+	uint64_t	subnet_prefix = 0ULL;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2817
+	int		mcgflag = 0;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2818
+	int		guidflag = 0;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2819
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2820
 	dev_list = ibv_get_device_list(NULL);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2821
 	if (!dev_list) {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2822
 		perror("Failed to get IB devices list");
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2823
@@ -103,19 +329,111 @@
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2824
 		return 1;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2825
 	}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2826
 
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2827
-	printf("%s: async event FD %d\n",
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2828
+	printf("\n%s: async event FD %d\n\n",
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2829
 	       ibv_get_device_name(*dev_list), context->async_fd);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2830
 
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2831
+	ibv_query_gid(context, port, 0, &sgid);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2832
+	subnet_prefix = sgid.global.subnet_prefix;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2833
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2834
+	while ((c = getopt_long(argc, argv, "p:GMs::t:", long_options, NULL))
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2835
+	    != -1) {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2836
+		switch(c) {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2837
+			case 'G':
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2838
+				guidflag = 1;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2839
+				break;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2840
+			case 'M':
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2841
+				mcgflag = 1;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2842
+				break;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2843
+			case 's':
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2844
+				do_sm_event_register = 1;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2845
+				if (mcgflag == 1)
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2846
+					num_gids =
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2847
+					    get_mcgs(optarg, subnet_prefix);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2848
+				else
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2849
+					num_gids =
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2850
+					    get_gids(optarg, subnet_prefix);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2851
+				break;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2852
+			case 'p':
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2853
+				port = strtol(optarg, NULL, 0);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2854
+				ibv_query_gid(context, port, 0, &sgid);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2855
+				subnet_prefix = sgid.global.subnet_prefix;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2856
+				break;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2857
+			default:
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2858
+				usage(argv[0]);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2859
+				return 1;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2860
+		}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2861
+	}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2862
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2863
+	/* Force line-buffering in case stdout is redirected */
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2864
+	setvbuf(stdout, NULL, _IOLBF, 0);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2865
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2866
+	if (num_gids) {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2867
+		if (mcgflag)
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2868
+			events = IBV_SM_EVENT_MGID;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2869
+		else
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2870
+			events = IBV_SM_EVENT_UGID;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2871
+	} else {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2872
+		if (mcgflag && guidflag)
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2873
+			events = IBV_SM_EVENT_ALL;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2874
+		else if (mcgflag)
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2875
+			events = IBV_SM_EVENT_MGID_ALL;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2876
+		else if (guidflag)
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2877
+			events = IBV_SM_EVENT_UGID_ALL;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2878
+		else
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2879
+			events = IBV_SM_EVENT_ALL;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2880
+	}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2881
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2882
+	if (do_sm_event_register)
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2883
+		ret = ibv_register_sm_events(context, events, num_gids, gids);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2884
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2885
+	(void) signal(SIGINT, catch_signal);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2886
+
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2887
 	while (1) {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2888
 		if (ibv_get_async_event(context, &event))
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2889
 			return 1;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2890
 
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2891
-		printf("  event_type %s (%d), port %d\n",
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2892
-		       event_name_str(event.event_type),
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2893
-		       event.event_type, event.element.port_num);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2894
+		if (IS_PORT_EVENT(event.event_type))
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2895
+			printf("Event: %s (%d), port %d\n",
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2896
+			    event_name_str(event.event_type),
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2897
+			    event.event_type, event.element.port_num);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2898
+		else if (IS_SM_EVENT(event.event_type))
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2899
+			printf("Event: %s (%d), gid " \
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2900
+			    "%02x%02x:%02x%02x:%02x%02x:%02x%02x:"\
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2901
+			    "%02x%02x:%02x%02x:%02x%02x:%02x%02x\n",
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2902
+			    event_name_str(event.event_type), event.event_type,
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2903
+			    event.element.gid.raw[0], event.element.gid.raw[1],
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2904
+			    event.element.gid.raw[2], event.element.gid.raw[3],
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2905
+			    event.element.gid.raw[4], event.element.gid.raw[5],
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2906
+			    event.element.gid.raw[6], event.element.gid.raw[7],
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2907
+			    event.element.gid.raw[8], event.element.gid.raw[9],
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2908
+			    event.element.gid.raw[10],
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2909
+			    event.element.gid.raw[11],
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2910
+			    event.element.gid.raw[12],
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2911
+			    event.element.gid.raw[13],
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2912
+			    event.element.gid.raw[14],
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2913
+			    event.element.gid.raw[15]);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2914
+		else if (IS_QP_EVENT(event.event_type))
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2915
+			printf("Event: %s (%d) QPN %d\n",
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2916
+			    event_name_str(event.event_type), event.event_type,
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2917
+			    event.element.qp->qp_num);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2918
+		else if (IS_CQ_EVENT(event.event_type))
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2919
+			printf("Event: %s (%d) CQE %d\n",
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2920
+			    event_name_str(event.event_type), event.event_type,
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2921
+			    event.element.cq->cqe);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2922
+		else if (IS_SRQ_EVENT(event.event_type))
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2923
+			printf("Event: %s (%d) SRQ %d\n",
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2924
+			    event_name_str(event.event_type), event.event_type,
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2925
+			    event.element.srq->handle);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2926
+		else
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2927
+			printf("Event: %s (%d)\n",
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2928
+			    event_name_str(event.event_type), event.event_type);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2929
 
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2930
 		ibv_ack_async_event(&event);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2931
-	}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2932
 
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2933
+		if (event.event_type == IBV_EVENT_GID_AVAIL) {
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2934
+			ret = ibv_gid_reachable(context, port,
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2935
+			    &event.element.gid, 0);
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2936
+		}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2937
+	}
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2938
 	return 0;
5b3dc1c8b85e PSARC 2012/384 Fast IB node death detection
Boris Chiu <Boris.Chiu@Oracle.COM>
parents: 2448
diff changeset
  2939
 }
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2940
diff -r -u /tmp/846623/libibverbs-1.1.4/examples/srq_pingpong.c libibverbs-1.1.4/examples/srq_pingpong.c
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2941
--- /tmp/846623/libibverbs-1.1.4/examples/srq_pingpong.c	Thu Mar 10 06:58:21 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2942
+++ libibverbs-1.1.4/examples/srq_pingpong.c	Wed Jun  8 09:46:34 2011
3821
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2943
@@ -165,8 +165,13 @@
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2944
 
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2945
 	n = getaddrinfo(servername, service, &hints, &res);
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2946
 
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2947
-	if (n < 0) {
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2948
-		fprintf(stderr, "%s for %s:%d\n", gai_strerror(n), servername, port);
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2949
+	if (n != 0) {
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2950
+		if (n == EAI_NONAME)
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2951
+			fprintf(stderr,
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2952
+			    "Name or service not known for %s:%d\n", servername, port);
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2953
+		else
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2954
+			fprintf(stderr,
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2955
+			    "%s for %s:%d\n", gai_strerror(n), servername, port);
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2956
 		free(service);
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2957
 		return NULL;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2958
 	}
3821
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2959
@@ -253,7 +258,7 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2960
 
3821
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2961
 	n = getaddrinfo(NULL, service, &hints, &res);
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2962
 
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2963
-	if (n < 0) {
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2964
+	if (n != 0) {
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2965
 		fprintf(stderr, "%s for port %d\n", gai_strerror(n), port);
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2966
 		free(service);
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2967
 		return NULL;
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2968
diff -r -u /tmp/846623/libibverbs-1.1.4/examples/ud_pingpong.c libibverbs-1.1.4/examples/ud_pingpong.c
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2969
--- /tmp/846623/libibverbs-1.1.4/examples/ud_pingpong.c	Thu Mar 10 06:58:21 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2970
+++ libibverbs-1.1.4/examples/ud_pingpong.c	Wed Jun  8 09:46:34 2011
3821
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2971
@@ -143,8 +143,13 @@
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2972
 
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2973
 	n = getaddrinfo(servername, service, &hints, &res);
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2974
 
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2975
-	if (n < 0) {
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2976
-		fprintf(stderr, "%s for %s:%d\n", gai_strerror(n), servername, port);
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2977
+	if (n != 0) {
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2978
+		if (n == EAI_NONAME)
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2979
+			fprintf(stderr,
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2980
+			    "Name or service not known for %s:%d\n", servername, port);
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2981
+		else
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2982
+			fprintf(stderr,
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2983
+			    "%s for %s:%d\n", gai_strerror(n), servername, port);
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2984
 		free(service);
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2985
 		return NULL;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2986
 	}
3821
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2987
@@ -217,7 +222,7 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2988
 
3821
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2989
 	n = getaddrinfo(NULL, service, &hints, &res);
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2990
 
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2991
-	if (n < 0) {
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2992
+	if (n != 0) {
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2993
 		fprintf(stderr, "%s for port %d\n", gai_strerror(n), port);
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2994
 		free(service);
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2995
 		return NULL;
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2996
diff -r -u /tmp/846623/libibverbs-1.1.4/examples/rc_pingpong.c libibverbs-1.1.4/examples/rc_pingpong.c
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2997
--- /tmp/846623/libibverbs-1.1.4/examples/rc_pingpong.c	Thu Mar 10 06:58:21 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  2998
+++ libibverbs-1.1.4/examples/rc_pingpong.c	Wed Jun  8 09:46:34 2011
3821
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  2999
@@ -155,8 +155,13 @@
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  3000
 
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  3001
 	n = getaddrinfo(servername, service, &hints, &res);
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  3002
 
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  3003
-	if (n < 0) {
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  3004
-		fprintf(stderr, "%s for %s:%d\n", gai_strerror(n), servername, port);
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  3005
+	if (n != 0) {
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  3006
+		if (n == EAI_NONAME)
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  3007
+			fprintf(stderr,
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  3008
+			    "Name or service not known for %s:%d\n", servername, port);
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  3009
+		else
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  3010
+			fprintf(stderr,
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  3011
+			    "%s for %s:%d\n", gai_strerror(n), servername, port);
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  3012
 		free(service);
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  3013
 		return NULL;
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  3014
 	}
3821
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  3015
@@ -230,7 +235,7 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  3016
 
3821
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  3017
 	n = getaddrinfo(NULL, service, &hints, &res);
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  3018
 
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  3019
-	if (n < 0) {
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  3020
+	if (n != 0) {
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  3021
 		fprintf(stderr, "%s for port %d\n", gai_strerror(n), port);
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  3022
 		free(service);
5a4c2272210e 18368329 Should use snprintf to convert numeric link_layer to string for ibstat to work
boris.chiu@oracle.com
parents: 2871
diff changeset
  3023
 		return NULL;
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  3024
diff -r -u /tmp/846623/libibverbs-1.1.4/examples/device_list.c libibverbs-1.1.4/examples/device_list.c
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  3025
--- /tmp/846623/libibverbs-1.1.4/examples/device_list.c	Sun Nov  1 06:47:19 2009
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  3026
+++ libibverbs-1.1.4/examples/device_list.c	Fri Feb 11 04:02:18 2011
851
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3027
@@ -36,16 +36,32 @@
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  3028
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  3029
 #include <stdio.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  3030
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  3031
+#if !(defined(__SVR4) && defined(__sun))
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  3032
 #include <endian.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  3033
 #include <byteswap.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  3034
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  3035
 
851
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3036
+#include <stdlib.h>
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3037
+#include <string.h>
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  3038
 #include <infiniband/verbs.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  3039
 #include <infiniband/arch.h>
851
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3040
 
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3041
+/*
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3042
+ * Structure to hold the data printed by ibv_devices.
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3043
+ */
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3044
+typedef struct dev_print_s {
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3045
+	char			name[24];
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3046
+	unsigned long long	guid;
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3047
+	uint8_t			is_pf;
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3048
+} dev_print_t;
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3049
+
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3050
 int main(int argc, char *argv[])
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3051
 {
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3052
 	struct ibv_device **dev_list;
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3053
 	int num_devices, i;
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3054
+	unsigned long long	guid_external;
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3055
+	dev_print_t	*dp;
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3056
+	int	print_col = 0;
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3057
 
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3058
 	dev_list = ibv_get_device_list(&num_devices);
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3059
 	if (!dev_list) {
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3060
@@ -53,15 +69,45 @@
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3061
 		return 1;
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3062
 	}
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3063
 
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3064
-	printf("    %-16s\t   node GUID\n", "device");
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3065
-	printf("    %-16s\t----------------\n", "------");
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3066
+	dp = (dev_print_t *)malloc(sizeof(dev_print_t) * num_devices);
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3067
 
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3068
-	for (i = 0; i < num_devices; ++i) {
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3069
-		printf("    %-16s\t%016llx\n",
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3070
-		       ibv_get_device_name(dev_list[i]),
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3071
-		       (unsigned long long) ntohll(ibv_get_device_guid(dev_list[i])));
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3072
+	for (i = (num_devices - 1); i >= 0; --i) {
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3073
+		strcpy(dp[i].name, ibv_get_device_name(dev_list[i]));
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3074
+
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3075
+		dp[i].guid = (unsigned long long) ntohll(ibv_get_device_guid(dev_list[i]));
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3076
+		guid_external = (unsigned long long) ntohll(ibv_get_device_guid_external(dev_list[i]));
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3077
+		if (dp[i].guid != guid_external) {
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3078
+			print_col = 1;
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3079
+			dp[i].is_pf = 0;
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3080
+		} else
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3081
+			dp[i].is_pf = 1;
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3082
 	}
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3083
 
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3084
+	if (print_col) {
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3085
+		printf("    %-16s\t   node GUID\t        type\n", "device");
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3086
+		printf("    %-16s\t----------------\t----\n", "------");
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3087
+		/* First print PFs */
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3088
+		for (i = (num_devices - 1); i >= 0; --i) {
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3089
+			if (dp[i].is_pf)
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3090
+				printf("    %-16s\t%016llx\t %s\n",
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3091
+					dp[i].name, dp[i].guid, "PF");
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3092
+		}
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3093
+		/* print VFs */
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3094
+		for (i = (num_devices - 1); i >= 0; --i) {
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3095
+			if (!dp[i].is_pf)
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3096
+				printf("    %-16s\t%016llx\t %s\n",
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3097
+					dp[i].name, dp[i].guid, "VF");
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3098
+		}
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3099
+	} else {
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3100
+		printf("    %-16s\t   node GUID\n", "device");
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3101
+		printf("    %-16s\t----------------\n", "------");
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3102
+		for (i = (num_devices - 1); i >= 0; --i) {
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3103
+			printf("    %-16s\t%016llx\n",
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3104
+				dp[i].name, dp[i].guid);
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3105
+		}
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3106
+	}
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3107
+	free(dp);
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3108
+
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3109
 	ibv_free_device_list(dev_list);
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3110
 
5d9119e2b7e1 PSARC/2012/200 OFUV SR-IOV support
Alex Chiu <Alex.Chiu@Oracle.COM>
parents: 817
diff changeset
  3111
 	return 0;
369
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  3112
diff -r -u /tmp/846623/libibverbs-1.1.4/examples/devinfo.c libibverbs-1.1.4/examples/devinfo.c
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  3113
--- /tmp/846623/libibverbs-1.1.4/examples/devinfo.c	Thu Mar 10 06:58:21 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  3114
+++ libibverbs-1.1.4/examples/devinfo.c	Fri Feb 11 04:02:19 2011
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  3115
@@ -41,8 +41,10 @@
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  3116
 #include <string.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  3117
 #include <getopt.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  3118
 #include <netinet/in.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  3119
+#if !(defined(__SVR4) && defined(__sun))
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  3120
 #include <endian.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  3121
 #include <byteswap.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  3122
+#endif
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  3123
 
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  3124
 #include <infiniband/verbs.h>
cc8c00719da9 PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff changeset
  3125
 #include <infiniband/driver.h>