<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="place" downloadurl="http://www.5iantlavalamp.com/"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Courier;
        panose-1:2 7 4 9 2 2 5 2 4 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin-top:3.0pt;
        margin-right:0in;
        margin-bottom:3.0pt;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
pre
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 face="Times New Roman"><span style='font-size:
11.0pt'>James and Arkady,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Times New Roman"><o:p> </o:p></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>DAPL provides a generalized abstraction to RDMA capable
transports. As a generalized abstraction, it cannot exploit the unique
properties that many of the underlying platforms/interconnects can provide so I
would like to propose a simple (minimum impact on libdat) extensible interface
to uDAPL that will allow vendors to expose such capabilities. I am looking for
feedback, especially from the DAT collaborative. I have included both a design document
and actual working code as a reference.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>The patch provides a fully tested DAT and DAPL library (openib_cma)
set with the following provider extensions:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Courier><span style='font-size:10.0pt;
font-family:Courier'>DAT_RETURN<br>
dat_ep_post_write_immed(<br>
      IN DAT_EP_HANDLE        ep_handle,<o:p></o:p></span></font></p>

<p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:
0in;margin-left:.5in;margin-bottom:.0001pt;page-break-after:avoid;text-autospace:
none'><font size=2 face=Courier><span style='font-size:10.0pt;font-family:Courier'>IN
DAT_COUNT            num_segments<br>
IN DAT_LMR_TRIPLET      *local_iov,<br>
IN DAT_DTO_COOKIE       user_cookie,<o:p></o:p></span></font></p>

<p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:
0in;margin-left:.5in;margin-bottom:.0001pt;page-break-after:avoid;text-autospace:
none'><font size=2 face=Courier><span style='font-size:10.0pt;font-family:Courier'>IN
DAT_RMR_TRIPLE       *remote_iov,<br>
IN DAT_UINT32           immediate_data,<br>
IN DAT_COMPLETION_FLAGS completion_flags);<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal style='margin:0in;margin-bottom:.0001pt;page-break-after:
avoid;text-autospace:none'><font size=2 face=Courier><span style='font-size:
10.0pt;font-family:Courier'>DAT_RETURN<br>
dat_ep_post_cmp_and_swap(<br>
      IN DAT_EP_HANDLE        ep_handle,<o:p></o:p></span></font></p>

<p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:
0in;margin-left:.5in;margin-bottom:.0001pt;page-break-after:avoid;text-autospace:
none'><font size=2 face=Courier><span style='font-size:10.0pt;font-family:Courier'>IN
DAT_UINT64           cmp_value,<br>
IN DAT_UINT64           swap_value,<o:p></o:p></span></font></p>

<p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:
0in;margin-left:.5in;margin-bottom:.0001pt;page-break-after:avoid;text-autospace:
none'><font size=2 face=Courier><span style='font-size:10.0pt;font-family:Courier'>IN
DAT_LMR_TRIPLE       *local_iov,<br>
IN DAT_DTO_COOKIE       user_cookie,<o:p></o:p></span></font></p>

<p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:
0in;margin-left:.5in;margin-bottom:.0001pt;page-break-after:avoid;text-autospace:
none'><font size=2 face=Courier><span style='font-size:10.0pt;font-family:Courier'>IN
DAT_RMR_TRIPLE       *remote_iov,<br>
IN DAT_COMPLETION_FLAGS completion_flags);<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal style='margin:0in;margin-bottom:.0001pt;page-break-after:
avoid;text-autospace:none'><font size=2 face=Courier><span style='font-size:
10.0pt;font-family:Courier'>DAT_RETURN<br>
dat_ep_post_fetch_and_add(<br>
      IN DAT_EP_HANDLE        ep_handle,<o:p></o:p></span></font></p>

<p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:
0in;margin-left:.5in;margin-bottom:.0001pt;page-break-after:avoid;text-autospace:
none'><font size=2 face=Courier><span style='font-size:10.0pt;font-family:Courier'>IN
DAT_UINT64           add_value,<o:p></o:p></span></font></p>

<p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:
0in;margin-left:.5in;margin-bottom:.0001pt;page-break-after:avoid;text-autospace:
none'><font size=2 face=Courier><span style='font-size:10.0pt;font-family:Courier'>IN
DAT_LMR_TRIPLE       *local_iov,<br>
IN DAT_DTO_COOKIE       user_cookie,<o:p></o:p></span></font></p>

<p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:
0in;margin-left:.5in;margin-bottom:.0001pt;page-break-after:avoid;text-autospace:
none'><font size=2 face=Courier><span style='font-size:10.0pt;font-family:Courier'>IN
DAT_RMR_TRIPLE       *remote_iov,<br>
IN DAT_COMPLETION_FLAGS completion_flags);<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Also, included is a sample program (dtest_ext.c) that can be
used as a programming example.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Thanks,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>-arlin<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<pre><font size=2 face="Courier New"><span style='font-size:10.0pt'>Signed-off by: Arlin Davis <a
href="mailto:ardavis@ichips.intel.com"><ardavis@ichips.intel.com></a><o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'><o:p> </o:p></span></font></pre>

<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>Index: test/dtest/dat.conf<br>
===================================================================<br>
--- test/dtest/dat.conf (revision 4589)<br>
+++ test/dtest/dat.conf (working copy)<br>
@@ -1,11 +1,20 @@<br>
 #<br>
-# DAT 1.1 and 1.2 configuration file<br>
+# DAT 1.2 configuration file<br>
 #<br>
 # Each entry should have the following fields:<br>
 #<br>
 # <ia_name> <api_version> <threadsafety>
<default> <lib_path> \<br>
 #          
<provider_version> <ia_params> <platform_params><br>
 #<br>
-# Example for openib using the first Mellanox adapter,  port 1 and port 2<br>
+# Example for openib_cma and openib_scm<br>
+#<br>
+# For scm version you specify <ia_params> as actual device name and port<br>
+# For cma version you specify <ia_params> as:<br>
+#       network address, network hostname, or
netdev name and 0 for port<br>
+#<br>
+OpenIB-scm1 u1.2 nonthreadsafe default
/usr/local/openib_dapl/udapl/Target/libdapl.so mv_dapl.1.2 "mthca0 1"
""<br>
+OpenIB-scm2 u1.2 nonthreadsafe default
/usr/local/openib_dapl/udapl/Target/libdapl.so mv_dapl.1.2 "mthca0 2"
""<br>
+OpenIB-cma-ip u1.2 nonthreadsafe default
/usr/local/openib_dapl/udapl/Target/libdapl.so mv_dapl.1.2 "192.168.0.22
0" ""<br>
+OpenIB-cma-name u1.2 nonthreadsafe default
/usr/local/openib_dapl/udapl/Target/libdapl.so mv_dapl.1.2 "svr1-ib0
0" ""<br>
+OpenIB-cma-netdev u1.2 nonthreadsafe default /usr/local/openib_dapl/udapl/Target/libdapl.so
mv_dapl.1.2 "ib0 0" ""<br>
 <br>
-IB1 u1.2 nonthreadsafe default <br>
Index: test/dtest/makefile<br>
===================================================================<br>
--- test/dtest/makefile (revision 4589)<br>
+++ test/dtest/makefile (working copy)<br>
@@ -4,13 +4,18 @@ CFLAGS     = -O2 -g<br>
 DAT_INC = ../../dat/include<br>
 DAT_LIB = /usr/local/lib<br>
 <br>
-all: dtest<br>
+all: dtest dtest_ext<br>
 <br>
 clean:<br>
-     rm -f *.o;touch *.c;rm -f dtest<br>
+     rm -f *.o;touch *.c;rm -f dtest dtest_ext<br>
 <br>
 dtest: ./dtest.c<br>
      $(CC) $(CFLAGS) ./dtest.c -o dtest \<br>
      -DDAPL_PROVIDER='"OpenIB-cma-ip"' \<br>
      -I $(DAT_INC) -L $(DAT_LIB) -ldat<br>
 <br>
+dtest_ext: ./dtest_ext.c<br>
+     $(CC) $(CFLAGS) ./dtest_ext.c -o dtest_ext \<br>
+     -DDAPL_PROVIDER='"OpenIB-cma-ip"' \<br>
+     -I $(DAT_INC) -L $(DAT_LIB) -ldat<br>
+<br>
Index: test/dtest/README<br>
===================================================================<br>
--- test/dtest/README   (revision 4589)<br>
+++ test/dtest/README   (working copy)<br>
@@ -1,10 +1,11 @@<br>
 simple dapl test just for initial openIB uDAPL testing...<br>
 <br>
        dtest/dtest.c<br>
