components/open-fabrics/libibverbs/patches/005-libibverbs-xrc.patch
author Sharath M Srinivasan <sharath.srinivasan@oracle.com>
Thu, 13 Apr 2017 20:30:48 -0700
changeset 7865 22ec3267b2a3
permissions -rw-r--r--
PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS 25759055 OFUV (Userland) support for XRC APIs 22595881 defer librdmacm allocation of PD on ADDRESS_RESOLVED event
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7865
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
     1
#This patch was developed both in-house and from outside. We plan to submit it
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
     2
#upstream, but do not yet have a target date for doing so
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
     3
#
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
     4
# HG changeset patch
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
     5
# Parent  f8684a1d3f02b9cc10a686daa8659805384ba51a
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
     6
25759055 OFUV (Userland) support for XRC APIs
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
     7
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
     8
diff -r f8684a1d3f02 Makefile.am
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
     9
--- a/Makefile.am	Mon Nov 21 11:48:20 2016 -0800
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    10
+++ b/Makefile.am	Mon Mar 20 14:32:42 2017 -0700
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    11
@@ -45,7 +45,8 @@
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    12
 
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    13
 libibverbsinclude_HEADERS = include/infiniband/arch.h include/infiniband/driver.h \
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    14
     include/infiniband/kern-abi.h include/infiniband/opcode.h include/infiniband/verbs.h \
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    15
-    include/infiniband/sa-kern-abi.h include/infiniband/sa.h include/infiniband/marshall.h
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    16
+    include/infiniband/sa-kern-abi.h include/infiniband/sa.h include/infiniband/marshall.h \
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    17
+    include/infiniband/ofa_verbs.h
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    18
 
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    19
 man_MANS = man/ibv_asyncwatch.1 man/ibv_devices.1 man/ibv_devinfo.1	\
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    20
     man/ibv_shpd_pingpong.1			\
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    21
@@ -64,7 +65,8 @@
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    22
     man/ibv_query_srq.3 man/ibv_rate_to_mult.3 man/ibv_reg_mr.3		\
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    23
     man/ibv_req_notify_cq.3 man/ibv_resize_cq.3 man/ibv_rate_to_mbps.3  \
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    24
     man/ibv_create_qp_ex.3 man/ibv_create_srq_ex.3 man/ibv_open_xrcd.3  \
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    25
-    man/ibv_get_srq_num.3 man/ibv_open_qp.3
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    26
+    man/ibv_get_srq_num.3 man/ibv_open_qp.3 man/ibv_create_xsrq.3       \
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    27
+    man/ibv_xsrq_pingpong.1
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    28
 
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    29
 DEBIAN = debian/changelog debian/compat debian/control debian/copyright \
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    30
     debian/ibverbs-utils.install debian/libibverbs1.install \
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    31
diff -r f8684a1d3f02 Makefile.in
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    32
--- a/Makefile.in	Mon Nov 21 11:48:20 2016 -0800
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    33
+++ b/Makefile.in	Mon Mar 20 14:32:42 2017 -0700
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    34
@@ -476,7 +476,8 @@
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    35
 libibverbsincludedir = $(includedir)/infiniband
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    36
 libibverbsinclude_HEADERS = include/infiniband/arch.h include/infiniband/driver.h \
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    37
     include/infiniband/kern-abi.h include/infiniband/opcode.h include/infiniband/verbs.h \
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    38
-    include/infiniband/sa-kern-abi.h include/infiniband/sa.h include/infiniband/marshall.h include/infiniband/ofa_solaris.h
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    39
+    include/infiniband/sa-kern-abi.h include/infiniband/sa.h include/infiniband/marshall.h \
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    40
+    include/infiniband/ofa_solaris.h include/infiniband/ofa_verbs.h
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    41
 
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    42
 man_MANS = man/ibv_asyncwatch.1 man/ibv_devices.1 man/ibv_devinfo.1	\
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    43
     man/ibv_shpd_pingpong.1			\
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    44
@@ -495,7 +496,8 @@
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    45
     man/ibv_query_srq.3 man/ibv_rate_to_mult.3 man/ibv_reg_mr.3		\
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    46
     man/ibv_req_notify_cq.3 man/ibv_resize_cq.3 man/ibv_rate_to_mbps.3  \
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    47
     man/ibv_create_qp_ex.3 man/ibv_create_srq_ex.3 man/ibv_open_xrcd.3  \
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    48
-    man/ibv_get_srq_num.3 man/ibv_open_qp.3
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    49
+    man/ibv_get_srq_num.3 man/ibv_open_qp.3 man/ibv_create_xsrq.3       \
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    50
+    man/ibv_xsrq_pingpong.1
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    51
 
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    52
 DEBIAN = debian/changelog debian/compat debian/control debian/copyright \
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    53
     debian/ibverbs-utils.install debian/libibverbs1.install \
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    54
diff -r f8684a1d3f02 include/infiniband/ofa_verbs.h
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    55
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    56
+++ b/include/infiniband/ofa_verbs.h	Mon Mar 20 14:32:42 2017 -0700
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    57
@@ -0,0 +1,140 @@
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    58
+/*
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    59
+ * Copyright (c) 2004, 2005 Topspin Communications.  All rights reserved.
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    60
+ * Copyright (c) 2004, 2011-2012 Intel Corporation.  All rights reserved.
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    61
+ * Copyright (c) 2005, 2006, 2007 Cisco Systems, Inc.  All rights reserved.
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    62
+ * Copyright (c) 2005 PathScale, Inc.  All rights reserved.
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    63
+ *
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    64
+ * This software is available to you under a choice of one of two
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    65
+ * licenses.  You may choose to be licensed under the terms of the GNU
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    66
+ * General Public License (GPL) Version 2, available from the file
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    67
+ * COPYING in the main directory of this source tree, or the
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    68
+ * OpenIB.org BSD license below:
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    69
+ *
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    70
+ *     Redistribution and use in source and binary forms, with or
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    71
+ *     without modification, are permitted provided that the following
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    72
+ *     conditions are met:
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    73
+ *
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    74
+ *	- Redistributions of source code must retain the above
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    75
+ *	  copyright notice, this list of conditions and the following
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    76
+ *	  disclaimer.
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    77
+ *
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    78
+ *	- Redistributions in binary form must reproduce the above
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    79
+ *	  copyright notice, this list of conditions and the following
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    80
+ *	  disclaimer in the documentation and/or other materials
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    81
+ *	  provided with the distribution.
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    82
+ *
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    83
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    84
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    85
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    86
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    87
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    88
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    89
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    90
+ * SOFTWARE.
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    91
+ */
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    92
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    93
+#ifndef INFINIBAND_OFA_VERBS_H
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    94
+#define INFINIBAND_OFA_VERBS_H
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    95
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    96
+struct ibv_srq_init_attr;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    97
+struct ibv_cq;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    98
+struct ibv_pd;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
    99
