<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>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.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";}
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=Arial><span style='font-size:10.0pt;
font-family:Arial'>James,<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'>Here is a patch with the IB rdma_write_with_immediate() back
in as an extension along with the atomics. Please review the various methods
that I used to extend the return codes, memory privileges, and DTO event
processing.<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>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>Signed-off by: Arlin Davis <a
href="mailto:ardavis@ichips.intel.com">ardavis@ichips.intel.com</a><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>Index: test/dtest/makefile<br>
===================================================================<br>
--- test/dtest/makefile (revision 5366)<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: dapl/include/dapl.h<br>
===================================================================<br>
--- dapl/include/dapl.h (revision 5366)<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>
@@ -178,6 +181,11 @@ typedef enum dapl_qp_state<br>
<br>
#define DAT_ERROR(Type, SubType) ((DAT_RETURN)(DAT_CLASS_ERROR | Type |
SubType))<br>
<br>
+#ifdef DAT_EXTENSIONS<br>
+#define DAT_ERROR_EXTENSION(Type, ExtType, SubType) \<br>
+ ((DAT_RETURN)(DAT_CLASS_ERROR | Type | ExtType | SubType))<br>
+#endif<br>
+<br>
/*********************************************************************<br>
*
*<br>
*
Typedefs
*<br>
@@ -563,6 +571,10 @@ typedef enum dapl_dto_type<br>
DAPL_DTO_TYPE_RECV,<br>
DAPL_DTO_TYPE_RDMA_WRITE,<br>
DAPL_DTO_TYPE_RDMA_READ,<br>
+#ifdef DAT_EXTENSIONS<br>
+ DAPL_DTO_TYPE_EXTENSION<br>
+#endif<br>
+<br>
} DAPL_DTO_TYPE;<br>
<br>
typedef enum dapl_cookie_type<br>
@@ -570,6 +582,7 @@ typedef enum dapl_cookie_type<br>
DAPL_COOKIE_TYPE_NULL,<br>
DAPL_COOKIE_TYPE_DTO,<br>
DAPL_COOKIE_TYPE_RMR,<br>
+<br>
} DAPL_COOKIE_TYPE;<br>
<br>
/* DAPL_DTO_COOKIE used as context for DTO WQEs */<br>
@@ -578,6 +591,9 @@ struct dapl_dto_cookie<br>
DAPL_DTO_TYPE type;<br>
DAT_DTO_COOKIE cookie;<br>
DAT_COUNT size; /*
used for SEND and RDMA write */<br>
+#ifdef DAT_EXTENSIONS<br>
+ DAT_PVOID extension; /*
extended DTO ops */<br>
+#endif<br>
};<br>
<br>
/* DAPL_RMR_COOKIE used as context for bind WQEs */<br>
@@ -1116,6 +1132,14 @@ extern DAT_RETURN dapl_srq_set_lw(<br>
IN
DAT_SRQ_HANDLE, /*
srq_handle */<br>
IN
DAT_COUNT);
/* low_watermark */<br>
<br>
+#ifdef DAT_EXTENSIONS<br>
+extern DAT_RETURN dapl_extensions(<br>
+ IN DAT_HANDLE, /*
dat_handle */<br>
+ IN DAT_DTO_EXTENSION_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/include/dapl_debug.h<br>
===================================================================<br>
--- dapl/include/dapl_debug.h (revision 5366)<br>
+++ dapl/include/dapl_debug.h (working copy)<br>
@@ -112,7 +112,13 @@ extern void dapl_internal_dbg_log ( DAPL<br>
#define DCNT_EVD_DEQUEUE_NOT_FOUND 18<br>
#define DCNT_TIMER_SET 19<br>
#define DCNT_TIMER_CANCEL 20<br>
+#ifdef DAT_EXTENSION<br>
+#define DCNT_EXTENSION 21<br>
+#define DCNT_NUM_COUNTERS 22<br>
+#else<br>
#define DCNT_NUM_COUNTERS 21<br>
+#endif<br>
+<br>
#define
DCNT_ALL_COUNTERS
DCNT_NUM_COUNTERS<br>
<br>
#if defined(DAPL_COUNTERS)<br>
Index: dapl/udapl/Makefile<br>
===================================================================<br>
--- dapl/udapl/Makefile (revision 5366)<br>
+++ dapl/udapl/Makefile (working copy)<br>
@@ -80,6 +80,12 @@ ifdef OS_VENDOR<br>
CFLAGS += -D$(OS_VENDOR)<br>
endif<br>
<br>
+# If an implementation supports immdiate data and extensions<br>
+CFLAGS += -DDAT_EXTENSIONS <br>
+<br>
+# If an implementation supports DAPL provider specific attributes<br>
+CFLAGS += -DDAPL_PROVIDER_SPECIFIC_ATTR<br>
+<br>
#<br>
# dummy provider<br>
#<br>
@@ -283,6 +289,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 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 5366)<br>
+++ dapl/common/dapl_ia_query.c (working copy)<br>
@@ -151,6 +151,7 @@ dapl_ia_query (<br>
provider_attr->dat_qos_supported =
DAT_QOS_BEST_EFFORT;<br>
provider_attr->completion_flags_supported =
DAT_COMPLETION_DEFAULT_FLAG;<br>
provider_attr->is_thread_safe =
DAT_FALSE;<br>
+<br>
/*<br>
* N.B. The second part of the following
equation will evaluate<br>
* to 0 unless IBHOSTS_NAMING
is enabled.<br>
@@ -167,6 +168,14 @@ dapl_ia_query (<br>
#if !defined(__KDAPL__)<br>
provider_attr->pz_support
= DAT_PZ_UNIQUE;<br>
#endif /* !KDAPL */<br>
+<br>
+ /*<br>
+ * Query for provider specific attributes<br>
+ */<br>
+#ifdef DAPL_PROVIDER_SPECIFIC_ATTR<br>
+ dapls_query_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 5366)<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_query_provider_specific_attr(<br>
+ IN DAT_PROVIDER_ATTR *provider_attr
);<br>
+#endif<br>
+<br>
+#ifdef DAT_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>
Index: dapl/common/dapl_provider.c<br>
===================================================================<br>
--- dapl/common/dapl_provider.c (revision 5366)<br>
+++ dapl/common/dapl_provider.c (working copy)<br>
@@ -221,7 +221,12 @@ 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 DAT_EXTENSIONS<br>
+ /* dat-2.0 */<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 5366)<br>
+++ dapl/common/dapl_evd_util.c (working copy)<br>
@@ -502,6 +502,21 @@ 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_IMMED",<br>
+ "OP_SEND",<br>
+ "OP_SEND_IMMED",<br>
+ "OP_RDMA_READ",<br>
+ "OP_COMP_AND_SWAP",<br>
+ "OP_FETCH_AND_ADD",<br>
+ "OP_RECEIVE",<br>
+ "OP_RECEIVE_IMMED",<br>
+ "OP_RECEIVE_RDMA_IMMED",<br>
+ "OP_BIND_MW",<br>
+ "OP_INVALID",<br>
+#else<br>
"OP_SEND",<br>
"OP_RDMA_READ",<br>
"OP_RDMA_WRITE",<br>
@@ -509,6 +524,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>
@@ -1047,6 +1063,10 @@ dapli_evd_cqe_to_event (<br>
event_ptr->event_data.dto_completion_event_data.user_cookie =<br>
cookie->val.dto.cookie;<br>
event_ptr->event_data.dto_completion_event_data.status = dto_status;<br>
+ <br>
+ /* new operation field for DAT 2.0
*/<br>
+
event_ptr->event_data.dto_completion_event_data.operation = <br>
+ DAPL_GET_CQE_DTOS_OPTYPE(cqe_ptr);<br>
<br>
#ifdef DAPL_DBG<br>
if (dto_status ==
DAT_DTO_SUCCESS)<br>
@@ -1055,15 +1075,20 @@ dapli_evd_cqe_to_event (<br>
<br>
ibtype =
DAPL_GET_CQE_OPTYPE (cqe_ptr);<br>
<br>
- dapl_os_assert
((ibtype == OP_SEND &&<br>
-
cookie->val.dto.type == DAPL_DTO_TYPE_SEND)<br>
- ||
(ibtype == OP_RECEIVE &&<br>
-
cookie->val.dto.type == DAPL_DTO_TYPE_RECV)<br>
- ||
(ibtype == OP_RDMA_WRITE &&<br>
-
cookie->val.dto.type == DAPL_DTO_TYPE_RDMA_WRITE)<br>
- ||
(ibtype == OP_RDMA_READ &&<br>
-
cookie->val.dto.type == DAPL_DTO_TYPE_RDMA_READ));<br>
- }<br>
+#ifdef DAT_EXTENSIONS<br>
+ if
((cookie->val.dto.type != DAPL_DTO_TYPE_EXTENSION) &&<br>
+
(ibtype == OP_RECEIVE && <br>
+ cookie->val.dto.type
== DAPL_DTO_TYPE_RECV))<br>
+#endif<br>
+ dapl_os_assert
((ibtype == OP_SEND &&<br>
+
cookie->val.dto.type == DAPL_DTO_TYPE_SEND)<br>
+ ||
(ibtype == OP_RECEIVE &&<br>
+
cookie->val.dto.type == DAPL_DTO_TYPE_RECV)<br>
+
|| (ibtype == OP_RDMA_WRITE &&<br>
+
cookie->val.dto.type == DAPL_DTO_TYPE_RDMA_WRITE)<br>
+
|| (ibtype == OP_RDMA_READ &&<br>
+
cookie->val.dto.type == DAPL_DTO_TYPE_RDMA_READ));<br>
+ }<br>
#endif /* DAPL_DBG */<br>
<br>
if ( cookie->val.dto.type
== DAPL_DTO_TYPE_SEND ||<br>
@@ -1079,6 +1104,11 @@ dapli_evd_cqe_to_event (<br>
DAPL_GET_CQE_BYTESNUM (cqe_ptr);<br>
}<br>
<br>
+#ifdef DAT_EXTENSIONS<br>
+ if (
DAPL_GET_CQE_DTOS_OPTYPE(cqe_ptr) == DAT_EXTENSION )<br>
+ dapls_cqe_to_event_extension(ep_ptr,
cookie, cqe_ptr, event_ptr);<br>
+#endif<br>
+<br>
dapls_cookie_dealloc (buffer,
cookie);<br>
break;<br>
}<br>
@@ -1113,6 +1143,7 @@ dapli_evd_cqe_to_event (<br>
dapls_cookie_dealloc
(&ep_ptr->req_buffer, cookie);<br>
break;<br>
}<br>
+<br>
default:<br>
{<br>
dapl_os_assert
(!"Invalid Operation type");<br>
Index: dapl/common/dapl_debug.c<br>
===================================================================<br>
--- dapl/common/dapl_debug.c (revision 5366)<br>
+++ dapl/common/dapl_debug.c (working copy)<br>
@@ -86,6 +86,9 @@ char *dapl_dbg_counter_names[] = {<br>
"dapl_evd_not_found",<br>
"dapls_timer_set",<br>
"dapls_timer_cancel",<br>
+#ifdef DAT_EXTENSION<br>
+ "dapls_extension",<br>
+#endif<br>
};<br>
<br>
void dapl_dump_cntr( int cntr )<br>
Index: dapl/openib_cma/dapl_ib_dto.h<br>
===================================================================<br>
--- dapl/openib_cma/dapl_ib_dto.h (revision 5366)<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>
@@ -200,6 +199,7 @@ dapls_ib_post_send (<br>
wr.wr.rdma.rkey, wr.wr.rdma.remote_addr);<br>
}<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>
@@ -224,6 +224,178 @@ dapls_ib_post_send (<br>
return DAT_SUCCESS;<br>
}<br>
<br>
+/* map Work Completions to DAPL WR operations */<br>
+STATIC _INLINE_ DAT_DTOS dapls_cqe_dtos_opcode(ib_work_completion_t *cqe_p)<br>
+{<br>
+ switch (cqe_p->opcode) {<br>
+<br>
+ case IBV_WC_SEND:<br>
+ return
(DAT_SEND);<br>
+ case IBV_WC_RDMA_READ:<br>
+ return
(DAT_RDMA_READ);<br>
+ case IBV_WC_BIND_MW:<br>
+ return
(DAT_BIND_MW);<br>
+#ifdef DAT_EXTENSIONS<br>
+ case IBV_WC_RDMA_WRITE:<br>
+ if
(cqe_p->wc_flags & IBV_WC_WITH_IMM)<br>
+ return
(DAT_EXTENSION);<br>
+ else<br>
+ return
(DAT_RDMA_WRITE);<br>
+ case IBV_WC_COMP_SWAP:<br>
+ return
(DAT_EXTENSION);<br>
+ case IBV_WC_FETCH_ADD:<br>
+ return
(DAT_EXTENSION);<br>
+ case IBV_WC_RECV_RDMA_WITH_IMM:<br>
+ return
(DAT_EXTENSION);<br>
+#else<br>
+ case IBV_WC_RDMA_WRITE:<br>
+ return
(DAT_RDMA_WRITE);<br>
+#endif<br>
+ case IBV_WC_RECV:<br>
+ return
(DAT_RECEIVE);<br>
+ default:<br>
+ return (0xff);<br>
+ }<br>
+}<br>
+#define DAPL_GET_CQE_DTOS_OPTYPE(cqe_p) dapls_cqe_dtos_opcode(cqe_p)<br>
+<br>
+<br>
+#ifdef DAT_EXTENSIONS<br>
+/*<br>
+ * dapls_ib_post_ext_send<br>
+ *<br>
+ * Provider specific extended Post SEND function for atomics<br>
+ * OP_COMP_AND_SWAP and OP_FETCH_AND_ADD<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 immed_data,<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>
+ 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>
+ switch (op_type) {<br>
+ case OP_RDMA_WRITE_IMMED:<br>
+ /*
OP_RDMA_WRITE)IMMED has direct IB wr_type mapping */<br>
+ dapl_dbg_log(DAPL_DBG_TYPE_EP,
<br>
+
" post_ext: rkey 0x%x va %#016Lx immed=0x%x\n",<br>
+
remote_iov->rmr_context, <br>
+
remote_iov->target_address, immed_data);<br>
+<br>
+ wr.imm_data =
immed_data;<br>
+ wr.wr.rdma.remote_addr
= remote_iov->target_address;<br>
+ wr.wr.rdma.rkey =
remote_iov->rmr_context;<br>
+ break;<br>
+ case OP_COMP_AND_SWAP:<br>
+ /*
OP_COMP_AND_SWAP has direct IB wr_type mapping */<br>
+ dapl_dbg_log(DAPL_DBG_TYPE_EP,
<br>
+
" post_ext: 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 IB wr_type mapping */<br>
+ dapl_dbg_log(DAPL_DBG_TYPE_EP,
<br>
+
" post_ext: 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>
+ /* 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>
@@ -233,13 +405,17 @@ dapls_ib_optional_prv_dat(<br>
return DAT_SUCCESS;<br>
}<br>
<br>
+/* map Work Completions to DAPL WR operations */<br>
STATIC _INLINE_ int dapls_cqe_opcode(ib_work_completion_t *cqe_p)<br>
{<br>
switch (cqe_p->opcode) {<br>
case IBV_WC_SEND:<br>
return
(OP_SEND);<br>
case IBV_WC_RDMA_WRITE:<br>
- return
(OP_RDMA_WRITE);<br>
+ if
(cqe_p->wc_flags & IBV_WC_WITH_IMM)<br>
+ return
(OP_RDMA_WRITE_IMMED);<br>
+ else<br>
+ return
(OP_RDMA_WRITE);<br>
case IBV_WC_RDMA_READ:<br>
return
(OP_RDMA_READ);<br>
case IBV_WC_COMP_SWAP:<br>
@@ -249,14 +425,18 @@ STATIC _INLINE_ int dapls_cqe_opcode(ib_<br>
case IBV_WC_BIND_MW:<br>
return
(OP_BIND_MW);<br>
case IBV_WC_RECV:<br>
- return
(OP_RECEIVE);<br>
+ if
(cqe_p->wc_flags & IBV_WC_WITH_IMM)<br>
+ return
(OP_RECEIVE_IMMED);<br>
+ else<br>
+ return
(OP_RECEIVE);<br>
case IBV_WC_RECV_RDMA_WITH_IMM:<br>
- return
(OP_RECEIVE_IMM);<br>
+ return
(OP_RECEIVE_RDMA_IMMED);<br>
default:<br>
return
(OP_INVALID);<br>
}<br>
}<br>
<br>
+<br>
#define DAPL_GET_CQE_OPTYPE(cqe_p) dapls_cqe_opcode(cqe_p)<br>
#define DAPL_GET_CQE_WRID(cqe_p) ((ib_work_completion_t*)cqe_p)->wr_id<br>
#define DAPL_GET_CQE_STATUS(cqe_p)
((ib_work_completion_t*)cqe_p)->status<br>
Index: dapl/openib_cma/dapl_ib_util.c<br>
===================================================================<br>
--- dapl/openib_cma/dapl_ib_util.c (revision 5366)<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>
@@ -121,11 +120,12 @@ static int getipaddr(char *name, char *a<br>
if (getaddrinfo(name, NULL, NULL, &res)) {<br>
/* retry
using network device name */<br>
ret =
getipaddr_netdev(name,addr,len);<br>
- if (ret)<br>
+ if (ret) {<br>
dapl_dbg_log(DAPL_DBG_TYPE_WARN,
<br>
" getipaddr: invalid name, addr, or netdev(%s)\n",<br>
name);<br>
- return ret;<br>
+ return
ret;<br>
+ }<br>
} else {<br>
if (len
>= res->ai_addrlen)<br>
memcpy(addr,
res->ai_addr, res->ai_addrlen);<br>
@@ -330,6 +330,13 @@ DAT_RETURN dapls_ib_close_hca(IN DAPL_HC<br>
hca_ptr->ib_hca_handle
= IB_INVALID_HANDLE;<br>
}<br>
<br>
+ dapl_os_lock(&g_hca_lock);<br>
+ if (g_ib_thread_state != IB_THREAD_RUN) {<br>
+ dapl_os_unlock(&g_hca_lock);<br>
+ goto bail;<br>
+ }<br>
+ dapl_os_unlock(&g_hca_lock);<br>
+<br>
/* <br>
* Remove hca from async and CQ event
processing list<br>
* Wakeup work thread to remove from
polling list<br>
@@ -342,10 +349,12 @@ DAT_RETURN dapls_ib_close_hca(IN DAPL_HC<br>
struct
timespec sleep, remain;<br>
sleep.tv_sec
= 0;<br>
sleep.tv_nsec
= 10000000; /* 10 ms */<br>
+ write(g_ib_pipe[1],
"w", sizeof "w");<br>
dapl_dbg_log(DAPL_DBG_TYPE_UTIL,
<br>
" ib_thread_destroy: wait on hca %p destroy\n");<br>
nanosleep
(&sleep, &remain);<br>
}<br>
+bail:<br>
return (DAT_SUCCESS);<br>
}<br>
<br>
@@ -727,7 +736,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 +776,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 +792,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 +843,61 @@ void dapli_thread(void *arg) <br>
dapl_os_unlock(&g_hca_lock); <br>
}<br>
<br>
+#ifdef DAPL_PROVIDER_SPECIFIC_ATTR<br>
+/*<br>
+ * dapls_query_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 DAT_EXTENSIONS<br>
+ {<br>
+ DAT_EXTENSION_ATTR,<br>
+ DAT_EXTENSION_ATTR_TRUE<br>
+ },<br>
+ {<br>
+ DAT_EXTENSION_ATTR_VERSION,<br>
+ DAT_EXTENSION_ATTR_VERSION_VALUE<br>
+ },<br>
+ {<br>
+ DAT_EXTENSION_ATTR_FETCH_AND_ADD,<br>
+ DAT_EXTENSION_ATTR_TRUE<br>
+ },<br>
+ {<br>
+ DAT_EXTENSION_ATTR_CMP_AND_SWAP,<br>
+ DAT_EXTENSION_ATTR_TRUE<br>
+ },<br>
+ {<br>
+ DAT_EXTENSION_ATTR_IMMED_DATA,<br>
+ DAT_EXTENSION_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>
+/* <br>
+ * Query for all provider specific attributes and <br>
+ */<br>
+void dapls_query_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 5366)<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,12 @@ 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>
+#ifdef DAT_EXTENSIONS<br>
+ if (DAT_MEM_PRIV_EXT_REMOTE_ATOMIC & privileges) <br>
+ access |=
IBV_ACCESS_REMOTE_ATOMIC;<br>
+#endif<br>
<br>
return access;<br>
}<br>
Index: dapl/openib_cma/dapl_ib_qp.c<br>
===================================================================<br>
--- dapl/openib_cma/dapl_ib_qp.c (revision 5366)<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 5366)<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>
@@ -123,15 +123,16 @@ typedef struct ibv_comp_channel *ib_wait<br>
<br>
/* DTO OPs, ordered for DAPL ENUM definitions */<br>
#define
OP_RDMA_WRITE
IBV_WR_RDMA_WRITE<br>
-#define OP_RDMA_WRITE_IMM IBV_WR_RDMA_WRITE_WITH_IMM<br>
+#define OP_RDMA_WRITE_IMMED IBV_WR_RDMA_WRITE_WITH_IMM<br>
#define
OP_SEND
IBV_WR_SEND<br>
-#define
OP_SEND_IMM
IBV_WR_SEND_WITH_IMM<br>
+#define
OP_SEND_IMMED
IBV_WR_SEND_WITH_IMM<br>
#define
OP_RDMA_READ IBV_WR_RDMA_READ<br>
#define OP_COMP_AND_SWAP
IBV_WR_ATOMIC_CMP_AND_SWP<br>
#define OP_FETCH_AND_ADD
IBV_WR_ATOMIC_FETCH_AND_ADD<br>
-#define
OP_RECEIVE
7 /* internal op */<br>
-#define OP_RECEIVE_IMM 8 /*
internel op */<br>
-#define OP_BIND_MW
9 /* internal op */<br>
+#define
OP_RECEIVE
0x7 /* internal op */<br>
+#define OP_RECEIVE_IMMED 0x8 /* internel
op */<br>
+#define OP_RECEIVE_RDMA_IMMED 0x9 /*
internal op */<br>
+#define
OP_BIND_MW
0xa /* internal op */<br>
#define OP_INVALID 0xff<br>
<br>
/* Definitions to map QP state */<br>
@@ -295,7 +296,8 @@ dapl_convert_errno( IN int err, IN const<br>
if (!err) return DAT_SUCCESS;<br>
<br>
#if DAPL_DBG<br>
- if ((err != EAGAIN) && (err != ETIME) &&
(err != ETIMEDOUT))<br>
+ if ((err != EAGAIN) && (err != ETIME) && <br>
+ (err != ETIMEDOUT) && (err != EINTR))<br>
dapl_dbg_log (DAPL_DBG_TYPE_ERR," %s
%s\n", str, strerror(err));<br>
#endif <br>
<br>
Index: dapl/openib_cma/dapl_ib_cq.c<br>
===================================================================<br>
--- dapl/openib_cma/dapl_ib_cq.c (revision 5366)<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/udat.h<br>
===================================================================<br>
--- dat/include/dat/udat.h (revision 5366)<br>
+++ dat/include/dat/udat.h (working copy)<br>
@@ -1,31 +1,51 @@<br>
/*<br>
- * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved.<br>
+ * Copyright (c) 2002-2004, 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>
+ * This Software is licensed under both of the following two licenses:<br>
+ *<br>
+ * 1) under the terms of the "Common Public License 1.0". 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>
+ *<br>
+ * OR<br>
+ *<br>
+ * 2) under the terms of the "The BSD License". The license is also
available<br>
+ * from 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>
+ *<br>
+ * Licensee has the right to choose either one of the above two licenses.<br>
+ *<br>
+ * Redistribution and use in source and binary forms, with or without<br>
+ * modification, are permitted provided that the following conditions are<br>
+ * met:<br>
+ *<br>
+ * Redistributions of source code must retain both the above copyright<br>
+ * notice and either 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>
+ * notice, either one of the license notices in the documentation<br>
* and/or other materials provided with the distribution.<br>
+ *<br>
+ * Neither the name of Network Appliance, Inc. nor the names of other DAT<br>
+ * Collaborative contributors may be used to endorse or promote<br>
+ * products derived from this software without specific prior written<br>
+ * permission.<br>
+ *<br>
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND<br>
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED<br>
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED<br>
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR<br>
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL<br>
+ * THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY<br>
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR<br>
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,<br>
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;<br>
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)<br>
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,<br>
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT<br>
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY<br>
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE<br>
+ * POSSIBILITY OF SUCH DAMAGE.<br>
*/<br>
<br>
/****************************************************************<br>
Index: dat/include/dat/dat_redirection.h<br>
===================================================================<br>
--- dat/include/dat/dat_redirection.h (revision 5366)<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,14 @@ typedef struct dat_provider DAT_PROVIDER<br>
(lbuf),
\<br>
(cookie))<br>
<br>
+#ifdef DAT_EXTENSIONS<br>
+#define DAT_EXTENSION(handle, op, args) \<br>
+ (*DAT_HANDLE_TO_PROVIDER (handle)->extension_func)
(\<br>
+ (handle), \<br>
+ (op), \<br>
+ (args))<br>
+#endif<br>
+<br>
/***************************************************************<br>
*<br>
* FUNCTION PROTOTYPES<br>
@@ -720,4 +728,13 @@ typedef DAT_RETURN (*DAT_SRQ_POST_RECV_F<br>
IN DAT_LMR_TRIPLET
*, /*
local_iov */<br>
IN DAT_DTO_COOKIE
); /* user_cookie
*/<br>
<br>
+#ifdef DAT_EXTENSIONS<br>
+#include <stdarg.h><br>
+typedef DAT_RETURN (*DAT_EXTENSION_FUNC) (<br>
+ IN DAT_HANDLE, /*
dat handle */<br>
+ IN DAT_DTO_EXTENSION_OP, /*
extension operation */<br>
+ IN va_list ); /*
va_list */<br>
+#endif<br>
+<br>
+<br>
#endif /* _DAT_REDIRECTION_H_ */<br>
Index: dat/include/dat/dat_error.h<br>
===================================================================<br>
--- dat/include/dat/dat_error.h (revision 5366)<br>
+++ dat/include/dat/dat_error.h (working copy)<br>
@@ -1,31 +1,51 @@<br>
/*<br>
- * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved.<br>
+ * Copyright (c) 2002-2004, 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>
+ * This Software is licensed under both of the following two licenses:<br>
+ *<br>
+ * 1) under the terms of the "Common Public License 1.0". 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>
+ *<br>
+ * OR<br>
+ *<br>
+ * 2) under the terms of the "The BSD License". The license is also
available<br>
+ * from 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>
+ *<br>
+ * Licensee has the right to choose either one of the above two licenses.<br>
+ *<br>
+ * Redistribution and use in source and binary forms, with or without<br>
+ * modification, are permitted provided that the following conditions are<br>
+ * met:<br>
+ *<br>
+ * Redistributions of source code must retain both the above copyright<br>
+ * notice and either 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>
+ * notice, either one of the license notices in the documentation<br>
* and/or other materials provided with the distribution.<br>
+ *<br>
+ * Neither the name of Network Appliance, Inc. nor the names of other DAT<br>
+ * Collaborative contributors may be used to endorse or promote<br>
+ * products derived from this software without specific prior written<br>
+ * permission.<br>
+ *<br>
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND<br>
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED<br>
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED<br>
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR<br>
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL<br>
+ * THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY<br>
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR<br>
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,<br>
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;<br>
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)<br>
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,<br>
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT<br>
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY<br>
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE<br>
+ * POSSIBILITY OF SUCH DAMAGE.<br>
*/<br>
<br>
/***********************************************************<br>
@@ -47,17 +67,15 @@<br>
<br>
/*<br>
*<br>
- * All return codes are actually a 3-way tuple:<br>
- *<br>
- * type: DAT_RETURN_CLASS DAT_RETURN_TYPE DAT_RETURN_SUBTYPE<br>
- * bits:
31-30
29-16 15-0<br>
+ * All return codes are actually a 4-way tuple:<br>
*<br>
- *
3
2 1<br>
- * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0<br>
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br>
- * | C |
DAT_RETURN_TYPE |
DAT_RETURN_SUBTYPE
|<br>
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<br>
+ * type: CLASS RETURN_TYPE
EXTENSION_SUBTYPE SUBTYPE<br>
+ * bits: 31-30
29-16
15-8
7-0<br>
*<br>
+ * +-------------------------------------------------------------------------+<br>
+ * |3130 | 2928272625242322212019181716 | 15141312111009080 | 706054003020100|<br>
+ * |CLAS |
DAT_TYPE_STATUS
| EXTENSION_SUBTYPE | SUBTYPE |<br>
+ * +-------------------------------------------------------------------------+<br>
*/<br>
<br>
/*<br>
@@ -70,8 +88,13 @@<br>
* DAT Error bits<br>
*/<br>
#define
DAT_TYPE_MASK
0x3fff0000 /* mask for DAT_TYPE_STATUS bits */<br>
-#define DAT_SUBTYPE_MASK
0x0000FFFF /* mask for DAT_SUBTYPE_STATUS bits */<br>
+#define DAT_SUBTYPE_MASK
0x000000FF /* mask for DAT_SUBTYPE_STATUS bits */<br>
<br>
+#ifdef DAT_EXTENSIONS<br>
+/* Mask and macro for new extension subtype bits */<br>
+#define DAT_EXTENSION_SUBTYPE_MASK 0x0000FF00 /* mask for
DAT_EXTENSION_SUBTYPE_STATUS bits */<br>
+#define DAT_GET_EXTENSION_SUBTYPE(status) ((DAT_UINT32)(status) &
DAT_EXTENSION_SUBTYPE_MASK)<br>
+#endif<br>
/*<br>
* Determining the success of an operation is best done with a macro;<br>
* each of these returns a boolean value.<br>
Index: dat/include/dat/udat_redirection.h<br>
===================================================================<br>
--- dat/include/dat/udat_redirection.h (revision 5366)<br>
+++ dat/include/dat/udat_redirection.h (working copy)<br>
@@ -199,13 +199,12 @@ 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>
{<br>
const char
*
device_name;<br>
-
DAT_PVOID
extension;<br>
+ DAT_PVOID extension;<br>
<br>
DAT_IA_OPEN_FUNC
ia_open_func;<br>
DAT_IA_QUERY_FUNC
ia_query_func;<br>
@@ -294,6 +293,12 @@ 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>
+#ifdef DAT_EXTENSIONS<br>
+ /* udat-2.0 extensions */<br>
+
DAT_EXTENSION_FUNC
extension_func;<br>
+#endif<br>
+<br>
};<br>
<br>
#endif /* _UDAT_REDIRECTION_H_ */<br>
Index: dat/include/dat/dat.h<br>
===================================================================<br>
--- dat/include/dat/dat.h (revision 5366)<br>
+++ dat/include/dat/dat.h (working copy)<br>
@@ -119,6 +119,23 @@ typedef DAT_HANDLE
DAT_RMR_HANDLE;<br>
typedef DAT_HANDLE DAT_RSP_HANDLE;<br>
typedef DAT_HANDLE DAT_SRQ_HANDLE;<br>
<br>
+/* PROTOTYPE: immediate data and extensions */<br>
+typedef enum dat_dtos<br>
+{<br>
+ DAT_SEND,<br>
+ DAT_SEND_IMMED,<br>
+ DAT_RDMA_WRITE,<br>
+ DAT_RDMA_WRITE_IMMED,<br>
+ DAT_RDMA_READ,<br>
+ DAT_RECEIVE,<br>
+ DAT_RECEIVE_INVALIDATE,<br>
+ DAT_RECEIVE_RDMA_WRITE_IMMED,<br>
+ DAT_BIND_MW,<br>
+#ifdef DAT_EXTENSIONS<br>
+ DAT_EXTENSION,<br>
+#endif<br>
+} DAT_DTOS;<br>
+<br>
/* dat NULL handles */<br>
#define DAT_HANDLE_NULL ((DAT_HANDLE)NULL)<br>
<br>
@@ -259,7 +276,6 @@ typedef struct dat_rmr_triplet<br>
*/<br>
<br>
/* Memory privileges */<br>
-<br>
typedef enum dat_mem_priv_flags<br>
{<br>
DAT_MEM_PRIV_NONE_FLAG
= 0x00,<br>
@@ -267,7 +283,11 @@ typedef enum dat_mem_priv_flags<br>
DAT_MEM_PRIV_REMOTE_READ_FLAG =
0x02,<br>
DAT_MEM_PRIV_LOCAL_WRITE_FLAG =
0x10,<br>
DAT_MEM_PRIV_REMOTE_WRITE_FLAG = 0x20,<br>
-
DAT_MEM_PRIV_ALL_FLAG
= 0x33<br>
+
DAT_MEM_PRIV_MW_BIND_FLAG = 0x40,<br>
+
DAT_MEM_PRIV_ALL_FLAG
= 0x73,<br>
+#ifdef DAT_EXTENSIONS<br>
+
DAT_MEM_PRIV_EXTENSION
= 0x1000<br>
+#endif<br>
} DAT_MEM_PRIV_FLAGS;<br>
<br>
/* For backward compatibility with DAT-1.0, memory privileges values are<br>
@@ -712,14 +732,23 @@ typedef enum dat_dto_completion_status<br>
<br>
/* Completion group structs (six total) */<br>
<br>
-/* DTO completion event data */<br>
+#ifdef DAT_EXTENSIONS<br>
+#include <dat/dat_extensions.h><br>
+#endif<br>
+<br>
+/* DTO completion event data, 2.0 update */<br>
/* transfered_length is not defined if status is not DAT_SUCCESS */<br>
typedef struct dat_dto_completion_event_data<br>
{<br>
DAT_EP_HANDLE
ep_handle;<br>
DAT_DTO_COOKIE user_cookie;<br>
DAT_DTO_COMPLETION_STATUS status;<br>
-
DAT_VLEN
transfered_length;<br>
+ DAT_VLEN transfered_length;<br>
+ DAT_DTOS operation;<br>
+ DAT_RMR_CONTEXT rmr_context;<br>
+#ifdef DAT_EXTENSIONS<br>
+ DAT_DTO_EXTENSION_EVENT_DATA extension;<br>
+#endif<br>
} DAT_DTO_COMPLETION_EVENT_DATA;<br>
<br>
/* RMR bind completion event data */<br>
@@ -854,11 +883,11 @@ 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>
+<br>
} DAT_EVENT_NUMBER;<br>
<br>
/* <st1:place w:st="on">Union</st1:place> for event Data */<br>
-<br>
typedef union dat_event_data<br>
{<br>
DAT_DTO_COMPLETION_EVENT_DATA
dto_completion_event_data;<br>
@@ -1222,6 +1251,13 @@ extern DAT_RETURN dat_srq_set_lw (<br>
IN
DAT_SRQ_HANDLE, /*
srq_handle */<br>
IN
DAT_COUNT); /*
low_watermark */<br>
<br>
+#ifdef DAT_EXTENSIONS<br>
+extern DAT_RETURN dat_extension(<br>
+ IN DAT_HANDLE,<br>
+ IN
DAT_DTO_EXTENSION_OP,<br>
+ IN ... );<br>
+#endif<br>
+<br>
/*<br>
* DAT registry functions.<br>
*<br>
Index: dat/common/dat_api.c<br>
===================================================================<br>
--- dat/common/dat_api.c (revision 5366)<br>
+++ dat/common/dat_api.c (working copy)<br>
@@ -2,27 +2,27 @@<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>
* in the file LICENSE.txt in the root directory. The
license is also<br>
- * available from the Open Source Initiative, see<br>
+ * available from the Open Source Initiative, see <br>
* http://www.opensource.org/licenses/cpl.php.<br>
- *<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 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>
@@ -35,7 +35,7 @@<br>
* PURPOSE: DAT Provider and Consumer registry functions.<br>
* Also provide small integers for
IA_HANDLES<br>
*<br>
- * $Id: dat_api.c,v 1.10 2005/05/20 22:25:31 jlentini Exp $<br>
+ * $Id: dat_api.c,v 1.5 2005/02/17 19:36:23 jlentini Exp $<br>
**********************************************************************/<br>
<br>
#include "dat_osd.h"<br>
@@ -70,15 +70,16 @@ dats_handle_vector_init ( void )<br>
{<br>
DAT_RETURN dat_status;<br>
int i;<br>
+ int status;<br>
<br>
dat_status = DAT_SUCCESS;<br>
<br>
g_hv.handle_max = DAT_HANDLE_ENTRY_STEP;<br>
<br>
- dat_status = dat_os_lock_init (&g_hv.handle_lock);<br>
- if ( DAT_SUCCESS != dat_status )<br>
+ status = dat_os_lock_init (&g_hv.handle_lock);<br>
+ if ( DAT_SUCCESS != status )<br>
{<br>
- return dat_status;<br>
+ return status;<br>
}<br>
<br>
g_hv.handle_array = dat_os_alloc (sizeof(void *) *
DAT_HANDLE_ENTRY_STEP);<br>
@@ -88,7 +89,7 @@ dats_handle_vector_init ( void )<br>
goto bail;<br>
}<br>
<br>
- for (i = 0; i < g_hv.handle_max; i++)<br>
+ for (i = g_hv.handle_max; i < g_hv.handle_max; i++)<br>
{<br>
g_hv.handle_array[i] = NULL;<br>
}<br>
@@ -112,11 +113,7 @@ dats_set_ia_handle (<br>
void **h;<br>
<br>
dat_os_lock (&g_hv.handle_lock);<br>
-<br>
- /*<br>
- * Don't give out handle zero since that is
DAT_HANDLE_NULL!<br>
- */<br>
- for (i = 1; i < g_hv.handle_max; i++)<br>
+ for (i = 0; i < g_hv.handle_max; i++)<br>
{<br>
if (g_hv.handle_array[i] == NULL)<br>
{<br>
@@ -1142,6 +1139,39 @@ DAT_RETURN dat_srq_set_lw(<br>
low_watermark);<br>
}<br>
<br>
+#ifdef DAT_EXTENSIONS<br>
+DAT_RETURN dat_extension(<br>
+ IN DAT_HANDLE handle,<br>
+ IN DAT_DTO_EXTENSION_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>
+#endif <br>
+<br>
+<br>
/*<br>
* Local variables:<br>
* c-indent-level: 4<br>
Index: dat/udat/Makefile<br>
===================================================================<br>
--- dat/udat/Makefile (revision 5366)<br>
+++ dat/udat/Makefile (working copy)<br>
@@ -112,6 +112,12 @@ CFLAGS32 = -m32<br>
endif<br>
<br>
#<br>
+# Prototype 2.0 DAT extensions <br>
+#<br>
+CFLAGS += -DDAT_EXTENSIONS<br>
+<br>
+<br>
+#<br>
# LD definitions<br>
#<br>
<br>
Index: dat/udat/udat.c<br>
===================================================================<br>
--- dat/udat/udat.c (revision 5366)<br>
+++ dat/udat/udat.c (working copy)<br>
@@ -2,27 +2,27 @@<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>
* in the file LICENSE.txt in the root directory. The
license is also<br>
- * available from the Open Source Initiative, see<br>
+ * available from the Open Source Initiative, see <br>
* http://www.opensource.org/licenses/cpl.php.<br>
- *<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>
+ * <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>
+ * <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>
@@ -34,7 +34,7 @@<br>
*<br>
* PURPOSE: DAT Provider and Consumer registry functions.<br>
*<br>
- * $Id: udat.c,v 1.22 2005/03/24 05:58:35 jlentini Exp $<br>
+ * $Id: udat.c,v 1.20 2005/02/11 20:17:05 jlentini Exp $<br>
**********************************************************************/<br>
<br>
#include <dat/udat.h><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>
@@ -226,17 +230,48 @@ dat_ia_openv (<br>
return dat_status;<br>
}<br>
<br>
- dat_status = (*ia_open_func) (name,<br>
-
async_event_qlen,<br>
-
async_event_handle,<br>
-
ia_handle);<br>
+ dat_status = (*ia_open_func) (name,<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>
+ 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>
+<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>
<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>
</div>
</body>
</html>