From 76a43cace54567135bac7ae54e336c6595b65fd9 Mon Sep 17 00:00:00 2001 From: Arlin Davis Date: Fri, 9 Mar 2007 13:09:14 -0800 Subject: [PATCH] Initial build with DAT 2.0 definitions and IB extensions. IB extensions configurable with --enable-ext-type=ib --- Makefile.am | 19 +- configure.in | 20 +- dapl/common/dapl_adapter_util.h | 24 +- dapl/common/dapl_ep_post_send.c | 17 +- dapl/common/dapl_evd_util.c | 26 +- dapl/common/dapl_rmr_util.c | 14 +- dapl/include/dapl.h | 18 +- dapl/openib_cma/dapl_ib_dto.h | 196 ++++++++++- dapl/openib_cma/dapl_ib_mem.c | 6 +- dapl/udapl/Makefile | 14 +- dapl/udapl/dapl_cno_query.c | 18 +- dat/common/dat_api.c | 143 +++++++- dat/include/dat/dat.h | 344 +++++++++++++------ dat/include/dat/dat_error.h | 38 +- dat/include/dat/dat_ib_extensions.h | 311 +++++++++++++++++ dat/include/dat/dat_platform_specific.h | 27 +- dat/include/dat/dat_redirection.h | 174 +++++++++- dat/include/dat/dat_registry.h | 31 +- dat/include/dat/dat_vendor_specific.h | 24 +- dat/include/dat/kdat.h | 268 ++++++++++++--- dat/include/dat/kdat_config.h | 18 +- dat/include/dat/kdat_redirection.h | 125 ++++++- dat/include/dat/kdat_vendor_specific.h | 29 +- dat/include/dat/udat.h | 204 ++++++++--- dat/include/dat/udat_config.h | 17 +- dat/include/dat/udat_redirection.h | 65 +++- dat/include/dat/udat_vendor_specific.h | 29 +- dat/udat/Makefile | 6 +- dat/udat/udat_api.c | 40 ++- libdat.spec.in | 18 +- test/dapltest/Makefile.am | 10 +- test/dapltest/test/dapl_bpool.c | 2 + test/dapltest/test/dapl_performance_client.c | 4 +- test/dapltest/test/dapl_performance_util.c | 4 +- test/dapltest/test/dapl_test_util.c | 2 +- test/dapltest/test/dapl_transaction_util.c | 8 +- test/dapltest/udapl/udapl_tdep.c | 1 + test/dtest/Makefile.am | 7 + test/dtest/dtest.c | 43 +-- 39 files changed, 1968 insertions(+), 396 deletions(-) create mode 100755 dat/include/dat/dat_ib_extensions.h diff --git a/Makefile.am b/Makefile.am index 70ef6ef..ccb8744 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,6 +8,12 @@ else OSFLAGS += endif +if EXT_TYPE_IB +XFLAGS = -DDAT_EXTENSIONS +else +XFLAGS = +endif + if DEBUG DBGFLAGS = -ggdb -DDAPL_DBG else @@ -22,11 +28,11 @@ dapllibcmadir = $(libdir) datlib_LTLIBRARIES = dat/udat/libdat.la dapllibcma_LTLIBRARIES = dapl/udapl/libdaplcma.la -dat_udat_libdat_la_CFLAGS = -Wall $(DBGFLAGS) -D_GNU_SOURCE $(OSFLAGS) \ +dat_udat_libdat_la_CFLAGS = -Wall $(DBGFLAGS) -D_GNU_SOURCE $(OSFLAGS) $(XFLAGS) \ -I$(srcdir)/dat/include/ -I$(srcdir)/dat/udat/ \ -I$(srcdir)/dat/udat/linux -I$(srcdir)/dat/common/ -dapl_udapl_libdaplcma_la_CFLAGS = -Wall $(DBGFLAGS) -D_GNU_SOURCE $(OSFLAGS) \ +dapl_udapl_libdaplcma_la_CFLAGS = -Wall $(DBGFLAGS) -D_GNU_SOURCE $(OSFLAGS) $(XFLAGS) \ -DOPENIB -DCQ_WAIT_OBJECT \ -I$(srcdir)/dat/include/ -I$(srcdir)/dapl/include/ \ -I$(srcdir)/dapl/common -I$(srcdir)/dapl/udapl/linux \ @@ -56,7 +62,7 @@ dat_udat_libdat_la_SOURCES = dat/udat/udat.c \ dat/common/dat_dr.c \ dat/common/dat_sr.c -dat_udat_libdat_la_LDFLAGS = -version-info 1:2:0 $(dat_version_script) -ldl +dat_udat_libdat_la_LDFLAGS = -version-info 2:0:0 $(dat_version_script) -ldl # # uDAPL OpenIB uCMA version: libdaplcma.so @@ -163,7 +169,7 @@ dapl_udapl_libdaplcma_la_SOURCES = dapl/udapl/dapl_init.c \ dapl/openib_cma/dapl_ib_cm.c \ dapl/openib_cma/dapl_ib_mem.c -dapl_udapl_libdaplcma_la_LDFLAGS = -version-info 1:2:0 $(daplcma_version_script) \ +dapl_udapl_libdaplcma_la_LDFLAGS = -version-info 2:0:0 $(daplcma_version_script) \ -Wl,-init,dapl_init -Wl,-fini,dapl_fini \ -lpthread -libverbs -lrdmacm @@ -178,7 +184,8 @@ libdatinclude_HEADERS = dat/include/dat/dat.h \ dat/include/dat/udat_config.h \ dat/include/dat/udat.h \ dat/include/dat/udat_redirection.h \ - dat/include/dat/udat_vendor_specific.h + dat/include/dat/udat_vendor_specific.h \ + dat/include/dat/dat_ib_extensions.h man_MANS = man/dtest.1 man/dapltest.1 @@ -225,8 +232,6 @@ EXTRA_DIST = dat/common/dat_dictionary.h \ dapl/include/dapl_vendor.h \ dapl/openib_cma/dapl_ib_dto.h \ dapl/openib_cma/dapl_ib_util.h \ - dapl/openib_scm/dapl_ib_dto.h \ - dapl/openib_scm/dapl_ib_util.h \ dat/udat/libdat.map \ doc/dat.conf \ dapl/udapl/libdaplcma.map \ diff --git a/configure.in b/configure.in index 324bfa1..972bd37 100644 --- a/configure.in +++ b/configure.in @@ -1,11 +1,11 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.57) -AC_INIT(dapl, 1.2.1, openib-general@openib.org) +AC_INIT(dapl, 2.0.0, openib-general@openib.org) AC_CONFIG_SRCDIR([dat/udat/udat.c]) AC_CONFIG_AUX_DIR(config) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(dapl, 1.2.1) +AM_INIT_AUTOMAKE(dapl, 2.0.0) AM_PROG_LIBTOOL @@ -50,6 +50,22 @@ AC_ARG_ENABLE(debug, esac],[debug=false]) AM_CONDITIONAL(DEBUG, test x$debug = xtrue) +dnl Support ib_extension build - if enable-ext-type == ib +AC_ARG_ENABLE(ext-type, +[ --enable-ext-type Enable extensions support for library, default=none, or ib], + [ if test "x$enableval" = "xib" ; then + ext_type=ib + elif test "x$enableval" = "xnone" ; then + ext_type=none + else + echo + echo "Error!" + echo "Unknown extension type' type" + exit -1 + fi + ]) +AM_CONDITIONAL(EXT_TYPE_IB, test "$ext_type" = "ib") + dnl Check for Redhat EL release AC_CACHE_CHECK(whether this is an RHEL system, ac_cv_rhel, if test -f /etc/redhat-release && diff --git a/dapl/common/dapl_adapter_util.h b/dapl/common/dapl_adapter_util.h index 9315bf1..388fee9 100644 --- a/dapl/common/dapl_adapter_util.h +++ b/dapl/common/dapl_adapter_util.h @@ -1,18 +1,21 @@ /* - * Copyright (c) 2002-2003, Network Appliance, Inc. All rights reserved. + * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. * * This Software is licensed under one of the following licenses: * * 1) under the terms of the "Common Public License 1.0" a copy of which is + * in the file LICENSE.txt in the root directory. The license is also * available from the Open Source Initiative, see * http://www.opensource.org/licenses/cpl.php. * - * 2) under the terms of the "The BSD License" a copy of which is - * available from the Open Source Initiative, see + * 2) under the terms of the "The BSD License" a copy of which is in the file + * LICENSE2.txt in the root directory. The license is also available from + * the Open Source Initiative, see * http://www.opensource.org/licenses/bsd-license.php. * - * 3) under the terms of the "GNU General Public License (GPL) Version 2" a - * copy of which is available from the Open Source Initiative, see + * 3) under the terms of the "GNU General Public License (GPL) Version 2" a + * copy of which is in the file LICENSE3.txt in the root directory. The + * license is also available from the Open Source Initiative, see * http://www.opensource.org/licenses/gpl-license.php. * * Licensee has the right to choose one of the above licenses. @@ -31,7 +34,7 @@ * * PURPOSE: Utility defs & routines for the adapter data structure * - * $Id:$ + * $Id: dapl_adapter_util.h 1317 2005-04-25 17:29:42Z jlentini $ * **********************************************************************/ @@ -256,6 +259,15 @@ dapls_ib_wait_object_wait ( IN u_int32_t timeout); #endif +#ifdef DAT_EXTENSIONS +void +dapls_cqe_to_event_extension( + IN DAPL_EP *ep_ptr, + IN DAPL_COOKIE *cookie, + IN ib_work_completion_t *cqe_ptr, + IN DAT_EVENT *event_ptr); +#endif + /* * Values for provider DAT_NAMED_ATTR */ diff --git a/dapl/common/dapl_ep_post_send.c b/dapl/common/dapl_ep_post_send.c index 04d6325..8fcdfa9 100644 --- a/dapl/common/dapl_ep_post_send.c +++ b/dapl/common/dapl_ep_post_send.c @@ -1,18 +1,21 @@ /* - * Copyright (c) 2002-2003, Network Appliance, Inc. All rights reserved. + * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. * * This Software is licensed under one of the following licenses: * * 1) under the terms of the "Common Public License 1.0" a copy of which is + * in the file LICENSE.txt in the root directory. The license is also * available from the Open Source Initiative, see * http://www.opensource.org/licenses/cpl.php. * - * 2) under the terms of the "The BSD License" a copy of which is - * available from the Open Source Initiative, see + * 2) under the terms of the "The BSD License" a copy of which is in the file + * LICENSE2.txt in the root directory. The license is also available from + * the Open Source Initiative, see * http://www.opensource.org/licenses/bsd-license.php. * - * 3) under the terms of the "GNU General Public License (GPL) Version 2" a - * copy of which is available from the Open Source Initiative, see + * 3) under the terms of the "GNU General Public License (GPL) Version 2" a + * copy of which is in the file LICENSE3.txt in the root directory. The + * license is also available from the Open Source Initiative, see * http://www.opensource.org/licenses/gpl-license.php. * * Licensee has the right to choose one of the above licenses. @@ -33,7 +36,7 @@ * Description: Interfaces in this file are completely described in * the DAPL 1.1 API, Chapter 6, section 5 * - * $Id:$ + * $Id: dapl_ep_post_send.c 1364 2005-10-31 18:30:14Z jlentini $ **********************************************************************/ #include "dapl_ep_util.h" @@ -71,7 +74,7 @@ dapl_ep_post_send ( IN DAT_DTO_COOKIE user_cookie, IN DAT_COMPLETION_FLAGS completion_flags ) { - DAT_RMR_TRIPLET remote_iov = {0,0,0,0}; + DAT_RMR_TRIPLET remote_iov = {0,0,0}; DAT_RETURN dat_status; dapl_dbg_log (DAPL_DBG_TYPE_API, diff --git a/dapl/common/dapl_evd_util.c b/dapl/common/dapl_evd_util.c index 346600b..28ab849 100644 --- a/dapl/common/dapl_evd_util.c +++ b/dapl/common/dapl_evd_util.c @@ -1,18 +1,21 @@ /* - * Copyright (c) 2002-2003, Network Appliance, Inc. All rights reserved. + * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. * * This Software is licensed under one of the following licenses: * * 1) under the terms of the "Common Public License 1.0" a copy of which is + * in the file LICENSE.txt in the root directory. The license is also * available from the Open Source Initiative, see * http://www.opensource.org/licenses/cpl.php. * - * 2) under the terms of the "The BSD License" a copy of which is - * available from the Open Source Initiative, see + * 2) under the terms of the "The BSD License" a copy of which is in the file + * LICENSE2.txt in the root directory. The license is also available from + * the Open Source Initiative, see * http://www.opensource.org/licenses/bsd-license.php. * - * 3) under the terms of the "GNU General Public License (GPL) Version 2" a - * copy of which is available from the Open Source Initiative, see + * 3) under the terms of the "GNU General Public License (GPL) Version 2" a + * copy of which is in the file LICENSE3.txt in the root directory. The + * license is also available from the Open Source Initiative, see * http://www.opensource.org/licenses/gpl-license.php. * * Licensee has the right to choose one of the above licenses. @@ -31,7 +34,7 @@ * * PURPOSE: Manage EVD Info structure * - * $Id:$ + * $Id: dapl_evd_util.c 1410 2006-07-19 17:12:02Z ardavis $ **********************************************************************/ #include "dapl_evd_util.h" @@ -508,6 +511,10 @@ dapli_evd_eh_print_cqe ( "OP_FETCH_AND_ADD", "OP_RECEIVE", "OP_BIND_MW", +#ifdef DAT_EXTENSIONS + "OP_COMP_AND_SWAP_RESP", + "OP_FETCH_AND_ADD_RESP", +#endif 0 }; @@ -1112,6 +1119,13 @@ dapli_evd_cqe_to_event ( dapls_cookie_dealloc (&ep_ptr->req_buffer, cookie); break; } +#ifdef DAT_EXTENSIONS + case DAPL_COOKIE_TYPE_EXTENSION: + { + dapls_cqe_to_event_extension(ep_ptr, cookie, cqe_ptr, event_ptr); + break; + } +#endif default: { dapl_os_assert (!"Invalid Operation type"); diff --git a/dapl/common/dapl_rmr_util.c b/dapl/common/dapl_rmr_util.c index 5eeb5b1..c3dcee8 100644 --- a/dapl/common/dapl_rmr_util.c +++ b/dapl/common/dapl_rmr_util.c @@ -1,18 +1,21 @@ /* - * Copyright (c) 2002-2003, Network Appliance, Inc. All rights reserved. + * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. * * This Software is licensed under one of the following licenses: * * 1) under the terms of the "Common Public License 1.0" a copy of which is + * in the file LICENSE.txt in the root directory. The license is also * available from the Open Source Initiative, see * http://www.opensource.org/licenses/cpl.php. * - * 2) under the terms of the "The BSD License" a copy of which is - * available from the Open Source Initiative, see + * 2) under the terms of the "The BSD License" a copy of which is in the file + * LICENSE2.txt in the root directory. The license is also available from + * the Open Source Initiative, see * http://www.opensource.org/licenses/bsd-license.php. * - * 3) under the terms of the "GNU General Public License (GPL) Version 2" a - * copy of which is available from the Open Source Initiative, see + * 3) under the terms of the "GNU General Public License (GPL) Version 2" a + * copy of which is in the file LICENSE3.txt in the root directory. The + * license is also available from the Open Source Initiative, see * http://www.opensource.org/licenses/gpl-license.php. * * Licensee has the right to choose one of the above licenses. @@ -63,7 +66,6 @@ dapl_rmr_alloc( rmr->param.ia_handle = (DAT_IA_HANDLE) pz->header.owner_ia; rmr->param.pz_handle = (DAT_PZ_HANDLE) pz; rmr->param.lmr_triplet.lmr_context = 0; - rmr->param.lmr_triplet.pad = 0; rmr->param.lmr_triplet.virtual_address = 0; rmr->param.lmr_triplet.segment_length = 0; diff --git a/dapl/include/dapl.h b/dapl/include/dapl.h index 45e1e8a..3545176 100644 --- a/dapl/include/dapl.h +++ b/dapl/include/dapl.h @@ -1,18 +1,21 @@ /* - * Copyright (c) 2002-2003, Network Appliance, Inc. All rights reserved. + * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. * * This Software is licensed under one of the following licenses: * * 1) under the terms of the "Common Public License 1.0" a copy of which is + * in the file LICENSE.txt in the root directory. The license is also * available from the Open Source Initiative, see * http://www.opensource.org/licenses/cpl.php. * - * 2) under the terms of the "The BSD License" a copy of which is - * available from the Open Source Initiative, see + * 2) under the terms of the "The BSD License" a copy of which is in the file + * LICENSE2.txt in the root directory. The license is also available from + * the Open Source Initiative, see * http://www.opensource.org/licenses/bsd-license.php. * - * 3) under the terms of the "GNU General Public License (GPL) Version 2" a - * copy of which is available from the Open Source Initiative, see + * 3) under the terms of the "GNU General Public License (GPL) Version 2" a + * copy of which is in the file LICENSE3.txt in the root directory. The + * license is also available from the Open Source Initiative, see * http://www.opensource.org/licenses/gpl-license.php. * * Licensee has the right to choose one of the above licenses. @@ -35,7 +38,7 @@ * DAPL RI. * * - * $Id:$ + * $Id: dapl.h 1317 2005-04-25 17:29:42Z jlentini $ **********************************************************************/ #ifndef _DAPL_H_ @@ -570,6 +573,9 @@ typedef enum dapl_cookie_type DAPL_COOKIE_TYPE_NULL, DAPL_COOKIE_TYPE_DTO, DAPL_COOKIE_TYPE_RMR, +#ifdef DAT_EXTENSIONS + DAPL_COOKIE_TYPE_EXTENSION, +#endif } DAPL_COOKIE_TYPE; /* DAPL_DTO_COOKIE used as context for DTO WQEs */ diff --git a/dapl/openib_cma/dapl_ib_dto.h b/dapl/openib_cma/dapl_ib_dto.h index c61ef61..f73f03b 100644 --- a/dapl/openib_cma/dapl_ib_dto.h +++ b/dapl/openib_cma/dapl_ib_dto.h @@ -35,7 +35,7 @@ * * Description: * - * The uDAPL openib provider - DTO operations and CQE macros + * The OpenIB uCMA provider - DTO operations and CQE macros * **************************************************************************** * Source Control System Information @@ -50,6 +50,10 @@ #include "dapl_ib_util.h" +#ifdef DAT_EXTENSIONS +#include +#endif + #define DEFAULT_DS_ENTRIES 8 STATIC _INLINE_ int dapls_cqe_opcode(ib_work_completion_t *cqe_p); @@ -119,7 +123,6 @@ dapls_ib_post_recv ( return DAT_SUCCESS; } - /* * dapls_ib_post_send * @@ -191,15 +194,16 @@ dapls_ib_post_send ( if (cookie != NULL) cookie->val.dto.size = total_len; - + if ((op_type == OP_RDMA_WRITE) || (op_type == OP_RDMA_READ)) { - wr.wr.rdma.remote_addr = remote_iov->target_address; + wr.wr.rdma.remote_addr = remote_iov->virtual_address; wr.wr.rdma.rkey = remote_iov->rmr_context; dapl_dbg_log(DAPL_DBG_TYPE_EP, " post_snd_rdma: rkey 0x%x va %#016Lx\n", wr.wr.rdma.rkey, wr.wr.rdma.remote_addr); } + /* inline data for send or write ops */ if ((total_len <= ibt_ptr->max_inline_send) && ((op_type == OP_SEND) || (op_type == OP_RDMA_WRITE))) @@ -224,6 +228,178 @@ dapls_ib_post_send ( return DAT_SUCCESS; } +/* map Work Completions to DAPL WR operations */ +STATIC _INLINE_ DAT_DTOS dapls_cqe_dtos_opcode(ib_work_completion_t *cqe_p) +{ + switch (cqe_p->opcode) { + + case IBV_WC_SEND: + return (DAT_DTO_SEND); + case IBV_WC_RDMA_READ: + return (DAT_DTO_RDMA_READ); + case IBV_WC_BIND_MW: + return (DAT_DTO_BIND_MW); +#ifdef DAT_EXTENSIONS + case IBV_WC_RDMA_WRITE: + if (cqe_p->wc_flags & IBV_WC_WITH_IMM) + return (DAT_IB_DTO_RDMA_WRITE_IMMED); + else + return (DAT_DTO_RDMA_WRITE); + case IBV_WC_COMP_SWAP: + return (DAT_IB_DTO_CMP_SWAP); + case IBV_WC_FETCH_ADD: + return (DAT_IB_DTO_FETCH_ADD); + case IBV_WC_RECV_RDMA_WITH_IMM: + return (DAT_IB_DTO_RECV_IMMED); +#else + case IBV_WC_RDMA_WRITE: + return (DAT_DTO_RDMA_WRITE); +#endif + case IBV_WC_RECV: + return (DAT_DTO_RECEIVE); + default: + return (0xff); + } +} +#define DAPL_GET_CQE_DTOS_OPTYPE(cqe_p) dapls_cqe_dtos_opcode(cqe_p) + + +#ifdef DAT_EXTENSIONS +/* + * dapls_ib_post_ext_send + * + * Provider specific extended Post SEND function for atomics + * OP_COMP_AND_SWAP and OP_FETCH_AND_ADD + */ +STATIC _INLINE_ DAT_RETURN +dapls_ib_post_ext_send ( + IN DAPL_EP *ep_ptr, + IN ib_send_op_type_t op_type, + IN DAPL_COOKIE *cookie, + IN DAT_COUNT segments, + IN DAT_LMR_TRIPLET *local_iov, + IN const DAT_RMR_TRIPLET *remote_iov, + IN DAT_UINT32 immed_data, + IN DAT_UINT64 compare_add, + IN DAT_UINT64 swap, + IN DAT_COMPLETION_FLAGS completion_flags) +{ + dapl_dbg_log(DAPL_DBG_TYPE_EP, + " post_snd: ep %p op %d ck %p sgs", + "%d l_iov %p r_iov %p f %d\n", + ep_ptr, op_type, cookie, segments, local_iov, + remote_iov, completion_flags); + + ib_data_segment_t ds_array[DEFAULT_DS_ENTRIES]; + ib_data_segment_t *ds_array_p; + struct ibv_send_wr wr; + struct ibv_send_wr *bad_wr; + DAT_COUNT i, total_len; + + dapl_dbg_log(DAPL_DBG_TYPE_EP, + " post_snd: ep %p cookie %p segs %d l_iov %p\n", + ep_ptr, cookie, segments, local_iov); + + if(segments <= DEFAULT_DS_ENTRIES) + ds_array_p = ds_array; + else + ds_array_p = + dapl_os_alloc(segments * sizeof(ib_data_segment_t)); + + if (NULL == ds_array_p) + return (DAT_INSUFFICIENT_RESOURCES); + + /* setup the work request */ + wr.next = 0; + wr.opcode = op_type; + wr.num_sge = 0; + wr.send_flags = 0; + wr.wr_id = (uint64_t)(uintptr_t)cookie; + wr.sg_list = ds_array_p; + total_len = 0; + + for (i = 0; i < segments; i++ ) { + if ( !local_iov[i].segment_length ) + continue; + + ds_array_p->addr = (uint64_t) local_iov[i].virtual_address; + ds_array_p->length = local_iov[i].segment_length; + ds_array_p->lkey = local_iov[i].lmr_context; + + dapl_dbg_log(DAPL_DBG_TYPE_EP, + " post_snd: lkey 0x%x va %p len %d\n", + ds_array_p->lkey, ds_array_p->addr, + ds_array_p->length ); + + total_len += ds_array_p->length; + wr.num_sge++; + ds_array_p++; + } + + if (cookie != NULL) + cookie->val.dto.size = total_len; + + switch (op_type) { + case OP_RDMA_WRITE_IMM: + /* OP_RDMA_WRITE)IMMED has direct IB wr_type mapping */ + dapl_dbg_log(DAPL_DBG_TYPE_EP, + " post_ext: rkey 0x%x va %#016Lx immed=0x%x\n", + remote_iov->rmr_context, + remote_iov->virtual_address, immed_data); + + wr.imm_data = immed_data; + wr.wr.rdma.remote_addr = remote_iov->virtual_address; + wr.wr.rdma.rkey = remote_iov->rmr_context; + break; + case OP_COMP_AND_SWAP: + /* OP_COMP_AND_SWAP has direct IB wr_type mapping */ + dapl_dbg_log(DAPL_DBG_TYPE_EP, + " post_ext: OP_COMP_AND_SWAP=%lx," + "%lx rkey 0x%x va %#016Lx\n", + compare_add, swap, remote_iov->rmr_context, + remote_iov->virtual_address); + + wr.wr.atomic.compare_add = compare_add; + wr.wr.atomic.swap = swap; + wr.wr.atomic.remote_addr = remote_iov->virtual_address; + wr.wr.atomic.rkey = remote_iov->rmr_context; + break; + case OP_FETCH_AND_ADD: + /* OP_FETCH_AND_ADD has direct IB wr_type mapping */ + dapl_dbg_log(DAPL_DBG_TYPE_EP, + " post_ext: OP_FETCH_AND_ADD=%lx," + "%lx rkey 0x%x va %#016Lx\n", + compare_add, remote_iov->rmr_context, + remote_iov->virtual_address); + + wr.wr.atomic.compare_add = compare_add; + wr.wr.atomic.remote_addr = remote_iov->virtual_address; + wr.wr.atomic.rkey = remote_iov->rmr_context; + break; + default: + break; + } + + /* set completion flags in work request */ + wr.send_flags |= (DAT_COMPLETION_SUPPRESS_FLAG & + completion_flags) ? 0 : IBV_SEND_SIGNALED; + wr.send_flags |= (DAT_COMPLETION_BARRIER_FENCE_FLAG & + completion_flags) ? IBV_SEND_FENCE : 0; + wr.send_flags |= (DAT_COMPLETION_SOLICITED_WAIT_FLAG & + completion_flags) ? IBV_SEND_SOLICITED : 0; + + dapl_dbg_log(DAPL_DBG_TYPE_EP, + " post_snd: op 0x%x flags 0x%x sglist %p, %d\n", + wr.opcode, wr.send_flags, wr.sg_list, wr.num_sge); + + if (ibv_post_send(ep_ptr->qp_handle->cm_id->qp, &wr, &bad_wr)) + return( dapl_convert_errno(EFAULT,"ibv_recv") ); + + dapl_dbg_log(DAPL_DBG_TYPE_EP," post_snd: returned\n"); + return DAT_SUCCESS; +} +#endif + STATIC _INLINE_ DAT_RETURN dapls_ib_optional_prv_dat( IN DAPL_CR *cr_ptr, @@ -233,13 +409,17 @@ dapls_ib_optional_prv_dat( return DAT_SUCCESS; } +/* map Work Completions to DAPL WR operations */ STATIC _INLINE_ int dapls_cqe_opcode(ib_work_completion_t *cqe_p) { switch (cqe_p->opcode) { case IBV_WC_SEND: return (OP_SEND); case IBV_WC_RDMA_WRITE: - return (OP_RDMA_WRITE); + if (cqe_p->wc_flags & IBV_WC_WITH_IMM) + return (OP_RDMA_WRITE_IMM); + else + return (OP_RDMA_WRITE); case IBV_WC_RDMA_READ: return (OP_RDMA_READ); case IBV_WC_COMP_SWAP: @@ -249,7 +429,10 @@ STATIC _INLINE_ int dapls_cqe_opcode(ib_work_completion_t *cqe_p) case IBV_WC_BIND_MW: return (OP_BIND_MW); case IBV_WC_RECV: - return (OP_RECEIVE); + if (cqe_p->wc_flags & IBV_WC_WITH_IMM) + return (OP_RECEIVE_IMM); + else + return (OP_RECEIVE); case IBV_WC_RECV_RDMA_WITH_IMM: return (OP_RECEIVE_IMM); default: @@ -257,6 +440,7 @@ STATIC _INLINE_ int dapls_cqe_opcode(ib_work_completion_t *cqe_p) } } + #define DAPL_GET_CQE_OPTYPE(cqe_p) dapls_cqe_opcode(cqe_p) #define DAPL_GET_CQE_WRID(cqe_p) ((ib_work_completion_t*)cqe_p)->wr_id #define DAPL_GET_CQE_STATUS(cqe_p) ((ib_work_completion_t*)cqe_p)->status diff --git a/dapl/openib_cma/dapl_ib_mem.c b/dapl/openib_cma/dapl_ib_mem.c index dc689f5..dce5185 100644 --- a/dapl/openib_cma/dapl_ib_mem.c +++ b/dapl/openib_cma/dapl_ib_mem.c @@ -30,7 +30,7 @@ * PURPOSE: Intel DET APIs: Memory windows, registration, * and protection domain * - * $Id: $ + * $Id: dapl_ib_mem.c 1367 2005-12-05 16:48:37Z jlentini $ * **********************************************************************/ @@ -78,6 +78,10 @@ dapls_convert_privileges(IN DAT_MEM_PRIV_FLAGS privileges) access |= IBV_ACCESS_REMOTE_READ; if (DAT_MEM_PRIV_REMOTE_READ_FLAG & privileges) access |= IBV_ACCESS_REMOTE_READ; +#ifdef DAT_EXTENSIONS + if (DAT_IB_MEM_PRIV_REMOTE_ATOMIC & privileges) + access |= IBV_ACCESS_REMOTE_ATOMIC; +#endif return access; } diff --git a/dapl/udapl/Makefile b/dapl/udapl/Makefile index cbd09ae..5b6ddec 100644 --- a/dapl/udapl/Makefile +++ b/dapl/udapl/Makefile @@ -1,18 +1,21 @@ # -# Copyright (c) 2002-2003, Network Appliance, Inc. All rights reserved. +# Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. # # This Software is licensed under one of the following licenses: # # 1) under the terms of the "Common Public License 1.0" a copy of which is +# in the file LICENSE.txt in the root directory. The license is also # available from the Open Source Initiative, see # http://www.opensource.org/licenses/cpl.php. # -# 2) under the terms of the "The BSD License" a copy of which is -# available from the Open Source Initiative, see +# 2) under the terms of the "The BSD License" a copy of which is in the file +# LICENSE2.txt in the root directory. The license is also available from +# the Open Source Initiative, see # http://www.opensource.org/licenses/bsd-license.php. # # 3) under the terms of the "GNU General Public License (GPL) Version 2" a -# copy of which is available from the Open Source Initiative, see +# copy of which is in the file LICENSE3.txt in the root directory. The +# license is also available from the Open Source Initiative, see # http://www.opensource.org/licenses/gpl-license.php. # # Licensee has the right to choose one of the above licenses. @@ -31,7 +34,7 @@ # # PURPOSE: Makefile for dapl reference provider # -# $Id:$ +# $Id: Makefile 1367 2005-12-05 16:48:37Z jlentini $ #*********************************************************************/ TOPDIR = $(shell /bin/pwd) @@ -155,6 +158,7 @@ ifeq ($(VERBS),openib_cma) PROVIDER = $(TOPDIR)/../openib_cma CFLAGS += -DOPENIB CFLAGS += -DCQ_WAIT_OBJECT +CFLAGS += -DDAT_EXTENSIONS CFLAGS += -I/usr/local/include/infiniband endif diff --git a/dapl/udapl/dapl_cno_query.c b/dapl/udapl/dapl_cno_query.c index 8b94df5..2901e2e 100644 --- a/dapl/udapl/dapl_cno_query.c +++ b/dapl/udapl/dapl_cno_query.c @@ -1,18 +1,21 @@ /* - * Copyright (c) 2002-2003, Network Appliance, Inc. All rights reserved. + * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. * * This Software is licensed under one of the following licenses: * * 1) under the terms of the "Common Public License 1.0" a copy of which is + * in the file LICENSE.txt in the root directory. The license is also * available from the Open Source Initiative, see * http://www.opensource.org/licenses/cpl.php. * - * 2) under the terms of the "The BSD License" a copy of which is - * available from the Open Source Initiative, see + * 2) under the terms of the "The BSD License" a copy of which is in the file + * LICENSE2.txt in the root directory. The license is also available from + * the Open Source Initiative, see * http://www.opensource.org/licenses/bsd-license.php. * - * 3) under the terms of the "GNU General Public License (GPL) Version 2" a - * copy of which is available from the Open Source Initiative, see + * 3) under the terms of the "GNU General Public License (GPL) Version 2" a + * copy of which is in the file LICENSE3.txt in the root directory. The + * license is also available from the Open Source Initiative, see * http://www.opensource.org/licenses/gpl-license.php. * * Licensee has the right to choose one of the above licenses. @@ -33,7 +36,7 @@ * Description: Interfaces in this file are completely described in * the DAPL 1.1 API, Chapter 6, section 3.2.5 * - * $Id:$ + * $Id: dapl_cno_query.c 1301 2005-03-24 05:58:55Z jlentini $ **********************************************************************/ #include "dapl.h" @@ -84,7 +87,8 @@ DAT_RETURN dapl_cno_query( cno_ptr = (DAPL_CNO *) cno_handle; cno_param->ia_handle = cno_ptr->header.owner_ia; - cno_param->agent = cno_ptr->cno_wait_agent; + cno_param->proxy_type = DAT_PROXY_TYPE_AGENT; + cno_param->proxy.agent = cno_ptr->cno_wait_agent; bail: return dat_status; diff --git a/dat/common/dat_api.c b/dat/common/dat_api.c index e958c68..d04b1d9 100644 --- a/dat/common/dat_api.c +++ b/dat/common/dat_api.c @@ -1,7 +1,7 @@ /* - * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. + * Copyright (c) 2002-2006, Network Appliance, Inc. All rights reserved. * - * This Software is licensed under one of the following licenses: + * This Software is licensed under all of the following licenses: * * 1) under the terms of the "Common Public License 1.0" a copy of which is * in the file LICENSE.txt in the root directory. The license is also @@ -20,12 +20,21 @@ * * Licensee has the right to choose one of the above licenses. * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright * notice and one of the license notices. * * Redistributions in binary form must reproduce both the above copyright * notice, one of the license notices in the documentation * and/or other materials provided with the distribution. + * + * Neither the name of Network Appliance, Inc. nor the names of other DAT + * Collaborative contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. */ /********************************************************************** @@ -35,7 +44,7 @@ * PURPOSE: DAT Provider and Consumer registry functions. * Also provide small integers for IA_HANDLES * - * $Id: dat_api.c,v 1.10 2005/05/20 22:25:31 jlentini Exp $ + * $Id: dat_api.c 1326 2005-05-20 22:25:31Z jlentini $ **********************************************************************/ #include "dat_osd.h" @@ -289,7 +298,6 @@ DAT_RETURN dat_ia_query ( return dat_status; } - DAT_RETURN dat_set_consumer_context ( IN DAT_HANDLE dat_handle, IN DAT_CONTEXT context) @@ -404,13 +412,15 @@ DAT_RETURN dat_cr_accept ( DAT_RETURN dat_cr_reject ( - IN DAT_CR_HANDLE cr_handle) + IN DAT_CR_HANDLE cr_handle, + IN DAT_COUNT private_data_size, + IN const DAT_PVOID private_data) { if (cr_handle == NULL) { return DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_CR); } - return DAT_CR_REJECT (cr_handle); + return DAT_CR_REJECT (cr_handle, private_data_size, private_data); } @@ -536,7 +546,6 @@ DAT_RETURN dat_ep_modify ( ep_param); } - DAT_RETURN dat_ep_connect ( IN DAT_EP_HANDLE ep_handle, IN DAT_IA_ADDRESS_PTR remote_ia_address, @@ -561,6 +570,23 @@ DAT_RETURN dat_ep_connect ( connect_flags); } +DAT_RETURN dat_ep_common_connect ( + IN DAT_EP_HANDLE ep_handle, + IN DAT_IA_ADDRESS_PTR remote_ia_address, + IN DAT_TIMEOUT timeout, + IN DAT_COUNT private_data_size, + IN const DAT_PVOID private_data) +{ + if (ep_handle == NULL) + { + return DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EP); + } + return DAT_EP_COMMON_CONNECT (ep_handle, + remote_ia_address, + timeout, + private_data_size, + private_data); +} DAT_RETURN dat_ep_dup_connect ( IN DAT_EP_HANDLE ep_handle, @@ -595,7 +621,6 @@ DAT_RETURN dat_ep_disconnect ( close_flags); } - DAT_RETURN dat_ep_post_send ( IN DAT_EP_HANDLE ep_handle, IN DAT_COUNT num_segments, @@ -614,6 +639,27 @@ DAT_RETURN dat_ep_post_send ( completion_flags); } +DAT_RETURN dat_ep_post_send_with_invalidate ( + IN DAT_EP_HANDLE ep_handle, + IN DAT_COUNT num_segments, + IN DAT_LMR_TRIPLET *local_iov, + IN DAT_DTO_COOKIE user_cookie, + IN DAT_COMPLETION_FLAGS completion_flags, + IN DAT_BOOLEAN invalidate_flag, + IN DAT_RMR_CONTEXT rmr_context) +{ + if (ep_handle == NULL) + { + return DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EP); + } + return DAT_EP_POST_SEND_WITH_INVALIDATE (ep_handle, + num_segments, + local_iov, + user_cookie, + completion_flags, + invalidate_flag, + rmr_context); +} DAT_RETURN dat_ep_post_recv ( IN DAT_EP_HANDLE ep_handle, @@ -655,6 +701,25 @@ DAT_RETURN dat_ep_post_rdma_read ( } +DAT_RETURN dat_ep_post_rdma_read_to_rmr ( + IN DAT_EP_HANDLE ep_handle, + IN const DAT_RMR_TRIPLET *local_iov, + IN DAT_DTO_COOKIE user_cookie, + IN const DAT_RMR_TRIPLET *remote_iov, + IN DAT_COMPLETION_FLAGS completion_flags) +{ + if (ep_handle == NULL) + { + return DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EP); + } + return DAT_EP_POST_RDMA_READ_TO_RMR (ep_handle, + local_iov, + user_cookie, + remote_iov, + completion_flags); +} + + DAT_RETURN dat_ep_post_rdma_write ( IN DAT_EP_HANDLE ep_handle, IN DAT_COUNT num_segments, @@ -739,6 +804,17 @@ DAT_RETURN dat_rmr_create ( } +DAT_RETURN dat_rmr_create_for_ep ( + IN DAT_PZ_HANDLE pz_handle, + OUT DAT_RMR_HANDLE *rmr_handle) +{ + if (pz_handle == NULL) + { + return DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_PZ); + } + return DAT_RMR_CREATE_FOR_EP (pz_handle, + rmr_handle); +} DAT_RETURN dat_rmr_query ( IN DAT_RMR_HANDLE rmr_handle, IN DAT_RMR_PARAM_MASK rmr_param_mask, @@ -756,8 +832,10 @@ DAT_RETURN dat_rmr_query ( DAT_RETURN dat_rmr_bind ( IN DAT_RMR_HANDLE rmr_handle, + IN DAT_LMR_HANDLE lmr_handle, IN const DAT_LMR_TRIPLET *lmr_triplet, IN DAT_MEM_PRIV_FLAGS mem_priv, + IN DAT_VA_TYPE va_type, IN DAT_EP_HANDLE ep_handle, IN DAT_RMR_COOKIE user_cookie, IN DAT_COMPLETION_FLAGS completion_flags, @@ -768,8 +846,10 @@ DAT_RETURN dat_rmr_bind ( return DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_RMR); } return DAT_RMR_BIND (rmr_handle, + lmr_handle, lmr_triplet, mem_priv, + va_type, ep_handle, user_cookie, completion_flags, @@ -904,6 +984,53 @@ DAT_RETURN dat_psp_free ( return DAT_PSP_FREE (psp_handle); } +DAT_RETURN dat_csp_create ( + IN DAT_IA_HANDLE ia_handle, + IN DAT_COMM *comm, + IN DAT_IA_ADDRESS_PTR address, + IN DAT_EVD_HANDLE evd_handle, + OUT DAT_CSP_HANDLE *csp_handle) +{ + DAT_IA_HANDLE dapl_ia_handle; + DAT_RETURN dat_status; + + dat_status = dats_get_ia_handle((unsigned long)ia_handle, + &dapl_ia_handle); + if (dat_status == DAT_SUCCESS) + { + dat_status = DAT_CSP_CREATE (dapl_ia_handle, + comm, + address, + evd_handle, + csp_handle); + } + return dat_status; +} + +DAT_RETURN dat_csp_query ( + IN DAT_CSP_HANDLE csp_handle, + IN DAT_CSP_PARAM_MASK csp_param_mask, + OUT DAT_CSP_PARAM *csp_param) +{ + if (csp_handle == NULL) + { + return DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_CSP); + } + return DAT_CSP_QUERY (csp_handle, + csp_param_mask, + csp_param); +} + +DAT_RETURN dat_csp_free ( + IN DAT_CSP_HANDLE csp_handle) +{ + if (csp_handle == NULL) + { + return DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_CSP); + } + return DAT_CSP_FREE (csp_handle); +} + DAT_RETURN dat_rsp_create ( IN DAT_IA_HANDLE ia_handle, diff --git a/dat/include/dat/dat.h b/dat/include/dat/dat.h index 152534f..53b2dd5 100644 --- a/dat/include/dat/dat.h +++ b/dat/include/dat/dat.h @@ -1,7 +1,7 @@ /* - * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. + * Copyright (c) 2002-2006, Network Appliance, Inc. All rights reserved. * - * This Software is licensed under one of the following licenses: + * This Software is licensed under all of the following licenses: * * 1) under the terms of the "Common Public License 1.0" a copy of which is * in the file LICENSE.txt in the root directory. The license is also @@ -20,12 +20,21 @@ * * Licensee has the right to choose one of the above licenses. * - * Redistributions of source code must retain the above copyright + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * Redistributions of source code must retain both the above copyright * notice and one of the license notices. * * Redistributions in binary form must reproduce both the above copyright * notice, one of the license notices in the documentation * and/or other materials provided with the distribution. + * + * Neither the name of Network Appliance, Inc. nor the names of other DAT + * Collaborative contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. */ /*************************************************************** @@ -35,7 +44,7 @@ * PURPOSE: defines the common DAT API for uDAPL and kDAPL. * * Description: Header file for "DAPL: Direct Access Programming - * Library, Version: 1.2" + * Library, Version: 2.0" * * Mapping rules: * All global symbols are prepended with DAT_ or dat_ @@ -71,6 +80,16 @@ typedef enum dat_boolean DAT_TRUE = 1 } DAT_BOOLEAN; +#ifdef DAT_EXTENSIONS +#define DAT_IB_EXTENSION 1 +#define DAT_IW_EXTENSION 2 +#endif /* DAT_EXTENSIONS */ + +typedef DAT_UINT32 DAT_HA_LB; +#define DAT_HA_LB_NONE (DAT_HA_LB)0 +#define DAT_HA_LB_INTERCOMM (DAT_HA_LB)1 +#define DAT_HA_LB_INTRACOMM (DAT_HA_LB)2 + typedef union dat_context { DAT_PVOID as_ptr; @@ -97,7 +116,16 @@ typedef enum dat_completion_flags * Waiter unblocking is controlled by the Threshold value of * dat_evd_wait. UNSIGNALLED for RECV is not allowed when EP has * this attribute. */ - DAT_COMPLETION_EVD_THRESHOLD_FLAG = 0x10 + DAT_COMPLETION_EVD_THRESHOLD_FLAG = 0x10, + /* Only valid for kDAPL + * Do not start processing LMR invalidate until all + * previously posted DTOs to the EP Request Queue + * have been completed. + * The value for LMR Invalidate Fence does not + * conflict with uDAPL so it can be extended + * to uDAPL usage later. + */ + DAT_COMPLETION_LMR_INVALIDATE_FENCE_FLAG = 0x20 } DAT_COMPLETION_FLAGS; @@ -118,11 +146,29 @@ typedef DAT_HANDLE DAT_PZ_HANDLE; typedef DAT_HANDLE DAT_RMR_HANDLE; typedef DAT_HANDLE DAT_RSP_HANDLE; typedef DAT_HANDLE DAT_SRQ_HANDLE; +typedef DAT_HANDLE DAT_CSP_HANDLE; + +typedef enum dat_dtos +{ + DAT_DTO_SEND, + DAT_DTO_RDMA_WRITE, + DAT_DTO_RDMA_READ, + DAT_DTO_RECEIVE, + DAT_DTO_RECEIVE_WITH_INVALIDATE, + DAT_DTO_BIND_MW, /* DAT 2.0 review, binds are reported via DTO events */ + DAT_DTO_LMR_FMR, /* kdat specific */ + DAT_DTO_LMR_INVALIDATE /* kdat specific */ +#ifdef DAT_EXTENSIONS + ,DAT_DTO_EXTENSION_BASE /* To be used by DAT extensions + as a starting point of extension DTOs */ +#endif /* DAT_EXTENSIONS */ +} DAT_DTOS; + /* dat NULL handles */ #define DAT_HANDLE_NULL ((DAT_HANDLE)NULL) -typedef DAT_SOCK_ADDR * DAT_IA_ADDRESS_PTR; +typedef DAT_SOCK_ADDR* DAT_IA_ADDRESS_PTR; typedef DAT_UINT64 DAT_CONN_QUAL; typedef DAT_UINT64 DAT_PORT_QUAL; @@ -143,10 +189,14 @@ typedef enum dat_qos * FLAGS */ +/* for backward compatibility */ +#define DAT_CONNECT_MULTIPATH_REQUESTED_FLAG DAT_CONNECT_MULTIPATH_FLAG + typedef enum dat_connect_flags { - DAT_CONNECT_DEFAULT_FLAG = 0x00, - DAT_CONNECT_MULTIPATH_FLAG = 0x01 + DAT_CONNECT_DEFAULT_FLAG = 0x00, + DAT_CONNECT_MULTIPATH_REQUESTED_FLAG = 0x01, + DAT_CONNECT_MULTIPATH_REQUIRED_FLAG = 0x02 } DAT_CONNECT_FLAGS; typedef enum dat_close_flags @@ -168,6 +218,10 @@ typedef enum dat_evd_flags /* DAT events only, no software events */ DAT_EVD_DEFAULT_FLAG = 0x1F0 +#ifdef DAT_EXTENSIONS +/* To be used by DAT extensions as a starting point for extended evd flags */ + ,DAT_EVD_EXTENSION_BASE = 0x200 +#endif /* DAT_EXTENSIONS */ } DAT_EVD_FLAGS; typedef enum dat_psp_flags @@ -226,10 +280,12 @@ typedef DAT_UINT32 DAT_RMR_CONTEXT; typedef DAT_UINT64 DAT_VLEN; typedef DAT_UINT64 DAT_VADDR; +typedef DAT_UINT32 DAT_SEG_LENGTH; /* The maximum data segment length */ typedef struct dat_provider_attr DAT_PROVIDER_ATTR; typedef struct dat_evd_param DAT_EVD_PARAM; typedef struct dat_lmr_param DAT_LMR_PARAM; +typedef enum dat_lmr_param_mask DAT_LMR_PARAM_MASK; /* It is legal for the Consumer to specify zero for segment_length * of the dat_lmr_triplet. When 0 is specified for the @@ -239,25 +295,18 @@ typedef struct dat_lmr_param DAT_LMR_PARAM; typedef struct dat_lmr_triplet { - DAT_LMR_CONTEXT lmr_context; - DAT_UINT32 pad; - DAT_VADDR virtual_address; - DAT_VLEN segment_length; + DAT_VADDR virtual_address;/* 64-bit address */ + DAT_SEG_LENGTH segment_length; /* 32-bit length */ + DAT_LMR_CONTEXT lmr_context; /* 32-bit lmr_context */ } DAT_LMR_TRIPLET; typedef struct dat_rmr_triplet { - DAT_RMR_CONTEXT rmr_context; - DAT_UINT32 pad; - DAT_VADDR target_address; - DAT_VLEN segment_length; + DAT_VADDR virtual_address;/* 64-bit address */ + DAT_SEG_LENGTH segment_length; /* 32-bit length */ + DAT_RMR_CONTEXT rmr_context; /* 32-bit rmr_context */ } DAT_RMR_TRIPLET; -/* - * The extra padding ensures that context, address, and length parameters are - * aligned on 64-bit boundaries. - */ - /* Memory privileges */ typedef enum dat_mem_priv_flags @@ -268,6 +317,12 @@ typedef enum dat_mem_priv_flags DAT_MEM_PRIV_LOCAL_WRITE_FLAG = 0x10, DAT_MEM_PRIV_REMOTE_WRITE_FLAG = 0x20, DAT_MEM_PRIV_ALL_FLAG = 0x33 +#ifdef DAT_EXTENSIONS +/* To be used by DAT extensions as a starting + point of extension memory privileges */ + ,DAT_MEM_PRIV_EXTENSION_BASE = 0x40 +#endif /* DAT_EXTENSIONS */ + } DAT_MEM_PRIV_FLAGS; /* For backward compatibility with DAT-1.0, memory privileges values are @@ -276,26 +331,24 @@ typedef enum dat_mem_priv_flags #define DAT_MEM_PRIV_READ_FLAG (DAT_MEM_PRIV_LOCAL_READ_FLAG | DAT_MEM_PRIV_REMOTE_READ_FLAG) #define DAT_MEM_PRIV_WRITE_FLAG (DAT_MEM_PRIV_LOCAL_WRITE_FLAG | DAT_MEM_PRIV_REMOTE_WRITE_FLAG) -/* LMR Arguments Mask */ - -typedef enum dat_lmr_param_mask +/* LMR VA types */ +typedef enum dat_va_type { - DAT_LMR_FIELD_IA_HANDLE = 0x001, - DAT_LMR_FIELD_MEM_TYPE = 0x002, - DAT_LMR_FIELD_REGION_DESC = 0x004, - DAT_LMR_FIELD_LENGTH = 0x008, - DAT_LMR_FIELD_PZ_HANDLE = 0x010, - DAT_LMR_FIELD_MEM_PRIV = 0x020, - DAT_LMR_FIELD_LMR_CONTEXT = 0x040, - DAT_LMR_FIELD_RMR_CONTEXT = 0x080, - DAT_LMR_FIELD_REGISTERED_SIZE = 0x100, - DAT_LMR_FIELD_REGISTERED_ADDRESS = 0x200, - - DAT_LMR_FIELD_ALL = 0x3FF -} DAT_LMR_PARAM_MASK; + DAT_VA_TYPE_VA = 0x0, + DAT_VA_TYPE_ZB = 0x1 +} DAT_VA_TYPE; /* RMR Arguments & RMR Arguments Mask */ +/* DAPL 2.0 addition */ +/* Defines RMR protection scope */ +typedef enum dat_rmr_scope +{ + DAT_RMR_SCOPE_EP, /* bound to at most one EP at a time. */ + DAT_RMR_SCOPE_PZ, /* bound to a Protection Zone */ + DAT_RMR_SCOPE_ANY /* Supports all types */ +} DAT_RMR_SCOPE; + typedef struct dat_rmr_param { DAT_IA_HANDLE ia_handle; @@ -303,6 +356,8 @@ typedef struct dat_rmr_param DAT_LMR_TRIPLET lmr_triplet; DAT_MEM_PRIV_FLAGS mem_priv; DAT_RMR_CONTEXT rmr_context; + DAT_RMR_SCOPE rmr_scope; + DAT_VA_TYPE va_type; } DAT_RMR_PARAM; typedef enum dat_rmr_param_mask @@ -312,8 +367,10 @@ typedef enum dat_rmr_param_mask DAT_RMR_FIELD_LMR_TRIPLET = 0x04, DAT_RMR_FIELD_MEM_PRIV = 0x08, DAT_RMR_FIELD_RMR_CONTEXT = 0x10, + DAT_RMR_FIELD_RMR_SCOPE = 0x20, + DAT_RMR_FIELD_VA_TYPE = 0x40, - DAT_RMR_FIELD_ALL = 0x1F + DAT_RMR_FIELD_ALL = 0x7F } DAT_RMR_PARAM_MASK; /* Provider attributes */ @@ -335,7 +392,6 @@ typedef enum dat_ep_creator_for_psp DAT_PSP_CREATES_EP_ALWAYS /* Provider always creates Endpoint. */ } DAT_EP_CREATOR_FOR_PSP; - /* General Interface Adapter attributes. These apply to both udat and kdat. */ /* To support backwards compatibility for DAPL-1.0 */ @@ -345,44 +401,18 @@ typedef enum dat_ep_creator_for_psp /* To support backwards compatibility for DAPL-1.0 & DAPL-1.1 */ #define max_mtu_size max_message_size -typedef struct dat_ia_attr +#ifdef DAT_EXTENSIONS +/* DAPL 2.0 addition */ +/* Defines extensions */ +typedef enum dat_extension { - char adapter_name[DAT_NAME_MAX_LENGTH]; - char vendor_name[DAT_NAME_MAX_LENGTH]; - DAT_UINT32 hardware_version_major; - DAT_UINT32 hardware_version_minor; - DAT_UINT32 firmware_version_major; - DAT_UINT32 firmware_version_minor; - DAT_IA_ADDRESS_PTR ia_address_ptr; - DAT_COUNT max_eps; - DAT_COUNT max_dto_per_ep; - DAT_COUNT max_rdma_read_per_ep_in; - DAT_COUNT max_rdma_read_per_ep_out; - DAT_COUNT max_evds; - DAT_COUNT max_evd_qlen; - DAT_COUNT max_iov_segments_per_dto; - DAT_COUNT max_lmrs; - DAT_VLEN max_lmr_block_size; - DAT_VADDR max_lmr_virtual_address; - DAT_COUNT max_pzs; - DAT_VLEN max_message_size; - DAT_VLEN max_rdma_size; - DAT_COUNT max_rmrs; - DAT_VADDR max_rmr_target_address; - DAT_COUNT max_srqs; - DAT_COUNT max_ep_per_srq; - DAT_COUNT max_recv_per_srq; - DAT_COUNT max_iov_segments_per_rdma_read; - DAT_COUNT max_iov_segments_per_rdma_write; - DAT_COUNT max_rdma_read_in; - DAT_COUNT max_rdma_read_out; - DAT_BOOLEAN max_rdma_read_per_ep_in_guaranteed; - DAT_BOOLEAN max_rdma_read_per_ep_out_guaranteed; - DAT_COUNT num_transport_attr; - DAT_NAMED_ATTR *transport_attr; - DAT_COUNT num_vendor_attr; - DAT_NAMED_ATTR *vendor_attr; -} DAT_IA_ATTR; + DAT_EXTENSION_IB, /* IB extension. */ + DAT_EXTENSION_IW, /* iWARP extension. */ + DAT_EXTENSION_NONE /* no extension supported. */ +} DAT_EXTENSION; +#endif /* DAT_EXTENSIONS */ + +typedef struct dat_ia_attr DAT_IA_ATTR; /* To support backwards compatibility for DAPL-1.0 & DAPL-1.1 */ #define DAT_IA_FIELD_IA_MAX_MTU_SIZE DAT_IA_FIELD_IA_MAX_MESSAGE_SIZE @@ -420,14 +450,10 @@ typedef DAT_UINT64 DAT_IA_ATTR_MASK; #define DAT_IA_FIELD_IA_MAX_RDMA_READ_OUT UINT64_C(0x010000000) #define DAT_IA_FIELD_IA_MAX_RDMA_READ_PER_EP_IN_GUARANTEED UINT64_C(0x020000000) #define DAT_IA_FIELD_IA_MAX_RDMA_READ_PER_EP_OUT_GUARANTEED UINT64_C(0x040000000) -#define DAT_IA_FIELD_IA_NUM_TRANSPORT_ATTR UINT64_C(0x080000000) -#define DAT_IA_FIELD_IA_TRANSPORT_ATTR UINT64_C(0x100000000) -#define DAT_IA_FIELD_IA_NUM_VENDOR_ATTR UINT64_C(0x200000000) -#define DAT_IA_FIELD_IA_VENDOR_ATTR UINT64_C(0x400000000) +#define DAT_IA_FIELD_IA_ZB_SUPPORTED UINT64_C(0x080000000) /* To support backwards compatibility for DAPL-1.0 & DAPL-1.1 */ #define DAT_IA_ALL DAT_IA_FIELD_ALL -#define DAT_IA_FIELD_ALL UINT64_C(0x07FFFFFFFF) #define DAT_IA_FIELD_NONE UINT64_C(0x0) /* Endpoint attributes */ @@ -440,8 +466,8 @@ typedef enum dat_service_type typedef struct dat_ep_attr { DAT_SERVICE_TYPE service_type; - DAT_VLEN max_message_size; - DAT_VLEN max_rdma_size; + DAT_SEG_LENGTH max_message_size; + DAT_SEG_LENGTH max_rdma_size; DAT_QOS qos; DAT_COMPLETION_FLAGS recv_completion_flags; DAT_COMPLETION_FLAGS request_completion_flags; @@ -479,13 +505,16 @@ typedef enum dat_ep_state DAT_EP_STATE_CONNECTED, DAT_EP_STATE_DISCONNECT_PENDING, DAT_EP_STATE_DISCONNECTED, - DAT_EP_STATE_COMPLETION_PENDING + DAT_EP_STATE_COMPLETION_PENDING, + DAT_EP_STATE_CONNECTED_SINGLE_PATH, + DAT_EP_STATE_CONNECTED_MULTI_PATH } DAT_EP_STATE; typedef struct dat_ep_param { DAT_IA_HANDLE ia_handle; DAT_EP_STATE ep_state; + DAT_COMM comm; DAT_IA_ADDRESS_PTR local_ia_address_ptr; DAT_PORT_QUAL local_port_qual; DAT_IA_ADDRESS_PTR remote_ia_address_ptr; @@ -501,15 +530,16 @@ typedef struct dat_ep_param typedef DAT_UINT64 DAT_EP_PARAM_MASK; #define DAT_EP_FIELD_IA_HANDLE UINT64_C(0x00000001) #define DAT_EP_FIELD_EP_STATE UINT64_C(0x00000002) -#define DAT_EP_FIELD_LOCAL_IA_ADDRESS_PTR UINT64_C(0x00000004) -#define DAT_EP_FIELD_LOCAL_PORT_QUAL UINT64_C(0x00000008) -#define DAT_EP_FIELD_REMOTE_IA_ADDRESS_PTR UINT64_C(0x00000010) -#define DAT_EP_FIELD_REMOTE_PORT_QUAL UINT64_C(0x00000020) -#define DAT_EP_FIELD_PZ_HANDLE UINT64_C(0x00000040) -#define DAT_EP_FIELD_RECV_EVD_HANDLE UINT64_C(0x00000080) -#define DAT_EP_FIELD_REQUEST_EVD_HANDLE UINT64_C(0x00000100) -#define DAT_EP_FIELD_CONNECT_EVD_HANDLE UINT64_C(0x00000200) -#define DAT_EP_FIELD_SRQ_HANDLE UINT64_C(0x00000400) +#define DAT_EP_FIELD_COMM UINT64_C(0x00000004) +#define DAT_EP_FIELD_LOCAL_IA_ADDRESS_PTR UINT64_C(0x00000008) +#define DAT_EP_FIELD_LOCAL_PORT_QUAL UINT64_C(0x00000010) +#define DAT_EP_FIELD_REMOTE_IA_ADDRESS_PTR UINT64_C(0x00000020) +#define DAT_EP_FIELD_REMOTE_PORT_QUAL UINT64_C(0x00000040) +#define DAT_EP_FIELD_PZ_HANDLE UINT64_C(0x00000080) +#define DAT_EP_FIELD_RECV_EVD_HANDLE UINT64_C(0x00000100) +#define DAT_EP_FIELD_REQUEST_EVD_HANDLE UINT64_C(0x00000200) +#define DAT_EP_FIELD_CONNECT_EVD_HANDLE UINT64_C(0x00000400) +#define DAT_EP_FIELD_SRQ_HANDLE UINT64_C(0x00000800) /* Remainder of values from EP_ATTR, 0x00001000 and up */ #define DAT_EP_FIELD_EP_ATTR_SERVICE_TYPE UINT64_C(0x00001000) #define DAT_EP_FIELD_EP_ATTR_MAX_MESSAGE_SIZE UINT64_C(0x00002000) @@ -532,7 +562,7 @@ typedef DAT_UINT64 DAT_EP_PARAM_MASK; #define DAT_EP_FIELD_EP_ATTR_PROVIDER_SPECIFIC_ATTR UINT64_C(0x40000000) #define DAT_EP_FIELD_EP_ATTR_ALL UINT64_C(0x7FFFF000) -#define DAT_EP_FIELD_ALL UINT64_C(0x7FFFF7FF) +#define DAT_EP_FIELD_ALL UINT64_C(0x7FFFFFFF) #define DAT_WATERMARK_INFINITE ((DAT_COUNT)~0) #define DAT_HW_DEFAULT DAT_WATERMARK_INFINITE @@ -633,6 +663,25 @@ typedef enum dat_rsp_param_mask DAT_RSP_FIELD_ALL = 0x0F } DAT_RSP_PARAM_MASK; +/* CSP Parameters */ +typedef struct dat_csp_param +{ + DAT_IA_HANDLE ia_handle; + DAT_COMM *comm; + DAT_IA_ADDRESS_PTR address_ptr; + DAT_EVD_HANDLE evd_handle; +} DAT_CSP_PARAM; + +typedef enum dat_csp_param_mask +{ + DAT_CSP_FIELD_IA_HANDLE = 0x01, + DAT_CSP_FIELD_COMM = 0x02, + DAT_CSP_FIELD_IA_ADDRESS = 0x04, + DAT_CSP_FIELD_EVD_HANDLE = 0x08, + + DAT_CSP_FIELD_ALL = 0x0F +} DAT_CSP_PARAM_MASK; + /* Connection Request Parameters. * * The Connection Request does not provide Remote Endpoint attributes. @@ -681,7 +730,7 @@ typedef enum dat_cr_param_mask /* DTO completion status */ - /* For backwards compatability */ + /* For backwards compatibility */ #define DAT_DTO_LENGTH_ERROR DAT_DTO_ERR_LOCAL_LENGTH #define DAT_DTO_FAILURE DAT_DTO_ERR_FLUSHED @@ -698,12 +747,13 @@ typedef enum dat_dto_completion_status DAT_DTO_ERR_TRANSPORT = 8, DAT_DTO_ERR_RECEIVER_NOT_READY = 9, DAT_DTO_ERR_PARTIAL_PACKET = 10, - DAT_RMR_OPERATION_FAILED = 11 + DAT_RMR_OPERATION_FAILED = 11, + DAT_DTO_ERR_LOCAL_MM_ERROR = 12 /* kdat specific */ } DAT_DTO_COMPLETION_STATUS; /* RMR completion status */ - /* For backwards compatability */ + /* For backwards compatibility */ #define DAT_RMR_BIND_SUCCESS DAT_DTO_SUCCESS #define DAT_RMR_BIND_FAILURE DAT_DTO_ERR_FLUSHED @@ -714,12 +764,16 @@ typedef enum dat_dto_completion_status /* DTO completion event data */ /* transfered_length is not defined if status is not DAT_SUCCESS */ +/* invalidate_flag and rmr_context are not defined if status is not DAT_SUCCESS */ + typedef struct dat_dto_completion_event_data { DAT_EP_HANDLE ep_handle; DAT_DTO_COOKIE user_cookie; DAT_DTO_COMPLETION_STATUS status; - DAT_VLEN transfered_length; + DAT_SEG_LENGTH transfered_length; + DAT_DTOS operation; + DAT_RMR_CONTEXT rmr_context; } DAT_DTO_COMPLETION_EVENT_DATA; /* RMR bind completion event data */ @@ -734,16 +788,17 @@ typedef union dat_sp_handle { DAT_RSP_HANDLE rsp_handle; DAT_PSP_HANDLE psp_handle; + DAT_CSP_HANDLE csp_handle; } DAT_SP_HANDLE; /* Connection Request Arrival event data */ typedef struct dat_cr_arrival_event_data { /* Handle to the Service Point that received the Connection Request - * from the remote side. If the Service Point was Reserved, sp is + * from the remote side. If the Service Point was Reserved, sp_handle is * DAT_HANDLE_NULL because the reserved Service Point is - * automatically destroyed upon generating this event. Can be PSP - * or RSP. + * automatically destroyed upon generating this event. Can be PSP, + * CSP, or RSP. */ DAT_SP_HANDLE sp_handle; @@ -761,6 +816,12 @@ typedef struct dat_cr_arrival_event_data * to dat_cr_accept or dat_cr_reject of the Connection Request. */ DAT_CR_HANDLE cr_handle; + + /* The binary indicator whether the arrived privata data was trancated + * or not. + * The default value of 0 means not truncation of received private data. */ + DAT_BOOLEAN truncate_flag; + } DAT_CR_ARRIVAL_EVENT_DATA; @@ -854,7 +915,16 @@ typedef enum dat_event_number DAT_ASYNC_ERROR_EP_BROKEN = 0x08003, DAT_ASYNC_ERROR_TIMED_OUT = 0x08004, DAT_ASYNC_ERROR_PROVIDER_INTERNAL_ERROR = 0x08005, + DAT_HA_DOWN_TO_1 = 0x08101, + DAT_HA_UP_TO_MULTI_PATH = 0x08102, + DAT_SOFTWARE_EVENT = 0x10001 +#ifdef DAT_EXTENSIONS + ,DAT_EXTENSION_EVENT = 0x20000, + DAT_IB_EXTENSION_RANGE_BASE = 0x40000, + DAT_IW_EXTENSION_RANGE_BASE = 0x80000 +#endif /* DAT_EXTENSIONS */ + } DAT_EVENT_NUMBER; /* Union for event Data */ @@ -876,6 +946,9 @@ typedef struct dat_event DAT_EVENT_NUMBER event_number; DAT_EVD_HANDLE evd_handle; DAT_EVENT_DATA event_data; +#ifdef DAT_EXTENSIONS + DAT_UINT64 event_extension_data[8]; +#endif /* DAT_EXTENSIONS */ } DAT_EVENT; /* Provider/registration info */ @@ -887,6 +960,7 @@ typedef struct dat_provider_info DAT_UINT32 dapl_version_minor; DAT_BOOLEAN is_thread_safe; } DAT_PROVIDER_INFO; + /*************************************************************** * * FUNCTION PROTOTYPES @@ -950,13 +1024,15 @@ extern DAT_RETURN dat_cr_query ( OUT DAT_CR_PARAM * ); /* cr_param */ extern DAT_RETURN dat_cr_accept ( - IN DAT_CR_HANDLE /* cr_handle */, + IN DAT_CR_HANDLE, /* cr_handle */ IN DAT_EP_HANDLE, /* ep_handle */ IN DAT_COUNT, /* private_data_size */ IN const DAT_PVOID ); /* private_data */ extern DAT_RETURN dat_cr_reject ( - IN DAT_CR_HANDLE ) /* cr_handle */; + IN DAT_CR_HANDLE, /* cr_handle */ + IN DAT_COUNT, /* private_data_size */ + IN const DAT_PVOID ); /* private_data */ /* For DAT-1.1 and above, this function is defined for both uDAPL and * kDAPL. For DAT-1.0, it is only defined for uDAPL. @@ -1026,6 +1102,13 @@ extern DAT_RETURN dat_ep_dup_connect ( IN const DAT_PVOID, /* private_data */ IN DAT_QOS); /* quality_of_service */ +extern DAT_RETURN dat_ep_common_connect ( + IN DAT_EP_HANDLE, /* ep_handle */ + IN DAT_IA_ADDRESS_PTR, /* remote_ia_address */ + IN DAT_TIMEOUT, /* timeout */ + IN DAT_COUNT, /* private_data_size */ + IN const DAT_PVOID ); /* private_data */ + extern DAT_RETURN dat_ep_disconnect ( IN DAT_EP_HANDLE, /* ep_handle */ IN DAT_CLOSE_FLAGS ); /* close_flags */ @@ -1037,6 +1120,15 @@ extern DAT_RETURN dat_ep_post_send ( IN DAT_DTO_COOKIE, /* user_cookie */ IN DAT_COMPLETION_FLAGS ); /* completion_flags */ +extern DAT_RETURN dat_ep_post_send_with_invalidate ( + IN DAT_EP_HANDLE, /* ep_handle */ + IN DAT_COUNT, /* num_segments */ + IN DAT_LMR_TRIPLET *, /* local_iov */ + IN DAT_DTO_COOKIE, /* user_cookie */ + IN DAT_COMPLETION_FLAGS, /* completion_flags */ + IN DAT_BOOLEAN, /* invalidate_flag */ + IN DAT_RMR_CONTEXT ); /* RMR to invalidate */ + extern DAT_RETURN dat_ep_post_recv ( IN DAT_EP_HANDLE, /* ep_handle */ IN DAT_COUNT, /* num_segments */ @@ -1052,6 +1144,13 @@ extern DAT_RETURN dat_ep_post_rdma_read ( IN const DAT_RMR_TRIPLET *,/* remote_iov */ IN DAT_COMPLETION_FLAGS ); /* completion_flags */ +extern DAT_RETURN dat_ep_post_rdma_read_to_rmr ( + IN DAT_EP_HANDLE, /* ep_handle */ + IN const DAT_RMR_TRIPLET *, /* local_iov */ + IN DAT_DTO_COOKIE, /* user_cookie */ + IN const DAT_RMR_TRIPLET *,/* remote_iov */ + IN DAT_COMPLETION_FLAGS ); /* completion_flags */ + extern DAT_RETURN dat_ep_post_rdma_write ( IN DAT_EP_HANDLE, /* ep_handle */ IN DAT_COUNT, /* num_segments */ @@ -1094,11 +1193,6 @@ extern DAT_RETURN dat_ep_set_watermark ( /* LMR functions */ -extern DAT_RETURN dat_lmr_query ( - IN DAT_LMR_HANDLE, /* lmr_handle */ - IN DAT_LMR_PARAM_MASK, /* lmr_param_mask */ - OUT DAT_LMR_PARAM *); /* lmr_param */ - extern DAT_RETURN dat_lmr_free ( IN DAT_LMR_HANDLE); /* lmr_handle */ @@ -1120,6 +1214,10 @@ extern DAT_RETURN dat_rmr_create ( IN DAT_PZ_HANDLE, /* pz_handle */ OUT DAT_RMR_HANDLE *); /* rmr_handle */ +extern DAT_RETURN dat_rmr_create_for_ep ( + IN DAT_PZ_HANDLE, /* pz_handle */ + OUT DAT_RMR_HANDLE *); /* rmr_handle */ + extern DAT_RETURN dat_rmr_query ( IN DAT_RMR_HANDLE, /* rmr_handle */ IN DAT_RMR_PARAM_MASK, /* rmr_param_mask */ @@ -1127,8 +1225,10 @@ extern DAT_RETURN dat_rmr_query ( extern DAT_RETURN dat_rmr_bind ( IN DAT_RMR_HANDLE, /* rmr_handle */ + IN DAT_LMR_HANDLE, /* lmr_handle */ IN const DAT_LMR_TRIPLET *,/* lmr_triplet */ IN DAT_MEM_PRIV_FLAGS, /* mem_priv */ + IN DAT_VA_TYPE, /* va_type */ IN DAT_EP_HANDLE, /* ep_handle */ IN DAT_RMR_COOKIE, /* user_cookie */ IN DAT_COMPLETION_FLAGS, /* completion_flags */ @@ -1178,6 +1278,23 @@ extern DAT_RETURN dat_rsp_query ( extern DAT_RETURN dat_rsp_free ( IN DAT_RSP_HANDLE ); /* rsp_handle */ +/* CSP functions */ + +extern DAT_RETURN dat_csp_create ( + IN DAT_IA_HANDLE, /* ia_handle */ + IN DAT_COMM *, /* communicator */ + IN DAT_IA_ADDRESS_PTR, /* address */ + IN DAT_EVD_HANDLE, /* evd_handle */ + OUT DAT_CSP_HANDLE * ); /* csp_handle */ + +extern DAT_RETURN dat_csp_query ( + IN DAT_CSP_HANDLE, /* csp_handle */ + IN DAT_CSP_PARAM_MASK, /* csp_param_mask */ + OUT DAT_CSP_PARAM * ); /* csp_param */ + +extern DAT_RETURN dat_csp_free ( + IN DAT_CSP_HANDLE ); /* csp_handle */ + /* PZ functions */ extern DAT_RETURN dat_pz_create ( @@ -1222,6 +1339,14 @@ extern DAT_RETURN dat_srq_set_lw ( IN DAT_SRQ_HANDLE, /* srq_handle */ IN DAT_COUNT); /* low_watermark */ +#ifdef DAT_EXTENSIONS +typedef int DAT_EXTENDED_OP; +extern DAT_RETURN dat_extension_op( + IN DAT_HANDLE, /* handle */ + IN DAT_EXTENDED_OP, /* operation */ + IN ... ); /* args */ +#endif + /* * DAT registry functions. * @@ -1231,7 +1356,7 @@ extern DAT_RETURN dat_srq_set_lw ( extern DAT_RETURN dat_registry_list_providers ( IN DAT_COUNT, /* max_to_return */ OUT DAT_COUNT *, /* entries_returned */ - OUT DAT_PROVIDER_INFO * (dat_provider_list[]) ); /* dat_provider_list */ + OUT DAT_PROVIDER_INFO *(dat_provider_list[]) ); /* dat_provider_list */ /* * DAT error functions. @@ -1242,3 +1367,4 @@ extern DAT_RETURN dat_strerror ( OUT const char ** ); /* minor message string */ #endif /* _DAT_H_ */ + diff --git a/dat/include/dat/dat_error.h b/dat/include/dat/dat_error.h index fce83a5..251e6c4 100644 --- a/dat/include/dat/dat_error.h +++ b/dat/include/dat/dat_error.h @@ -1,7 +1,7 @@ /* - * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. + * Copyright (c) 2002-2006, Network Appliance, Inc. All rights reserved. * - * This Software is licensed under one of the following licenses: + * This Software is licensed under all of the following licenses: * * 1) under the terms of the "Common Public License 1.0" a copy of which is * in the file LICENSE.txt in the root directory. The license is also @@ -20,12 +20,21 @@ * * Licensee has the right to choose one of the above licenses. * - * Redistributions of source code must retain the above copyright + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * Redistributions of source code must retain both the above copyright * notice and one of the license notices. * * Redistributions in binary form must reproduce both the above copyright * notice, one of the license notices in the documentation * and/or other materials provided with the distribution. + * + * Neither the name of Network Appliance, Inc. nor the names of other DAT + * Collaborative contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. */ /*********************************************************** @@ -35,7 +44,7 @@ * PURPOSE: DAT return codes * * Description: Header file for "DAPL: Direct Access Programming - * Library, Version: 1.2" + * Library, Version: 2.0" * * Mapping rules: * Error types are compound types, as mapped out below. @@ -87,7 +96,7 @@ typedef enum dat_return_type { /* The operation was successful. */ - DAT_SUCCESS = 0x000000, + DAT_SUCCESS = 0x00000000, /* The operation was aborted because IA was closed or EVD was * * destroyed. */ @@ -162,17 +171,29 @@ typedef enum dat_return_type /* No Connection Qualifiers are available */ DAT_CONN_QUAL_UNAVAILABLE = 0x00140000, + /* kDAPL reserved LMR */ + DAT_RESERVED_LMR = 0x00150000, /* kdapl only */ + + /* The specified IP Port was in use. */ + DAT_PORT_IN_USE = 0x00160000, + /* The specified COMM not supported. */ + DAT_COMM_NOT_SUPPORTED = 0x00170000, + +#ifdef DAT_EXTENSIONS + /* The DAT extensions support. */ + DAT_EXTENSION_BASE = 0x10000000, + /* range 0x10000000 - 0x3FFF0000 is reserved for extensions */ +#endif /* DAT_EXTENSIONS */ + /* Provider does not support the operation yet. */ - DAT_NOT_IMPLEMENTED = 0xFFFF0000 + DAT_NOT_IMPLEMENTED = 0x3FFF0000 } DAT_RETURN_TYPE; typedef DAT_UINT32 DAT_RETURN; - /* Backward compatibility with DAT 1.0 */ #define DAT_NAME_NOT_FOUND DAT_PROVIDER_NOT_FOUND - /* * DAT_RETURN_SUBTYPE listing */ @@ -217,6 +238,7 @@ typedef enum dat_return_subtype DAT_INVALID_HANDLE_EVD_CONN, DAT_INVALID_HANDLE_EVD_ASYNC, DAT_INVALID_HANDLE_SRQ, + DAT_INVALID_HANDLE_CSP, DAT_INVALID_HANDLE1, DAT_INVALID_HANDLE2, DAT_INVALID_HANDLE3, diff --git a/dat/include/dat/dat_ib_extensions.h b/dat/include/dat/dat_ib_extensions.h new file mode 100755 index 0000000..1dba175 --- /dev/null +++ b/dat/include/dat/dat_ib_extensions.h @@ -0,0 +1,311 @@ +/* + * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. + * + * This Software is licensed under one of the following licenses: + * + * 1) under the terms of the "Common Public License 1.0" a copy of which is + * in the file LICENSE.txt in the root directory. The license is also + * available from the Open Source Initiative, see + * http://www.opensource.org/licenses/cpl.php. + * + * 2) under the terms of the "The BSD License" a copy of which is in the file + * LICENSE2.txt in the root directory. The license is also available from + * the Open Source Initiative, see + * http://www.opensource.org/licenses/bsd-license.php. + * + * 3) under the terms of the "GNU General Public License (GPL) Version 2" a + * copy of which is in the file LICENSE3.txt in the root directory. The + * license is also available from the Open Source Initiative, see + * http://www.opensource.org/licenses/gpl-license.php. + * + * Licensee has the right to choose one of the above licenses. + * + * Redistributions of source code must retain the above copyright + * notice and one of the license notices. + * + * Redistributions in binary form must reproduce both the above copyright + * notice, one of the license notices in the documentation + * and/or other materials provided with the distribution. + */ +/********************************************************************** + * + * HEADER: dat_ib_extensions.h + * + * PURPOSE: extensions to the DAT API for IB transport specific services + * NOTE: Prototyped IB extension support in openib-cma 1.2 provider. + * Applications MUST recompile with new dat.h definitions + * and include this file. + * + * Description: Header file for "uDAPL: User Direct Access Programming + * Library, Version: 2.0" + * + * Mapping rules: + * All global symbols are prepended with "DAT_" or "dat_" + * All DAT objects have an 'api' tag which, such as 'ep' or 'lmr' + * The method table is in the provider definition structure. + * + * + **********************************************************************/ +#ifndef _DAT_IB_EXTENSIONS_H_ +#define _DAT_IB_EXTENSIONS_H_ + +/* + * Provider specific attribute strings for extension support + * returned with dat_ia_query() and + * DAT_PROVIDER_ATTR_MASK == DAT_PROVIDER_FIELD_PROVIDER_SPECIFIC_ATTR + * + * DAT_NAMED_ATTR name == extended operations and version, + * version_value = version number of extension API + */ +#define DAT_EXTENSION_ATTR "DAT_EXTENSION_INTERFACE" +#define DAT_EXTENSION_ATTR_VERSION "DAT_EXTENSION_VERSION" +#define DAT_EXTENSION_ATTR_VERSION_VALUE "2.0.1" +#define DAT_IB_ATTR_FETCH_AND_ADD "DAT_IB_FETCH_AND_ADD" +#define DAT_IB_ATTR_CMP_AND_SWAP "DAT_IB_CMP_AND_SWAP" +#define DAT_IB_ATTR_IMMED_DATA "DAT_IB_IMMED_DATA" + +/* + * Definition for extended EVENT numbers, DAT_IB_EXTENSION_BASE_RANGE + * is used by these extensions as a starting point for extended event numbers + */ +typedef enum dat_ib_event_number +{ + DAT_IB_DTO_EVENT = DAT_IB_EXTENSION_RANGE_BASE, + +} DAT_IB_EVENT_NUMBER; + +/* + * Extension operations + */ +typedef enum dat_ib_op +{ + DAT_IB_FETCH_AND_ADD_OP, + DAT_IB_CMP_AND_SWAP_OP, + DAT_IB_RDMA_WRITE_IMMED_OP, + +} DAT_IB_OP; + +/* + * The DAT_IB_EXT_TYPE enum specifies the type of extension operation that just + * completed. All IB extended completion types both, DTO and NON-DTO, are + * reported in the extended operation type with the single DAT_IB_DTO_EVENT type. + * The specific extended DTO operation is reported with a DAT_IB_DTOS type in the + * operation field of the base DAT_EVENT structure. All other extended events are + * identified by unique DAT_IB_EVENT_NUMBER types. + */ +typedef enum dat_ib_ext_type +{ + DAT_IB_FETCH_AND_ADD, // 0 + DAT_IB_CMP_AND_SWAP, // 1 + DAT_IB_RDMA_WRITE_IMMED, // 2 + DAT_IB_RDMA_WRITE_IMMED_DATA, // 3 + +} DAT_IB_EXT_TYPE; + +/* + * Extension event status + */ +typedef enum dat_ib_status +{ + DAT_OP_SUCCESS = DAT_SUCCESS, + DAT_IB_OP_ERR, + +} DAT_IB_STATUS; + + +/* + * Definitions for additional extension type RETURN codes above + * standard DAT types. Included with standard DAT_TYPE_STATUS + * bits using a DAT_EXTENSION BASE as a starting point. + */ +typedef enum dat_ib_return +{ + DAT_IB_ERR = DAT_EXTENSION_BASE, + +} DAT_IB_RETURN; + +/* + * Definition for extended IB DTO operations, DAT_DTO_EXTENSION_BASE + * is used by DAT extensions as a starting point of extension DTOs + */ +typedef enum dat_ib_dtos +{ + DAT_IB_DTO_RDMA_WRITE_IMMED = DAT_DTO_EXTENSION_BASE, + DAT_IB_DTO_RECV_IMMED, + DAT_IB_DTO_FETCH_ADD, + DAT_IB_DTO_CMP_SWAP, + +} DAT_IB_DTOS; + +/* + * Definitions for additional extension handle types beyond + * standard DAT handle. New Bit definitions MUST start at + * DAT_HANDLE_TYPE_EXTENSION_BASE + */ +typedef enum dat_ib_handle_type +{ + DAT_IB_HANDLE_TYPE_EXT = DAT_HANDLE_TYPE_EXTENSION_BASE, + +} DAT_IB_HANDLE_TYPE; + +/* + * The DAT_IB_EVD_EXTENSION_FLAGS enum specifies the EVD extension flags that + * do not map directly to existing DAT_EVD_FLAGS. This new EVD flag has been + * added to identify an extended EVD that does not fit the existing stream + * types. + */ +typedef enum dat_ib_evd_extension_flags +{ + DAT_IB_EVD_EXTENSION_FLAG = DAT_EVD_EXTENSION_BASE + +} DAT_IB_EVD_EXTENSION_FLAGS; + +/* + * Definition for memory privilege extension flags. + * New privileges required for new atomic DTO type extensions. + * New Bit definitions MUST start at DAT_MEM_PRIV_EXTENSION + */ +typedef enum dat_ib_mem_priv_flags +{ + DAT_IB_MEM_PRIV_REMOTE_ATOMIC = DAT_MEM_PRIV_EXTENSION_BASE, + +} DAT_IB_MEM_PRIV_FLAGS; + + +/* + * Definitions for extended event data: + * When dat_event->event_number >= DAT_IB_EXTENSION_BASE_RANGE + * then dat_event->extension_data == DAT_IB_EXT_EVENT_DATA type + * and ((DAT_IB_EXT_EVENT_DATA*)dat_event->extension_data)->type + * specifies extension data values. + * NOTE: DAT_IB_EXT_EVENT_DATA cannot exceed 64 bytes as defined by + * "DAT_UINT64 extension_data[8]" in DAT_EVENT (dat.h) + */ +typedef struct dat_ib_immed_data +{ + DAT_UINT32 data; + +} DAT_IB_IMMED_DATA; + +/* + * Definitions for extended event data: + * When dat_event->event_number >= DAT_IB_EXTENSION_BASE_RANGE + * then dat_event->extension_data == DAT_EXTENSION_EVENT_DATA type + * and ((DAT_EXTENSION_EVENT_DATA*)dat_event->extension_data)->type + * specifies extension data values. + * NOTE: DAT_EXTENSION_EVENT_DATA cannot exceed 64 bytes as defined by + * "DAT_UINT64 extension_data[8]" in DAT_EVENT (dat.h) + */ +typedef struct dat_ib_extension_event_data +{ + DAT_IB_EXT_TYPE type; + DAT_IB_STATUS status; + union { + DAT_IB_IMMED_DATA immed; + } val; + +} DAT_IB_EXTENSION_EVENT_DATA; + +/* Extended RETURN and EVENT STATUS string helper functions */ + +/* DAT_EXT_RETURN error to string */ +static __inline__ DAT_RETURN +dat_strerror_extension ( + IN DAT_IB_RETURN value, + OUT const char **message ) +{ + switch( DAT_GET_TYPE(value) ) { + case DAT_IB_ERR: + *message = "DAT_IB_ERR"; + return DAT_SUCCESS; + default: + /* standard DAT return type */ + return(dat_strerror(value, message, NULL)); + } +} + +/* DAT_EXT_STATUS error to string */ +static __inline__ DAT_RETURN +dat_strerror_ext_status ( + IN DAT_IB_STATUS value, + OUT const char **message ) +{ + switch(value) { + case 0: + *message = " "; + return DAT_SUCCESS; + case DAT_IB_OP_ERR: + *message = "DAT_IB_OP_ERR"; + return DAT_SUCCESS; + default: + *message = "unknown extension status"; + return DAT_INVALID_PARAMETER; + } +} + +/* + * Extended IB transport specific APIs + * redirection via DAT extension function + */ + +/* + * This asynchronous call is modeled after the InfiniBand atomic + * Fetch and Add operation. The add_value is added to the 64 bit + * value stored at the remote memory location specified in remote_iov + * and the result is stored in the local_iov. + */ +#define dat_ib_post_fetch_and_add(ep, add_val, lbuf, cookie, rbuf, flgs) \ + dat_extension_op( ep, \ + DAT_IB_FETCH_AND_ADD_OP, \ + (add_val), \ + (lbuf), \ + (cookie), \ + (rbuf), \ + (flgs)) + +/* + * This asynchronous call is modeled after the InfiniBand atomic + * Compare and Swap operation. The cmp_value is compared to the 64 bit + * value stored at the remote memory location specified in remote_iov. + * If the two values are equal, the 64 bit swap_value is stored in + * the remote memory location. In all cases, the original 64 bit + * value stored in the remote memory location is copied to the local_iov. + */ +#define dat_ib_post_cmp_and_swap(ep, cmp_val, swap_val, lbuf, cookie, rbuf, flgs) \ + dat_extension_op( ep, \ + DAT_IB_CMP_AND_SWAP_OP, \ + (cmp_val), \ + (swap_val), \ + (lbuf), \ + (cookie), \ + (rbuf), \ + (flgs)) + +/* + * RDMA Write with IMMEDIATE: + * + * This asynchronous call is modeled after the InfiniBand rdma write with + * immediate data operation. Event completion for the request completes as an + * DAT_EXTENSION with extension type set to DAT_DTO_EXTENSION_IMMED_DATA. + * Event completion on the remote endpoint completes as receive DTO operation + * type of DAT_EXTENSION with operation set to DAT_DTO_EXTENSION_IMMED_DATA. + * The immediate data will be provided in the extented DTO event data structure. + * + * Note to Consumers: the immediate data will consume a receive + * buffer at the Data Sink. + * + * Other extension flags: + * n/a + */ +#define dat_ib_post_rdma_write_immed(ep, size, lbuf, cookie, rbuf, idata, flgs) \ + dat_extension_op( ep, \ + DAT_IB_RDMA_WRITE_IMMED_OP, \ + (size), \ + (lbuf), \ + (cookie), \ + (rbuf), \ + (idata), \ + (flgs)) + +#endif /* _DAT_IB_EXTENSIONS_H_ */ + diff --git a/dat/include/dat/dat_platform_specific.h b/dat/include/dat/dat_platform_specific.h index e91dc08..0314035 100644 --- a/dat/include/dat/dat_platform_specific.h +++ b/dat/include/dat/dat_platform_specific.h @@ -1,7 +1,7 @@ /* - * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. + * Copyright (c) 2002-2006, Network Appliance, Inc. All rights reserved. * - * This Software is licensed under one of the following licenses: + * This Software is licensed under all of the following licenses: * * 1) under the terms of the "Common Public License 1.0" a copy of which is * in the file LICENSE.txt in the root directory. The license is also @@ -19,13 +19,22 @@ * http://www.opensource.org/licenses/gpl-license.php. * * Licensee has the right to choose one of the above licenses. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: * - * Redistributions of source code must retain the above copyright + * Redistributions of source code must retain both the above copyright * notice and one of the license notices. * * Redistributions in binary form must reproduce both the above copyright * notice, one of the license notices in the documentation * and/or other materials provided with the distribution. + * + * Neither the name of Network Appliance, Inc. nor the names of other DAT + * Collaborative contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. */ /*************************************************************** @@ -35,7 +44,7 @@ * PURPOSE: defines Platform-specific types. * * Description: Header file for "DAPL: Direct Access Programming - * Library, Version: 1.2" + * Library, Version: 2.0" * * Mapping rules: * @@ -101,8 +110,8 @@ * */ -#if defined (sun) || defined(__sun) || defined(_sun_) || defined (__solaris__) /* Solaris begins */ +#if defined (sun) || defined(__sun) || defined(_sun_) || defined (__solaris__) #include #include /* needed for UINT64_C() macro */ @@ -155,6 +164,14 @@ typedef DAT_UINT64 DAT_PADDR; #include #endif /* defined(__KERNEL__) */ +typedef struct dat_comm { + int domain; + int type; + int protocol; +} DAT_COMM; + +typedef int DAT_FD; /* DAT File Descriptor */ + typedef struct sockaddr DAT_SOCK_ADDR; /* Socket address header native to OS */ typedef struct sockaddr_in6 DAT_SOCK_ADDR6; /* Socket address header native to OS */ #define DAT_AF_INET AF_INET diff --git a/dat/include/dat/dat_redirection.h b/dat/include/dat/dat_redirection.h index 1b7f99a..e8d5af2 100644 --- a/dat/include/dat/dat_redirection.h +++ b/dat/include/dat/dat_redirection.h @@ -1,7 +1,7 @@ /* - * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. + * Copyright (c) 2002-2006, Network Appliance, Inc. All rights reserved. * - * This Software is licensed under one of the following licenses: + * This Software is licensed under all of the following licenses: * * 1) under the terms of the "Common Public License 1.0" a copy of which is * in the file LICENSE.txt in the root directory. The license is also @@ -20,12 +20,21 @@ * * Licensee has the right to choose one of the above licenses. * - * Redistributions of source code must retain the above copyright + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * Redistributions of source code must retain both the above copyright * notice and one of the license notices. * * Redistributions in binary form must reproduce both the above copyright * notice, one of the license notices in the documentation * and/or other materials provided with the distribution. + * + * Neither the name of Network Appliance, Inc. nor the names of other DAT + * Collaborative contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. */ /**************************************************************** @@ -100,9 +109,11 @@ typedef struct dat_provider DAT_PROVIDER; (size), \ (pdata)) -#define DAT_CR_REJECT(cr) \ +#define DAT_CR_REJECT(cr, size, pdata) \ (*DAT_HANDLE_TO_PROVIDER (cr)->cr_reject_func) (\ - (cr)) + (cr), \ + (size), \ + (pdata)) #define DAT_CR_HANDOFF(cr,qual) \ (*DAT_HANDLE_TO_PROVIDER(cr)->cr_handoff_func)(\ @@ -180,6 +191,14 @@ typedef struct dat_provider DAT_PROVIDER; (qos), \ (flags)) +#define DAT_EP_COMMON_CONNECT(ep, addr, timeout, psize, pdata) \ + (*DAT_HANDLE_TO_PROVIDER(ep)->ep_common_connect_func)(\ + (ep), \ + (addr), \ + (timeout), \ + (psize), \ + (pdata)) + #define DAT_EP_DUP_CONNECT(ep, dup, timeout, psize, pdata, qos) \ (*DAT_HANDLE_TO_PROVIDER (ep)->ep_dup_connect_func) (\ (ep), \ @@ -202,6 +221,18 @@ typedef struct dat_provider DAT_PROVIDER; (cookie), \ (flags)) +#define DAT_EP_POST_SEND_WITH_INVALIDATE( \ + ep,size,lbuf,cookie,flags,inv_flag,rmr_context) \ + (*DAT_HANDLE_TO_PROVIDER(ep)-> \ + ep_post_send_with_invalidate_func)(\ + (ep), \ + (size), \ + (lbuf), \ + (cookie), \ + (flags), \ + (inv_flag), \ + (rmr_context)) + #define DAT_EP_POST_RECV(ep, size, lbuf, cookie, flags) \ (*DAT_HANDLE_TO_PROVIDER (ep)->ep_post_recv_func) (\ (ep), \ @@ -219,6 +250,14 @@ typedef struct dat_provider DAT_PROVIDER; (rbuf), \ (flags)) +#define DAT_EP_POST_RDMA_READ_TO_RMR(ep, lbuf, cookie, rbuf, flags) \ + (*DAT_HANDLE_TO_PROVIDER(ep)->ep_post_rdma_read_to_rmr_func)(\ + (ep), \ + (lbuf), \ + (cookie), \ + (rbuf), \ + (flags)) + #define DAT_EP_POST_RDMA_WRITE(ep, size, lbuf, cookie, rbuf, flags) \ (*DAT_HANDLE_TO_PROVIDER (ep)->ep_post_rdma_write_func) (\ (ep), \ @@ -282,17 +321,25 @@ typedef struct dat_provider DAT_PROVIDER; (pz), \ (rmr)) +#define DAT_RMR_CREATE_FOR_EP(pz, rmr) \ + (*DAT_HANDLE_TO_PROVIDER (pz)->rmr_create_for_ep_func) (\ + (pz), \ + (rmr)) + #define DAT_RMR_QUERY(rmr, mask, param) \ (*DAT_HANDLE_TO_PROVIDER (rmr)->rmr_query_func) (\ (rmr), \ (mask), \ (param)) -#define DAT_RMR_BIND(rmr, lmr, mem_priv, ep, cookie, flags, context) \ +#define DAT_RMR_BIND(rmr, lmr, lmr_triplet, mem_priv, \ + va_type, ep, cookie, flags, context) \ (*DAT_HANDLE_TO_PROVIDER (rmr)->rmr_bind_func) (\ (rmr), \ (lmr), \ + (lmr_triplet), \ (mem_priv), \ + (va_type), \ (ep), \ (cookie), \ (flags), \ @@ -346,6 +393,24 @@ typedef struct dat_provider DAT_PROVIDER; (*DAT_HANDLE_TO_PROVIDER (rsp)->rsp_free_func) (\ (rsp)) +#define DAT_CSP_CREATE(ia, comm, addr, evd, handle) \ + (*DAT_HANDLE_TO_PROVIDER(ia)->csp_create_func)(\ + (ia),\ + (comm),\ + (addr),\ + (evd),\ + (handle)) + +#define DAT_CSP_QUERY(csp, mask, param) \ + (*DAT_HANDLE_TO_PROVIDER(csp)->csp_query_func)(\ + (csp),\ + (mask),\ + (param)) + +#define DAT_CSP_FREE(csp)\ + (*DAT_HANDLE_TO_PROVIDER(csp)->csp_free_func)(\ + (csp)) + #define DAT_PZ_CREATE(ia, pz) \ (*DAT_HANDLE_TO_PROVIDER (ia)->pz_create_func) (\ (ia), \ @@ -362,7 +427,7 @@ typedef struct dat_provider DAT_PROVIDER; (pz)) #define DAT_SRQ_CREATE(ia, pz, attr, srq) \ - (*DAT_HANDLE_TO_PROVIDER (srq)->srq_create_func) (\ + (*DAT_HANDLE_TO_PROVIDER (ia)->srq_create_func) (\ (ia), \ (pz), \ (attr), \ @@ -395,6 +460,21 @@ typedef struct dat_provider DAT_PROVIDER; (lbuf), \ (cookie)) +#define DAT_IA_HA_RELATED (ia, name, answer) \ + (*DAT_HANDLE_TO_PROVIDER(ia)->ia_ha_related) (\ + (ia), \ + (name), \ + (answer)) + +#ifdef DAT_EXTENSIONS + /* generic extended op */ +#define DAT_HANDLE_EXTENDEDOP (handle,op,args) \ + (*DAT_HANDLE_TO_PROVIDER(handle)->extendedop_func) (\ + (handle), \ + (op), \ + (args)) +#endif + /*************************************************************** * * FUNCTION PROTOTYPES @@ -434,7 +514,7 @@ typedef DAT_RETURN (*DAT_SET_CONSUMER_CONTEXT_FUNC) ( IN DAT_CONTEXT); /* context */ typedef DAT_RETURN (*DAT_GET_CONSUMER_CONTEXT_FUNC) ( - IN DAT_HANDLE /* dat_handle */, + IN DAT_HANDLE, /* dat_handle */ OUT DAT_CONTEXT * ); /* context */ typedef DAT_RETURN (*DAT_GET_HANDLE_TYPE_FUNC) ( @@ -449,13 +529,15 @@ typedef DAT_RETURN (*DAT_CR_QUERY_FUNC) ( OUT DAT_CR_PARAM * ); /* cr_param */ typedef DAT_RETURN (*DAT_CR_ACCEPT_FUNC) ( - IN DAT_CR_HANDLE /* cr_handle */, + IN DAT_CR_HANDLE, /* cr_handle */ IN DAT_EP_HANDLE, /* ep_handle */ IN DAT_COUNT, /* private_data_size */ IN const DAT_PVOID ); /* private_data */ typedef DAT_RETURN (*DAT_CR_REJECT_FUNC) ( - IN DAT_CR_HANDLE ) /* cr_handle */; + IN DAT_CR_HANDLE, /* cr_handle */ + IN DAT_COUNT, /* private_data_size */ + IN const DAT_PVOID ); /* private_data */ /* For DAT-1.1 this function is defined for both uDAPL and kDAPL. * For DAT-1.0 it was only defined for uDAPL. @@ -528,6 +610,13 @@ typedef DAT_RETURN (*DAT_EP_CONNECT_FUNC) ( IN DAT_QOS, /* quality_of_service */ IN DAT_CONNECT_FLAGS ); /* connect_flags */ +typedef DAT_RETURN (*DAT_EP_COMMON_CONNECT_FUNC) ( + IN DAT_EP_HANDLE, /* ep_handle */ + IN DAT_IA_ADDRESS_PTR, /* remote_ia_address */ + IN DAT_TIMEOUT, /* timeout */ + IN DAT_COUNT, /* private_data_size */ + IN const DAT_PVOID ); /* private_data */ + typedef DAT_RETURN (*DAT_EP_DUP_CONNECT_FUNC) ( IN DAT_EP_HANDLE, /* ep_handle */ IN DAT_EP_HANDLE, /* ep_dup_handle */ @@ -547,6 +636,15 @@ typedef DAT_RETURN (*DAT_EP_POST_SEND_FUNC) ( IN DAT_DTO_COOKIE, /* user_cookie */ IN DAT_COMPLETION_FLAGS ); /* completion_flags */ +typedef DAT_RETURN (*DAT_EP_POST_SEND_WITH_INVALIDATE_FUNC) ( + IN DAT_EP_HANDLE, /* ep_handle */ + IN DAT_COUNT, /* num_segments */ + IN DAT_LMR_TRIPLET *, /* local_iov */ + IN DAT_DTO_COOKIE, /* user_cookie */ + IN DAT_COMPLETION_FLAGS, /* completion_flags */ + IN DAT_BOOLEAN, /* invalidate_flag */ + IN DAT_RMR_CONTEXT ); /* RMR context */ + typedef DAT_RETURN (*DAT_EP_POST_RECV_FUNC) ( IN DAT_EP_HANDLE, /* ep_handle */ IN DAT_COUNT, /* num_segments */ @@ -562,6 +660,13 @@ typedef DAT_RETURN (*DAT_EP_POST_RDMA_READ_FUNC) ( IN const DAT_RMR_TRIPLET *,/* remote_iov */ IN DAT_COMPLETION_FLAGS ); /* completion_flags */ +typedef DAT_RETURN (*DAT_EP_POST_RDMA_READ_TO_RMR_FUNC) ( + IN DAT_EP_HANDLE, /* ep_handle */ + IN const DAT_RMR_TRIPLET *, /* local_iov */ + IN DAT_DTO_COOKIE, /* user_cookie */ + IN const DAT_RMR_TRIPLET *,/* remote_iov */ + IN DAT_COMPLETION_FLAGS ); /* completion_flags */ + typedef DAT_RETURN (*DAT_EP_POST_RDMA_WRITE_FUNC) ( IN DAT_EP_HANDLE, /* ep_handle */ IN DAT_COUNT, /* num_segments */ @@ -595,12 +700,7 @@ typedef DAT_RETURN (*DAT_EP_SET_WATERMARK_FUNC) ( /* LMR functions */ typedef DAT_RETURN (*DAT_LMR_FREE_FUNC) ( - IN DAT_LMR_HANDLE) /* lmr_handle */; - -typedef DAT_RETURN (*DAT_LMR_QUERY_FUNC) ( - IN DAT_LMR_HANDLE /* lmr_handle */, - IN DAT_LMR_PARAM_MASK, /* lmr_param_mask */ - OUT DAT_LMR_PARAM *); /* lmr_param */ + IN DAT_LMR_HANDLE ); /* lmr_handle */ typedef DAT_RETURN (*DAT_LMR_SYNC_RDMA_READ_FUNC) ( IN DAT_IA_HANDLE, /* ia_handle */ @@ -618,22 +718,28 @@ typedef DAT_RETURN (*DAT_RMR_CREATE_FUNC) ( IN DAT_PZ_HANDLE, /* pz_handle */ OUT DAT_RMR_HANDLE *); /* rmr_handle */ +typedef DAT_RETURN (*DAT_RMR_CREATE_FOR_EP_FUNC) ( + IN DAT_PZ_HANDLE, /* pz_handle */ + OUT DAT_RMR_HANDLE *); /* rmr_handle */ + typedef DAT_RETURN (*DAT_RMR_QUERY_FUNC) ( IN DAT_RMR_HANDLE, /* rmr_handle */ IN DAT_RMR_PARAM_MASK, /* rmr_param_mask */ OUT DAT_RMR_PARAM *); /* rmr_param */ typedef DAT_RETURN (*DAT_RMR_BIND_FUNC) ( - IN DAT_RMR_HANDLE /* rmr_handle */, + IN DAT_RMR_HANDLE, /* rmr_handle */ + IN DAT_LMR_HANDLE, /* lmr_handle */ IN const DAT_LMR_TRIPLET *,/* lmr_triplet */ IN DAT_MEM_PRIV_FLAGS, /* mem_priv */ + IN DAT_VA_TYPE, /* va_type */ IN DAT_EP_HANDLE, /* ep_handle */ IN DAT_RMR_COOKIE, /* user_cookie */ IN DAT_COMPLETION_FLAGS, /* completion_flags */ OUT DAT_RMR_CONTEXT * ); /* context */ typedef DAT_RETURN (*DAT_RMR_FREE_FUNC) ( - IN DAT_RMR_HANDLE) /* rmr_handle */; + IN DAT_RMR_HANDLE); /* rmr_handle */ /* PSP functions */ @@ -671,11 +777,28 @@ typedef DAT_RETURN (*DAT_RSP_CREATE_FUNC) ( typedef DAT_RETURN (*DAT_RSP_QUERY_FUNC) ( IN DAT_RSP_HANDLE, /* rsp_handle */ IN DAT_RSP_PARAM_MASK, /* rsp_param_mask */ - OUT DAT_RSP_PARAM * ); /* *rsp_param */ + OUT DAT_RSP_PARAM * ); /* rsp_param */ typedef DAT_RETURN (*DAT_RSP_FREE_FUNC) ( IN DAT_RSP_HANDLE ); /* rsp_handle */ + /* CSP functions functions - DAT 2.0 */ + +typedef DAT_RETURN (*DAT_CSP_CREATE_FUNC) ( + IN DAT_IA_HANDLE, /* ia_handle */ + IN DAT_COMM *, /* communicator */ + IN DAT_IA_ADDRESS_PTR, /* address */ + IN DAT_EVD_HANDLE, /* evd_handle */ + OUT DAT_CSP_HANDLE * ); /* csp_handle */ + +typedef DAT_RETURN (*DAT_CSP_QUERY_FUNC) ( + IN DAT_CSP_HANDLE, /* csp_handle */ + IN DAT_CSP_PARAM_MASK, /* csp_param_mask */ + OUT DAT_CSP_PARAM * ); /* csp_param */ + +typedef DAT_RETURN (*DAT_CSP_FREE_FUNC) ( + IN DAT_CSP_HANDLE ); /* csp_handle */ + /* PZ functions */ typedef DAT_RETURN (*DAT_PZ_CREATE_FUNC) ( @@ -720,4 +843,17 @@ typedef DAT_RETURN (*DAT_SRQ_POST_RECV_FUNC) ( IN DAT_LMR_TRIPLET *, /* local_iov */ IN DAT_DTO_COOKIE ); /* user_cookie */ +typedef DAT_RETURN (*DAT_IA_HA_RELATED_FUNC) ( + IN DAT_IA_HANDLE, /* ia_handle */ + IN const DAT_NAME_PTR, /* provider */ + OUT DAT_BOOLEAN *); /* answer */ + +#ifdef DAT_EXTENSIONS +#include +typedef DAT_RETURN (*DAT_HANDLE_EXTENDEDOP_FUNC) ( + IN DAT_HANDLE, /* handle */ + IN DAT_EXTENDED_OP, /* extended op */ + IN va_list ); /* arguments list */ +#endif /* DAT_EXTENSIONS */ + #endif /* _DAT_REDIRECTION_H_ */ diff --git a/dat/include/dat/dat_registry.h b/dat/include/dat/dat_registry.h index a056406..fe9db4b 100644 --- a/dat/include/dat/dat_registry.h +++ b/dat/include/dat/dat_registry.h @@ -1,7 +1,7 @@ /* - * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. + * Copyright (c) 2002-2006, Network Appliance, Inc. All rights reserved. * - * This Software is licensed under one of the following licenses: + * This Software is licensed under all of the following licenses: * * 1) under the terms of the "Common Public License 1.0" a copy of which is * in the file LICENSE.txt in the root directory. The license is also @@ -20,12 +20,21 @@ * * Licensee has the right to choose one of the above licenses. * - * Redistributions of source code must retain the above copyright + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * Redistributions of source code must retain both the above copyright * notice and one of the license notices. * * Redistributions in binary form must reproduce both the above copyright * notice, one of the license notices in the documentation * and/or other materials provided with the distribution. + * + * Neither the name of Network Appliance, Inc. nor the names of other DAT + * Collaborative contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. */ /**************************************************************** @@ -35,7 +44,7 @@ * PURPOSE: DAT registration API signatures * * Description: Header file for "DAPL: Direct Access Programming - * Library, Version: 1.2" + * Library, Version: 2.0" * * Contains registration external reference signatures * for dat registry functions. This file is *only* @@ -97,4 +106,18 @@ typedef void ( *DAT_PROVIDER_INIT_FUNC) ( typedef void ( *DAT_PROVIDER_FINI_FUNC) ( IN const DAT_PROVIDER_INFO *); /* provider info */ +typedef enum dat_ha_relationship +{ + DAT_HA_FALSE, /* two IAs are not related */ + DAT_HA_TRUE, /* two IAs are related */ + DAT_HA_UNKNOWN, /* relationship is not known */ + DAT_HA_CONFLICTING, /* 2 IAs do not agree on the relationship */ + DAT_HA_EXTENSION_BASE +} DAT_HA_RELATIONSHIP; + +extern DAT_RETURN dat_registry_providers_related ( + IN const DAT_NAME_PTR, + IN const DAT_NAME_PTR, + OUT DAT_HA_RELATIONSHIP * ); + #endif /* _DAT_REGISTRY_H_ */ diff --git a/dat/include/dat/dat_vendor_specific.h b/dat/include/dat/dat_vendor_specific.h index 4957de3..844fc7e 100644 --- a/dat/include/dat/dat_vendor_specific.h +++ b/dat/include/dat/dat_vendor_specific.h @@ -1,7 +1,7 @@ /* - * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. + * Copyright (c) 2002-2006, Network Appliance, Inc. All rights reserved. * - * This Software is licensed under one of the following licenses: + * This Software is licensed under all of the following licenses: * * 1) under the terms of the "Common Public License 1.0" a copy of which is * in the file LICENSE.txt in the root directory. The license is also @@ -20,7 +20,11 @@ * * Licensee has the right to choose one of the above licenses. * - * Redistributions of source code must retain the above copyright + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * Redistributions of source code must retain both the above copyright * notice and one of the license notices. * * Redistributions in binary form must reproduce both the above copyright @@ -35,7 +39,7 @@ * PURPOSE: * * Description: Header file for "DAPL: Direct Access Programming - * Library, Version: 1.2" + * Library, Version: 2.0" * * Mapping rules: * @@ -50,9 +54,11 @@ #if defined(_AMMASSO) -#elif defined(_IBM) +#elif defined(_BROADCOM) -#elif defined(_INFINICON) +#elif defined(_CISCO) + +#elif defined(_IBM) #elif defined(_INTEL) @@ -62,9 +68,11 @@ #elif defined(_MYRINET) -#elif defined(_SILIQUENT) +#elif defined(_NETEFFECT) + +#elif defined(_QLOGIC) -#elif defined(_TOPSPIN) +#elif defined(_SILVERSTORM) #elif defined(_VOLTAIRE) diff --git a/dat/include/dat/kdat.h b/dat/include/dat/kdat.h index 222fafa..848a22e 100644 --- a/dat/include/dat/kdat.h +++ b/dat/include/dat/kdat.h @@ -1,7 +1,7 @@ /* - * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. + * Copyright (c) 2002-2006, Network Appliance, Inc. All rights reserved. * - * This Software is licensed under one of the following licenses: + * This Software is licensed under all of the following licenses: * * 1) under the terms of the "Common Public License 1.0" a copy of which is * in the file LICENSE.txt in the root directory. The license is also @@ -20,12 +20,21 @@ * * Licensee has the right to choose one of the above licenses. * - * Redistributions of source code must retain the above copyright + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * Redistributions of source code must retain both the above copyright * notice and one of the license notices. * * Redistributions in binary form must reproduce both the above copyright * notice, one of the license notices in the documentation * and/or other materials provided with the distribution. + * + * Neither the name of Network Appliance, Inc. nor the names of other DAT + * Collaborative contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. */ /**************************************************************** @@ -35,7 +44,7 @@ * PURPOSE: defines the kernel DAT API * * Description: Header file for "kDAPL: Kernel Direct Access Programming - * Library, Version: 1.2" + * Library, Version: 2.0" * Mapping rules: * All global symbols are prepended with DAT_ or dat_ * All DAT objects have an 'api' tag which, such as 'ep' or 'lmr' @@ -52,6 +61,10 @@ #include +#if 1 +#define EXPORT_SYMBOL_NOVERS(sym) EXPORT_SYMBOL(sym) +#endif + typedef enum dat_mem_type { /* Shared between udat and kdat */ @@ -61,7 +74,8 @@ typedef enum dat_mem_type DAT_MEM_TYPE_PHYSICAL = 0x10, DAT_MEM_TYPE_PLATFORM = 0x20, DAT_MEM_TYPE_IA = 0x40, - DAT_MEM_TYPE_BYPASS = 0x80 + DAT_MEM_TYPE_BYPASS = 0x80, + DAT_MEM_TYPE_PHYSICAL_VAR_PAGES = 0x100 } DAT_MEM_TYPE; /* dat handle types */ @@ -76,7 +90,11 @@ typedef enum dat_handle_type DAT_HANDLE_TYPE_PZ, DAT_HANDLE_TYPE_RMR, DAT_HANDLE_TYPE_RSP, - DAT_HANDLE_TYPE_SRQ + DAT_HANDLE_TYPE_SRQ, + DAT_HANDLE_TYPE_CSP +#ifdef DAT_EXTENSIONS + ,DAT_HANDLE_TYPE_EXTENSION_BASE +#endif } DAT_HANDLE_TYPE; typedef enum dat_evd_param_mask @@ -93,6 +111,8 @@ typedef DAT_UINT64 DAT_PROVIDER_ATTR_MASK; #include +typedef DAT_CONTEXT DAT_LMR_COOKIE; + /* Upcall support */ typedef enum dat_upcall_policy @@ -103,6 +123,8 @@ typedef enum dat_upcall_policy DAT_UPCALL_TEARDOWN = -1 /* support no upcalls & return * * after all in progress * * UpCalls return */ + ,DAT_UPCALL_NORIFY = 2 /* support single upcall with * + * notification only */ } DAT_UPCALL_POLICY; typedef void (*DAT_UPCALL_FUNC)( @@ -124,6 +146,13 @@ typedef struct dat_upcall_object #define DAT_UPCALL_SAME ((DAT_UPCALL_OBJECT *) NULL) + /* kDAT Upcall Invocation Policy */ +typedef enum dat_upcall_flag +{ + DAT_UPCALL_INVOC_NEW = 0, /* invoke on a new event arrival */ + DAT_UPCALL_INVOC_ANY = 1 /* invoke on any event on EVD */ +} DAT_UPCALL_FLAG; + struct dat_evd_param { DAT_IA_HANDLE ia_handle; @@ -153,17 +182,31 @@ typedef enum dat_mem_optimize_flags DAT_MEM_OPTIMIZE_EXACT_EXPOSURE = 0x04 } DAT_MEM_OPTIMIZE_FLAGS; +typedef struct dat_physical_var_pages +{ + DAT_VLEN page_size; + void* pages; +} DAT_PHYSICAL_VAR_PAGES; typedef union dat_region_description { DAT_PVOID for_va; DAT_LMR_HANDLE for_lmr_handle; - void * for_pointer; /* For kdapl only */ - void * for_array; /* For kdapl only */ - DAT_PADDR for_pa; /* For kdapl only */ + void * for_platform; /* For kdapl only + for platform and bypass */ + DAT_PHYSICAL_VAR_PAGES for_array; /* for kdapl only */ + DAT_PADDR *for_physical; /* for kdapl only */ + /* array of physical pages of the same size */ + DAT_PADDR for_ia; /* for kdapl only */ } DAT_REGION_DESCRIPTION; /* LMR Arguments */ +typedef struct dat_lmr_state +{ + DAT_BOOLEAN fmr_support; + DAT_BOOLEAN bound; +} DAT_LMR_STATE; + struct dat_lmr_param { DAT_IA_HANDLE ia_handle; @@ -172,15 +215,106 @@ struct dat_lmr_param DAT_VLEN length; DAT_PZ_HANDLE pz_handle; DAT_MEM_PRIV_FLAGS mem_priv; + DAT_VA_TYPE va_type; DAT_LMR_CONTEXT lmr_context; DAT_RMR_CONTEXT rmr_context; DAT_VLEN registered_size; DAT_VADDR registered_address; + DAT_LMR_STATE lmr_state; /* kDAPL only */ }; -#include +/* LMR Arguments Mask */ + +enum dat_lmr_param_mask +{ + DAT_LMR_FIELD_IA_HANDLE = 0x001, + DAT_LMR_FIELD_MEM_TYPE = 0x002, + DAT_LMR_FIELD_REGION_DESC = 0x004, + DAT_LMR_FIELD_LENGTH = 0x008, + DAT_LMR_FIELD_PZ_HANDLE = 0x010, + DAT_LMR_FIELD_MEM_PRIV = 0x020, + DAT_LMR_FIELD_VA_TYPE = 0x040, + DAT_LMR_FIELD_LMR_CONTEXT = 0x080, + DAT_LMR_FIELD_RMR_CONTEXT = 0x100, + DAT_LMR_FIELD_REGISTERED_SIZE = 0x200, + DAT_LMR_FIELD_REGISTERED_ADDRESS = 0x400, + DAT_LMR_FIELD_LMR_STATE = 0x800, + + DAT_LMR_FIELD_ALL = 0xFFF +}; + + /* kDAPL 1.3 addition */ + /* Defines LMR protection scope */ +typedef enum dat_lmr_scope +{ + DAT_LMR_SCOPE_EP, /* bound to at most one EP at a time. */ + DAT_LMR_SCOPE_PZ, /* bound to a Protection Zone */ + DAT_LMR_SCOPE_ANY /* Supports all types */ +} DAT_LMR_SCOPE; + +struct dat_ia_attr +{ + char adapter_name[DAT_NAME_MAX_LENGTH]; + char vendor_name[DAT_NAME_MAX_LENGTH]; + DAT_UINT32 hardware_version_major; + DAT_UINT32 hardware_version_minor; + DAT_UINT32 firmware_version_major; + DAT_UINT32 firmware_version_minor; + DAT_IA_ADDRESS_PTR ia_address_ptr; + DAT_COUNT max_eps; + DAT_COUNT max_dto_per_ep; + DAT_COUNT max_rdma_read_per_ep_in; + DAT_COUNT max_rdma_read_per_ep_out; + DAT_COUNT max_evds; + DAT_COUNT max_evd_qlen; + DAT_COUNT max_iov_segments_per_dto; + DAT_COUNT max_lmrs; + DAT_SEG_LENGTH max_lmr_block_size; + DAT_VADDR max_lmr_virtual_address; + DAT_COUNT max_pzs; + DAT_SEG_LENGTH max_message_size; + DAT_SEG_LENGTH max_rdma_size; + DAT_COUNT max_rmrs; + DAT_VADDR max_rmr_target_address; + DAT_COUNT max_srqs; + DAT_COUNT max_ep_per_srq; + DAT_COUNT max_recv_per_srq; + DAT_COUNT max_iov_segments_per_rdma_read; + DAT_COUNT max_iov_segments_per_rdma_write; + DAT_COUNT max_rdma_read_in; + DAT_COUNT max_rdma_read_out; + DAT_BOOLEAN max_rdma_read_per_ep_in_guaranteed; + DAT_BOOLEAN max_rdma_read_per_ep_out_guaranteed; + DAT_BOOLEAN zb_supported; + DAT_BOOLEAN reserved_lmr_supported; +#ifdef DAT_EXTENSIONS + DAT_EXTENSION extension_supported; + DAT_COUNT extension_version; +#endif /* DAT_EXTENSIONS */ + DAT_COUNT num_transport_attr; + DAT_NAMED_ATTR *transport_attr; + DAT_COUNT num_vendor_attr; + DAT_NAMED_ATTR *vendor_attr; +}; + +#define DAT_IA_FIELD_IA_RESERVED_LMR_SUPPORTED UINT64_C(0x100000000) +#ifdef DAT_EXTENSIONS +#define DAT_IA_FIELD_IA_EXTENSION UINT64_C(0x200000000) +#define DAT_IA_FIELD_IA_EXTENSION_VERSION UINT64_C(0x400000000) +#endif /* DAT_EXTENSIONS */ + +#define DAT_IA_FIELD_IA_NUM_TRANSPORT_ATTR UINT64_C(0x800000000) +#define DAT_IA_FIELD_IA_TRANSPORT_ATTR UINT64_C(0x1000000000) +#define DAT_IA_FIELD_IA_NUM_VENDOR_ATTR UINT64_C(0x2000000000) +#define DAT_IA_FIELD_IA_VENDOR_ATTR UINT64_C(0x4000000000) +#define DAT_IA_FIELD_ALL UINT64_C(0x7FFFFFFFFF) + +#define DAT_EVENT_NULL ((DAT_EVENT) NULL) /* General Provider attributes. kdat specific. */ + +#include + /* Provider should support merging of all event stream types. Provider * attribute specify support for merging different event stream types. * It is a 2D binary matrix where each row and column represents an event @@ -221,42 +355,58 @@ struct dat_provider_attr DAT_BOOLEAN lmr_sync_req; DAT_BOOLEAN dto_async_return_guaranteed; DAT_BOOLEAN rdma_write_for_rdma_read_req; + DAT_BOOLEAN rdma_read_lmr_rmr_context_exposure; + DAT_RMR_SCOPE rmr_scope_supported; + DAT_BOOLEAN is_interrupt_safe; + DAT_BOOLEAN fmr_supported; + DAT_LMR_SCOPE lmr_for_fmr_scope_supported; + DAT_BOOLEAN ha_supported; + DAT_HA_LB ha_loadbalancing; + DAT_COUNT num_provider_specific_attr; DAT_NAMED_ATTR * provider_specific_attr; }; -#define DAT_PROVIDER_FIELD_PROVIDER_NAME UINT64_C(0x0000001) -#define DAT_PROVIDER_FIELD_PROVIDER_VERSION_MAJOR UINT64_C(0x0000002) -#define DAT_PROVIDER_FIELD_PROVIDER_VERSION_MINOR UINT64_C(0x0000004) -#define DAT_PROVIDER_FIELD_DAPL_VERSION_MAJOR UINT64_C(0x0000008) -#define DAT_PROVIDER_FIELD_DAPL_VERSION_MINOR UINT64_C(0x0000010) -#define DAT_PROVIDER_FIELD_LMR_MEM_TYPE_SUPPORTED UINT64_C(0x0000020) -#define DAT_PROVIDER_FIELD_IOV_OWNERSHIP UINT64_C(0x0000040) -#define DAT_PROVIDER_FIELD_DAT_QOS_SUPPORTED UINT64_C(0x0000080) -#define DAT_PROVIDER_FIELD_COMPLETION_FLAGS_SUPPORTED UINT64_C(0x000100) -#define DAT_PROVIDER_FIELD_IS_THREAD_SAFE UINT64_C(0x0000200) -#define DAT_PROVIDER_FIELD_MAX_PRIVATE_DATA_SIZE UINT64_C(0x0000400) -#define DAT_PROVIDER_FIELD_SUPPORTS_MULTIPATH UINT64_C(0x0000800) -#define DAT_PROVIDER_FIELD_EP_CREATOR UINT64_C(0x0001000) -#define DAT_PROVIDER_FIELD_UPCALL_POLICY UINT64_C(0x0002000) -#define DAT_PROVIDER_FIELD_OPTIMAL_BUFFER_ALIGNMENT UINT64_C(0x0004000) -#define DAT_PROVIDER_FIELD_EVD_STREAM_MERGING_SUPPORTED UINT64_C(0x0008000) -#define DAT_PROVIDER_FIELD_SRQ_SUPPORTED UINT64_C(0x0010000) -#define DAT_PROVIDER_FIELD_SRQ_WATERMARKS_SUPPORTED UINT64_C(0x0020000) -#define DAT_PROVIDER_FIELD_SRQ_EP_PZ_DIFFERENCE_SUPPORTED UINT64_C(0x0040000) -#define DAT_PROVIDER_FIELD_SRQ_INFO_SUPPORTED UINT64_C(0x0080000) -#define DAT_PROVIDER_FIELD_EP_RECV_INFO_SUPPORTED UINT64_C(0x0100000) -#define DAT_PROVIDER_FIELD_LMR_SYNC_REQ UINT64_C(0x0200000) -#define DAT_PROVIDER_FIELD_DTO_ASYNC_RETURN_GUARANTEED UINT64_C(0x0400000) -#define DAT_PROVIDER_FIELD_RDMA_WRITE_FOR_RDMA_READ_REQ UINT64_C(0x0800000) -#define DAT_PROVIDER_FIELD_NUM_PROVIDER_SPECIFIC_ATTR UINT64_C(0x1000000) -#define DAT_PROVIDER_FIELD_PROVIDER_SPECIFIC_ATTR UINT64_C(0x2000000) - -#define DAT_PROVIDER_FIELD_ALL UINT64_C(0x3FFFFFF) +#define DAT_PROVIDER_FIELD_PROVIDER_NAME UINT64_C(0x000000001) +#define DAT_PROVIDER_FIELD_PROVIDER_VERSION_MAJOR UINT64_C(0x000000002) +#define DAT_PROVIDER_FIELD_PROVIDER_VERSION_MINOR UINT64_C(0x000000004) +#define DAT_PROVIDER_FIELD_DAPL_VERSION_MAJOR UINT64_C(0x000000008) +#define DAT_PROVIDER_FIELD_DAPL_VERSION_MINOR UINT64_C(0x000000010) +#define DAT_PROVIDER_FIELD_LMR_MEM_TYPE_SUPPORTED UINT64_C(0x000000020) +#define DAT_PROVIDER_FIELD_IOV_OWNERSHIP UINT64_C(0x000000040) +#define DAT_PROVIDER_FIELD_DAT_QOS_SUPPORTED UINT64_C(0x000000080) +#define DAT_PROVIDER_FIELD_COMPLETION_FLAGS_SUPPORTED UINT64_C(0x000000100) +#define DAT_PROVIDER_FIELD_IS_THREAD_SAFE UINT64_C(0x000000200) +#define DAT_PROVIDER_FIELD_MAX_PRIVATE_DATA_SIZE UINT64_C(0x000000400) +#define DAT_PROVIDER_FIELD_SUPPORTS_MULTIPATH UINT64_C(0x000000800) +#define DAT_PROVIDER_FIELD_EP_CREATOR UINT64_C(0x000001000) +#define DAT_PROVIDER_FIELD_UPCALL_POLICY UINT64_C(0x000002000) +#define DAT_PROVIDER_FIELD_OPTIMAL_BUFFER_ALIGNMENT UINT64_C(0x000004000) +#define DAT_PROVIDER_FIELD_EVD_STREAM_MERGING_SUPPORTED UINT64_C(0x000008000) +#define DAT_PROVIDER_FIELD_SRQ_SUPPORTED UINT64_C(0x000010000) +#define DAT_PROVIDER_FIELD_SRQ_WATERMARKS_SUPPORTED UINT64_C(0x000020000) +#define DAT_PROVIDER_FIELD_SRQ_EP_PZ_DIFFERENCE_SUPPORTED UINT64_C(0x000040000) +#define DAT_PROVIDER_FIELD_SRQ_INFO_SUPPORTED UINT64_C(0x000080000) +#define DAT_PROVIDER_FIELD_EP_RECV_INFO_SUPPORTED UINT64_C(0x000100000) +#define DAT_PROVIDER_FIELD_LMR_SYNC_REQ UINT64_C(0x000200000) +#define DAT_PROVIDER_FIELD_DTO_ASYNC_RETURN_GUARANTEED UINT64_C(0x000400000) +#define DAT_PROVIDER_FIELD_RDMA_WRITE_FOR_RDMA_READ_REQ UINT64_C(0x000800000) +#define DAT_PROVIDER_FIELD_RDMA_READ_LMR_RMR_CONTEXT_EXPOSURE UINT64_C(0x001000000) +#define DAT_PROVIDER_FIELD_RMR_SCOPE_SUPPORTED UINT64_C(0x002000000) +#define DAT_PROVIDER_FIELD_IS_INTERRUPT_SAFE UINT64_C(0x004000000) +#define DAT_PROVIDER_FIELD_FMR_SUPPORTED UINT64_C(0x008000000) +#define DAT_PROVIDER_FIELD_LMR_FOR_FMR_SCOPE UINT64_C(0x010000000) +#define DAT_PROVIDER_FIELD_HA_SUPPORTED UINT64_C(0x020000000) +#define DAT_PROVIDER_FIELD_HA_LB UINT64_C(0x040000000) +#define DAT_PROVIDER_FIELD_NUM_PROVIDER_SPECIFIC_ATTR UINT64_C(0x080000000) +#define DAT_PROVIDER_FIELD_PROVIDER_SPECIFIC_ATTR UINT64_C(0x100000000) + +#define DAT_PROVIDER_FIELD_ALL UINT64_C(0x1FFFFFFFF) #define DAT_PROVIDER_FIELD_NONE UINT64_C(0x0) -/**************************************************************/ +/**********************************************************************/ + /* * Kernel DAT function call definitions, */ @@ -268,6 +418,7 @@ extern DAT_RETURN dat_lmr_kcreate ( IN DAT_VLEN, /* length */ IN DAT_PZ_HANDLE, /* pz_handle */ IN DAT_MEM_PRIV_FLAGS, /* privileges */ + IN DAT_VA_TYPE, /* va_type */ IN DAT_MEM_OPTIMIZE_FLAGS, /* mem_optimization */ OUT DAT_LMR_HANDLE *, /* lmr_handle */ OUT DAT_LMR_CONTEXT *, /* lmr_context */ @@ -283,6 +434,42 @@ extern DAT_RETURN dat_ia_memtype_hint ( OUT DAT_VLEN *, /* preferred_length */ OUT DAT_VADDR * ); /* preferred_alignment */ +extern DAT_RETURN dat_lmr_query ( + IN DAT_LMR_HANDLE, /* lmr_handle */ + IN DAT_LMR_PARAM_MASK, /* lmr_param_mask */ + OUT DAT_LMR_PARAM *); /* lmr_param */ + +extern DAT_RETURN dat_lmr_allocate ( + IN DAT_IA_HANDLE, /* ia_handle */ + IN DAT_PZ_HANDLE, /* pz_handle */ + IN DAT_COUNT, /* max # of physical pages */ + IN DAT_LMR_SCOPE, /* scope of lmr */ + OUT DAT_LMR_HANDLE * ); /*lmr handle */ + +extern DAT_RETURN dat_lmr_fmr ( + IN DAT_LMR_HANDLE, /* lmr_handle */ + IN DAT_MEM_TYPE, /* mem_type */ + IN DAT_REGION_DESCRIPTION, /* region_description */ + IN DAT_VLEN, /* number of pages */ + IN DAT_MEM_PRIV_FLAGS, /* mem_privileges */ + IN DAT_VA_TYPE, /* va_type */ + IN DAT_EP_HANDLE, /* ep_handle */ + IN DAT_LMR_COOKIE, /* user_cookie */ + IN DAT_COMPLETION_FLAGS, /* completion_flags */ + OUT DAT_LMR_CONTEXT, /* lmr_context */ + OUT DAT_RMR_CONTEXT ); /* rmr_context */ + +extern DAT_RETURN dat_lmr_invalidate ( + IN DAT_LMR_HANDLE, /* lmr_handle */ + IN DAT_EP_HANDLE, /* ep_handle */ + IN DAT_LMR_COOKIE, /* user_cookie */ + IN DAT_COMPLETION_FLAGS ); /* completion_flags */ + +extern DAT_RETURN dat_ia_reserved_lmr ( + IN DAT_IA_HANDLE, /* ia_handle */ + OUT DAT_LMR_HANDLE *, /* reserved_lmr_handle */ + OUT DAT_LMR_CONTEXT * ); /* reserved_lmr_context */ + extern DAT_RETURN dat_evd_kcreate ( IN DAT_IA_HANDLE, /* ia_handle */ IN DAT_COUNT, /* evd_min_qlen */ @@ -294,6 +481,7 @@ extern DAT_RETURN dat_evd_kcreate ( extern DAT_RETURN dat_evd_modify_upcall ( IN DAT_EVD_HANDLE, /* evd_handle */ IN DAT_UPCALL_POLICY, /* upcall_policy */ - IN const DAT_UPCALL_OBJECT * ); /* upcall */ + IN const DAT_UPCALL_OBJECT* , /* upcall */ + IN DAT_UPCALL_FLAG ); /* upcall invocation policy */ #endif /* _KDAT_H_ */ diff --git a/dat/include/dat/kdat_config.h b/dat/include/dat/kdat_config.h index 505bddd..855a629 100644 --- a/dat/include/dat/kdat_config.h +++ b/dat/include/dat/kdat_config.h @@ -1,7 +1,7 @@ /* - * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. + * Copyright (c) 2002-2006, Network Appliance, Inc. All rights reserved. * - * This Software is licensed under one of the following licenses: + * This Software is licensed under all of the following licenses: * * 1) under the terms of the "Common Public License 1.0" a copy of which is * in the file LICENSE.txt in the root directory. The license is also @@ -20,13 +20,23 @@ * * Licensee has the right to choose one of the above licenses. * - * Redistributions of source code must retain the above copyright + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * Redistributions of source code must retain both the above copyright * notice and one of the license notices. * * Redistributions in binary form must reproduce both the above copyright * notice, one of the license notices in the documentation * and/or other materials provided with the distribution. + * + * Neither the name of Network Appliance, Inc. nor the names of other DAT + * Collaborative contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. */ + /*************************************************************** * * HEADER: kdat_config.h @@ -34,7 +44,7 @@ * PURPOSE: provides kDAPL configuration information. * * Description: Header file for "kDAPL: Kernel Direct Access Programming - * Library, Version: 1.2" + * Library, Version: 2.0" * ***************************************************************/ #ifndef _KDAT_CONFIG_H_ diff --git a/dat/include/dat/kdat_redirection.h b/dat/include/dat/kdat_redirection.h index 08e6a16..038acb3 100644 --- a/dat/include/dat/kdat_redirection.h +++ b/dat/include/dat/kdat_redirection.h @@ -1,7 +1,7 @@ /* - * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. + * Copyright (c) 2002-2006, Network Appliance, Inc. All rights reserved. * - * This Software is licensed under one of the following licenses: + * This Software is licensed under all of the following licenses: * * 1) under the terms of the "Common Public License 1.0" a copy of which is * in the file LICENSE.txt in the root directory. The license is also @@ -20,14 +20,23 @@ * * Licensee has the right to choose one of the above licenses. * - * Redistributions of source code must retain the above copyright + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * Redistributions of source code must retain both the above copyright * notice and one of the license notices. * * Redistributions in binary form must reproduce both the above copyright * notice, one of the license notices in the documentation * and/or other materials provided with the distribution. - + * + * Neither the name of Network Appliance, Inc. nor the names of other DAT + * Collaborative contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. */ + /**************************************************************** * * HEADER: kdat_redirection.h @@ -59,11 +68,12 @@ /* evd_modify_upcall macro */ -#define DAT_EVD_MODIFY_UPCALL(evd, policy, upcall) \ +#define DAT_EVD_MODIFY_UPCALL(evd, policy, upcall, flag) \ (*DAT_HANDLE_TO_PROVIDER(evd)->evd_modify_upcall_func)(\ (evd), \ (policy), \ - (upcall)) + (upcall), \ + (flag)) /* evd_create macro */ #define DAT_EVD_KCREATE(ia,qlen,policy,upcall,flags,handle) \ @@ -77,7 +87,7 @@ /* lmr_kcreate macro */ #define DAT_LMR_KCREATE(ia,mtype,reg_desc,len,pz,priv,mem_opt,\ - lmr,lmr_context,rmr_context,reg_len,reg_addr) \ + va_type,lmr,lmr_context,rmr_context,reg_len,reg_addr) \ (*DAT_HANDLE_TO_PROVIDER(ia)->lmr_kcreate_func)(\ (ia), \ (mtype), \ @@ -86,12 +96,49 @@ (pz), \ (priv), \ (mem_opt), \ + (va_type), \ (lmr), \ (lmr_context), \ (rmr_context), \ (reg_len), \ (reg_addr)) +#define DAT_LMR_ALLOCATE(ia,pz,size,scope,lmr) \ + (*DAT_HANDLE_TO_PROVIDER(ia)->lmr_allocate_func)(\ + (ia), \ + (pz), \ + (size), \ + (scope), \ + (lmr)) + +#define DAT_LMR_FMR(lmr,mtype,reg_desc,length,priv,\ + va_type,ep,cookie,flags,lmr_context,rmr_context) \ + (*DAT_HANDLE_TO_PROVIDER(lmr)->lmr_fmr_func)(\ + (lmr),\ + (mtype),\ + (reg_desc),\ + (length),\ + (priv),\ + (va_type),\ + (ep),\ + (cookie),\ + (flags),\ + (lmr_context),\ + (rmr_context)) + +#define DAT_LMR_INVALIDATE(lmr, ep,cookie,flags) \ + (*DAT_HANDLE_TO_PROVIDER(lmr)->lmr_invalidate_func)(\ + (lmr),\ + (ep),\ + (cookie),\ + (flags)) + +#define DAT_IA_RESERVED_LMR(ia, lmr, lmr_context) \ + (*DAT_HANDLE_TO_PROVIDER(ia)->ia_reserved_lmr_func)(\ + (ia),\ + (lmr),\ + (lmr_context)) + /*************************************************************** * FUNCTION PROTOTYPES * @@ -106,6 +153,7 @@ typedef DAT_RETURN (*DAT_LMR_KCREATE_FUNC) ( IN DAT_VLEN, /* length */ IN DAT_PZ_HANDLE, /* pz_handle */ IN DAT_MEM_PRIV_FLAGS, /* privileges */ + IN DAT_VA_TYPE, /* va_type */ IN DAT_MEM_OPTIMIZE_FLAGS, /* mem_optimization */ OUT DAT_LMR_HANDLE *, /* lmr_handle */ OUT DAT_LMR_CONTEXT *, /* lmr_context */ @@ -122,6 +170,37 @@ typedef DAT_RETURN (*DAT_IA_MEMTYPE_HINT_FUNC) ( OUT DAT_VLEN *, /* preferred_length */ OUT DAT_VADDR * ); /* preferred_alignment */ +typedef DAT_RETURN (*DAT_LMR_QUERY_FUNC) ( + IN DAT_LMR_HANDLE, /* lmr_handle */ + IN DAT_LMR_PARAM_MASK, /* lmr_param_mask */ + OUT DAT_LMR_PARAM *); /* lmr_param */ + +typedef DAT_RETURN (*DAT_LMR_ALLOCATE_FUNC) ( + IN DAT_IA_HANDLE, /* ia_handle */ + IN DAT_PZ_HANDLE, /* pz_handle */ + IN DAT_COUNT, /* max number of physical pages */ + IN DAT_LMR_SCOPE, /* scope of LMR */ + OUT DAT_LMR_HANDLE ); /* lmr_handle */ + +typedef DAT_RETURN (*DAT_LMR_FMR_FUNC) ( + IN DAT_LMR_HANDLE, /* lmr_handle */ + IN DAT_MEM_TYPE, /* mem_type */ + IN const DAT_REGION_DESCRIPTION, /* region_description */ + IN DAT_VLEN, /* number of pages */ + IN DAT_MEM_PRIV_FLAGS, /* mem_privileges */ + IN DAT_VA_TYPE, /* va_type */ + IN DAT_EP_HANDLE, /* ep_handle */ + IN DAT_LMR_COOKIE, /* user_cookie */ + IN DAT_COMPLETION_FLAGS, /* completion_flags */ + OUT DAT_LMR_CONTEXT * , /* lmr_context */ + OUT DAT_RMR_CONTEXT * ); /* rmr_context */ + +typedef DAT_RETURN (*DAT_LMR_INVALIDATE_FUNC) ( + IN DAT_LMR_HANDLE, /* lmr_handle */ + IN DAT_EP_HANDLE, /* ep_handle */ + IN DAT_LMR_COOKIE, /* user_cookie */ + IN DAT_COMPLETION_FLAGS ); /* completion_flags */ + typedef DAT_RETURN (*DAT_EVD_KCREATE_FUNC) ( IN DAT_IA_HANDLE, /* ia_handle */ IN DAT_COUNT, /* evd_min_qlen */ @@ -133,10 +212,15 @@ typedef DAT_RETURN (*DAT_EVD_KCREATE_FUNC) ( typedef DAT_RETURN (*DAT_EVD_MODIFY_UPCALL_FUNC) ( IN DAT_EVD_HANDLE, /* evd_handle */ IN DAT_UPCALL_POLICY, /* upcall_policy */ - IN const DAT_UPCALL_OBJECT * ); /* upcall */ + IN const DAT_UPCALL_OBJECT *, /* upcall */ + IN DAT_UPCALL_FLAG ); /* upcall invocation flag */ -#include +typedef DAT_RETURN (*DAT_IA_RESERVED_LMR_FUNC) ( + IN DAT_IA_HANDLE, /* ia_handle */ + OUT DAT_LMR_HANDLE *, /* lmr_handle */ + OUT DAT_LMR_CONTEXT * ); /* lmr_context */ +#include struct dat_provider { @@ -218,6 +302,29 @@ struct dat_provider DAT_SRQ_QUERY_FUNC srq_query_func; DAT_SRQ_RESIZE_FUNC srq_resize_func; DAT_SRQ_SET_LW_FUNC srq_set_lw_func; + +/* DAT 2.0 functions */ + DAT_CSP_CREATE_FUNC csp_create_func; + DAT_CSP_QUERY_FUNC csp_query_func; + DAT_CSP_FREE_FUNC csp_free_func; + + DAT_EP_COMMON_CONNECT_FUNC ep_common_connect_func; + DAT_RMR_CREATE_FOR_EP_FUNC rmr_create_for_ep_func; + + DAT_EP_POST_SEND_WITH_INVALIDATE_FUNC ep_post_send_with_invalidate_func; + DAT_EP_POST_RDMA_READ_TO_RMR_FUNC ep_post_rdma_read_to_rmr_func; + + /* kDAT 2.0 functions */ + DAT_LMR_ALLOCATE_FUNC lmr_allocate_func; + DAT_LMR_FMR_FUNC lmr_fmr_func; + DAT_LMR_INVALIDATE_FUNC lmr_invalidate_func; + DAT_IA_RESERVED_LMR_FUNC ia_reserved_lmr_func; + +#ifdef DAT_EXTENSIONS + DAT_HANDLE_EXTENDEDOP_FUNC handle_extendedop_func; +#endif + + DAT_IA_HA_RELATED_FUNC ia_ha_related_func; }; #endif /* _KDAT_REDIRECTION_H_ */ diff --git a/dat/include/dat/kdat_vendor_specific.h b/dat/include/dat/kdat_vendor_specific.h index 98d6a23..fe8e873 100644 --- a/dat/include/dat/kdat_vendor_specific.h +++ b/dat/include/dat/kdat_vendor_specific.h @@ -1,7 +1,7 @@ /* - * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. + * Copyright (c) 2002-2006, Network Appliance, Inc. All rights reserved. * - * This Software is licensed under one of the following licenses: + * This Software is licensed under all of the following licenses: * * 1) under the terms of the "Common Public License 1.0" a copy of which is * in the file LICENSE.txt in the root directory. The license is also @@ -20,12 +20,21 @@ * * Licensee has the right to choose one of the above licenses. * - * Redistributions of source code must retain the above copyright + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * Redistributions of source code must retain both the above copyright * notice and one of the license notices. * * Redistributions in binary form must reproduce both the above copyright * notice, one of the license notices in the documentation * and/or other materials provided with the distribution. + * + * Neither the name of Network Appliance, Inc. nor the names of other DAT + * Collaborative contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. */ /*************************************************************** @@ -35,7 +44,7 @@ * PURPOSE: Vendor defined macros & support. * * Description: Header file for "kDAPL: Kernel Direct Access Programming - * Library, Version: 1.2" + * Library, Version: 2.0" * ***************************************************************/ #ifndef _KDAT_VENDOR_SPECIFIC_H_ @@ -47,9 +56,11 @@ #if defined(_AMMASSO) -#elif defined(_IBM) +#elif defined(_BROADCOM) -#elif defined(_INFINICON) +#elif defined(_CISCO) + +#elif defined(_IBM) #elif defined(_INTEL) @@ -59,9 +70,11 @@ #elif defined(_MYRINET) -#elif defined(_SILIQUENT) +#elif defined(_NETEFFECT) + +#elif defined(_QLOGIC) -#elif defined(_TOPSPIN) +#elif defined(_SILVERSTORM) #elif defined(_VOLTAIRE) diff --git a/dat/include/dat/udat.h b/dat/include/dat/udat.h index be2e5d5..569b702 100644 --- a/dat/include/dat/udat.h +++ b/dat/include/dat/udat.h @@ -1,7 +1,7 @@ /* - * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. + * Copyright (c) 2002-2006, Network Appliance, Inc. All rights reserved. * - * This Software is licensed under one of the following licenses: + * This Software is licensed under all of the following licenses: * * 1) under the terms of the "Common Public License 1.0" a copy of which is * in the file LICENSE.txt in the root directory. The license is also @@ -20,12 +20,21 @@ * * Licensee has the right to choose one of the above licenses. * - * Redistributions of source code must retain the above copyright + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * Redistributions of source code must retain both the above copyright * notice and one of the license notices. * * Redistributions in binary form must reproduce both the above copyright * notice, one of the license notices in the documentation * and/or other materials provided with the distribution. + * + * Neither the name of Network Appliance, Inc. nor the names of other DAT + * Collaborative contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. */ /**************************************************************** @@ -35,7 +44,7 @@ * PURPOSE: defines the user DAT API * * Description: Header file for "uDAPL: User Direct Access Programming - * Library, Version: 1.2" + * Library, Version: 2.0" * * Mapping rules: * All global symbols are prepended with DAT_ or dat_ @@ -73,7 +82,11 @@ typedef enum dat_handle_type DAT_HANDLE_TYPE_RMR, DAT_HANDLE_TYPE_RSP, DAT_HANDLE_TYPE_CNO, - DAT_HANDLE_TYPE_SRQ + DAT_HANDLE_TYPE_SRQ, + DAT_HANDLE_TYPE_CSP +#ifdef DAT_EXTENSIONS + ,DAT_HANDLE_TYPE_EXTENSION_BASE +#endif } DAT_HANDLE_TYPE; /* EVD state consists of three orthogonal substates. One for @@ -170,8 +183,6 @@ typedef struct dat_os_wait_proxy_agent * type Provider supports for LMR memory creation. */ - - /* For udapl only */ typedef struct dat_shared_memory @@ -197,26 +208,110 @@ struct dat_lmr_param DAT_VLEN length; DAT_PZ_HANDLE pz_handle; DAT_MEM_PRIV_FLAGS mem_priv; + DAT_VA_TYPE va_type; DAT_LMR_CONTEXT lmr_context; DAT_RMR_CONTEXT rmr_context; DAT_VLEN registered_size; DAT_VADDR registered_address; }; +enum dat_lmr_param_mask +{ + DAT_LMR_FIELD_IA_HANDLE = 0x001, + DAT_LMR_FIELD_MEM_TYPE = 0x002, + DAT_LMR_FIELD_REGION_DESC = 0x004, + DAT_LMR_FIELD_LENGTH = 0x008, + DAT_LMR_FIELD_PZ_HANDLE = 0x010, + DAT_LMR_FIELD_MEM_PRIV = 0x020, + DAT_LMR_FIELD_VA_TYPE = 0x040, + DAT_LMR_FIELD_LMR_CONTEXT = 0x080, + DAT_LMR_FIELD_RMR_CONTEXT = 0x100, + DAT_LMR_FIELD_REGISTERED_SIZE = 0x200, + DAT_LMR_FIELD_REGISTERED_ADDRESS = 0x400, + + DAT_LMR_FIELD_ALL = 0x7FF +}; + +typedef enum dat_proxy_type +{ + DAT_PROXY_TYPE_NONE = 0x0, + DAT_PROXY_TYPE_AGENT = 0x1, + DAT_PROXY_TYPE_FD = 0x2 +} DAT_PROXY_TYPE; typedef struct dat_cno_param { DAT_IA_HANDLE ia_handle; - DAT_OS_WAIT_PROXY_AGENT agent; + DAT_PROXY_TYPE proxy_type; + union { + DAT_OS_WAIT_PROXY_AGENT agent; + DAT_FD fd; + DAT_PVOID none; + } proxy; } DAT_CNO_PARAM; typedef enum dat_cno_param_mask { - DAT_CNO_FIELD_IA_HANDLE = 0x1, - DAT_CNO_FIELD_AGENT = 0x2, - DAT_CNO_FIELD_ALL = 0x3 + DAT_CNO_FIELD_IA_HANDLE = 0x1, + DAT_CNO_FIELD_PROXY_TYPE = 0x2, + DAT_CNO_FIELD_PROXY = 0x3, + DAT_CNO_FIELD_ALL = 0x4 } DAT_CNO_PARAM_MASK; +struct dat_ia_attr +{ + char adapter_name[DAT_NAME_MAX_LENGTH]; + char vendor_name[DAT_NAME_MAX_LENGTH]; + DAT_UINT32 hardware_version_major; + DAT_UINT32 hardware_version_minor; + DAT_UINT32 firmware_version_major; + DAT_UINT32 firmware_version_minor; + DAT_IA_ADDRESS_PTR ia_address_ptr; + DAT_COUNT max_eps; + DAT_COUNT max_dto_per_ep; + DAT_COUNT max_rdma_read_per_ep_in; + DAT_COUNT max_rdma_read_per_ep_out; + DAT_COUNT max_evds; + DAT_COUNT max_evd_qlen; + DAT_COUNT max_iov_segments_per_dto; + DAT_COUNT max_lmrs; + DAT_SEG_LENGTH max_lmr_block_size; + DAT_VADDR max_lmr_virtual_address; + DAT_COUNT max_pzs; + DAT_SEG_LENGTH max_message_size; + DAT_SEG_LENGTH max_rdma_size; + DAT_COUNT max_rmrs; + DAT_VADDR max_rmr_target_address; + DAT_COUNT max_srqs; + DAT_COUNT max_ep_per_srq; + DAT_COUNT max_recv_per_srq; + DAT_COUNT max_iov_segments_per_rdma_read; + DAT_COUNT max_iov_segments_per_rdma_write; + DAT_COUNT max_rdma_read_in; + DAT_COUNT max_rdma_read_out; + DAT_BOOLEAN max_rdma_read_per_ep_in_guaranteed; + DAT_BOOLEAN max_rdma_read_per_ep_out_guaranteed; + DAT_BOOLEAN zb_supported; +#ifdef DAT_EXTENSIONS + DAT_EXTENSION extension_supported; + DAT_COUNT extension_version; +#endif /* DAT_EXTENSIONS */ + DAT_COUNT num_transport_attr; + DAT_NAMED_ATTR *transport_attr; + DAT_COUNT num_vendor_attr; + DAT_NAMED_ATTR *vendor_attr; +}; + +#ifdef DAT_EXTENSIONS +#define DAT_IA_FIELD_IA_EXTENSION UINT64_C(0x100000000) +#define DAT_IA_FIELD_IA_EXTENSION_VERSION UINT64_C(0x200000000) +#endif /* DAT_EXTENSIONS */ + +#define DAT_IA_FIELD_IA_NUM_TRANSPORT_ATTR UINT64_C(0x400000000) +#define DAT_IA_FIELD_IA_TRANSPORT_ATTR UINT64_C(0x800000000) +#define DAT_IA_FIELD_IA_NUM_VENDOR_ATTR UINT64_C(0x1000000000) +#define DAT_IA_FIELD_IA_VENDOR_ATTR UINT64_C(0x2000000000) +#define DAT_IA_FIELD_ALL UINT64_C(0x3FFFFFFFFF) /* General Provider attributes. udat specific. */ @@ -226,7 +321,6 @@ typedef enum dat_pz_support DAT_PZ_SHAREABLE } DAT_PZ_SUPPORT; - #include /* Provider should support merging of all event stream types. Provider @@ -269,38 +363,48 @@ struct dat_provider_attr DAT_BOOLEAN lmr_sync_req; DAT_BOOLEAN dto_async_return_guaranteed; DAT_BOOLEAN rdma_write_for_rdma_read_req; + DAT_BOOLEAN rdma_read_lmr_rmr_context_exposure; + DAT_RMR_SCOPE rmr_scope_supported; + DAT_BOOLEAN is_signal_safe; + DAT_BOOLEAN ha_supported; + DAT_HA_LB ha_loadbalancing; DAT_COUNT num_provider_specific_attr; DAT_NAMED_ATTR * provider_specific_attr; }; -#define DAT_PROVIDER_FIELD_PROVIDER_NAME UINT64_C(0x0000001) -#define DAT_PROVIDER_FIELD_PROVIDER_VERSION_MAJOR UINT64_C(0x0000002) -#define DAT_PROVIDER_FIELD_PROVIDER_VERSION_MINOR UINT64_C(0x0000004) -#define DAT_PROVIDER_FIELD_DAPL_VERSION_MAJOR UINT64_C(0x0000008) -#define DAT_PROVIDER_FIELD_DAPL_VERSION_MINOR UINT64_C(0x0000010) -#define DAT_PROVIDER_FIELD_LMR_MEM_TYPE_SUPPORTED UINT64_C(0x0000020) -#define DAT_PROVIDER_FIELD_IOV_OWNERSHIP UINT64_C(0x0000040) -#define DAT_PROVIDER_FIELD_DAT_QOS_SUPPORTED UINT64_C(0x0000080) -#define DAT_PROVIDER_FIELD_COMPLETION_FLAGS_SUPPORTED UINT64_C(0x0000100) -#define DAT_PROVIDER_FIELD_IS_THREAD_SAFE UINT64_C(0x0000200) -#define DAT_PROVIDER_FIELD_MAX_PRIVATE_DATA_SIZE UINT64_C(0x0000400) -#define DAT_PROVIDER_FIELD_SUPPORTS_MULTIPATH UINT64_C(0x0000800) -#define DAT_PROVIDER_FIELD_EP_CREATOR UINT64_C(0x0001000) -#define DAT_PROVIDER_FIELD_PZ_SUPPORT UINT64_C(0x0002000) -#define DAT_PROVIDER_FIELD_OPTIMAL_BUFFER_ALIGNMENT UINT64_C(0x0004000) -#define DAT_PROVIDER_FIELD_EVD_STREAM_MERGING_SUPPORTED UINT64_C(0x0008000) -#define DAT_PROVIDER_FIELD_SRQ_SUPPORTED UINT64_C(0x0010000) -#define DAT_PROVIDER_FIELD_SRQ_WATERMARKS_SUPPORTED UINT64_C(0x0020000) -#define DAT_PROVIDER_FIELD_SRQ_EP_PZ_DIFFERENCE_SUPPORTED UINT64_C(0x0040000) -#define DAT_PROVIDER_FIELD_SRQ_INFO_SUPPORTED UINT64_C(0x0080000) -#define DAT_PROVIDER_FIELD_EP_RECV_INFO_SUPPORTED UINT64_C(0x0100000) -#define DAT_PROVIDER_FIELD_LMR_SYNC_REQ UINT64_C(0x0200000) -#define DAT_PROVIDER_FIELD_DTO_ASYNC_RETURN_GUARANTEED UINT64_C(0x0400000) -#define DAT_PROVIDER_FIELD_RDMA_WRITE_FOR_RDMA_READ_REQ UINT64_C(0x0800000) -#define DAT_PROVIDER_FIELD_NUM_PROVIDER_SPECIFIC_ATTR UINT64_C(0x1000000) -#define DAT_PROVIDER_FIELD_PROVIDER_SPECIFIC_ATTR UINT64_C(0x2000000) - -#define DAT_PROVIDER_FIELD_ALL UINT64_C(0x3FFFFFF) +#define DAT_PROVIDER_FIELD_PROVIDER_NAME UINT64_C(0x00000001) +#define DAT_PROVIDER_FIELD_PROVIDER_VERSION_MAJOR UINT64_C(0x00000002) +#define DAT_PROVIDER_FIELD_PROVIDER_VERSION_MINOR UINT64_C(0x00000004) +#define DAT_PROVIDER_FIELD_DAPL_VERSION_MAJOR UINT64_C(0x00000008) +#define DAT_PROVIDER_FIELD_DAPL_VERSION_MINOR UINT64_C(0x00000010) +#define DAT_PROVIDER_FIELD_LMR_MEM_TYPE_SUPPORTED UINT64_C(0x00000020) +#define DAT_PROVIDER_FIELD_IOV_OWNERSHIP UINT64_C(0x00000040) +#define DAT_PROVIDER_FIELD_DAT_QOS_SUPPORTED UINT64_C(0x00000080) +#define DAT_PROVIDER_FIELD_COMPLETION_FLAGS_SUPPORTED UINT64_C(0x00000100) +#define DAT_PROVIDER_FIELD_IS_THREAD_SAFE UINT64_C(0x00000200) +#define DAT_PROVIDER_FIELD_MAX_PRIVATE_DATA_SIZE UINT64_C(0x00000400) +#define DAT_PROVIDER_FIELD_SUPPORTS_MULTIPATH UINT64_C(0x00000800) +#define DAT_PROVIDER_FIELD_EP_CREATOR UINT64_C(0x00001000) +#define DAT_PROVIDER_FIELD_PZ_SUPPORT UINT64_C(0x00002000) +#define DAT_PROVIDER_FIELD_OPTIMAL_BUFFER_ALIGNMENT UINT64_C(0x00004000) +#define DAT_PROVIDER_FIELD_EVD_STREAM_MERGING_SUPPORTED UINT64_C(0x00008000) +#define DAT_PROVIDER_FIELD_SRQ_SUPPORTED UINT64_C(0x00010000) +#define DAT_PROVIDER_FIELD_SRQ_WATERMARKS_SUPPORTED UINT64_C(0x00020000) +#define DAT_PROVIDER_FIELD_SRQ_EP_PZ_DIFFERENCE_SUPPORTED UINT64_C(0x00040000) +#define DAT_PROVIDER_FIELD_SRQ_INFO_SUPPORTED UINT64_C(0x00080000) +#define DAT_PROVIDER_FIELD_EP_RECV_INFO_SUPPORTED UINT64_C(0x00100000) +#define DAT_PROVIDER_FIELD_LMR_SYNC_REQ UINT64_C(0x00200000) +#define DAT_PROVIDER_FIELD_DTO_ASYNC_RETURN_GUARANTEED UINT64_C(0x00400000) +#define DAT_PROVIDER_FIELD_RDMA_WRITE_FOR_RDMA_READ_REQ UINT64_C(0x00800000) +#define DAT_PROVIDER_FIELD_RDMA_READ_LMR_RMR_CONTEXT_EXPOSURE UINT64_C(0x01000000) +#define DAT_PROVIDER_FIELD_RMR_SCOPE_SUPPORTED UINT64_C(0x02000000) +#define DAT_PROVIDER_FIELD_IS_SIGNAL_SAFE UINT64_C(0x04000000) +#define DAT_PROVIDER_FIELD_HA_SUPPORTED UINT64_C(0x08000000) +#define DAT_PROVIDER_FIELD_HA_LB UINT64_C(0x10000000) +#define DAT_PROVIDER_FIELD_NUM_PROVIDER_SPECIFIC_ATTR UINT64_C(0x20000000) +#define DAT_PROVIDER_FIELD_PROVIDER_SPECIFIC_ATTR UINT64_C(0x40000000) + +#define DAT_PROVIDER_FIELD_ALL UINT64_C(0x7FFFFFFF) #define DAT_PROVIDER_FIELD_NONE UINT64_C(0x0) /**************************************************************/ @@ -309,7 +413,6 @@ struct dat_provider_attr * User DAT function call definitions, */ - extern DAT_RETURN dat_lmr_create ( IN DAT_IA_HANDLE, /* ia_handle */ IN DAT_MEM_TYPE, /* mem_type */ @@ -317,12 +420,18 @@ extern DAT_RETURN dat_lmr_create ( IN DAT_VLEN, /* length */ IN DAT_PZ_HANDLE, /* pz_handle */ IN DAT_MEM_PRIV_FLAGS, /* privileges */ + IN DAT_VA_TYPE, /* va_type */ OUT DAT_LMR_HANDLE *, /* lmr_handle */ OUT DAT_LMR_CONTEXT *, /* lmr_context */ OUT DAT_RMR_CONTEXT *, /* rmr_context */ OUT DAT_VLEN *, /* registered_length */ OUT DAT_VADDR * ); /* registered_address */ +extern DAT_RETURN dat_lmr_query ( + IN DAT_LMR_HANDLE, /* lmr_handle */ + IN DAT_LMR_PARAM_MASK, /* lmr_param_mask */ + OUT DAT_LMR_PARAM * ); /* lmr_param */ + /* Event Functions */ extern DAT_RETURN dat_evd_create ( @@ -363,8 +472,8 @@ extern DAT_RETURN dat_evd_enable ( extern DAT_RETURN dat_evd_wait ( IN DAT_EVD_HANDLE, /* evd_handle */ - IN DAT_TIMEOUT, /* Timeout */ - IN DAT_COUNT, /* Threshold */ + IN DAT_TIMEOUT, /* timeout */ + IN DAT_COUNT, /* threshold */ OUT DAT_EVENT *, /* event */ OUT DAT_COUNT * ); /* n_more_events */ @@ -377,4 +486,13 @@ extern DAT_RETURN dat_evd_set_unwaitable ( extern DAT_RETURN dat_evd_clear_unwaitable ( IN DAT_EVD_HANDLE); /* evd_handle */ +extern DAT_RETURN dat_cno_fd_create ( + IN DAT_IA_HANDLE, /* ia_handle */ + OUT DAT_FD *, /* file descriptor */ + OUT DAT_CNO_HANDLE * ); /* cno_handle */ + +extern DAT_RETURN dat_cno_trigger ( + IN DAT_CNO_HANDLE, /* cno_handle */ + OUT DAT_EVD_HANDLE * ); /* evd_handle */ + #endif /* _UDAT_H_ */ diff --git a/dat/include/dat/udat_config.h b/dat/include/dat/udat_config.h index f429f15..fc47a05 100644 --- a/dat/include/dat/udat_config.h +++ b/dat/include/dat/udat_config.h @@ -1,7 +1,7 @@ /* - * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. + * Copyright (c) 2002-2006, Network Appliance, Inc. All rights reserved. * - * This Software is licensed under one of the following licenses: + * This Software is licensed under all of the following licenses: * * 1) under the terms of the "Common Public License 1.0" a copy of which is * in the file LICENSE.txt in the root directory. The license is also @@ -20,12 +20,21 @@ * * Licensee has the right to choose one of the above licenses. * - * Redistributions of source code must retain the above copyright + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * Redistributions of source code must retain both the above copyright * notice and one of the license notices. * * Redistributions in binary form must reproduce both the above copyright * notice, one of the license notices in the documentation * and/or other materials provided with the distribution. + * + * Neither the name of Network Appliance, Inc. nor the names of other DAT + * Collaborative contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. */ /*************************************************************** @@ -35,7 +44,7 @@ * PURPOSE: provides uDAPL configuration information. * * Description: Header file for "uDAPL: User Direct Access Programming - * Library, Version: 1.2" + * Library, Version: 2.0" * ***************************************************************/ #ifndef _UDAT_CONFIG_H_ diff --git a/dat/include/dat/udat_redirection.h b/dat/include/dat/udat_redirection.h index 37724ca..764ede9 100644 --- a/dat/include/dat/udat_redirection.h +++ b/dat/include/dat/udat_redirection.h @@ -1,7 +1,7 @@ /* - * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. + * Copyright (c) 2002-2006, Network Appliance, Inc. All rights reserved. * - * This Software is licensed under one of the following licenses: + * This Software is licensed under all of the following licenses: * * 1) under the terms of the "Common Public License 1.0" a copy of which is * in the file LICENSE.txt in the root directory. The license is also @@ -20,12 +20,21 @@ * * Licensee has the right to choose one of the above licenses. * - * Redistributions of source code must retain the above copyright + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * Redistributions of source code must retain both the above copyright * notice and one of the license notices. * * Redistributions in binary form must reproduce both the above copyright * notice, one of the license notices in the documentation * and/or other materials provided with the distribution. + * + * Neither the name of Network Appliance, Inc. nor the names of other DAT + * Collaborative contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. */ /**************************************************************** @@ -46,7 +55,7 @@ #define _UDAT_REDIRECTION_H_ -#define DAT_LMR_CREATE(ia, mem_type, reg_desc, len, pz, priv, \ +#define DAT_LMR_CREATE(ia, mem_type, reg_desc, len, pz, priv, va_type, \ lmr, lmr_context, rmr_context, reg_len, reg_addr) \ (*DAT_HANDLE_TO_PROVIDER(ia)->lmr_create_func)(\ (ia), \ @@ -55,6 +64,7 @@ (len), \ (pz), \ (priv), \ + (va_type), \ (lmr), \ (lmr_context), \ (rmr_context), \ @@ -104,6 +114,18 @@ (proxy), \ (cno)) +#define DAT_CNO_FD_CREATE(ia, fd, cno) \ + (*DAT_HANDLE_TO_PROVIDER(ia)->cno_fd_create_func)(\ + (ia), \ + (fd), \ + (cno)) + +#define DAT_CNO_TRIGGER(cno, evd) \ + (*DAT_HANDLE_TO_PROVIDER(cno)->cno_trigger_func)(\ + (cno), \ + (evd)) + + #define DAT_CNO_MODIFY_AGENT(cno, proxy) \ (*DAT_HANDLE_TO_PROVIDER(cno)->cno_modify_agent_func)(\ (cno), \ @@ -139,12 +161,18 @@ typedef DAT_RETURN (*DAT_LMR_CREATE_FUNC) ( IN DAT_VLEN, /* length */ IN DAT_PZ_HANDLE, /* pz_handle */ IN DAT_MEM_PRIV_FLAGS, /* privileges */ + IN DAT_VA_TYPE, /* va_type */ OUT DAT_LMR_HANDLE *, /* lmr_handle */ OUT DAT_LMR_CONTEXT *, /* lmr_context */ OUT DAT_RMR_CONTEXT *, /* rmr_context */ OUT DAT_VLEN *, /* registered_length */ OUT DAT_VADDR * ); /* registered_address */ +typedef DAT_RETURN (*DAT_LMR_QUERY_FUNC) ( + IN DAT_LMR_HANDLE, /* lmr_handle */ + IN DAT_LMR_PARAM_MASK, /* lmr_param_mask */ + OUT DAT_LMR_PARAM *); /* lmr_param */ + /* Event functions */ typedef DAT_RETURN (*DAT_EVD_CREATE_FUNC) ( @@ -163,6 +191,15 @@ typedef DAT_RETURN (*DAT_CNO_CREATE_FUNC) ( IN DAT_OS_WAIT_PROXY_AGENT,/* agent */ OUT DAT_CNO_HANDLE *); /* cno_handle */ +typedef DAT_RETURN (*DAT_CNO_FD_CREATE_FUNC) ( + IN DAT_IA_HANDLE, /* ia_handle */ + OUT DAT_FD *, /* file_descriptor */ + OUT DAT_CNO_HANDLE *); /* cno_handle */ + +typedef DAT_RETURN (*DAT_CNO_TRIGGER_FUNC) ( + IN DAT_CNO_HANDLE, /* cno_handle */ + OUT DAT_EVD_HANDLE *); /* trigger */ + typedef DAT_RETURN (*DAT_CNO_MODIFY_AGENT_FUNC) ( IN DAT_CNO_HANDLE, /* cno_handle */ IN DAT_OS_WAIT_PROXY_AGENT);/* agent */ @@ -294,6 +331,26 @@ struct dat_provider DAT_SRQ_QUERY_FUNC srq_query_func; DAT_SRQ_RESIZE_FUNC srq_resize_func; DAT_SRQ_SET_LW_FUNC srq_set_lw_func; + + /* DAT 2.0 functions */ + DAT_CSP_CREATE_FUNC csp_create_func; + DAT_CSP_QUERY_FUNC csp_query_func; + DAT_CSP_FREE_FUNC csp_free_func; + + DAT_EP_COMMON_CONNECT_FUNC ep_common_connect_func; + + DAT_RMR_CREATE_FOR_EP_FUNC rmr_create_for_ep_func; + DAT_EP_POST_SEND_WITH_INVALIDATE_FUNC ep_post_send_with_invalidate_func; + DAT_EP_POST_RDMA_READ_TO_RMR_FUNC ep_post_rdma_read_to_rmr_func; + + DAT_CNO_FD_CREATE_FUNC cno_fd_create_func; + DAT_CNO_TRIGGER_FUNC cno_trigger_func; + + DAT_IA_HA_RELATED_FUNC ia_ha_related_func; + +#ifdef DAT_EXTENSIONS + DAT_HANDLE_EXTENDEDOP_FUNC handle_extendedop_func; +#endif }; #endif /* _UDAT_REDIRECTION_H_ */ diff --git a/dat/include/dat/udat_vendor_specific.h b/dat/include/dat/udat_vendor_specific.h index f03e9f0..2a8bd94 100644 --- a/dat/include/dat/udat_vendor_specific.h +++ b/dat/include/dat/udat_vendor_specific.h @@ -1,7 +1,7 @@ /* - * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. + * Copyright (c) 2002-2006, Network Appliance, Inc. All rights reserved. * - * This Software is licensed under one of the following licenses: + * This Software is licensed under all of the following licenses: * * 1) under the terms of the "Common Public License 1.0" a copy of which is * in the file LICENSE.txt in the root directory. The license is also @@ -20,12 +20,21 @@ * * Licensee has the right to choose one of the above licenses. * - * Redistributions of source code must retain the above copyright + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * Redistributions of source code must retain both the above copyright * notice and one of the license notices. * * Redistributions in binary form must reproduce both the above copyright * notice, one of the license notices in the documentation * and/or other materials provided with the distribution. + * + * Neither the name of Network Appliance, Inc. nor the names of other DAT + * Collaborative contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. */ /*************************************************************** @@ -35,7 +44,7 @@ * PURPOSE: Vendor defined macros & support. * * Description: Header file for "uDAPL: User Direct Access Programming - * Library, Version: 1.2" + * Library, Version: 2.0" * ***************************************************************/ #ifndef _UDAT_VENDOR_SPECIFIC_H_ @@ -47,9 +56,11 @@ #if defined(_AMMASSO) -#elif defined(_IBM) +#elif defined(_BROADCOM) -#elif defined(_INFINICON) +#elif defined(_CISCO) + +#elif defined(_IBM) #elif defined(_INTEL) @@ -59,9 +70,11 @@ #elif defined(_MYRINET) -#elif defined(_SILIQUENT) +#elif defined(_NETEFFECT) + +#elif defined(_QLOGIC) -#elif defined(_TOPSPIN) +#elif defined(_SILVERSTORM) #elif defined(_VOLTAIRE) diff --git a/dat/udat/Makefile b/dat/udat/Makefile index 789f721..5dee33d 100644 --- a/dat/udat/Makefile +++ b/dat/udat/Makefile @@ -34,7 +34,7 @@ # # PURPOSE: Makefile for DAT registration module # -# $Id: Makefile,v 1.20 2005/03/24 05:58:35 jlentini Exp $ +# $Id: Makefile 1301 2005-03-24 05:58:55Z jlentini $ #*********************************************************************/ @@ -61,7 +61,7 @@ STATIC32 = $(TARGET_PATH32)/libdat.a DYNAMIC32 = $(TARGET_PATH32)/libdat.so ifeq "$(ARCH)" "x86_64" -DUAL_ARCH = true +#DUAL_ARCH = true endif OBJS = $(OBJ_PATH)/udat.o \ @@ -111,6 +111,8 @@ ifeq "$(ARCH)" "x86_64" CFLAGS32 = -m32 endif +CFLAGS += -DDAT_EXTENSIONS + # # LD definitions # diff --git a/dat/udat/udat_api.c b/dat/udat/udat_api.c index fa07671..58813fe 100644 --- a/dat/udat/udat_api.c +++ b/dat/udat/udat_api.c @@ -1,7 +1,7 @@ /* - * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. + * Copyright (c) 2002-2006, Network Appliance, Inc. All rights reserved. * - * This Software is licensed under one of the following licenses: + * This Software is licensed under all of the following licenses: * * 1) under the terms of the "Common Public License 1.0" a copy of which is * in the file LICENSE.txt in the root directory. The license is also @@ -20,12 +20,21 @@ * * Licensee has the right to choose one of the above licenses. * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright * notice and one of the license notices. * * Redistributions in binary form must reproduce both the above copyright * notice, one of the license notices in the documentation * and/or other materials provided with the distribution. + * + * Neither the name of Network Appliance, Inc. nor the names of other DAT + * Collaborative contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. */ /********************************************************************** @@ -34,7 +43,7 @@ * * PURPOSE: DAT Provider and Consumer registry functions. * - * $Id: udat_api.c,v 1.6 2005/03/24 05:58:35 jlentini Exp $ + * $Id: udat_api.c 1301 2005-03-24 05:58:55Z jlentini $ **********************************************************************/ #include "dat_osd.h" @@ -50,6 +59,7 @@ DAT_RETURN dat_lmr_create ( IN DAT_VLEN length, IN DAT_PZ_HANDLE pz_handle, IN DAT_MEM_PRIV_FLAGS privileges, + IN DAT_VA_TYPE va_type, OUT DAT_LMR_HANDLE *lmr_handle, OUT DAT_LMR_CONTEXT *lmr_context, OUT DAT_RMR_CONTEXT *rmr_context, @@ -69,6 +79,7 @@ DAT_RETURN dat_lmr_create ( length, pz_handle, privileges, + va_type, lmr_handle, lmr_context, rmr_context, @@ -138,6 +149,25 @@ DAT_RETURN dat_cno_create ( return dat_status; } +DAT_RETURN dat_cno_fd_create ( + IN DAT_IA_HANDLE ia_handle, + OUT DAT_FD *fd, + OUT DAT_CNO_HANDLE *cno_handle) +{ + DAT_IA_HANDLE dapl_ia_handle; + DAT_RETURN dat_status; + + dat_status = dats_get_ia_handle((unsigned long)ia_handle, + &dapl_ia_handle); + if (dat_status == DAT_SUCCESS) + { + dat_status = DAT_CNO_FD_CREATE (dapl_ia_handle, + (DAT_FD *)fd, + cno_handle); + } + + return dat_status; +} DAT_RETURN dat_cno_modify_agent ( IN DAT_CNO_HANDLE cno_handle, @@ -268,7 +298,7 @@ DAT_RETURN dat_cr_handoff ( DAT_RETURN dat_lmr_query ( IN DAT_LMR_HANDLE lmr_handle, - IN DAT_LMR_PARAM_MASK lmv_param_mask, + IN DAT_LMR_PARAM_MASK lmr_param_mask, OUT DAT_LMR_PARAM *lmr_param) { if (lmr_handle == NULL) @@ -276,7 +306,7 @@ DAT_RETURN dat_lmr_query ( return DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_LMR); } return DAT_LMR_QUERY (lmr_handle, - lmv_param_mask, + lmr_param_mask, lmr_param); } diff --git a/libdat.spec.in b/libdat.spec.in index bcd78ad..cad9327 100644 --- a/libdat.spec.in +++ b/libdat.spec.in @@ -27,11 +27,11 @@ # and/or other materials provided with the distribution. # # -# uDAT and uDAPL 1.2 Registry RPM SPEC file +# uDAT and uDAPL 2.0 Registry RPM SPEC file # # $Id: $ -%define ver 1.2.1 +%define ver 2.0.0 %define RELEASE pre %define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE} @@ -48,7 +48,8 @@ Url: http://openfabrics.org/ %description Along with the OpenIB kernel drivers, libdat and libdapl provides a userspace -RDMA API that supports DAT 1.2 specification +RDMA API that supports DAT 2.0 specification and IB transport extensions for +atomic operations and rdma write with immediate data. %package devel Summary: Development files for the libdat and libdapl libraries @@ -105,6 +106,7 @@ rm -rf $RPM_BUILD_ROOT %{_includedir}/dat/udat.h %{_includedir}/dat/udat_redirection.h %{_includedir}/dat/udat_vendor_specific.h +%{_includedir}/dat/dat_ib_extensions.h %{_sysconfdir}/dat.conf %files utils @@ -113,11 +115,5 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man1/* %changelog -* Wed Mar 7 2007 Arlin Davis - 1.2.1.pre -- OFED 1.2-alpha, added dtest and dapltest utilies to package - -* Fri Oct 20 2006 Arlin Davis - 1.2.0 -- OFED 1.1, - -* Wed May 31 2006 Arlin Davis - 1.2.0 -- OFED 1.0 +* Wed Mar 7 2007 Arlin Davis - 2.0.0.pre +- Initial release of DAT 2.0 APIs, includes IB extensions diff --git a/test/dapltest/Makefile.am b/test/dapltest/Makefile.am index 1a19c53..21970bf 100755 --- a/test/dapltest/Makefile.am +++ b/test/dapltest/Makefile.am @@ -1,7 +1,15 @@ +if EXT_TYPE_IB +XFLAGS = -DDAT_EXTENSIONS +else +XFLAGS = +endif + +dapltest_CFLAGS = $(XFLAGS) + INCLUDES = -I include \ -I mdep/linux \ -I $(srcdir)/../../dat/include - + bin_PROGRAMS = dapltest dapltest_SOURCES = \ diff --git a/test/dapltest/test/dapl_bpool.c b/test/dapltest/test/dapl_bpool.c index 4c3db38..da2aa38 100644 --- a/test/dapltest/test/dapl_bpool.c +++ b/test/dapltest/test/dapl_bpool.c @@ -173,8 +173,10 @@ DT_BpoolAlloc ( bpool_ptr->reg_addr, bpool_ptr->reg_size)); ret = dat_rmr_bind ( bpool_ptr->rmr_handle, + bpool_ptr->lmr_handle, &iov, mflags, + DAT_VA_TYPE_VA, bpool_ptr->ep_handle, cookie, DAT_COMPLETION_DEFAULT_FLAG, diff --git a/test/dapltest/test/dapl_performance_client.c b/test/dapltest/test/dapl_performance_client.c index 815b94d..d1dec89 100644 --- a/test/dapltest/test/dapl_performance_client.c +++ b/test/dapltest/test/dapl_performance_client.c @@ -308,15 +308,13 @@ DT_Performance_Test_Client_Phase2 ( /* Prep the inputs */ for (i = 0; i < op->num_segs; i++) { - iov[i].pad = 0U; iov[i].virtual_address = (DAT_VADDR) (uintptr_t) DT_Bpool_GetBuffer (op->bp, i); iov[i].segment_length = op->seg_size; iov[i].lmr_context = DT_Bpool_GetLMR (op->bp, i); } - rmr_triplet.pad = 0U; - rmr_triplet.target_address = op->Rdma_Address; + rmr_triplet.virtual_address = op->Rdma_Address; rmr_triplet.segment_length = op->seg_size * op->num_segs; rmr_triplet.rmr_context = op->Rdma_Context; diff --git a/test/dapltest/test/dapl_performance_util.c b/test/dapltest/test/dapl_performance_util.c index 78a638e..4794a13 100644 --- a/test/dapltest/test/dapl_performance_util.c +++ b/test/dapltest/test/dapl_performance_util.c @@ -426,15 +426,13 @@ DT_performance_post_rdma_op ( /* Prep the inputs */ for (j = 0; j < op->num_segs; j++) { - iov[j].pad = 0U; iov[j].virtual_address = (DAT_VADDR) (uintptr_t) DT_Bpool_GetBuffer (op->bp, j); iov[j].segment_length = op->seg_size; iov[j].lmr_context = DT_Bpool_GetLMR (op->bp, j); } - rmr_triplet.pad = 0U; - rmr_triplet.target_address = op->Rdma_Address; + rmr_triplet.virtual_address = op->Rdma_Address; rmr_triplet.segment_length = op->seg_size * op->num_segs; rmr_triplet.rmr_context = op->Rdma_Context; diff --git a/test/dapltest/test/dapl_test_util.c b/test/dapltest/test/dapl_test_util.c index 11b2e90..f4554e7 100644 --- a/test/dapltest/test/dapl_test_util.c +++ b/test/dapltest/test/dapl_test_util.c @@ -702,7 +702,7 @@ DT_cr_check ( DT_Tdep_Print_Head *phead, } else { - ret = dat_cr_reject (cr_stat_p->cr_handle); + ret = dat_cr_reject (cr_stat_p->cr_handle, 0, NULL); if (ret != DAT_SUCCESS) { DT_Tdep_PT_Printf (phead, "\tdat_cr_reject error: %s\n", diff --git a/test/dapltest/test/dapl_transaction_util.c b/test/dapltest/test/dapl_transaction_util.c index d26ca85..970aa8c 100644 --- a/test/dapltest/test/dapl_transaction_util.c +++ b/test/dapltest/test/dapl_transaction_util.c @@ -51,7 +51,6 @@ DT_handle_post_recv_buf (DT_Tdep_Print_Head *phead, /* Prep the inputs */ for (j = 0; j < op->num_segs; j++) { - iov[j].pad = 0U; iov[j].virtual_address = (DAT_VADDR) (uintptr_t) DT_Bpool_GetBuffer (op->bp, j); iov[j].segment_length = op->seg_size; @@ -113,7 +112,6 @@ DT_handle_send_op (DT_Tdep_Print_Head *phead, /* Prep the inputs */ for (j = 0; j < op->num_segs; j++) { - iov[j].pad = 0U; iov[j].virtual_address = (DAT_VADDR) (uintptr_t) DT_Bpool_GetBuffer (op->bp, j); iov[j].segment_length = op->seg_size; @@ -493,7 +491,6 @@ DT_handle_rdma_op (DT_Tdep_Print_Head *phead, /* Prep the inputs */ for (j = 0; j < op->num_segs; j++) { - iov[j].pad = 0U; iov[j].virtual_address = (DAT_VADDR) (uintptr_t) DT_Bpool_GetBuffer (op->bp, j); iov[j].segment_length = op->seg_size; @@ -503,15 +500,14 @@ DT_handle_rdma_op (DT_Tdep_Print_Head *phead, ((((DAT_UINT64) i) << 32) | (((uintptr_t) DT_Bpool_GetBuffer (op->bp, 0)) & 0xffffffffUL)); - rmr_triplet.pad = 0U; - rmr_triplet.target_address = (DAT_VADDR) (uintptr_t) op->Rdma_Address; + rmr_triplet.virtual_address = (DAT_VADDR) (uintptr_t) op->Rdma_Address; rmr_triplet.segment_length = op->seg_size * op->num_segs; rmr_triplet.rmr_context = op->Rdma_Context; DT_Tdep_PT_Debug (3, (phead, "Call dat_ep_post_rdma_%s [" F64x ", sz=" F64x ", ctxt=%x]\n", (opcode == RDMA_WRITE ? "write" : "read"), - rmr_triplet.target_address, + rmr_triplet.virtual_address, rmr_triplet.segment_length, rmr_triplet.rmr_context )); diff --git a/test/dapltest/udapl/udapl_tdep.c b/test/dapltest/udapl/udapl_tdep.c index fb1343b..9b3c93f 100644 --- a/test/dapltest/udapl/udapl_tdep.c +++ b/test/dapltest/udapl/udapl_tdep.c @@ -67,6 +67,7 @@ DT_Tdep_lmr_create (DAT_IA_HANDLE ia_handle, len, pz_handle, priv_flag, + DAT_VA_TYPE_VA, lmr_handle_ptr, lmr_context_ptr, rmr_context_ptr, diff --git a/test/dtest/Makefile.am b/test/dtest/Makefile.am index fcb9b4e..38ea368 100755 --- a/test/dtest/Makefile.am +++ b/test/dtest/Makefile.am @@ -1,3 +1,10 @@ +if EXT_TYPE_IB +XFLAGS = -DDAT_EXTENSIONS +else +XFLAGS = +endif + +dtest_CFLAGS = $(XFLAGS) bin_PROGRAMS = dtest dtest_SOURCES = dtest.c INCLUDES = -I $(srcdir)/../../dat/include diff --git a/test/dtest/dtest.c b/test/dtest/dtest.c index 86b70cc..f723cdc 100644 --- a/test/dtest/dtest.c +++ b/test/dtest/dtest.c @@ -493,7 +493,6 @@ send_msg( void *data, DAT_RETURN ret; iov.lmr_context = context; - iov.pad = 0; iov.virtual_address = (DAT_VADDR)(unsigned long)data; iov.segment_length = size; @@ -589,13 +588,14 @@ connect_ep( char *hostname, int conn_id ) sizeof(DAT_RMR_TRIPLET), h_pz, DAT_MEM_PRIV_LOCAL_WRITE_FLAG, + DAT_VA_TYPE_VA, &h_lmr_send_msg, &lmr_context_send_msg, &rmr_context_send_msg, ®istered_size_send_msg, ®istered_addr_send_msg ); - if (ret != DAT_SUCCESS) { + if (ret != DAT_SUCCESS) { fprintf(stderr, "%d Error registering send msg buffer: %s\n", getpid(),DT_RetToString(ret)); return(ret); @@ -614,6 +614,7 @@ connect_ep( char *hostname, int conn_id ) sizeof(DAT_RMR_TRIPLET)*MSG_BUF_COUNT, h_pz, DAT_MEM_PRIV_LOCAL_WRITE_FLAG, + DAT_VA_TYPE_VA, &h_lmr_recv_msg, &lmr_context_recv_msg, &rmr_context_recv_msg, @@ -631,7 +632,6 @@ connect_ep( char *hostname, int conn_id ) for ( i = 0; i < MSG_BUF_COUNT; i++ ) { cookie.as_64 = i; l_iov.lmr_context = lmr_context_recv_msg; - l_iov.pad = 0; l_iov.virtual_address = (DAT_VADDR)(unsigned long)&rmr_recv_msg[ i ]; l_iov.segment_length = sizeof(DAT_RMR_TRIPLET); @@ -770,13 +770,12 @@ connect_ep( char *hostname, int conn_id ) * Setup our remote memory and tell the other side about it */ rmr_send_msg.rmr_context = rmr_context_recv; - rmr_send_msg.pad = 0; - rmr_send_msg.target_address = (DAT_VADDR)(unsigned long)rbuf; + rmr_send_msg.virtual_address = (DAT_VADDR)(unsigned long)rbuf; rmr_send_msg.segment_length = RDMA_BUFFER_SIZE; - printf("%d Send RMR to remote: snd_msg: r_key_ctx=%x,pad=%x,va=%llx,len=0x%x\n", - getpid(), rmr_send_msg.rmr_context, rmr_send_msg.pad, - rmr_send_msg.target_address, rmr_send_msg.segment_length ); + printf("%d Send RMR to remote: snd_msg: r_key_ctx=%x,va=%llx,len=0x%x\n", + getpid(), rmr_send_msg.rmr_context, + rmr_send_msg.virtual_address, rmr_send_msg.segment_length ); ret = send_msg( &rmr_send_msg, sizeof( DAT_RMR_TRIPLET ), @@ -845,9 +844,9 @@ connect_ep( char *hostname, int conn_id ) r_iov = rmr_recv_msg[ recv_msg_index ]; - printf("%d Received RMR from remote: r_iov: r_key_ctx=%x,pad=%x,va=%llx,len=0x%x\n", - getpid(), r_iov.rmr_context, r_iov.pad, - r_iov.target_address, r_iov.segment_length ); + printf("%d Received RMR from remote: r_iov: r_key_ctx=%x,va=%llx,len=0x%x\n", + getpid(), r_iov.rmr_context, + r_iov.virtual_address, r_iov.segment_length ); recv_msg_index++; @@ -963,7 +962,6 @@ do_rdma_write_with_msg( ) for (i=0;i