+struct ibv_qp_init_attr;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   100
+struct ibv_qp_attr;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   101
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   102
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   103
+#ifdef __GNUC__
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   104
+#define DEPRECATED  __attribute__((deprecated))
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   105
+#else
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   106
+#define DEPRECATED
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   107
+#endif
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   108
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   109
+/* XRC compatability layer */
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   110
+#define LEGACY_XRC_SRQ_HANDLE 0xffffffff
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   111
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   112
+struct ibv_xrc_domain {
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   113
+	struct ibv_context     *context;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   114
+	uint32_t		handle;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   115
+};
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   116
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   117
+struct ibv_srq_legacy {
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   118
+	struct ibv_context     *context;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   119
+	void		       *srq_context;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   120
+	struct ibv_pd	       *pd;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   121
+	uint32_t		handle;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   122
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   123
+	uint32_t		events_completed;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   124
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   125
+	uint32_t		xrc_srq_num_bin_compat;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   126
+	struct ibv_xrc_domain  *xrc_domain_bin_compat;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   127
+	struct ibv_cq	       *xrc_cq_bin_compat;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   128
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   129
+	pthread_mutex_t		mutex;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   130
+	pthread_cond_t		cond;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   131
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   132
+	void		       *ibv_srq;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   133
+	/*
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   134
+	 * Below fields are for legacy source compatibility. They reside
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   135
+	 * on the same offset as of those fields in struct ibv_srq.
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   136
+	 */
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   137
+	uint32_t		xrc_srq_num;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   138
+	struct ibv_xrc_domain  *xrc_domain;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   139
+	struct ibv_cq	       *xrc_cq;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   140
+};
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   141
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   142
+/**
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   143
+ * ibv_open_xrc_domain - open an XRC domain
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   144
+ * Returns a reference to an XRC domain.
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   145
+ *
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   146
+ * @context: Device context
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   147
+ * @fd: descriptor for inode associated with the domain
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   148
+ *     If fd == -1, no inode is associated with the domain; in this ca= se,
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   149
+ *     the only legal value for oflag is O_CREAT
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   150
+ *
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   151
+ * @oflag: oflag values are constructed by OR-ing flags from the following list
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   152
+ *
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   153
+ * O_CREAT
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   154
+ *     If a domain belonging to device named by context is already associated
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   155
+ *     with the inode, this flag has no effect, except as noted under O_EXCL
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   156
+ *     below. Otherwise, a new XRC domain is created and is associated with
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   157
+ *     inode specified by fd.
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   158
+ *
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   159
+ * O_EXCL
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   160
+ *     If O_EXCL and O_CREAT are set, open will fail if a domain associated with
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   161
+ *     the inode exists. The check for the existence of the domain and creation
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   162
+ *     of the domain if it does not exist is atomic with respect to other
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   163
+ *     processes executing open with fd naming the same inode.
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   164
+ */
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   165
+struct ibv_xrc_domain *ibv_open_xrc_domain(struct ibv_context *context,
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   166
+					   int fd, int oflag) DEPRECATED;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   167
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   168
+/**
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   169
+ * ibv_create_xrc_srq - Creates a SRQ associated with the specified protection
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   170
+ *   domain and xrc domain.
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   171
+ * @pd: The protection domain associated with the SRQ.
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   172
+ * @xrc_domain: The XRC domain associated with the SRQ.
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   173
+ * @xrc_cq: CQ to report completions for XRC packets on.
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   174
+ *
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   175
+ * @srq_init_attr: A list of initial attributes required to create the SRQ.
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   176
+ *
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   177
+ * srq_attr->max_wr and srq_attr->max_sge are read the determine the
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   178
+ * requested size of the SRQ, and set to the actual values allocated
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   179
+ * on return.  If ibv_create_srq() succeeds, then max_wr and max_sge
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   180
+ * will always be at least as large as the requested values.
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   181
+ */
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   182
+struct ibv_srq *ibv_create_xrc_srq(struct ibv_pd *pd,
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   183
+				   struct ibv_xrc_domain *xrc_domain,
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   184
+				   struct ibv_cq *xrc_cq,
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   185
+				   struct ibv_srq_init_attr *srq_init_attr) DEPRECATED;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   186
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   187
+/**
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   188
+ * ibv_close_xrc_domain - close an XRC domain
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   189
+ * If this is the last reference, destroys the domain.
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   190
+ *
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   191
+ * @d: reference to XRC domain to close
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   192
+ *
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   193
+ * close is implicitly performed at process exit.
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   194
+ */
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   195
+int ibv_close_xrc_domain(struct ibv_xrc_domain *d) DEPRECATED;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   196
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   197
+#endif
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   198
diff -r f8684a1d3f02 include/infiniband/verbs.h
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   199
--- a/include/infiniband/verbs.h	Mon Nov 21 11:48:20 2016 -0800
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   200
+++ b/include/infiniband/verbs.h	Mon Mar 20 14:32:42 2017 -0700
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   201
@@ -42,6 +42,7 @@
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   202
 #include <errno.h>
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   203
 #if defined(__SVR4) && defined(__sun)
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   204
 #include <infiniband/ofa_solaris.h>
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   205
+#include <infiniband/ofa_verbs.h>
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   206
 #endif
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   207
 
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   208
 #ifdef __cplusplus
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   209
@@ -252,6 +253,8 @@
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   210
 		struct ibv_srq *srq;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   211
 		int		port_num;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   212
 		union ibv_gid	gid;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   213