+       dtest/dtest_ext.c<br>
        dtest/makefile<br>
        dtest/dat.conf<br>
 <br>
-to build (default uDAPL name == IB1, ib device  ==  mthca0, port ==
1)<br>
+to build (default uDAPL name == OpenIB-cma-ip)<br>
        edit makefile and change path (DAT_LIB)
to appropriate libdat.so<br>
        edit dat.conf and change path to
appropriate libdapl.so<br>
        cp dat.conf to /etc/dat.conf<br>
Index: dapl/include/dapl.h<br>
===================================================================<br>
--- dapl/include/dapl.h (revision 4589)<br>
+++ dapl/include/dapl.h (working copy)<br>
@@ -1,25 +1,28 @@<br>
 /*<br>
- * Copyright (c) 2002-2003, Network Appliance, Inc. All rights reserved.<br>
+ * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved.<br>
  *<br>
  * This Software is licensed under one of the following licenses:<br>
- *<br>
+ * <br>
  * 1) under the terms of the "Common Public License 1.0" a copy
of which is<br>
- *    available from the Open Source Initiative, see<br>
+ *    in the file LICENSE.txt in the root directory. The
license is also<br>
+ *    available from the Open Source Initiative, see <br>
  *    http://www.opensource.org/licenses/cpl.php.<br>
- *<br>
- * 2) under the terms of the "The BSD License" a copy of which is<br>
- *    available from the Open Source Initiative, see<br>
+ * <br>
+ * 2) under the terms of the "The BSD License" a copy of which is in
the file<br>
+ *    LICENSE2.txt in the root directory. The license is also
available from<br>
+ *    the Open Source Initiative, see<br>
  *    http://www.opensource.org/licenses/bsd-license.php.<br>
- *<br>
+ * <br>
  * 3) under the terms of the "GNU General Public License (GPL)
Version 2" a<br>
- *    copy of which is available from the Open Source
Initiative, see<br>
+ *    copy of which is in the file LICENSE3.txt in the root
directory. The<br>
+ *    license is also available from the Open Source
Initiative, see<br>
  *    http://www.opensource.org/licenses/gpl-license.php.<br>
- *<br>
+ * <br>
  * Licensee has the right to choose one of the above licenses.<br>
- *<br>
+ * <br>
  * Redistributions of source code must retain the above copyright<br>
  * notice and one of the license notices.<br>
- *<br>
+ * <br>
  * Redistributions in binary form must reproduce both the above copyright<br>
  * notice, one of the license notices in the documentation<br>
  * and/or other materials provided with the distribution.<br>
@@ -61,6 +64,8 @@<br>
 #include "dapl_dummy_util.h"<br>
 #elif OPENIB<br>
 #include "dapl_ib_util.h"<br>
+#elif DET<br>
+#include "dapl_det_util.h"<br>
 #endif<br>
 <br>
 /*********************************************************************<br>
@@ -213,6 +218,10 @@ typedef struct dapl_cookie       DAPL_COOKIE;<br>
 typedef struct dapl_dto_cookie           DAPL_DTO_COOKIE;<br>
 typedef struct dapl_rmr_cookie           DAPL_RMR_COOKIE;<br>
 <br>
+#ifdef DAPL_EXTENSIONS<br>
+typedef struct dapl_ext_cookie           DAPL_EXT_COOKIE;<br>
+#endif<br>
+<br>
 typedef struct dapl_private        DAPL_PRIVATE;<br>
 <br>
 typedef void (*DAPL_CONNECTION_STATE_HANDLER) (<br>
@@ -563,6 +572,13 @@ typedef enum dapl_dto_type<br>
     DAPL_DTO_TYPE_RECV,<br>
     DAPL_DTO_TYPE_RDMA_WRITE,<br>
     DAPL_DTO_TYPE_RDMA_READ,<br>
+#ifdef DAPL_EXTENSIONS<br>
+    DAPL_DTO_TYPE_RDMA_WRITE_IMMED,<br>
+    DAPL_DTO_TYPE_RECV_IMMED,<br>
+    DAPL_DTO_TYPE_CMP_AND_SWAP,<br>
+    DAPL_DTO_TYPE_FETCH_AND_ADD,<br>
+#endif<br>
+<br>
 } DAPL_DTO_TYPE;<br>
 <br>
 typedef enum dapl_cookie_type<br>
@@ -570,6 +586,9 @@ typedef enum dapl_cookie_type<br>
     DAPL_COOKIE_TYPE_NULL,<br>
     DAPL_COOKIE_TYPE_DTO,<br>
     DAPL_COOKIE_TYPE_RMR,<br>
+#ifdef DAPL_EXTENSIONS<br>
+    DAPL_COOKIE_TYPE_EXTENSION,<br>
+#endif<br>
 } DAPL_COOKIE_TYPE;<br>
 <br>
 /* DAPL_DTO_COOKIE used as context for DTO WQEs */<br>
@@ -587,6 +606,27 @@ struct dapl_rmr_cookie<br>
    
DAT_RMR_COOKIE             
cookie;<br>
 };<br>
 <br>
+#ifdef DAPL_EXTENSIONS<br>
+<br>
+/* DAPL extended cookie types */<br>
+typedef enum dapl_ext_type<br>
+{<br>
+    DAPL_EXT_TYPE_RDMA_WRITE_IMMED,<br>
+    DAPL_EXT_TYPE_CMP_AND_SWAP,<br>
+    DAPL_EXT_TYPE_FETCH_AND_ADD,<br>
+    DAPL_EXT_TYPE_RECV<br>
+} DAPL_EXT_TYPE;<br>
+<br>
+/* DAPL extended cookie */<br>
+struct dapl_ext_cookie<br>
+{<br>
+    DAPL_EXT_TYPE            type;<br>
+    DAT_DTO_COOKIE           cookie;<br>
+    DAT_COUNT                size; /*
used RDMA write with immed */<br>
+};<br>
+<br>
+#endif<br>
+<br>
 /* DAPL_COOKIE used as context for WQEs */<br>
 struct dapl_cookie<br>
 {<br>
@@ -597,6 +637,9 @@ struct dapl_cookie<br>
     {<br>
      DAPL_DTO_COOKIE   dto;<br>
      DAPL_RMR_COOKIE         rmr;<br>
+#ifdef DAPL_EXTENSIONS<br>
+     DAPL_EXT_COOKIE         ext;<br>
+#endif<br>
     } val;<br>
 };<br>
 <br>
@@ -1116,6 +1159,15 @@ extern DAT_RETURN dapl_srq_set_lw(<br>
      IN     
DAT_SRQ_HANDLE,         /*
srq_handle           */<br>
      IN     
DAT_COUNT);            
/* low_watermark        */<br>
 <br>
+#ifdef DAPL_EXTENSIONS<br>
+<br>
+extern DAT_RETURN dapl_extensions(<br>
+     IN      DAT_HANDLE,           /*
dat_handle           */<br>
+     IN    DAT_EXT_OP,             /*
extension operation  */<br>
+     IN    va_list );        /*
va_list args         */<br>
+<br>
+#endif<br>
+<br>
 /*<br>
  * DAPL internal utility function prototpyes<br>
  */<br>
Index: dapl/udapl/Makefile<br>
===================================================================<br>
--- dapl/udapl/Makefile (revision 4589)<br>
+++ dapl/udapl/Makefile (working copy)<br>
@@ -156,6 +156,7 @@ PROVIDER = $(TOPDIR)/../openib_cma<br>
 CFLAGS   += -DOPENIB<br>
 CFLAGS   += -DCQ_WAIT_OBJECT<br>
 CFLAGS   += -I/usr/local/include/infiniband<br>
+CFLAGS   += -I/usr/local/include/rdma<br>
 endif<br>
 <br>
 #<br>
@@ -168,6 +169,12 @@ endif<br>
 # VN_MEM_SHARED_VIRTUAL_SUPPORT <br>
 # CFLAGS   += -DVN_MEM_SHARED_VIRTUAL_SUPPORT=1<br>
 <br>
+# If an implementation supports DAPL extensions<br>
+CFLAGS += -DDAPL_EXTENSIONS<br>
+<br>
+# If an implementation supports DAPL provider specific attributes<br>
+CFLAGS += -DDAPL_PROVIDER_SPECIFIC_ATTR<br>
+<br>
 CFLAGS   += -I. <br>
 CFLAGS   += -I.. <br>
 CFLAGS   += -I../../dat/include <br>
@@ -283,6 +290,8 @@ LDFLAGS += -libverbs -lrdmacm<br>
 LDFLAGS += -rpath /usr/local/lib -L /usr/local/lib<br>
 PROVIDER_SRCS  = dapl_ib_util.c dapl_ib_cq.c dapl_ib_qp.c \<br>
                 
dapl_ib_cm.c dapl_ib_mem.c<br>
+# implementation supports DAPL extensions<br>
+PROVIDER_SRCS += dapl_ib_extensions.c<br>
 endif<br>
 <br>
 UDAPL_SRCS =     dapl_init.c       \<br>
Index: dapl/common/dapl_ia_query.c<br>
===================================================================<br>
--- dapl/common/dapl_ia_query.c     (revision 4589)<br>
+++ dapl/common/dapl_ia_query.c     (working copy)<br>
@@ -167,6 +167,14 @@ dapl_ia_query (<br>
 #if !defined(__KDAPL__)<br>
      provider_attr->pz_support                
= DAT_PZ_UNIQUE;<br>
 #endif /* !KDAPL */<br>
+<br>
+     /*<br>
+      *  Have provider set their own.<br>
+      */<br>
+#ifdef DAPL_PROVIDER_SPECIFIC_ATTR<br>
+     dapls_set_provider_specific_attr(provider_attr);<br>
+#endif<br>
+<br>
      /*<br>
       * Set up evd_stream_merging_supported
options. Note there is<br>
       * one bit per allowable combination, using
the ordinal<br>
Index: dapl/common/dapl_adapter_util.h<br>
===================================================================<br>
--- dapl/common/dapl_adapter_util.h (revision 4589)<br>
+++ dapl/common/dapl_adapter_util.h (working copy)<br>
@@ -256,6 +256,21 @@ dapls_ib_wait_object_wait (<br>
      IN u_int32_t                  timeout);<br>
 #endif<br>
 <br>
+#ifdef DAPL_PROVIDER_SPECIFIC_ATTR<br>
+void <br>
+dapls_set_provider_specific_attr(<br>
+     IN DAT_PROVIDER_ATTR          *provider_attr
);<br>
+#endif<br>
+<br>
+#ifdef DAPL_EXTENSIONS<br>
+void<br>
+dapls_cqe_to_event_extension(<br>
+     IN DAPL_EP              *ep_ptr,<br>
+     IN DAPL_COOKIE                *cookie,<br>
+     IN ib_work_completion_t       *cqe_ptr,<br>
+     OUT DAT_EVENT                 *event_ptr);<br>
+#endif<br>
+<br>
 /*<br>
  * Values for provider DAT_NAMED_ATTR<br>
  */<br>
@@ -272,6 +287,8 @@ dapls_ib_wait_object_wait (<br>
 #include "dapl_dummy_dto.h"<br>
 #elif OPENIB<br>
 #include "dapl_ib_dto.h"<br>
+#elif DET<br>
+#include "dapl_det_dto.h"<br>
 #endif<br>
 <br>
 <br>
Index: dapl/common/dapl_provider.c<br>
===================================================================<br>
--- dapl/common/dapl_provider.c     (revision 4589)<br>
+++ dapl/common/dapl_provider.c     (working copy)<br>
@@ -221,7 +221,11 @@ DAT_PROVIDER g_dapl_provider_template =<br>
     &dapl_srq_post_recv,<br>
     &dapl_srq_query,<br>
     &dapl_srq_resize,<br>
-    &dapl_srq_set_lw<br>
+    &dapl_srq_set_lw,<br>
+<br>
+#ifdef DAPL_EXTENSIONS<br>
+    &dapl_extensions<br>
+#endif<br>
 <br>
 };<br>
 #endif /* __KDAPL__ */<br>
Index: dapl/common/dapl_evd_util.c<br>
===================================================================<br>
--- dapl/common/dapl_evd_util.c     (revision 4589)<br>
+++ dapl/common/dapl_evd_util.c     (working copy)<br>
@@ -502,6 +502,20 @@ dapli_evd_eh_print_cqe (<br>
 #ifdef DAPL_DBG<br>
     static char *optable[] =<br>
     {<br>
+#ifdef OPENIB<br>
+     /* different order for openib verbs */<br>
+     "OP_RDMA_WRITE",<br>
+     "OP_RDMA_WRITE_IMM",<br>
+     "OP_SEND",<br>
+     "OP_SEND_IMM",<br>
+     "OP_RDMA_READ",<br>
+     "OP_COMP_AND_SWAP",<br>
+     "OP_FETCH_AND_ADD",<br>
+     "OP_RECEIVE",<br>
+     "OP_RECEIVE_IMM",<br>
+     "OP_BIND_MW",<br>
+     "OP_INVALID",<br>
+#else<br>
      "OP_SEND",<br>
      "OP_RDMA_READ",<br>
      "OP_RDMA_WRITE",<br>
@@ -509,6 +523,7 @@ dapli_evd_eh_print_cqe (<br>
      "OP_FETCH_AND_ADD",<br>
      "OP_RECEIVE",<br>
      "OP_BIND_MW",<br>
+#endif<br>
      0<br>
     };<br>
 <br>
@@ -1113,6 +1128,15 @@ dapli_evd_cqe_to_event (<br>
          dapls_cookie_dealloc
(&ep_ptr->req_buffer, cookie);<br>
          break;<br>
      }<br>
+<br>
+#ifdef DAPL_EXTENSIONS<br>
+     case DAPL_COOKIE_TYPE_EXTENSION:<br>
+     {<br>
+        
dapls_cqe_to_event_extension(ep_ptr, cookie, cqe_ptr, event_ptr);<br>
+         break;<br>
+     }<br>
+#endif<br>
+<br>
      default:<br>
      {<br>
          dapl_os_assert
(!"Invalid Operation type");<br>
Index: dapl/openib_cma/dapl_ib_dto.h<br>
===================================================================<br>
--- dapl/openib_cma/dapl_ib_dto.h   (revision 4589)<br>
+++ dapl/openib_cma/dapl_ib_dto.h   (working copy)<br>
@@ -35,7 +35,7 @@<br>
  *<br>
  *   Description: <br>
  *<br>
- *   The uDAPL openib provider - DTO operations and CQE macros <br>
+ *   The OpenIB uCMA provider - DTO operations and CQE macros <br>
  *<br>
 
****************************************************************************<br>
  *            Source
Control System Information<br>
@@ -119,7 +119,6 @@ dapls_ib_post_recv (<br>
      return DAT_SUCCESS;<br>
 }<br>
 <br>
-<br>
 /*<br>
  * dapls_ib_post_send<br>
  *<br>
@@ -191,7 +190,7 @@ dapls_ib_post_send (<br>
 <br>
      if (cookie != NULL) <br>
            cookie->val.dto.size
= total_len;<br>
-     <br>
+<br>
      if ((op_type == OP_RDMA_WRITE) || (op_type == OP_RDMA_READ))
{<br>
            wr.wr.rdma.remote_addr
= remote_iov->target_address;<br>
            wr.wr.rdma.rkey
= remote_iov->rmr_context;<br>
@@ -224,6 +223,152 @@ dapls_ib_post_send (<br>
      return DAT_SUCCESS;<br>
 }<br>
 <br>
+#ifdef DAPL_EXTENSIONS<br>
+/*<br>
+ * dapls_ib_post_ext_send<br>
+ *<br>
+ * Provider specific extended Post SEND function<br>
+ */<br>
+STATIC _INLINE_ DAT_RETURN <br>
+dapls_ib_post_ext_send (<br>
+     IN  DAPL_EP             *ep_ptr,<br>
+     IN  ib_send_op_type_t         op_type,<br>
+     IN  DAPL_COOKIE               *cookie,<br>
+     IN  DAT_COUNT                 segments,<br>
+     IN  DAT_LMR_TRIPLET           *local_iov,<br>
+     IN  const DAT_RMR_TRIPLET     *remote_iov,<br>
+     IN  DAT_UINT32                idata,<br>
+     IN  DAT_UINT64                compare_add,<br>
+     IN  DAT_UINT64                swap,<br>
+     IN  DAT_COMPLETION_FLAGS      completion_flags)<br>
+{<br>
+     dapl_dbg_log(DAPL_DBG_TYPE_EP,<br>
+               
" post_snd: ep %p op %d ck %p sgs",<br>
+               
"%d l_iov %p r_iov %p f %d\n",<br>
+               
ep_ptr, op_type, cookie, segments, local_iov, <br>
+               
remote_iov, completion_flags);<br>
+<br>
+     ib_data_segment_t ds_array[DEFAULT_DS_ENTRIES];<br>
+     ib_data_segment_t *ds_array_p;<br>
+     struct ibv_send_wr wr;<br>
+     struct ibv_send_wr *bad_wr;<br>
+     ib_hca_transport_t *ibt_ptr = <br>
+           &ep_ptr->header.owner_ia->hca_ptr->ib_trans;<br>
+     DAT_COUNT i, total_len;<br>
+     <br>
+     dapl_dbg_log(DAPL_DBG_TYPE_EP,<br>
+               
" post_snd: ep %p cookie %p segs %d l_iov %p\n",<br>
+               
ep_ptr, cookie, segments, local_iov);<br>
+<br>
+     if(segments <= DEFAULT_DS_ENTRIES) <br>
+           ds_array_p =
ds_array;<br>
+     else<br>
+           ds_array_p = <br>
+                 dapl_os_alloc(segments
* sizeof(ib_data_segment_t));<br>
+<br>
+     if (NULL == ds_array_p)<br>
+           return
(DAT_INSUFFICIENT_RESOURCES);<br>
+     <br>
+     /* setup the work request */<br>
+     wr.next = 0;<br>
+     wr.opcode = op_type;<br>
+     wr.num_sge = 0;<br>
+     wr.send_flags = 0;<br>
+     wr.wr_id = (uint64_t)(uintptr_t)cookie;<br>
+     wr.sg_list = ds_array_p;<br>
+     total_len = 0;<br>
+<br>
+     for (i = 0; i < segments; i++ ) {<br>
+           if (
!local_iov[i].segment_length )<br>
+                 continue;<br>
+<br>
+           ds_array_p->addr
= (uint64_t) local_iov[i].virtual_address;<br>
+           ds_array_p->length
= local_iov[i].segment_length;<br>
+           ds_array_p->lkey
= local_iov[i].lmr_context;<br>
+           <br>
+           dapl_dbg_log(DAPL_DBG_TYPE_EP,
<br>
+                     
" post_snd: lkey 0x%x va %p len %d\n",<br>
+                     
ds_array_p->lkey, ds_array_p->addr, <br>
+                     
ds_array_p->length );<br>
+<br>
+           total_len +=
ds_array_p->length;<br>
+           wr.num_sge++;<br>
+           ds_array_p++;<br>
+     }<br>
+<br>
+     if (cookie != NULL) <br>
+           cookie->val.dto.size
= total_len;<br>
+<br>
+     if ((op_type == OP_RDMA_WRITE) || <br>
+         (op_type == OP_RDMA_WRITE_IMM) ||<br>
+         (op_type == OP_RDMA_READ)) {<br>
+           wr.wr.rdma.remote_addr
= remote_iov->target_address;<br>
+           wr.wr.rdma.rkey =
remote_iov->rmr_context;<br>
+           dapl_dbg_log(DAPL_DBG_TYPE_EP,
<br>
+                     
" post_snd_rdma: rkey 0x%x va %#016Lx\n",<br>
+                     
wr.wr.rdma.rkey, wr.wr.rdma.remote_addr);<br>
+     }<br>
+<br>
+     switch (op_type) {<br>
+     case OP_RDMA_WRITE_IMM:<br>
+           dapl_dbg_log(DAPL_DBG_TYPE_EP,
<br>
+                     
" post_snd: OP_RDMA_WRITE_IMMED=0x%x\n", idata );<br>
+           wr.imm_data =
idata;<br>
+           break;<br>
+     case OP_COMP_AND_SWAP:<br>
+           /* OP_COMP_AND_SWAP
has direct IBAL wr_type mapping */<br>
+           dapl_dbg_log(DAPL_DBG_TYPE_EP,
<br>
+                     
" post_snd: OP_COMP_AND_SWAP=%lx,"<br>
+                     
"%lx rkey 0x%x va %#016Lx\n",<br>
+                     
compare_add, swap, remote_iov->rmr_context,<br>
+                     
remote_iov->target_address);<br>
+           <br>
+           wr.wr.atomic.compare_add
= compare_add;<br>
+           wr.wr.atomic.swap
= swap;<br>
+           wr.wr.atomic.remote_addr
= remote_iov->target_address;<br>
+           wr.wr.atomic.rkey
= remote_iov->rmr_context;<br>
+           break;<br>
+     case OP_FETCH_AND_ADD:<br>
+           /*
OP_FETCH_AND_ADD has direct IBAL wr_type mapping */<br>
+           dapl_dbg_log(DAPL_DBG_TYPE_EP,
<br>
+                     
" post_snd: OP_FETCH_AND_ADD=%lx,"<br>
+                     
"%lx rkey 0x%x va %#016Lx\n",<br>
+                     
compare_add, remote_iov->rmr_context,<br>
+                     
remote_iov->target_address);<br>
+<br>
+           wr.wr.atomic.compare_add
= compare_add;<br>
+           wr.wr.atomic.remote_addr
= remote_iov->target_address;<br>
+           wr.wr.atomic.rkey
= remote_iov->rmr_context;<br>
+           break;<br>
+     default:<br>
+           break;<br>
+     }<br>
+<br>
+     /* inline data for send or write ops */<br>
+     if ((total_len <= ibt_ptr->max_inline_send)
&& <br>
+        ((op_type == OP_SEND) || (op_type ==
OP_RDMA_WRITE))) <br>
+           wr.send_flags |=
IBV_SEND_INLINE;<br>
+     <br>
+     /* set completion flags in work request */<br>
+     wr.send_flags |= (DAT_COMPLETION_SUPPRESS_FLAG & <br>
+                       completion_flags)
? 0 : IBV_SEND_SIGNALED;<br>
+     wr.send_flags |= (DAT_COMPLETION_BARRIER_FENCE_FLAG
& <br>
+                       completion_flags)
? IBV_SEND_FENCE : 0;<br>
+     wr.send_flags |= (DAT_COMPLETION_SOLICITED_WAIT_FLAG
& <br>
+                       completion_flags)
? IBV_SEND_SOLICITED : 0;<br>
+<br>
+     dapl_dbg_log(DAPL_DBG_TYPE_EP, <br>
+               
" post_snd: op 0x%x flags 0x%x sglist %p, %d\n", <br>
+               
wr.opcode, wr.send_flags, wr.sg_list, wr.num_sge);<br>
+<br>
+     if
(ibv_post_send(ep_ptr->qp_handle->cm_id->qp, &wr, &bad_wr))<br>
+           return(
dapl_convert_errno(EFAULT,"ibv_recv") );<br>
+     <br>
+     dapl_dbg_log(DAPL_DBG_TYPE_EP," post_snd: returned\n");<br>
+     return DAT_SUCCESS;<br>
+}<br>
+#endif<br>
+<br>
 STATIC _INLINE_ DAT_RETURN <br>
 dapls_ib_optional_prv_dat(<br>
      IN  DAPL_CR       *cr_ptr,<br>
Index: dapl/openib_cma/dapl_ib_util.c<br>
===================================================================<br>
--- dapl/openib_cma/dapl_ib_util.c  (revision 4589)<br>
+++ dapl/openib_cma/dapl_ib_util.c  (working copy)<br>
@@ -35,7 +35,7 @@<br>
  *<br>
  *   Description: <br>
  *<br>
- *   The uDAPL openib provider - init, open, close, utilities, work
thread<br>
+ *   The OpenIB uCMA provider - init, open, close, utilities, work
thread<br>
  *<br>
 
****************************************************************************<br>
  *            Source
Control System Information<br>
@@ -64,7 +64,6 @@ static const char rcsid[] = "$Id:  $";<br>
 #include <net/if.h>     /* for struct ifreq */<br>
 #include <net/if_arp.h> /* for ARPHRD_INFINIBAND */<br>
 <br>
-<br>
 int g_dapl_loopback_connection = 0;<br>
 int g_ib_pipe[2];<br>
 ib_thread_state_t g_ib_thread_state = 0;<br>
@@ -727,7 +726,7 @@ void dapli_thread(void *arg) <br>
      int               
ret,idx,fds;<br>
      char              
rbuf[2];<br>
      <br>
-     dapl_dbg_log (DAPL_DBG_TYPE_CM,<br>
+     dapl_dbg_log (DAPL_DBG_TYPE_UTIL,<br>
                 
" ib_thread(%d,0x%x): ENTER: pipe %d ucma %d\n",<br>
                 
getpid(), g_ib_thread, g_ib_pipe[0], rdma_get_fd());<br>
 <br>
@@ -767,7 +766,7 @@ void dapli_thread(void *arg) <br>
                  ufds[idx].revents
= 0;<br>
                  uhca[idx]
= hca;<br>
 <br>
-                 dapl_dbg_log(DAPL_DBG_TYPE_CM,<br>
+                 dapl_dbg_log(DAPL_DBG_TYPE_UTIL,<br>
                        "
ib_thread(%d) poll_fd: hca[%d]=%p, async=%d"<br>
                        "
pipe=%d cm=%d cq=d\n",<br>
                        getpid(),
hca, ufds[idx-1].fd, <br>
@@ -783,14 +782,14 @@ void dapli_thread(void *arg) <br>
            dapl_os_unlock(&g_hca_lock);<br>
                
ret = poll(ufds, fds, -1); <br>
            if (ret
<= 0) {<br>
-                 dapl_dbg_log(DAPL_DBG_TYPE_WARN,<br>
+                 dapl_dbg_log(DAPL_DBG_TYPE_UTIL,<br>
                            
" ib_thread(%d): ERR %s poll\n",<br>
                            
getpid(),strerror(errno));<br>
                
 dapl_os_lock(&g_hca_lock);<br>
                  continue;<br>
            }<br>
 <br>
-           dapl_dbg_log(DAPL_DBG_TYPE_CM,<br>
+           dapl_dbg_log(DAPL_DBG_TYPE_UTIL,<br>
                  "
ib_thread(%d) poll_event: "<br>
                  "
async=0x%x pipe=0x%x cm=0x%x cq=0x%x\n",<br>
                  getpid(),
ufds[idx-1].revents, ufds[0].revents, <br>
@@ -834,3 +833,63 @@ void dapli_thread(void *arg) <br>
      dapl_os_unlock(&g_hca_lock);  <br>
 }<br>
 <br>
+#ifdef DAPL_PROVIDER_SPECIFIC_ATTR<br>
+/*<br>
+ * dapls_set_provider_specific_attr<br>
+ *<br>
+ * Input:<br>
+ *   attr_ptr    Pointer provider attributes<br>
+ *<br>
+ * Output:<br>
+ *   none<br>
+ *<br>
+ * Returns:<br>
+ *   void<br>
+ */<br>
+DAT_NAMED_ATTR   ib_attrs[] = {<br>
+ <br>
+#ifdef DAPL_EXTENSIONS<br>
+    {<br>
+     DAT_EXT_ATTR,<br>
+     DAT_EXT_ATTR_TRUE<br>
+    },<br>
+    {<br>
+     DAT_EXT_ATTR_RDMA_WRITE_IMMED,<br>
+     DAT_EXT_ATTR_TRUE<br>
+    },<br>
+    {<br>
+     DAT_EXT_ATTR_RECV_IMMED,<br>
+     DAT_EXT_ATTR_TRUE<br>
+    },<br>
+    /* inbound immediate data placed in event, NOT payload */<br>
+    {<br>
+     DAT_EXT_ATTR_RECV_IMMED_EVENT,<br>
+     DAT_EXT_ATTR_TRUE<br>
+    },<br>
+    {<br>
+     DAT_EXT_ATTR_FETCH_AND_ADD,<br>
+     DAT_EXT_ATTR_TRUE<br>
+    },<br>
+    {<br>
+     DAT_EXT_ATTR_CMP_AND_SWAP,<br>
+     DAT_EXT_ATTR_TRUE<br>
+    },<br>
+#else<br>
+     {<br>
+     "DAT_EXTENSION_INTERFACE",<br>
+     "FALSE"<br>
+    },<br>
+#endif<br>
+};<br>
+<br>
+#define SPEC_ATTR_SIZE(x) ( sizeof(x)/sizeof(DAT_NAMED_ATTR) )<br>
+<br>
+void dapls_set_provider_specific_attr(<br>
+     IN DAT_PROVIDER_ATTR    *attr_ptr )<br>
+{<br>
+    attr_ptr->num_provider_specific_attr =
SPEC_ATTR_SIZE(ib_attrs);<br>
+    attr_ptr->provider_specific_attr = ib_attrs;<br>
+}<br>
+<br>
+#endif<br>
+<br>
Index: dapl/openib_cma/dapl_ib_mem.c<br>
===================================================================<br>
--- dapl/openib_cma/dapl_ib_mem.c   (revision 4589)<br>
+++ dapl/openib_cma/dapl_ib_mem.c   (working copy)<br>
@@ -25,9 +25,9 @@<br>
 <br>
 /**********************************************************************<br>
  * <br>
- * MODULE: dapl_det_mem.c<br>
+ * MODULE: dapl_ib_mem.c<br>
  *<br>
- * PURPOSE: Intel DET APIs: Memory windows, registration,<br>
+ * PURPOSE: OpenIB uCMA provider Memory windows, registration,<br>
  *           and
protection domain <br>
  *<br>
  * $Id: $<br>
@@ -72,12 +72,10 @@ dapls_convert_privileges(IN DAT_MEM_PRIV<br>
            access |=
IBV_ACCESS_LOCAL_WRITE;<br>
      if (DAT_MEM_PRIV_REMOTE_WRITE_FLAG &
privileges)<br>
            access |=
IBV_ACCESS_REMOTE_WRITE;<br>
-     if (DAT_MEM_PRIV_REMOTE_READ_FLAG & privileges)<br>
-           access |=
IBV_ACCESS_REMOTE_READ;<br>
-     if (DAT_MEM_PRIV_REMOTE_READ_FLAG & privileges)<br>
-           access |=
IBV_ACCESS_REMOTE_READ;<br>
-     if (DAT_MEM_PRIV_REMOTE_READ_FLAG & privileges)<br>
+     if (DAT_MEM_PRIV_REMOTE_READ_FLAG & privileges) {<br>
            access |=
IBV_ACCESS_REMOTE_READ;<br>
+           access |=
IBV_ACCESS_REMOTE_ATOMIC;<br>
+     }<br>
 <br>
      return access;<br>
 }<br>
Index: dapl/openib_cma/dapl_ib_cm.c<br>
===================================================================<br>
--- dapl/openib_cma/dapl_ib_cm.c    (revision 4589)<br>
+++ dapl/openib_cma/dapl_ib_cm.c    (working copy)<br>
@@ -35,7 +35,7 @@<br>
  *<br>
  *   Description: <br>
  *<br>
- *   The uDAPL openib provider - connection management<br>
+ *   The OpenIB uCMA provider - uCMA connection management<br>
  *<br>
 
****************************************************************************<br>
  *            Source
Control System Information<br>
@@ -592,7 +592,11 @@ dapls_ib_setup_conn_listener(IN DAPL_IA <br>
 <br>
      if (rdma_bind_addr(conn->cm_id,<br>
                    
(struct sockaddr *)&ia_ptr->hca_ptr->hca_address)) {<br>
-           dat_status =
dapl_convert_errno(errno,"setup_listener");<br>
+           if (errno ==
-EBUSY)<br>
+                 dat_status
= DAT_CONN_QUAL_IN_USE;<br>
+           else<br>
+                 dat_status
= <br>
+                       dapl_convert_errno(errno,"setup_listener");<br>
            goto bail;<br>
      }<br>
 <br>
Index: dapl/openib_cma/dapl_ib_qp.c<br>
===================================================================<br>
--- dapl/openib_cma/dapl_ib_qp.c    (revision 4589)<br>
+++ dapl/openib_cma/dapl_ib_qp.c    (working copy)<br>
@@ -25,9 +25,9 @@<br>
 <br>
 /**********************************************************************<br>
  *<br>
- * MODULE: dapl_det_qp.c<br>
+ * MODULE: dapl_ib_qp.c<br>
  *<br>
- * PURPOSE: QP routines for access to DET Verbs<br>
+ * PURPOSE: OpenIB uCMA QP routines <br>
  *<br>
  * $Id: $<br>
  **********************************************************************/<br>
Index: dapl/openib_cma/dapl_ib_util.h<br>
===================================================================<br>
--- dapl/openib_cma/dapl_ib_util.h  (revision 4589)<br>
+++ dapl/openib_cma/dapl_ib_util.h  (working copy)<br>
@@ -35,7 +35,7 @@<br>
  *<br>
  *   Description: <br>
  *<br>
- *   The uDAPL openib provider - definitions, prototypes,<br>
+ *   The OpenIB uCMA provider - definitions, prototypes,<br>
  *<br>
  ****************************************************************************<br>
  *            Source
Control System Information<br>
Index: dapl/openib_cma/README<br>
===================================================================<br>
--- dapl/openib_cma/README    (revision 4589)<br>
+++ dapl/openib_cma/README    (working copy)<br>
@@ -23,15 +23,22 @@ New files for openib_scm provider<br>
      dapl/openib_cma/dapl_ib_util.c<br>
      dapl/openib_cma/dapl_ib_util.h<br>
      dapl/openib_cma/dapl_ib_cm.c<br>
+     dapl/openib_cma/dapl_ib_extensions.c<br>
 <br>
 A simple dapl test just for openib_scm testing...<br>
 <br>
      test/dtest/dtest.c<br>
+     test/dtest/dtest_ext.c<br>
      test/dtest/makefile<br>
 <br>
      server:     dtest -s <br>
      client:     dtest -h
hostname<br>
 <br>
+or with extensions<br>
+<br>
+     server:     dtest_ext -s <br>
+     client:     dtest_ext -h hostname<br>
+<br>
 known issues:<br>
 <br>
      no memory windows support in ibverbs,
dat_create_rmr fails.<br>
Index: dapl/openib_cma/dapl_ib_cq.c<br>
===================================================================<br>
--- dapl/openib_cma/dapl_ib_cq.c    (revision 4589)<br>
+++ dapl/openib_cma/dapl_ib_cq.c    (working copy)<br>
@@ -35,7 +35,7 @@<br>
  *<br>
  *   Description: <br>
  *<br>
- *   The uDAPL openib provider - completion queue<br>
+ *   The OpenIB uCMA provider - completion queue<br>
  *<br>
 
****************************************************************************<br>
  *            Source
Control System Information<br>
@@ -498,7 +498,10 @@ dapls_ib_wait_object_wait(IN ib_wait_obj<br>
      if (timeout != DAT_TIMEOUT_INFINITE)<br>
            timeout_ms =
timeout/1000;<br>
 <br>
-     status = poll(&cq_fd, 1, timeout_ms);<br>
+     /* restart syscall */<br>
+     while ((status = poll(&cq_fd, 1, timeout_ms)) ==
-1 )<br>
+           if (errno ==
EINTR)<br>
+                 continue;<br>
 <br>
      /* returned event */<br>
      if (status > 0) {<br>
@@ -511,6 +514,8 @@ dapls_ib_wait_object_wait(IN ib_wait_obj<br>
      /* timeout */<br>
      } else if (status == 0) <br>
            status =
ETIMEDOUT;<br>
+     else <br>
+           status = errno;<br>
      <br>
      dapl_dbg_log(DAPL_DBG_TYPE_UTIL, <br>
                
" cq_object_wait: RET evd %p ibv_cq %p ibv_ctx %p %s\n",<br>
Index: dat/include/dat/dat_redirection.h<br>
===================================================================<br>
--- dat/include/dat/dat_redirection.h     (revision 4589)<br>
+++ dat/include/dat/dat_redirection.h     (working copy)<br>
@@ -59,10 +59,10 @@ typedef struct dat_provider DAT_PROVIDER<br>
  * This would allow a good compiler to avoid indirection overhead when<br>
  * making function calls.<br>
  */<br>
-<br>
 #define DAT_HANDLE_TO_PROVIDER(handle) (*(DAT_PROVIDER **)(handle))<br>
 #endif<br>
 <br>
+<br>
 #define DAT_IA_QUERY(ia, evd, ia_msk, ia_ptr, p_msk, p_ptr) \<br>
      (*DAT_HANDLE_TO_PROVIDER (ia)->ia_query_func)
(\<br>
                
(ia),              
\<br>
@@ -395,6 +395,12 @@ typedef struct dat_provider DAT_PROVIDER<br>
            (lbuf), 
            \<br>
            (cookie))<br>
 <br>
+#define DAT_EXTENSION(handle, op, args) \<br>
+     (*DAT_HANDLE_TO_PROVIDER (handle)->extension_func)
(\<br>
+           (handle), \<br>
+           (op), \<br>
+           (args))<br>
+<br>
 /***************************************************************<br>
  *<br>
  * FUNCTION PROTOTYPES<br>
@@ -720,4 +726,11 @@ typedef DAT_RETURN (*DAT_SRQ_POST_RECV_F<br>
      IN      DAT_LMR_TRIPLET
*,    /*
local_iov            */<br>
      IN      DAT_DTO_COOKIE
);     /*
user_cookie          */<br>
 <br>
+/* Extension function */<br>
+#include <stdarg.h><br>
+typedef DAT_RETURN (*DAT_EXTENSION_FUNC) (<br>
+     IN    DAT_HANDLE,       /*
dat handle           */<br>
+     IN    DAT_EXT_OP,       /*
extension operation  */<br>
+        IN va_list );        /*
va_list        */<br>
+<br>
 #endif /* _DAT_REDIRECTION_H_ */<br>
Index: dat/include/dat/dat.h<br>
===================================================================<br>
--- dat/include/dat/dat.h     (revision 4589)<br>
+++ dat/include/dat/dat.h     (working copy)<br>
@@ -854,11 +854,15 @@ typedef enum dat_event_number<br>
    
DAT_ASYNC_ERROR_EP_BROKEN                   
= 0x08003,<br>
    
DAT_ASYNC_ERROR_TIMED_OUT         
          = 0x08004,<br>
    
DAT_ASYNC_ERROR_PROVIDER_INTERNAL_ERROR      =
0x08005,<br>
-   
DAT_SOFTWARE_EVENT                          
= 0x10001<br>
+   
DAT_SOFTWARE_EVENT                          
= 0x10001,<br>
+   
DAT_EXTENSION_EVENT                         
= 0x20001<br>
+<br>
 } DAT_EVENT_NUMBER;<br>
 <br>
-/* <st1:place w:st="on">Union</st1:place> for event Data */<br>
+/* include extension data definitions */<br>
+#include <dat/dat_extensions.h><br>
 <br>
+/* <st1:place w:st="on">Union</st1:place> for event Data */<br>
 typedef union dat_event_data<br>
 {<br>
    
DAT_DTO_COMPLETION_EVENT_DATA      dto_completion_event_data;<br>
@@ -867,6 +871,7 @@ typedef union dat_event_data<br>
    
DAT_CONNECTION_EVENT_DATA         
connect_event_data;<br>
    
DAT_ASYNCH_ERROR_EVENT_DATA       
asynch_error_event_data;<br>
    
DAT_SOFTWARE_EVENT_DATA           
software_event_data;<br>
+    DAT_EXTENSION_DATA                
extension_data;<br>
 } DAT_EVENT_DATA;<br>
 <br>
 /* Event struct that holds all event information */<br>
@@ -1222,6 +1227,11 @@ extern DAT_RETURN dat_srq_set_lw (<br>
      IN     
DAT_SRQ_HANDLE,         /*
srq_handle           */<br>
      IN      DAT_COUNT);            
/* low_watermark        */<br>
 <br>
+extern DAT_RETURN dat_extension(<br>
+     IN    DAT_HANDLE,<br>
+     IN      DAT_EXT_OP,<br>
+     IN    ... );<br>
+<br>
 /*<br>
  * DAT registry functions.<br>
  *<br>
Index: dat/include/dat/udat_redirection.h<br>
===================================================================<br>
--- dat/include/dat/udat_redirection.h    (revision 4589)<br>
+++ dat/include/dat/udat_redirection.h    (working copy)<br>
@@ -199,7 +199,6 @@ typedef DAT_RETURN (*DAT_EVD_SET_UNWAITA<br>
 typedef DAT_RETURN (*DAT_EVD_CLEAR_UNWAITABLE_FUNC) (<br>
      IN DAT_EVD_HANDLE);           /*
evd_handle           */<br>
 <br>
-<br>
 #include <dat/dat_redirection.h><br>
 <br>
 struct dat_provider<br>
@@ -294,6 +293,10 @@ struct dat_provider<br>
    
DAT_SRQ_QUERY_FUNC                 
srq_query_func;<br>
    
DAT_SRQ_RESIZE_FUNC                
srq_resize_func;<br>
    
DAT_SRQ_SET_LW_FUNC                
srq_set_lw_func;<br>
+<br>
+    /* extension for provder specific functions */<br>
+    DAT_EXTENSION_FUNC             extension_func;<br>
+<br>
 };<br>
 <br>
 #endif /* _UDAT_REDIRECTION_H_ */<br>
Index: dat/include/dat/dat_extensions.h<br>
===================================================================<br>
--- dat/include/dat/dat_extensions.h      (revision 0)<br>
+++ dat/include/dat/dat_extensions.h      (revision 0)<br>
@@ -0,0 +1,209 @@<br>
+/*<br>
+ * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved.<br>
+ *<br>
+ * This Software is licensed under one of the following licenses:<br>
+ * <br>
+ * 1) under the terms of the "Common Public License 1.0" a copy of
which is<br>
+ *    in the file LICENSE.txt in the root directory. The
license is also<br>
+ *    available from the Open Source Initiative, see <br>
+ *    http://www.opensource.org/licenses/cpl.php.<br>
+ * <br>
+ * 2) under the terms of the "The BSD License" a copy of which is in
the file<br>
+ *    LICENSE2.txt in the root directory. The license is also
available from<br>
+ *    the Open Source Initiative, see<br>
+ *    http://www.opensource.org/licenses/bsd-license.php.<br>
+ * <br>
+ * 3) under the terms of the "GNU General Public License (GPL) Version
2" a<br>
+ *    copy of which is in the file LICENSE3.txt in the root
directory. The<br>
+ *    license is also available from the Open Source
Initiative, see<br>
+ *    http://www.opensource.org/licenses/gpl-license.php.<br>
+ * <br>
+ * Licensee has the right to choose one of the above licenses.<br>
+ * <br>
+ * Redistributions of source code must retain the above copyright<br>
+ * notice and one of the license notices.<br>
+ * <br>
+ * Redistributions in binary form must reproduce both the above copyright<br>
+ * notice, one of the license notices in the documentation<br>
+ * and/or other materials provided with the distribution.<br>
+ */<br>
+/**********************************************************************<br>
+ *<br>
+ * HEADER: dat_extensions.h<br>
+ *<br>
+ * PURPOSE: defines the extensions to the DAT API for uDAPL.<br>
+ *<br>
+ * Description: Header file for "uDAPL: User Direct Access Programming<br>
+ *         Library, Version: 1.2"<br>
+ *<br>
+ * Mapping rules:<br>
+ *      All global symbols are prepended with
"DAT_" or "dat_"<br>
+ *      All DAT objects have an 'api' tag which, such
as 'ep' or 'lmr'<br>
+ *      The method table is in the provider
definition structure.<br>
+ *<br>
+ *<br>
+ **********************************************************************/<br>
+<br>
+#ifndef _DAT_EXTENSIONS_H_<br>
+<br>
+extern int dat_extensions;<br>
+<br>
+/* <br>
+ * Provider specific attribute strings for extension support <br>
+ *   returned with dat_ia_query() and <br>
+ *   DAT_PROVIDER_ATTR_MASK == DAT_PROVIDER_FIELD_PROVIDER_SPECIFIC_ATTR<br>
+ *<br>
+ *   DAT_NAMED_ATTR    name == extended operation, <br>
+ *               value
== TRUE if extended operation is supported<br>
+ */<br>
+#define DAT_EXT_ATTR               "DAT_EXTENSION_INTERFACE"<br>
+#define DAT_EXT_ATTR_RDMA_WRITE_IMMED    "DAT_EXT_RDMA_WRITE_IMMED"<br>
+#define DAT_EXT_ATTR_RECV_IMMED          "DAT_EXT_RECV_IMMED"<br>
+#define DAT_EXT_ATTR_RECV_IMMED_EVENT    "DAT_EXT_RECV_IMMED_EVENT"<br>
+#define DAT_EXT_ATTR_RECV_IMMED_PAYLOAD  "DAT_EXT_RECV_IMMED_PAYLOAD"<br>
+#define DAT_EXT_ATTR_FETCH_AND_ADD "DAT_EXT_FETCH_AND_ADD"<br>
+#define DAT_EXT_ATTR_CMP_AND_SWAP  "DAT_EXT_CMP_AND_SWAP"<br>
+#define DAT_EXT_ATTR_TRUE          "TRUE"<br>
+#define DAT_EXT_ATTR_FALSE         "FALSE"<br>
+<br>
+/* <br>
+ * Extension OPERATIONS <br>
+ */<br>
+typedef enum dat_ext_op<br>
+{<br>
+     DAT_EXT_RDMA_WRITE_IMMED,<br>
+     DAT_EXT_RECV_IMMED,<br>
+     DAT_EXT_FETCH_AND_ADD,<br>
+     DAT_EXT_CMP_AND_SWAP,<br>
+<br>
+} DAT_EXT_OP;<br>
+<br>
+/* <br>
+ * Extension completion event TYPES<br>
+ */<br>
+typedef enum dat_ext_event_type<br>
+{<br>
+     DAT_EXT_RDMA_WRITE_IMMED_STATUS = 1,<br>
+     DAT_EXT_RECV_NO_IMMED,<br>
+     DAT_EXT_RECV_IMMED_DATA_EVENT,      <br>
+     DAT_EXT_RECV_IMMED_DATA_PAYLOAD,    <br>
+     DAT_EXT_FETCH_AND_ADD_STATUS,       <br>
+     DAT_EXT_CMP_AND_SWAP_STATUS,        <br>
+<br>
+} DAT_EXT_EVENT_TYPE;<br>
+<br>
+/* <br>
+ * Extension completion event DATA<br>
+ */<br>
+typedef struct dat_immediate_data <br>
+{<br>
+    DAT_UINT32   data;<br>
+<br>
+} DAT_RDMA_WRITE_IMMED_DATA;<br>
+<br>
+typedef struct dat_extension_data<br>
+{<br>
+     DAT_DTO_COMPLETION_EVENT_DATA dto;<br>
+     DAT_EXT_EVENT_TYPE            type;<br>
+     union {<br>
+           DAT_RDMA_WRITE_IMMED_DATA     immed;      <br>
+     } val;<br>
+} DAT_EXTENSION_DATA;<br>
+<br>
+typedef enum dat_ext_flags<br>
+{<br>
+     DAT_EXT_WRITE_IMMED_FLAG      =
0x1,<br>
+     DAT_EXT_WRITE_CONFIRM_FLAG    = 0x2,<br>
+<br>
+} DAT_EXT_FLAGS;<br>
+<br>
+/* <br>
+ * Extended API with redirection via DAT extension function<br>
+ */<br>
+<br>
+/* <br>
+ * RDMA Write with IMMEDIATE extension:<br>
+ *<br>
+ * Asynchronous call performs a normal RDMA write to the remote endpoint <br>
+ * followed by a post of an extended immediate data value to the receive <br>
+ * EVD on the remote endpoint. Event completion for the request completes <br>
+ * as an DAT_EXTENSION_EVENT with type set to DAT_EXT_RDMA_WRITE_IMMED_STATUS.<br>
+ * Event completion on the remote endpoint completes as an DAT_EXTENSION_EVENT<br>
+ * with type set to DAT_EXT_RECV_IMMED_DATA_IN_EVENT or <br>
+ * DAT_EXT_RECV_IMMED_DATA_IN_PAYLOAD depending on the provider transport.<br>
+ *<br>
+ * DAT_EXT_WRITE_IMMED_FLAG requests that the supplied<br>
+ *'immediate' value be sent as the payload of a four byte send following<br>
+ * the RDMA Write, or any transport-dependent equivalent thereof.<br>
+ * For example, on InfiniBand the request should be translated as an<br>
+ * RDMA Write with Immediate. <br>
+ *<br>
+ * DAT_EXT_WRITE_CONFIRM_FLAG requests that this DTO<br>
+ * not complete until receipt by the far end is confirmed. <br>
+ *<br>
+ * Note to Consumers: the immediate data will consume a receive<br>
+ * buffer at the Data Sink. <br>
+ *<br>
+ * Other extension flags:<br>
+ *   n/a<br>
+ */<br>
+#define dat_ep_post_rdma_write_immed(ep, size, lbuf, cookie, rbuf, idata,
eflgs, flgs) \<br>
+           dat_extension( 
ep, \<br>
+                       DAT_EXT_RDMA_WRITE_IMMED,
\<br>
+                       (size),
\<br>
+                       (lbuf),
\<br>
+                       (cookie),
\<br>
+                       (rbuf),
\<br>
+                       (idata),
\<br>
+                       (eflgs),
\<br>
+                       (flgs))<br>
+     <br>
+/* <br>
+ * Call performs a normal post receive message to the local endpoint<br>
+ * that includes additional 32-bit buffer space for immediate data <br>
+ * Event completion for the request completes as an <br>
+ * DAT_EXTENSION_EVENT with type set to DAT_EXT_RDMA_WRITE_IMMED_STATUS.<br>
+ */<br>
+#define dat_ep_post_recv_immed(ep, size, lbuf, cookie, flgs) \<br>
+                 dat_extension( 
ep, \<br>
+                       DAT_EXT_RECV_IMMED,
\<br>
+                       (size),
\<br>
+                       (lbuf),
\<br>
+                       (cookie),
\<br>
+                       (flgs))<br>
+<br>
+/*<br>
+ * This asynchronous call is modeled after the InfiniBand atomic <br>
+ * Fetch and Add operation. The add_value is added to the 64 bit <br>
+ * value stored at the remote memory location specified in remote_iov<br>
+ * and the result is stored in the local_iov.  <br>
+ */<br>
+#define dat_ep_post_fetch_and_add(ep, add_val, lbuf, cookie, rbuf, flgs) \<br>
+           dat_extension( 
ep, \<br>
+                       DAT_EXT_FETCH_AND_ADD,
\<br>
+                       (add_val),
\<br>
+                       (lbuf),
\<br>
+                       (cookie),
\<br>
+                       (rbuf),
\<br>
+                       (flgs))<br>
+                       <br>
+/*<br>
+ * This asynchronous call is modeled after the InfiniBand atomic <br>
+ * Compare and Swap operation. The cmp_value is compared to the 64 bit <br>
+ * value stored at the remote memory location specified in remote_iov.  <br>
+ * If the two values are equal, the 64 bit swap_value is stored in <br>
+ * the remote memory location.  In all cases, the original 64 bit <br>
+ * value stored in the remote memory location is copied to the local_iov.<br>
+ */<br>
+#define dat_ep_post_cmp_and_swap(ep, cmp_val, swap_val, lbuf, cookie, rbuf,
flgs) \<br>
+           dat_extension( 
ep, \<br>
+                       DAT_EXT_CMP_AND_SWAP,
\<br>
+                       (cmp_val),
\<br>
+                       (swap_val),
\<br>
+                       (lbuf),
\<br>
+                       (cookie),
\<br>
+                       (rbuf),
\<br>
+                       (flgs))<br>
+<br>
+#endif /* _DAT_EXTENSIONS_H_ */<br>
+<br>
Index: dat/common/dat_api.c<br>
===================================================================<br>
--- dat/common/dat_api.c      (revision 4594)<br>
+++ dat/common/dat_api.c      (working copy)<br>
@@ -1142,6 +1142,36 @@ DAT_RETURN dat_srq_set_lw(<br>
                    
low_watermark);<br>
 }<br>
 <br>
+DAT_RETURN dat_extension(<br>
+        IN     
DAT_HANDLE      handle,<br>
+        IN     
DAT_EXT_OP      ext_op,<br>
+        IN     
... )<br>
+<br>
+{<br>
+     DAT_RETURN status;<br>
+     va_list    args;<br>
+<br>
+     if (handle == NULL)<br>
+     {<br>
+        return
DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EP);<br>
+     }<br>
+<br>
+     /* verify provider extension support */<br>
+     if (!dat_extensions)<br>
+     {<br>
+        return DAT_ERROR(DAT_NOT_IMPLEMENTED,
0);<br>
+     }<br>
+<br>
+     va_start(args, ext_op);<br>
+<br>
+     status = DAT_EXTENSION(handle,<br>
+                           
ext_op,<br>
+                           
args);<br>
+     va_end(args);<br>
+<br>
+     return status;<br>
+}<br>
+<br>
 /*<br>
  * Local variables:<br>
  *  c-indent-level: 4<br>
Index: dat/udat/udat.c<br>
===================================================================<br>
--- dat/udat/udat.c     (revision 4594)<br>
+++ dat/udat/udat.c     (working copy)<br>
@@ -66,6 +66,10 @@ udat_check_state ( void );<br>
 
*                                          
                        *<br>
  *********************************************************************/<br>
 <br>
+/*<br>
+ *  Use a global to get an unresolved when run with pre-extension library<br>
+ */<br>
+int dat_extensions = 0;<br>
 <br>
 /*<br>
  *<br>
@@ -230,13 +234,44 @@ dat_ia_openv (<br>
                         
async_event_qlen,<br>
                         
async_event_handle,<br>
                         
ia_handle);<br>
+<br>
+    /*<br>
+     *  See if provider supports extensions<br>
+     */<br>
     if (dat_status == DAT_SUCCESS)<br>
     {<br>
-     return_handle = dats_set_ia_handle (*ia_handle);<br>
-     if (return_handle >= 0)<br>
-     {<br>
-         *ia_handle =
(DAT_IA_HANDLE)return_handle;<br>
-     }<br>
+       
DAT_PROVIDER_ATTR       p_attr;<br>
+       
int                    
i;<br>
+<br>
+        return_handle = dats_set_ia_handle
(*ia_handle);<br>
+        if (return_handle >= 0)<br>
+        {<br>
+            *ia_handle
= (DAT_IA_HANDLE)return_handle;<br>
+        }<br>
+<br>
+        if ( dat_ia_query( *ia_handle,<br>
+                          
NULL,<br>
+                          
0,<br>
+                          
NULL,<br>
+                          
DAT_PROVIDER_FIELD_PROVIDER_SPECIFIC_ATTR,<br>
+                          
&p_attr ) == DAT_SUCCESS )<br>
+        {<br>
+            for ( i =
0; i < p_attr.num_provider_specific_attr; i++ )<br>
+            {<br>
+               
if ( (strcmp( p_attr.provider_specific_attr[i].name,<br>
+                           
            "DAT_EXTENSION_INTERFACE"
) == 0) &&<br>
+                    
(strcmp( p_attr.provider_specific_attr[i].value,<br>
+                                       
"TRUE" ) == 0) )<br>
+               
{<br>
+                       
dat_os_dbg_print(DAT_OS_DBG_TYPE_CONSUMER_API,<br>
+                                        
"DAT Registry: dat_ia_open () "<br>
+                                        
"DAPL Extension Interface supported!\n");<br>
+<br>
+                       
dat_extensions = 1;<br>
+                       
break;<br>
+                }<br>
+            }<br>
+        }<br>
     }<br>
 <br>
     return dat_status;<br>
Index: README<br>
===================================================================<br>
--- README  (revision 4589)<br>
+++ README  (working copy)<br>
@@ -1,5 +1,10 @@<br>
 There are now 3 uDAPL providers for openib
(openib,openib_scm,openib_cma). <br>
 <br>
+NEW FEATURES for openib_cma provider:<br>
+API extensions for immediate data and atomic operations have been added.<br>
+see dat/include/dat/dat_extensions.h for new API's. <br>
+see dapl/test/dtest/dtest_ext.c for example test cast <br>
+<br>
 <br>
 ==========<br>
 1.0 BUILD:<br>
<o:p> </o:p></span></font></p>

<pre><font size=2 face="Courier New"><span style='font-size:10.0pt'><o:p> </o:p></span></font></pre>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

</div>

</body>

</html>