+		/* For source compatibility with legacy API */
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   214
+		uint32_t	xrc_qp_num;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   215
 	} element;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   216
 	enum ibv_event_type	event_type;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   217
 };
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   218
@@ -507,6 +510,7 @@
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   219
 	IBV_QPT_RC = 2,
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   220
 	IBV_QPT_UC,
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   221
 	IBV_QPT_UD,
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   222
+	IBV_QPT_XRC, /* XRC legacy compatible type */
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   223
 	IBV_QPT_RAW_PACKET = 8,
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   224
 	IBV_QPT_XRC_SEND = 9,
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   225
 	IBV_QPT_XRC_RECV
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   226
@@ -536,6 +540,8 @@
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   227
 	struct ibv_qp_cap	cap;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   228
 	enum ibv_qp_type	qp_type;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   229
 	int			sq_sig_all;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   230
+	/* Below is needed for legacy compatibility */
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   231
+	struct ibv_xrc_domain  *xrc_domain;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   232
 };
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   233
 
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   234
 enum ibv_qp_init_attr_mask {
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   235
@@ -692,10 +698,14 @@
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   236
 		} ud;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   237
 	} wr;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   238
 	union {
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   239
-		struct {
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   240
-			uint32_t    remote_srqn;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   241
-		} xrc;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   242
-	} qp_type;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   243
+		union {
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   244
+		      struct {
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   245
+			      uint32_t	  remote_srqn;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   246
+		      } xrc;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   247
+		} qp_type;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   248
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   249
+		uint32_t		xrc_remote_srq_num;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   250
+	};
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   251
 };
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   252
 
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   253
 struct ibv_recv_wr {
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   254
@@ -723,6 +733,25 @@
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   255
 	pthread_mutex_t		mutex;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   256
 	pthread_cond_t		cond;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   257
 	uint32_t		events_completed;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   258
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   259
+       /* 
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   260
+	* Below is for source compatibility with legacy XRC APIs.
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   261
+	* Padding is based on ibv_srq_legacy.
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   262
+	*/
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   263
+	uint32_t		xrc_srq_num_bin_compat_padding;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   264
+	struct ibv_xrc_domain  *xrc_domain_bin_compat_padding;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   265
+	struct ibv_cq	       *xrc_cq_bin_compat_padding;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   266
+	void		       *ibv_srq_padding;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   267
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   268
+	/* legacy fields */
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   269
+	uint32_t		xrc_srq_num;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   270
+	struct ibv_xrc_domain  *xrc_domain;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   271
+	struct ibv_cq	       *xrc_cq;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   272
+};
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   273
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   274
+/* XRC source compat layer */
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   275
+enum ibv_event_flags {
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   276
+       IBV_XRC_QP_EVENT_FLAG = 0x80000000,
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   277
 };
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   278
 
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   279
 struct ibv_qp {
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   280
@@ -996,6 +1025,8 @@
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   281
 
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   282
 struct verbs_context {
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   283
 	/*  "grows up" - new fields go here */
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   284
+	void * (*drv_get_legacy_xrc) (struct ibv_srq *ibv_srq);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   285
+	void (*drv_set_legacy_xrc) (struct ibv_srq *ibv_srq, void *legacy_xrc);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   286
 	int (*drv_ibv_destroy_flow) (struct ibv_flow *flow);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   287
 	int (*lib_ibv_destroy_flow) (struct ibv_flow *flow);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   288
 	struct ibv_flow * (*drv_ibv_create_flow) (struct ibv_qp *qp,
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   289
diff -r f8684a1d3f02 man/ibv_create_qp_ex.3
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   290
--- a/man/ibv_create_qp_ex.3	Mon Nov 21 11:48:20 2016 -0800
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   291
+++ b/man/ibv_create_qp_ex.3	Mon Mar 20 14:32:42 2017 -0700
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   292
@@ -28,7 +28,7 @@
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   293
 struct ibv_cq          *recv_cq;        /* CQ to be associated with the Receive Queue (RQ) */
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   294
 struct ibv_srq         *srq;            /* SRQ handle if QP is to be associated with an SRQ, otherwise NULL */
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   295
 struct ibv_qp_cap       cap;            /* QP capabilities */
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   296
-enum ibv_qp_type        qp_type;        /* QP Transport Service Type: IBV_QPT_RC, IBV_QPT_UC, IBV_QPT_UD or IBV_QPT_RAW_PACKET */
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   297
+enum ibv_qp_type        qp_type;        /* QP Transport Service Type: IBV_QPT_RC, IBV_QPT_XRC_SEND, IBV_QPT_XRC_RECV, IBV_QPT_UC, IBV_QPT_UD or IBV_QPT_RAW_PACKET */
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   298
 int                     sq_sig_all;     /* If set, each Work Request (WR) submitted to the SQ generates a completion entry */
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   299
 uint32_t                comp_mask;	/* Identifies valid fields */
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   300
 struct ibv_pd          *pd;		/* PD to be associated with the QP */
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   301
diff -r f8684a1d3f02 man/ibv_create_xsrq.3
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   302
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   303
+++ b/man/ibv_create_xsrq.3	Mon Mar 20 14:32:42 2017 -0700
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   304
@@ -0,0 +1,87 @@
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   305
+.\" -*- nroff -*-
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   306
+.\"
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   307
+.TH IBV_CREATE_XSRQ 3 2011-06-17 libibverbs "Libibverbs Programmer's Manual"
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   308
+.SH "NAME"
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   309
+ibv_create_xsrq, ibv_destroy_srq \- create or destroy a shared receive queue (SRQ)
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   310
+.SH "SYNOPSIS"
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   311
+.nf
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   312
+.B #include 
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   313
+.sp
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   314
+.BI "struct ibv_srq *ibv_create_xsrq(struct ibv_pd " "*pd" ", struct "
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   315
+.BI "                                ibv_srq_init_attr " "*srq_init_attr"
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   316
+);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   317
+.sp
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   318
+.BI "int ibv_destroy_srq(struct ibv_srq " "*srq" );
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   319
+.fi
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   320
+.SH "DESCRIPTION"
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   321
+.B ibv_create_xsrq()
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   322
+creates a shared receive queue (SRQ) associated with the protection domain
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   323
+.I pd\fR.
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   324
+The argument
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   325
+.I srq_init_attr
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   326
+is an ibv_srq_init_attr struct, as defined in .
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   327
+.PP
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   328
+.nf
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   329
+struct ibv_srq_init_attr {
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   330
+.in +8
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   331
+void                   *srq_context;    /* Associated context of the SRQ
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   332
+*/
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   333
+struct ibv_srq_attr     attr;           /* SRQ attributes */
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   334
+enum ibv_srq_type       srq_type;       /* Specifies type of SRQ to create
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   335
+*/
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   336
+union {
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   337
+.in +8
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   338
+struct {
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   339
+.in +8
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   340
+struct ibv_xrcd *xrcd;   /* XRC domain associated with an XRC SRQ */
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   341
+struct ibv_cq   *cq;     /* completion queue for an XRC SRQ*/
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   342
+.in -8
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   343
+} xrc;   /* Extended attributes for IBV_SRQT_XRC type SRQs */
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   344
+.in -8
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   345
+} ext;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   346
+.in -8
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   347
+};
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   348
+.sp
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   349
+.nf
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   350
+struct ibv_srq_attr {
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   351
+.in +8
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   352
+uint32_t                max_wr;         /* Requested max number of
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   353
+outstanding work requests (WRs) in the SRQ */
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   354
+uint32_t                max_sge;        /* Requested max number of scatter
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   355
+elements per WR */
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   356
+uint32_t                srq_limit;      /* The limit value of the SRQ
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   357
+(ignored for ibv_create_srq) */
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   358
+.in -8
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   359
+};
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   360
+.fi
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   361
+.PP
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   362
+The function
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   363
+.B ibv_create_xsrq()
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   364
+will update the
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   365
+.I srq_init_attr
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   366
+struct with the original values of the SRQ that was created; the
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   367
+values of max_wr and max_sge will be greater than or equal to the
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   368
+values requested.
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   369
+.PP
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   370
+.B ibv_destroy_srq()
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   371
+destroys the SRQ
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   372
+.I srq\fR.
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   373
+.SH "RETURN VALUE"
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   374
+.B ibv_create_xsrq()
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   375
+returns a pointer to the created SRQ, or NULL if the request fails.
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   376
+.PP
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   377
+.B ibv_destroy_srq()
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   378
+returns 0 on success, or the value of errno on failure (which indicates
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   379
+the failure reason).
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   380
+.SH "NOTES"
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   381
+.B ibv_destroy_srq()
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   382
+fails if any queue pair is still associated with this SRQ.
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   383
+.SH "SEE ALSO"
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   384
+.BR ibv_alloc_pd (3),
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   385
+.BR ibv_create_cq (3),
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   386
+.BR ibv_open_xrcd (3),
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   387
+.BR ibv_modify_srq (3),
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   388
+.BR ibv_query_srq (3)
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   389
+.SH "AUTHORS"
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   390
+.TP
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   391
+Sean Hefty
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   392
diff -r f8684a1d3f02 man/ibv_xsrq_pingpong.1
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   393
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   394
+++ b/man/ibv_xsrq_pingpong.1	Mon Mar 20 14:32:42 2017 -0700
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   395
@@ -0,0 +1,71 @@
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   396
+.TH IBV_XSRQ_PINGPONG 1 "May 24, 2016" "libibverbs" "USER COMMANDS"
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   397
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   398
+.SH NAME
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   399
+ibv_xsrq_pingpong \- simple InfiniBand shared receive queue test
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   400
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   401
+.SH SYNOPSIS
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   402
+.B ibv_xsrq_pingpong
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   403
+[\-p port] [\-d device] [\-i ib port] [\-s size] [\-m mtu] [\-c clients]
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   404
+[\-n num_tests] [\-l sl] [\-e] \fBHOSTNAME\fR
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   405
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   406
+.B ibv_xsrq_pingpong
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   407
+[\-p port] [\-d device] [\-i ib port] [\-s size] [\-m mtu] [\-c clients]
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   408
+[\-n num_tests] [\-l sl] [\-e]
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   409
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   410
+.SH DESCRIPTION
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   411
+.PP
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   412
+Run a simple ping-pong test over InfiniBand via the extended reliable
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   413
+connected (XRC) transport service, using a shared receive queue (SRQ).
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   414
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   415
+.SH OPTIONS
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   416
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   417
+.PP
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   418
+.TP
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   419
+\fB\-p\fR, \fB\-\-port\fR=\fIPORT\fR
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   420
+use TCP port \fIPORT\fR for initial synchronization (default 18515)
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   421
+.TP
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   422
+\fB\-d\fR, \fB\-\-ib\-dev\fR=\fIDEVICE\fR
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   423
+use IB device \fIDEVICE\fR (default first device found)
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   424
+.TP
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   425
+\fB\-i\fR, \fB\-\-ib\-port\fR=\fIPORT\fR
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   426
+use IB port \fIPORT\fR (default port 1)
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   427
+.TP
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   428
+\fB\-s\fR, \fB\-\-size\fR=\fISIZE\fR
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   429
+ping-pong messages of size \fISIZE\fR (default 4096)
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   430
+.TP
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   431
+\fB\-m\fR, \fB\-\-mtu\fR=\fIMTU\fR
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   432
+use path mtu of size \fIMTU\fR (default 2048)
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   433
+.TP
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   434
+\fB\-c\fR, \fB\-\-clients\fR=\fICLIENTS\fR
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   435
+number of clients \fICLIENTS\fR (on server only, default 1)
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   436
+.TP
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   437
+\fB\-n\fR, \fB\-\-num\-tests\fR=\fINUM_TESTS\fR
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   438
+perform \fINUM_TESTS\fR tests per client (default 5)
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   439
+.TP
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   440
+\fB\-l\fR, \fB\-\-sl\fR=\fISL\fR
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   441
+use \fISL\fR as the service level value (default 0)
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   442
+.TP
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   443
+\fB\-e\fR, \fB\-\-events\fR
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   444
+sleep while waiting for work completion events (default is to poll for
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   445
+completions)
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   446
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   447
+.SH SEE ALSO
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   448
+.BR ibv_rc_pingpong (1),
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   449
+.BR ibv_uc_pingpong (1),
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   450
+.BR ibv_ud_pingpong (1)
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   451
+.BR ibv_srq_pingpong (1)
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   452
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   453
+.SH AUTHORS
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   454
+.TP
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   455
+Roland Dreier
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   456
+.RI < [email protected] >
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   457
+.TP
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   458
+Jarod Wilson
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   459
+.RI < [email protected] >
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   460
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   461
+.SH BUGS
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   462
+The network synchronization between client and server instances is
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   463
+weak, and does not prevent incompatible options from being used on the
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   464
+two instances.  The method used for retrieving work completions is not
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   465
+strictly correct, and race conditions may cause failures on some
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   466
+systems.
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   467
diff -r f8684a1d3f02 src/cmd.c
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   468
--- a/src/cmd.c	Mon Nov 21 11:48:20 2016 -0800
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   469
+++ b/src/cmd.c	Mon Mar 20 14:32:42 2017 -0700
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   470
@@ -815,6 +815,7 @@
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   471
 	cmd->user_handle     = (uintptr_t) qp;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   472
 
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   473
 	if (attr_ex->comp_mask & IBV_QP_INIT_ATTR_XRCD) {
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   474
+	        /* XRC receive side */
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   475
 		vxrcd = container_of(attr_ex->xrcd, struct verbs_xrcd, xrcd);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   476
 		cmd->pd_handle	= vxrcd->handle;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   477
 	} else {
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   478
@@ -824,7 +825,9 @@
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   479
 		cmd->pd_handle	= attr_ex->pd->handle;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   480
 		cmd->send_cq_handle = attr_ex->send_cq->handle;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   481
 
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   482
-		if (attr_ex->qp_type != IBV_QPT_XRC_SEND) {
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   483
+		/* XRC sender doesn't have a receive cq */
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   484
+		if (attr_ex->qp_type != IBV_QPT_XRC_SEND &&
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   485
+			attr_ex->qp_type != IBV_QPT_XRC) {
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   486
 			cmd->recv_cq_handle = attr_ex->recv_cq->handle;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   487
 			cmd->srq_handle = attr_ex->srq ? attr_ex->srq->handle : 0;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   488
 		}
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   489
@@ -847,7 +850,8 @@
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   490
 #else
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   491
 	cmd->sq_sig_all	     = attr_ex->sq_sig_all;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   492
 #endif
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   493
-	cmd->qp_type         = attr_ex->qp_type;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   494
+	cmd->qp_type	     = (attr_ex->qp_type == IBV_QPT_XRC) ?
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   495
+				IBV_QPT_XRC_SEND : attr_ex->qp_type;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   496
 	cmd->is_srq	     = !!attr_ex->srq;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   497
 	cmd->reserved	     = 0;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   498
 
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   499
@@ -1215,6 +1219,9 @@
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   500
 			tmp->wr.ud.remote_qpn  = i->wr.ud.remote_qpn;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   501
 			tmp->wr.ud.remote_qkey = i->wr.ud.remote_qkey;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   502
 		} else {
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   503
+			if (ibqp->qp_type == IBV_QPT_XRC_SEND)
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   504
+				tmp->qp_type.xrc.remote_srqn =
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   505
+					i->qp_type.xrc.remote_srqn;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   506
 			switch (i->opcode) {
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   507
 			case IBV_WR_RDMA_WRITE:
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   508
 			case IBV_WR_RDMA_WRITE_WITH_IMM:
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   509
diff -r f8684a1d3f02 src/device.c
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   510
--- a/src/device.c	Mon Nov 21 11:48:20 2016 -0800
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   511
+++ b/src/device.c	Mon Mar 20 14:32:42 2017 -0700
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   512
@@ -261,6 +261,9 @@
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   513
 			  struct ibv_async_event *event)
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   514
 {
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   515
 	struct ibv_kern_async_event ev;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   516
+	struct verbs_context *vctx;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   517
+	struct ibv_srq_legacy *ibv_srq_legacy = NULL;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   518
+	struct ibv_qp *qp;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   519
 
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   520
 	if (read(context->async_fd, &ev, sizeof ev) != sizeof ev)
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   521
 		return -1;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   522
@@ -281,11 +284,24 @@
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   523
 	case IBV_EVENT_PATH_MIG_ERR:
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   524
 	case IBV_EVENT_QP_LAST_WQE_REACHED:
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   525
 		event->element.qp = (void *) (uintptr_t) ev.element;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   526
+		qp = ibv_find_xrc_qp(event->element.qp->qp_num);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   527
+		if (qp) {
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   528
+			/* This is an XRC receive QP created by the legacy API */
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   529
+			event->event_type |= IBV_XRC_QP_EVENT_FLAG;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   530
+			event->element.qp = NULL;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   531
+			event->element.xrc_qp_num = qp->qp_num;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   532
+		}		
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   533
 		break;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   534
 
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   535
 	case IBV_EVENT_SRQ_ERR:
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   536
 	case IBV_EVENT_SRQ_LIMIT_REACHED:
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   537
-		event->element.srq = (void *) (uintptr_t) ev.element;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   538
+		vctx = verbs_get_ctx_op(context, drv_get_legacy_xrc);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   539
+		if (vctx)
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   540
+			ibv_srq_legacy =
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   541
+			  vctx->drv_get_legacy_xrc((void *) (uintptr_t) ev.element);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   542
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   543
+		event->element.srq = (ibv_srq_legacy) ? (void *)ibv_srq_legacy :
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   544
+			(void *) (uintptr_t) ev.element;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   545
 		break;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   546
 	case IBV_EVENT_GID_AVAIL:
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   547
 	case IBV_EVENT_GID_UNAVAIL:
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   548
@@ -310,6 +326,12 @@
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   549
 
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   550
 void __ibv_ack_async_event(struct ibv_async_event *event)
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   551
 {
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   552
+	int is_legacy_xrc = 0;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   553
+	if (event->event_type & IBV_XRC_QP_EVENT_FLAG) {
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   554
+		event->event_type ^= IBV_XRC_QP_EVENT_FLAG;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   555
+		is_legacy_xrc = 1;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   556
+	}
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   557
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   558
 	switch (event->event_type) {
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   559
 	case IBV_EVENT_CQ_ERR:
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   560
 	{
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   561
@@ -334,6 +356,16 @@
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   562
 	{
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   563
 		struct ibv_qp *qp = event->element.qp;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   564
 
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   565
+		if (is_legacy_xrc) {
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   566
+			qp = ibv_find_xrc_qp(event->element.xrc_qp_num);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   567
+			if (!qp || qp->qp_num != event->element.xrc_qp_num) {
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   568
+				fprintf(stderr, PFX "Warning: ibv_ack_async_event, "
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   569
+					"XRC qpn=%u wasn't found\n",
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   570
+					event->element.xrc_qp_num);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   571
+				return;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   572
+			}
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   573
+		}
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   574
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   575
 		pthread_mutex_lock(&qp->mutex);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   576
 		++qp->events_completed;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   577
 		pthread_cond_signal(&qp->cond);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   578
@@ -347,6 +379,12 @@
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   579
 	{
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   580
 		struct ibv_srq *srq = event->element.srq;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   581
 
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   582
+		if (srq->handle == LEGACY_XRC_SRQ_HANDLE) {
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   583
+		       struct ibv_srq_legacy *ibv_srq_legacy =
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   584
+				       (struct ibv_srq_legacy *) srq;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   585
+		       srq = ibv_srq_legacy->ibv_srq;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   586
+		}
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   587
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   588
 		pthread_mutex_lock(&srq->mutex);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   589
 		++srq->events_completed;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   590
 		pthread_cond_signal(&srq->cond);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   591
diff -r f8684a1d3f02 src/ibverbs.h
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   592
--- a/src/ibverbs.h	Mon Nov 21 11:48:20 2016 -0800
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   593
+++ b/src/ibverbs.h	Mon Mar 20 14:32:42 2017 -0700
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   594
@@ -85,6 +85,7 @@
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   595
 extern HIDDEN int abi_ver;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   596
 
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   597
 HIDDEN int ibverbs_init(struct ibv_device ***list);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   598
+HIDDEN struct ibv_qp *ibv_find_xrc_qp(uint32_t qpn);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   599
 
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   600
 #define IBV_INIT_CMD(cmd, size, opcode)					\
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   601
 	do {								\
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   602
diff -r f8684a1d3f02 src/libibverbs.map
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   603
--- a/src/libibverbs.map	Mon Nov 21 11:48:20 2016 -0800
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   604
+++ b/src/libibverbs.map	Mon Mar 20 14:32:42 2017 -0700
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   605
@@ -124,4 +124,7 @@
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   606
 		ibv_cmd_create_qp_ex;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   607
 		ibv_cmd_open_qp;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   608
 
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   609
+		ibv_open_xrc_domain;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   610
+		ibv_create_xrc_srq;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   611
+		ibv_close_xrc_domain;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   612
 } IBVERBS_1.0;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   613
diff -r f8684a1d3f02 src/verbs.c
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   614
--- a/src/verbs.c	Mon Nov 21 11:48:20 2016 -0800
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   615
+++ b/src/verbs.c	Mon Mar 20 14:32:42 2017 -0700
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   616
@@ -41,6 +41,7 @@
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   617
 #include <stdlib.h>
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   618
 #include <errno.h>
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   619
 #include <string.h>
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   620
+#include <search.h>
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   621
 #if defined(__SVR4) && defined(__sun)
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   622
 #include <fcntl.h>
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   623
 #include <sys/stat.h>
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   624
@@ -854,3 +855,208 @@
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   625
 	return qp->context->ops.detach_mcast(qp, gid, lid);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   626
 }
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   627
 default_symver(__ibv_detach_mcast, ibv_detach_mcast);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   628
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   629
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   630
+/* XRC compatibility layer */
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   631
+struct ibv_xrc_domain *ibv_open_xrc_domain(struct ibv_context *context,
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   632
+					   int fd, int oflag)
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   633
+{
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   634
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   635
+	struct ibv_xrcd *ibv_xrcd;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   636
+	struct ibv_xrcd_init_attr xrcd_init_attr;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   637
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   638
+	memset(&xrcd_init_attr, 0, sizeof(xrcd_init_attr));
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   639
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   640
+	xrcd_init_attr.fd = fd;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   641
+	xrcd_init_attr.oflags = oflag;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   642
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   643
+	xrcd_init_attr.comp_mask = IBV_XRCD_INIT_ATTR_FD |
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   644
+					IBV_XRCD_INIT_ATTR_OFLAGS;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   645
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   646
+	ibv_xrcd = ibv_open_xrcd(context, &xrcd_init_attr);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   647
+	if (!ibv_xrcd)
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   648
+		return NULL;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   649
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   650
+	return (struct ibv_xrc_domain *)ibv_xrcd;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   651
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   652
+}
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   653
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   654
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   655
+struct ibv_srq *ibv_create_xrc_srq(struct ibv_pd *pd,
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   656
+				   struct ibv_xrc_domain *xrc_domain,
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   657
+				   struct ibv_cq *xrc_cq,
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   658
+				   struct ibv_srq_init_attr *srq_init_attr)
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   659
+{
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   660
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   661
+	struct ibv_srq_init_attr_ex ibv_srq_init_attr_ex;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   662
+	struct ibv_srq_legacy *ibv_srq_legacy;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   663
+	struct ibv_srq *ibv_srq;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   664
+	uint32_t		xrc_srq_num;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   665
+	struct verbs_context *vctx;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   666
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   667
+	vctx = verbs_get_ctx_op(pd->context, drv_set_legacy_xrc);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   668
+	if (!vctx) {
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   669
+		errno = ENOSYS;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   670
+		return NULL;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   671
+	}
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   672
+	memset(&ibv_srq_init_attr_ex, 0, sizeof ibv_srq_init_attr_ex);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   673
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   674
+	ibv_srq_init_attr_ex.xrcd = (struct ibv_xrcd *)xrc_domain;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   675
+	ibv_srq_init_attr_ex.comp_mask = IBV_SRQ_INIT_ATTR_XRCD |
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   676
+				IBV_SRQ_INIT_ATTR_TYPE |
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   677
+				IBV_SRQ_INIT_ATTR_CQ | IBV_SRQ_INIT_ATTR_PD;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   678
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   679
+	ibv_srq_init_attr_ex.cq = xrc_cq;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   680
+	ibv_srq_init_attr_ex.pd = pd;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   681
+	ibv_srq_init_attr_ex.srq_type = IBV_SRQT_XRC;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   682
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   683
+	ibv_srq_init_attr_ex.attr.max_sge = srq_init_attr->attr.max_sge;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   684
+	ibv_srq_init_attr_ex.attr.max_wr = srq_init_attr->attr.max_wr;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   685
+	ibv_srq_init_attr_ex.attr.srq_limit = srq_init_attr->attr.srq_limit;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   686
+	ibv_srq_init_attr_ex.srq_context = srq_init_attr->srq_context;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   687
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   688
+	ibv_srq = ibv_create_srq_ex(pd->context, &ibv_srq_init_attr_ex);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   689
+	if (!ibv_srq)
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   690
+		return NULL;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   691
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   692
+	if (ibv_srq->handle == LEGACY_XRC_SRQ_HANDLE) {
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   693
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   694
+		struct ibv_srq *ibv_srq_tmp = ibv_srq;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   695
+		int ret;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   696
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   697
+		ibv_srq = ibv_create_srq_ex(pd->context, &ibv_srq_init_attr_ex);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   698
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   699
+		ret = ibv_destroy_srq(ibv_srq_tmp);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   700
+		if (ret) {
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   701
+			fprintf(stderr, PFX "ibv_create_xrc_srq, "
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   702
+				"fail to destroy intermediate srq\n");
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   703
+			return NULL;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   704
+		}
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   705
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   706
+		if (!ibv_srq)
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   707
+			return NULL;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   708
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   709
+		if (ibv_srq->handle == LEGACY_XRC_SRQ_HANDLE) {
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   710
+			ret = ibv_destroy_srq(ibv_srq);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   711
+			if (ret)
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   712
+				fprintf(stderr, PFX "ibv_create_xrc_srq, "
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   713
+					"fail to destroy intermediate srq\n");
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   714
+			errno = EAGAIN;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   715
+			return NULL;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   716
+		}
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   717
+	}
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   718
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   719
+	ibv_srq_legacy = calloc(1, sizeof(*ibv_srq_legacy));
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   720
+	if (!ibv_srq_legacy) {
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   721
+		errno = ENOMEM;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   722
+		goto err;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   723
+	}
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   724
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   725
+	if (ibv_get_srq_num(ibv_srq, &xrc_srq_num))
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   726
+		goto err_free;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   727
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   728
+	ibv_srq_legacy->ibv_srq = ibv_srq;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   729
+	ibv_srq_legacy->xrc_srq_num = xrc_srq_num;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   730
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   731
+	/* Setting the bin compat fields */
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   732
+	ibv_srq_legacy->xrc_srq_num_bin_compat = xrc_srq_num;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   733
+	ibv_srq_legacy->xrc_domain_bin_compat = xrc_domain;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   734
+	ibv_srq_legacy->xrc_cq_bin_compat = xrc_cq;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   735
+	ibv_srq_legacy->context          = pd->context;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   736
+	ibv_srq_legacy->srq_context      = srq_init_attr->srq_context;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   737
+	ibv_srq_legacy->pd		 = pd;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   738
+	/*
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   739
+	 * Set an indication that this is a legacy structure. For legacy structures,
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   740
+	 * we should use the internal ibv_srq.
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   741
+	 */
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   742
+	ibv_srq_legacy->handle		 = LEGACY_XRC_SRQ_HANDLE;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   743
+	ibv_srq_legacy->xrc_domain	 = xrc_domain;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   744
+	ibv_srq_legacy->xrc_cq		 = xrc_cq;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   745
+	ibv_srq_legacy->events_completed = 0;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   746
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   747
+	srq_init_attr->attr.max_wr = ibv_srq_init_attr_ex.attr.max_wr;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   748
+	srq_init_attr->attr.max_sge = ibv_srq_init_attr_ex.attr.max_sge;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   749
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   750
+	vctx->drv_set_legacy_xrc(ibv_srq, ibv_srq_legacy);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   751
+	return (struct ibv_srq *)(ibv_srq_legacy);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   752
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   753
+err_free:
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   754
+	free(ibv_srq_legacy);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   755
+err:
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   756
+	ibv_destroy_srq(ibv_srq);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   757
+	return NULL;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   758
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   759
+}
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   760
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   761
+static pthread_mutex_t xrc_tree_mutex = PTHREAD_MUTEX_INITIALIZER;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   762
+static void *ibv_xrc_qp_tree;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   763
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   764
+static int xrc_qp_compare(const void *a, const void *b)
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   765
+{
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   766
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   767
+	if ((*(uint32_t *) a) < (*(uint32_t *) b))
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   768
+	       return -1;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   769
+	else if ((*(uint32_t *) a) > (*(uint32_t *) b))
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   770
+	       return 1;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   771
+	else
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   772
+	       return 0;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   773
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   774
+}
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   775
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   776
+struct ibv_qp *ibv_find_xrc_qp(uint32_t qpn)
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   777
+{
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   778
+	uint32_t **qpn_ptr;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   779
+	struct ibv_qp *ibv_qp = NULL;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   780
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   781
+	pthread_mutex_lock(&xrc_tree_mutex);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   782
+	qpn_ptr = tfind(&qpn, &ibv_xrc_qp_tree, xrc_qp_compare);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   783
+	if (!qpn_ptr)
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   784
+		goto end;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   785
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   786
+	ibv_qp = container_of(*qpn_ptr, struct ibv_qp, qp_num);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   787
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   788
+end:
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   789
+	pthread_mutex_unlock(&xrc_tree_mutex);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   790
+	return ibv_qp;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   791
+}
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   792
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   793
+static int ibv_clear_xrc_qp(uint32_t qpn)
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   794
+{
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   795
+	uint32_t **qpn_ptr;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   796
+	int ret = 0;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   797
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   798
+	pthread_mutex_lock(&xrc_tree_mutex);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   799
+	qpn_ptr = tdelete(&qpn, &ibv_xrc_qp_tree, xrc_qp_compare);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   800
+	if (!qpn_ptr)
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   801
+		ret = EINVAL;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   802
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   803
+	pthread_mutex_unlock(&xrc_tree_mutex);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   804
+	return ret;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   805
+}
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   806
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   807
+static int ibv_store_xrc_qp(struct ibv_qp *qp)
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   808
+{
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   809
+	uint32_t **qpn_ptr;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   810
+	int ret = 0;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   811
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   812
+	if (ibv_find_xrc_qp(qp->qp_num)) {
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   813
+		fprintf(stderr, PFX "ibv_store_xrc_qp failed, qpn=%u is already stored\n",
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   814
+				qp->qp_num);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   815
+		return EEXIST;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   816
+	}
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   817
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   818
+	pthread_mutex_lock(&xrc_tree_mutex);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   819
+	qpn_ptr = tsearch(&qp->qp_num, &ibv_xrc_qp_tree, xrc_qp_compare);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   820
+	if (!qpn_ptr)
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   821
+		ret = EINVAL;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   822
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   823
+	pthread_mutex_unlock(&xrc_tree_mutex);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   824
+	return ret;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   825
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   826
+}
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   827
+
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   828
+int ibv_close_xrc_domain(struct ibv_xrc_domain *d)
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   829
+{
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   830
+	struct ibv_xrcd *ibv_xrcd = (struct ibv_xrcd *)d;
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   831
+	return ibv_close_xrcd(ibv_xrcd);
22ec3267b2a3 PSARC/2017/028 OFUV Exafusion support: XRC and RDMA_OPTION_ID_TOS
Sharath M Srinivasan <sharath.srinivasan@oracle.com>
parents:
diff changeset
   832
+}