Committed in revision 2488. On Wed, 25 May 2005, Tom Duffy wrote:
tduffy> Signed-off-by: Tom Duffy <[EMAIL PROTECTED]> tduffy> tduffy> Index: linux-kernel-rmr/dat-provider/dapl_rmr_create.c tduffy> =================================================================== tduffy> --- linux-kernel-rmr/dat-provider/dapl_rmr_create.c (revision 2483) tduffy> +++ linux-kernel-rmr/dat-provider/dapl_rmr_create.c (working copy) tduffy> @@ -1,89 +0,0 @@ tduffy> -/* tduffy> - * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. tduffy> - * tduffy> - * This Software is licensed under one of the following licenses: tduffy> - * tduffy> - * 1) under the terms of the "Common Public License 1.0" a copy of which is tduffy> - * available from the Open Source Initiative, see tduffy> - * http://www.opensource.org/licenses/cpl.php. tduffy> - * tduffy> - * 2) under the terms of the "The BSD License" a copy of which is tduffy> - * available from the Open Source Initiative, see tduffy> - * http://www.opensource.org/licenses/bsd-license.php. tduffy> - * tduffy> - * 3) under the terms of the "GNU General Public License (GPL) Version 2" a tduffy> - * copy of which is available from the Open Source Initiative, see tduffy> - * http://www.opensource.org/licenses/gpl-license.php. tduffy> - * tduffy> - * Licensee has the right to choose one of the above licenses. tduffy> - * tduffy> - * Redistributions of source code must retain the above copyright tduffy> - * notice and one of the license notices. tduffy> - * tduffy> - * Redistributions in binary form must reproduce both the above copyright tduffy> - * notice, one of the license notices in the documentation tduffy> - * and/or other materials provided with the distribution. tduffy> - */ tduffy> - tduffy> -/* tduffy> - * $Id$ tduffy> - */ tduffy> - tduffy> -#include "dapl_rmr_util.h" tduffy> -#include "dapl_openib_util.h" tduffy> - tduffy> -/* tduffy> - * dapl_rmr_create tduffy> - * tduffy> - * Create a remote memory region for the specified protection zone tduffy> - * tduffy> - * Input: tduffy> - * pz_handle tduffy> - * tduffy> - * Output: tduffy> - * rmr_handle tduffy> - * tduffy> - * Returns: tduffy> - * DAT_SUCCESS tduffy> - * DAT_INSUFFICIENT_RESOURCES tduffy> - * DAT_INVALID_PARAMETER tduffy> - */ tduffy> -u32 dapl_rmr_create(DAT_PZ_HANDLE pz_handle, DAT_RMR_HANDLE *rmr_handle) tduffy> -{ tduffy> - struct dapl_pz *pz; tduffy> - struct dapl_rmr *rmr; tduffy> - u32 dat_status = DAT_SUCCESS; tduffy> - tduffy> - if (DAPL_BAD_HANDLE(pz_handle, DAPL_MAGIC_PZ)) { tduffy> - dat_status = tduffy> - DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_PZ); tduffy> - goto bail; tduffy> - } tduffy> - tduffy> - pz = (struct dapl_pz *)pz_handle; tduffy> - tduffy> - rmr = dapl_rmr_alloc(pz); tduffy> - tduffy> - if (rmr == NULL) { tduffy> - dat_status = tduffy> - DAT_ERROR(DAT_INSUFFICIENT_RESOURCES, DAT_RESOURCE_MEMORY); tduffy> - goto bail; tduffy> - } tduffy> - tduffy> - dat_status = dapl_ib_mw_alloc(rmr); tduffy> - tduffy> - if (dat_status != DAT_SUCCESS) { tduffy> - dapl_rmr_dealloc(rmr); tduffy> - dat_status = tduffy> - DAT_ERROR(DAT_INSUFFICIENT_RESOURCES, tduffy> - DAT_RESOURCE_MEMORY_REGION); tduffy> - goto bail; tduffy> - } tduffy> - tduffy> - atomic_inc(&pz->pz_ref_count); tduffy> - tduffy> - *rmr_handle = rmr; tduffy> - tduffy> -bail: tduffy> - return dat_status; tduffy> -} tduffy> Index: linux-kernel-rmr/dat-provider/Makefile tduffy> =================================================================== tduffy> --- linux-kernel-rmr/dat-provider/Makefile (revision 2483) tduffy> +++ linux-kernel-rmr/dat-provider/Makefile (working copy) tduffy> @@ -76,11 +61,7 @@ PROVIDER_MODULES := \ tduffy> dapl_psp_query \ tduffy> dapl_pz \ tduffy> dapl_ring_buffer_util \ tduffy> - dapl_rmr_bind \ tduffy> - dapl_rmr_create \ tduffy> - dapl_rmr_free \ tduffy> - dapl_rmr_query \ tduffy> - dapl_rmr_util \ tduffy> + dapl_rmr \ tduffy> dapl_rsp_create \ tduffy> dapl_rsp_free \ tduffy> dapl_rsp_query \ tduffy> @@ -98,5 +79,25 @@ PROVIDER_MODULES := \ tduffy> Index: linux-kernel-rmr/dat-provider/dapl_rmr_free.c tduffy> =================================================================== tduffy> --- linux-kernel-rmr/dat-provider/dapl_rmr_free.c (revision 2483) tduffy> +++ linux-kernel-rmr/dat-provider/dapl_rmr_free.c (working copy) tduffy> @@ -1,84 +0,0 @@ tduffy> -/* tduffy> - * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. tduffy> - * tduffy> - * This Software is licensed under one of the following licenses: tduffy> - * tduffy> - * 1) under the terms of the "Common Public License 1.0" a copy of which is tduffy> - * available from the Open Source Initiative, see tduffy> - * http://www.opensource.org/licenses/cpl.php. tduffy> - * tduffy> - * 2) under the terms of the "The BSD License" a copy of which is tduffy> - * available from the Open Source Initiative, see tduffy> - * http://www.opensource.org/licenses/bsd-license.php. tduffy> - * tduffy> - * 3) under the terms of the "GNU General Public License (GPL) Version 2" a tduffy> - * copy of which is available from the Open Source Initiative, see tduffy> - * http://www.opensource.org/licenses/gpl-license.php. tduffy> - * tduffy> - * Licensee has the right to choose one of the above licenses. tduffy> - * tduffy> - * Redistributions of source code must retain the above copyright tduffy> - * notice and one of the license notices. tduffy> - * tduffy> - * Redistributions in binary form must reproduce both the above copyright tduffy> - * notice, one of the license notices in the documentation tduffy> - * and/or other materials provided with the distribution. tduffy> - */ tduffy> - tduffy> -/* tduffy> - * $Id$ tduffy> - */ tduffy> - tduffy> -#include "dapl_rmr_util.h" tduffy> -#include "dapl_openib_util.h" tduffy> -#include "dapl_ia_util.h" tduffy> - tduffy> -/* tduffy> - * dapl_rmr_free tduffy> - * tduffy> - * Destroy an instance of the Remote Memory Region tduffy> - * tduffy> - * Input: tduffy> - * rmr_handle tduffy> - * tduffy> - * Output: tduffy> - * none tduffy> - * tduffy> - * Returns: tduffy> - * DAT_SUCCESS tduffy> - * DAT_INVALID_PARAMETER tduffy> - */ tduffy> -u32 dapl_rmr_free(DAT_RMR_HANDLE rmr_handle) tduffy> -{ tduffy> - struct dapl_rmr *rmr; tduffy> - u32 dat_status = DAT_SUCCESS; tduffy> - tduffy> - if (DAPL_BAD_HANDLE(rmr_handle, DAPL_MAGIC_RMR)) { tduffy> - dat_status = tduffy> - DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_RMR); tduffy> - goto bail; tduffy> - } tduffy> - tduffy> - rmr = (struct dapl_rmr *)rmr_handle; tduffy> - tduffy> - /* tduffy> - * If the user did not perform an unbind op, release tduffy> - * counts here. tduffy> - */ tduffy> - if (rmr->param.lmr_triplet.virtual_address != 0) { tduffy> - atomic_dec(&rmr->lmr->lmr_ref_count); tduffy> - rmr->param.lmr_triplet.virtual_address = 0; tduffy> - } tduffy> - tduffy> - dat_status = dapl_ib_mw_free(rmr); tduffy> - tduffy> - if (dat_status != DAT_SUCCESS) tduffy> - goto bail; tduffy> - tduffy> - atomic_dec(&rmr->pz->pz_ref_count); tduffy> - tduffy> - dapl_rmr_dealloc(rmr); tduffy> - tduffy> -bail: tduffy> - return dat_status; tduffy> -} tduffy> Index: linux-kernel-rmr/dat-provider/dapl_rmr_query.c tduffy> =================================================================== tduffy> --- linux-kernel-rmr/dat-provider/dapl_rmr_query.c (revision 2483) tduffy> +++ linux-kernel-rmr/dat-provider/dapl_rmr_query.c (working copy) tduffy> @@ -1,55 +0,0 @@ tduffy> -/* tduffy> - * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. tduffy> - * tduffy> - * This Software is licensed under one of the following licenses: tduffy> - * tduffy> - * 1) under the terms of the "Common Public License 1.0" a copy of which is tduffy> - * available from the Open Source Initiative, see tduffy> - * http://www.opensource.org/licenses/cpl.php. tduffy> - * tduffy> - * 2) under the terms of the "The BSD License" a copy of which is tduffy> - * available from the Open Source Initiative, see tduffy> - * http://www.opensource.org/licenses/bsd-license.php. tduffy> - * tduffy> - * 3) under the terms of the "GNU General Public License (GPL) Version 2" a tduffy> - * copy of which is available from the Open Source Initiative, see tduffy> - * http://www.opensource.org/licenses/gpl-license.php. tduffy> - * tduffy> - * Licensee has the right to choose one of the above licenses. tduffy> - * tduffy> - * Redistributions of source code must retain the above copyright tduffy> - * notice and one of the license notices. tduffy> - * tduffy> - * Redistributions in binary form must reproduce both the above copyright tduffy> - * notice, one of the license notices in the documentation tduffy> - * and/or other materials provided with the distribution. tduffy> - */ tduffy> - tduffy> -/* tduffy> - * $Id$ tduffy> - */ tduffy> - tduffy> -#include "dapl.h" tduffy> - tduffy> -u32 dapl_rmr_query(DAT_RMR_HANDLE rmr_handle, struct dat_rmr_param *rmr_param) tduffy> -{ tduffy> - struct dapl_rmr *rmr; tduffy> - u32 dat_status = DAT_SUCCESS; tduffy> - tduffy> - if (DAPL_BAD_HANDLE(rmr_handle, DAPL_MAGIC_RMR)) { tduffy> - dat_status = tduffy> - DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_RMR); tduffy> - goto bail; tduffy> - } tduffy> - if (NULL == rmr_param) { tduffy> - dat_status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG3); tduffy> - goto bail; tduffy> - } tduffy> - tduffy> - rmr = (struct dapl_rmr *)rmr_handle; tduffy> - tduffy> - memcpy(rmr_param, &rmr->param, sizeof *rmr_param); tduffy> - tduffy> -bail: tduffy> - return dat_status; tduffy> -} tduffy> Index: linux-kernel-rmr/dat-provider/dapl_rmr_bind.c tduffy> =================================================================== tduffy> --- linux-kernel-rmr/dat-provider/dapl_rmr_bind.c (revision 2483) tduffy> +++ linux-kernel-rmr/dat-provider/dapl_rmr_bind.c (working copy) tduffy> @@ -1,273 +0,0 @@ tduffy> -/* tduffy> - * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. tduffy> - * tduffy> - * This Software is licensed under one of the following licenses: tduffy> - * tduffy> - * 1) under the terms of the "Common Public License 1.0" a copy of which is tduffy> - * available from the Open Source Initiative, see tduffy> - * http://www.opensource.org/licenses/cpl.php. tduffy> - * tduffy> - * 2) under the terms of the "The BSD License" a copy of which is tduffy> - * available from the Open Source Initiative, see tduffy> - * http://www.opensource.org/licenses/bsd-license.php. tduffy> - * tduffy> - * 3) under the terms of the "GNU General Public License (GPL) Version 2" a tduffy> - * copy of which is available from the Open Source Initiative, see tduffy> - * http://www.opensource.org/licenses/gpl-license.php. tduffy> - * tduffy> - * Licensee has the right to choose one of the above licenses. tduffy> - * tduffy> - * Redistributions of source code must retain the above copyright tduffy> - * notice and one of the license notices. tduffy> - * tduffy> - * Redistributions in binary form must reproduce both the above copyright tduffy> - * notice, one of the license notices in the documentation tduffy> - * and/or other materials provided with the distribution. tduffy> - */ tduffy> - tduffy> -/* tduffy> - * $Id$ tduffy> - */ tduffy> - tduffy> -#include "dapl.h" tduffy> -#include "dapl_rmr_util.h" tduffy> -#include "dapl_ep_util.h" tduffy> -#include "dapl_cookie.h" tduffy> -#include "dapl_openib_util.h" tduffy> - tduffy> -/********************************************************************* tduffy> - * * tduffy> - * Function Definitions * tduffy> - * * tduffy> - *********************************************************************/ tduffy> - tduffy> -static inline u32 dapl_rmr_bind_fuse(struct dapl_rmr *rmr, tduffy> - const struct dat_lmr_triplet *lmr_triplet, tduffy> - enum dat_mem_priv_flags mem_priv, tduffy> - struct dapl_ep *ep_ptr, tduffy> - DAT_RMR_COOKIE user_cookie, tduffy> - enum dat_completion_flags completion_flags, tduffy> - DAT_RMR_CONTEXT *rmr_context) tduffy> -{ tduffy> - struct dapl_lmr *lmr; tduffy> - struct dapl_cookie *cookie; tduffy> - u32 status; tduffy> - boolean_t is_signaled; tduffy> - tduffy> - status = dapl_hash_search(rmr->header.owner_ia->hca_ptr->lmr_hash_table, tduffy> - lmr_triplet->lmr_context, tduffy> - (DAPL_HASH_DATA *) &lmr); tduffy> - if (DAT_SUCCESS != status) { tduffy> - status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG2); tduffy> - goto bail; tduffy> - } tduffy> - tduffy> - /* if the ep in unconnected return an error. IB requires that the */ tduffy> - /* QP be connected to change a memory window binding since: */ tduffy> - /* */ tduffy> - /* - memory window bind operations are WQEs placed on a QP's */ tduffy> - /* send queue */ tduffy> - /* */ tduffy> - /* - QP's only process WQEs on the send queue when the QP is in */ tduffy> - /* the RTS state */ tduffy> - if (DAT_EP_STATE_CONNECTED != ep_ptr->param.ep_state) { tduffy> - status = tduffy> - DAT_ERROR(DAT_INVALID_STATE, dapl_ep_state_subtype(ep_ptr)); tduffy> - goto bail; tduffy> - } tduffy> - tduffy> - if (FALSE == tduffy> - dapl_mr_bounds_check(dapl_mr_get_address tduffy> - (lmr->param.region_desc, lmr->param.mem_type), tduffy> - lmr->param.length, tduffy> - lmr_triplet->virtual_address, tduffy> - lmr_triplet->segment_length)) { tduffy> - status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG2); tduffy> - goto bail; tduffy> - } tduffy> - tduffy> - /* If the LMR, RMR, and EP are not in the same PZ, there is an error */ tduffy> - if ((ep_ptr->param.pz_handle != lmr->param.pz_handle) || tduffy> - (ep_ptr->param.pz_handle != rmr->param.pz_handle)) { tduffy> - status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG4); tduffy> - goto bail; tduffy> - } tduffy> - tduffy> - if (!dapl_rmr_validate_completion_flag(DAT_COMPLETION_SUPPRESS_FLAG, tduffy> - ep_ptr->param.ep_attr. tduffy> - request_completion_flags, tduffy> - completion_flags) || tduffy> - !dapl_rmr_validate_completion_flag(DAT_COMPLETION_UNSIGNALLED_FLAG, tduffy> - ep_ptr->param.ep_attr. tduffy> - request_completion_flags, tduffy> - completion_flags) || tduffy> - !dapl_rmr_validate_completion_flag( tduffy> - DAT_COMPLETION_BARRIER_FENCE_FLAG, tduffy> - ep_ptr->param.ep_attr.request_completion_flags, tduffy> - completion_flags)) { tduffy> - status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG4); tduffy> - goto bail; tduffy> - } tduffy> - tduffy> - status = dapl_rmr_cookie_alloc(&ep_ptr->req_buffer, rmr, user_cookie, tduffy> - &cookie); tduffy> - if (DAT_SUCCESS != status) tduffy> - goto bail; tduffy> - tduffy> - is_signaled = (completion_flags & DAT_COMPLETION_SUPPRESS_FLAG) ? tduffy> - FALSE : TRUE; tduffy> - tduffy> - /* tduffy> - * Take reference before posting to avoid race conditions with tduffy> - * completions tduffy> - */ tduffy> - atomic_inc(&ep_ptr->req_count); tduffy> - tduffy> - status = dapl_ib_mw_bind(rmr, lmr, ep_ptr, cookie, tduffy> - lmr_triplet->virtual_address, tduffy> - lmr_triplet->segment_length, tduffy> - mem_priv, is_signaled); tduffy> - if (DAT_SUCCESS != status) { tduffy> - atomic_dec(&ep_ptr->req_count); tduffy> - dapl_cookie_dealloc(&ep_ptr->req_buffer, cookie); tduffy> - goto bail; tduffy> - } tduffy> - tduffy> - atomic_inc(&lmr->lmr_ref_count); tduffy> - tduffy> - /* if the RMR was previously bound */ tduffy> - if (NULL != rmr->lmr) tduffy> - atomic_dec(&rmr->lmr->lmr_ref_count); tduffy> - tduffy> - rmr->param.mem_priv = mem_priv; tduffy> - rmr->param.lmr_triplet = *lmr_triplet; tduffy> - rmr->ep = ep_ptr; tduffy> - rmr->lmr = lmr; tduffy> - tduffy> - if (NULL != rmr_context) tduffy> - *rmr_context = rmr->param.rmr_context; tduffy> - tduffy> -bail: tduffy> - return status; tduffy> -} tduffy> - tduffy> -static inline u32 dapl_rmr_bind_unfuse(struct dapl_rmr *rmr, tduffy> - struct dapl_ep *ep_ptr, tduffy> - DAT_RMR_COOKIE user_cookie, tduffy> - enum dat_completion_flags cflags) tduffy> -{ tduffy> - struct dapl_cookie *cookie; tduffy> - u32 status = DAT_SUCCESS; tduffy> - boolean_t is_signaled; tduffy> - tduffy> - /* tduffy> - * if the ep in unconnected return an error. IB requires that the tduffy> - * QP be connected to change a memory window binding since: tduffy> - * tduffy> - * - memory window bind operations are WQEs placed on a QP's tduffy> - * send queue tduffy> - * tduffy> - * - QP's only process WQEs on the send queue when the QP is in tduffy> - * the RTS state tduffy> - */ tduffy> - if (DAT_EP_STATE_CONNECTED != ep_ptr->param.ep_state) { tduffy> - status = tduffy> - DAT_ERROR(DAT_INVALID_STATE, dapl_ep_state_subtype(ep_ptr)); tduffy> - goto bail1; tduffy> - } tduffy> - tduffy> - /* If the RMR and EP are not in the same PZ, there is an error */ tduffy> - if (ep_ptr->param.pz_handle != rmr->param.pz_handle) { tduffy> - status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG2); tduffy> - goto bail1; tduffy> - } tduffy> - tduffy> - if (!dapl_rmr_validate_completion_flag(DAT_COMPLETION_SUPPRESS_FLAG, tduffy> - ep_ptr->param.ep_attr. tduffy> - request_completion_flags, tduffy> - cflags) || tduffy> - !dapl_rmr_validate_completion_flag(DAT_COMPLETION_UNSIGNALLED_FLAG, tduffy> - ep_ptr->param.ep_attr. tduffy> - request_completion_flags, tduffy> - cflags) || tduffy> - !dapl_rmr_validate_completion_flag( tduffy> - DAT_COMPLETION_BARRIER_FENCE_FLAG, tduffy> - ep_ptr->param.ep_attr.request_completion_flags, cflags)) { tduffy> - status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG2); tduffy> - goto bail1; tduffy> - } tduffy> - tduffy> - status = dapl_rmr_cookie_alloc(&ep_ptr->req_buffer, rmr, user_cookie, tduffy> - &cookie); tduffy> - if (DAT_SUCCESS != status) tduffy> - goto bail1; tduffy> - tduffy> - is_signaled = (cflags & DAT_COMPLETION_UNSIGNALLED_FLAG) ? FALSE : TRUE; tduffy> - tduffy> - /* tduffy> - * Take reference before posting to avoid race conditions with tduffy> - * completions tduffy> - */ tduffy> - atomic_inc(&ep_ptr->req_count); tduffy> - tduffy> - status = dapl_ib_mw_unbind(rmr, ep_ptr, cookie, is_signaled); tduffy> - if (DAT_SUCCESS != status) { tduffy> - atomic_dec(&ep_ptr->req_count); tduffy> - dapl_cookie_dealloc(&ep_ptr->req_buffer, cookie); tduffy> - goto bail1; tduffy> - } tduffy> - tduffy> - /* if the RMR was previously bound */ tduffy> - if (NULL != rmr->lmr) tduffy> - atomic_dec(&rmr->lmr->lmr_ref_count); tduffy> - tduffy> - rmr->param.mem_priv = DAT_MEM_PRIV_NONE_FLAG; tduffy> - rmr->param.lmr_triplet.lmr_context = 0; tduffy> - rmr->param.lmr_triplet.virtual_address = 0; tduffy> - rmr->param.lmr_triplet.segment_length = 0; tduffy> - rmr->ep = ep_ptr; tduffy> - rmr->lmr = NULL; tduffy> - tduffy> -bail1: tduffy> - return status; tduffy> -} tduffy> - tduffy> -/* tduffy> - * dapl_rmr_bind tduffy> - * tduffy> - * DAPL Requirements Version xxx, 6.6.4.4 tduffy> - * tduffy> - * Bind the RMR to the specified memory region within the LMR and tduffy> - * provide a new rmr_context value. tduffy> - * tduffy> - * Input: tduffy> - * Output: tduffy> - */ tduffy> -u32 dapl_rmr_bind(DAT_RMR_HANDLE rmr_handle, tduffy> - const struct dat_lmr_triplet *lmr_triplet, tduffy> - enum dat_mem_priv_flags mem_priv, DAT_EP_HANDLE ep_handle, tduffy> - DAT_RMR_COOKIE user_cookie, tduffy> - enum dat_completion_flags completion_flags, tduffy> - DAT_RMR_CONTEXT *rmr_context) tduffy> -{ tduffy> - struct dapl_rmr *rmr; tduffy> - struct dapl_ep *ep_ptr; tduffy> - tduffy> - if (DAPL_BAD_HANDLE(rmr_handle, DAPL_MAGIC_RMR)) tduffy> - return DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_RMR); tduffy> - tduffy> - if (DAPL_BAD_HANDLE(ep_handle, DAPL_MAGIC_EP)) tduffy> - return DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EP); tduffy> - tduffy> - rmr = (struct dapl_rmr *)rmr_handle; tduffy> - ep_ptr = (struct dapl_ep *)ep_handle; tduffy> - tduffy> - /* if the rmr should be bound */ tduffy> - if (0 != lmr_triplet->segment_length) tduffy> - return dapl_rmr_bind_fuse(rmr, lmr_triplet, mem_priv, ep_ptr, tduffy> - user_cookie, completion_flags, tduffy> - rmr_context); tduffy> - else /* the rmr should be unbound */ tduffy> - return dapl_rmr_bind_unfuse(rmr, ep_ptr, user_cookie, tduffy> - completion_flags); tduffy> -} tduffy> Index: linux-kernel-rmr/dat-provider/dapl_openib_util.c tduffy> =================================================================== tduffy> --- linux-kernel-rmr/dat-provider/dapl_openib_util.c (revision 2483) tduffy> +++ linux-kernel-rmr/dat-provider/dapl_openib_util.c (working copy) tduffy> @@ -37,7 +37,6 @@ tduffy> #include "dapl_openib_util.h" tduffy> #include "dapl_evd_util.h" tduffy> #include "dapl_cr_util.h" tduffy> -#include "dapl_rmr_util.h" tduffy> #include "dapl_cookie.h" tduffy> #include "dapl_openib_cm.h" tduffy> tduffy> Index: linux-kernel-rmr/dat-provider/dapl_rmr_util.c tduffy> =================================================================== tduffy> --- linux-kernel-rmr/dat-provider/dapl_rmr_util.c (revision 2483) tduffy> +++ linux-kernel-rmr/dat-provider/dapl_rmr_util.c (working copy) tduffy> @@ -1,82 +0,0 @@ tduffy> -/* tduffy> - * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. tduffy> - * tduffy> - * This Software is licensed under one of the following licenses: tduffy> - * tduffy> - * 1) under the terms of the "Common Public License 1.0" a copy of which is tduffy> - * available from the Open Source Initiative, see tduffy> - * http://www.opensource.org/licenses/cpl.php. tduffy> - * tduffy> - * 2) under the terms of the "The BSD License" a copy of which is tduffy> - * available from the Open Source Initiative, see tduffy> - * http://www.opensource.org/licenses/bsd-license.php. tduffy> - * tduffy> - * 3) under the terms of the "GNU General Public License (GPL) Version 2" a tduffy> - * copy of which is available from the Open Source Initiative, see tduffy> - * http://www.opensource.org/licenses/gpl-license.php. tduffy> - * tduffy> - * Licensee has the right to choose one of the above licenses. tduffy> - * tduffy> - * Redistributions of source code must retain the above copyright tduffy> - * notice and one of the license notices. tduffy> - * tduffy> - * Redistributions in binary form must reproduce both the above copyright tduffy> - * notice, one of the license notices in the documentation tduffy> - * and/or other materials provided with the distribution. tduffy> - */ tduffy> - tduffy> -#include "dapl_rmr_util.h" tduffy> -#include "dapl_ia_util.h" tduffy> - tduffy> -struct dapl_rmr *dapl_rmr_alloc(struct dapl_pz *pz) tduffy> -{ tduffy> - struct dapl_rmr *rmr; tduffy> - tduffy> - /* Allocate LMR */ tduffy> - rmr = kmalloc(sizeof *rmr, GFP_ATOMIC); tduffy> - if (!rmr) tduffy> - return NULL; tduffy> - tduffy> - /* zero the structure */ tduffy> - memset(rmr, 0, sizeof *rmr); tduffy> - tduffy> - /* tduffy> - * initialize the header tduffy> - */ tduffy> - rmr->header.provider = pz->header.provider; tduffy> - rmr->header.magic = DAPL_MAGIC_RMR; tduffy> - rmr->header.handle_type = DAT_HANDLE_TYPE_RMR; tduffy> - rmr->header.owner_ia = pz->header.owner_ia; tduffy> - rmr->header.user_context.as_64 = 0; tduffy> - rmr->header.user_context.as_ptr = NULL; tduffy> - dapl_llist_init_entry(&rmr->header.ia_list_entry); tduffy> - dapl_ia_link_rmr(rmr->header.owner_ia, rmr); tduffy> - spin_lock_init(&rmr->header.lock); tduffy> - tduffy> - /* tduffy> - * initialize the body tduffy> - */ tduffy> - rmr->param.ia_handle = (DAT_IA_HANDLE) pz->header.owner_ia; tduffy> - rmr->param.pz_handle = (DAT_PZ_HANDLE) pz; tduffy> - rmr->param.lmr_triplet.lmr_context = 0; tduffy> - rmr->param.lmr_triplet.pad = 0; tduffy> - rmr->param.lmr_triplet.virtual_address = 0; tduffy> - rmr->param.lmr_triplet.segment_length = 0; tduffy> - tduffy> - rmr->param.mem_priv = 0; tduffy> - rmr->pz = pz; tduffy> - rmr->lmr = NULL; tduffy> - tduffy> - return rmr; tduffy> -} tduffy> - tduffy> -void dapl_rmr_dealloc(struct dapl_rmr *rmr) tduffy> -{ tduffy> - /* reset magic to prevent reuse */ tduffy> - rmr->header.magic = DAPL_MAGIC_INVALID; tduffy> - tduffy> - dapl_ia_unlink_rmr(rmr->header.owner_ia, rmr); tduffy> - /* no need to destroy rmr->header.lock */ tduffy> - tduffy> - kfree(rmr); tduffy> -} tduffy> Index: linux-kernel-rmr/dat-provider/dapl_rmr.c tduffy> =================================================================== tduffy> --- linux-kernel-rmr/dat-provider/dapl_rmr.c (revision 0) tduffy> +++ linux-kernel-rmr/dat-provider/dapl_rmr.c (revision 0) tduffy> @@ -0,0 +1,461 @@ tduffy> +/* tduffy> + * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. tduffy> + * tduffy> + * This Software is licensed under one of the following licenses: tduffy> + * tduffy> + * 1) under the terms of the "Common Public License 1.0" a copy of which is tduffy> + * available from the Open Source Initiative, see tduffy> + * http://www.opensource.org/licenses/cpl.php. tduffy> + * tduffy> + * 2) under the terms of the "The BSD License" a copy of which is tduffy> + * available from the Open Source Initiative, see tduffy> + * http://www.opensource.org/licenses/bsd-license.php. tduffy> + * tduffy> + * 3) under the terms of the "GNU General Public License (GPL) Version 2" a tduffy> + * copy of which is available from the Open Source Initiative, see tduffy> + * http://www.opensource.org/licenses/gpl-license.php. tduffy> + * tduffy> + * Licensee has the right to choose one of the above licenses. tduffy> + * tduffy> + * Redistributions of source code must retain the above copyright tduffy> + * notice and one of the license notices. tduffy> + * tduffy> + * Redistributions in binary form must reproduce both the above copyright tduffy> + * notice, one of the license notices in the documentation tduffy> + * and/or other materials provided with the distribution. tduffy> + */ tduffy> + tduffy> +/* tduffy> + * $Id$ tduffy> + */ tduffy> + tduffy> +#include "dapl.h" tduffy> +#include "dapl_ep_util.h" tduffy> +#include "dapl_ia_util.h" tduffy> +#include "dapl_mr_util.h" tduffy> +#include "dapl_hash.h" tduffy> +#include "dapl_cookie.h" tduffy> +#include "dapl_openib_util.h" tduffy> + tduffy> +static inline boolean_t tduffy> +dapl_rmr_validate_completion_flag(enum dat_completion_flags mask, tduffy> + enum dat_completion_flags allow, tduffy> + enum dat_completion_flags request) tduffy> +{ tduffy> + if ((mask & request) && !(mask & allow)) tduffy> + return FALSE; tduffy> + else tduffy> + return TRUE; tduffy> +} tduffy> + tduffy> + tduffy> +static struct dapl_rmr *dapl_rmr_alloc(struct dapl_pz *pz) tduffy> +{ tduffy> + struct dapl_rmr *rmr; tduffy> + tduffy> + /* Allocate LMR */ tduffy> + rmr = kmalloc(sizeof *rmr, GFP_ATOMIC); tduffy> + if (!rmr) tduffy> + return NULL; tduffy> + tduffy> + /* zero the structure */ tduffy> + memset(rmr, 0, sizeof *rmr); tduffy> + tduffy> + /* tduffy> + * initialize the header tduffy> + */ tduffy> + rmr->header.provider = pz->header.provider; tduffy> + rmr->header.magic = DAPL_MAGIC_RMR; tduffy> + rmr->header.handle_type = DAT_HANDLE_TYPE_RMR; tduffy> + rmr->header.owner_ia = pz->header.owner_ia; tduffy> + rmr->header.user_context.as_64 = 0; tduffy> + rmr->header.user_context.as_ptr = NULL; tduffy> + dapl_llist_init_entry(&rmr->header.ia_list_entry); tduffy> + dapl_ia_link_rmr(rmr->header.owner_ia, rmr); tduffy> + spin_lock_init(&rmr->header.lock); tduffy> + tduffy> + /* tduffy> + * initialize the body tduffy> + */ tduffy> + rmr->param.ia_handle = (DAT_IA_HANDLE)pz->header.owner_ia; tduffy> + rmr->param.pz_handle = (DAT_PZ_HANDLE)pz; tduffy> + rmr->param.lmr_triplet.lmr_context = 0; tduffy> + rmr->param.lmr_triplet.pad = 0; tduffy> + rmr->param.lmr_triplet.virtual_address = 0; tduffy> + rmr->param.lmr_triplet.segment_length = 0; tduffy> + tduffy> + rmr->param.mem_priv = 0; tduffy> + rmr->pz = pz; tduffy> + rmr->lmr = NULL; tduffy> + tduffy> + return rmr; tduffy> +} tduffy> + tduffy> +static void dapl_rmr_dealloc(struct dapl_rmr *rmr) tduffy> +{ tduffy> + /* reset magic to prevent reuse */ tduffy> + rmr->header.magic = DAPL_MAGIC_INVALID; tduffy> + tduffy> + dapl_ia_unlink_rmr(rmr->header.owner_ia, rmr); tduffy> + /* no need to destroy rmr->header.lock */ tduffy> + tduffy> + kfree(rmr); tduffy> +} tduffy> + tduffy> +static inline u32 dapl_rmr_bind_fuse(struct dapl_rmr *rmr, tduffy> + const struct dat_lmr_triplet *lmr_triplet, tduffy> + enum dat_mem_priv_flags mem_priv, tduffy> + struct dapl_ep *ep_ptr, tduffy> + DAT_RMR_COOKIE user_cookie, tduffy> + enum dat_completion_flags completion_flags, tduffy> + DAT_RMR_CONTEXT *rmr_context) tduffy> +{ tduffy> + struct dapl_lmr *lmr; tduffy> + struct dapl_cookie *cookie; tduffy> + u32 status; tduffy> + boolean_t is_signaled; tduffy> + tduffy> + status = dapl_hash_search(rmr->header.owner_ia->hca_ptr->lmr_hash_table, tduffy> + lmr_triplet->lmr_context, tduffy> + (DAPL_HASH_DATA *) &lmr); tduffy> + if (DAT_SUCCESS != status) { tduffy> + status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG2); tduffy> + goto bail; tduffy> + } tduffy> + tduffy> + /* tduffy> + * if the ep in unconnected return an error. IB requires that the tduffy> + * QP be connected to change a memory window binding since: tduffy> + * tduffy> + * - memory window bind operations are WQEs placed on a QP's tduffy> + * send queue tduffy> + * tduffy> + * - QP's only process WQEs on the send queue when the QP is in tduffy> + * the RTS state tduffy> + */ tduffy> + if (DAT_EP_STATE_CONNECTED != ep_ptr->param.ep_state) { tduffy> + status = tduffy> + DAT_ERROR(DAT_INVALID_STATE, dapl_ep_state_subtype(ep_ptr)); tduffy> + goto bail; tduffy> + } tduffy> + tduffy> + if (FALSE == tduffy> + dapl_mr_bounds_check(dapl_mr_get_address tduffy> + (lmr->param.region_desc, lmr->param.mem_type), tduffy> + lmr->param.length, tduffy> + lmr_triplet->virtual_address, tduffy> + lmr_triplet->segment_length)) { tduffy> + status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG2); tduffy> + goto bail; tduffy> + } tduffy> + tduffy> + /* If the LMR, RMR, and EP are not in the same PZ, there is an error */ tduffy> + if ((ep_ptr->param.pz_handle != lmr->param.pz_handle) || tduffy> + (ep_ptr->param.pz_handle != rmr->param.pz_handle)) { tduffy> + status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG4); tduffy> + goto bail; tduffy> + } tduffy> + tduffy> + if (!dapl_rmr_validate_completion_flag(DAT_COMPLETION_SUPPRESS_FLAG, tduffy> + ep_ptr->param.ep_attr. tduffy> + request_completion_flags, tduffy> + completion_flags) || tduffy> + !dapl_rmr_validate_completion_flag(DAT_COMPLETION_UNSIGNALLED_FLAG, tduffy> + ep_ptr->param.ep_attr. tduffy> + request_completion_flags, tduffy> + completion_flags) || tduffy> + !dapl_rmr_validate_completion_flag( tduffy> + DAT_COMPLETION_BARRIER_FENCE_FLAG, tduffy> + ep_ptr->param.ep_attr.request_completion_flags, tduffy> + completion_flags)) { tduffy> + status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG4); tduffy> + goto bail; tduffy> + } tduffy> + tduffy> + status = dapl_rmr_cookie_alloc(&ep_ptr->req_buffer, rmr, user_cookie, tduffy> + &cookie); tduffy> + if (DAT_SUCCESS != status) tduffy> + goto bail; tduffy> + tduffy> + is_signaled = (completion_flags & DAT_COMPLETION_SUPPRESS_FLAG) ? tduffy> + FALSE : TRUE; tduffy> + tduffy> + /* tduffy> + * Take reference before posting to avoid race conditions with tduffy> + * completions tduffy> + */ tduffy> + atomic_inc(&ep_ptr->req_count); tduffy> + tduffy> + status = dapl_ib_mw_bind(rmr, lmr, ep_ptr, cookie, tduffy> + lmr_triplet->virtual_address, tduffy> + lmr_triplet->segment_length, tduffy> + mem_priv, is_signaled); tduffy> + if (DAT_SUCCESS != status) { tduffy> + atomic_dec(&ep_ptr->req_count); tduffy> + dapl_cookie_dealloc(&ep_ptr->req_buffer, cookie); tduffy> + goto bail; tduffy> + } tduffy> + tduffy> + atomic_inc(&lmr->lmr_ref_count); tduffy> + tduffy> + /* if the RMR was previously bound */ tduffy> + if (NULL != rmr->lmr) tduffy> + atomic_dec(&rmr->lmr->lmr_ref_count); tduffy> + tduffy> + rmr->param.mem_priv = mem_priv; tduffy> + rmr->param.lmr_triplet = *lmr_triplet; tduffy> + rmr->ep = ep_ptr; tduffy> + rmr->lmr = lmr; tduffy> + tduffy> + if (NULL != rmr_context) tduffy> + *rmr_context = rmr->param.rmr_context; tduffy> + tduffy> +bail: tduffy> + return status; tduffy> +} tduffy> + tduffy> +static inline u32 dapl_rmr_bind_unfuse(struct dapl_rmr *rmr, tduffy> + struct dapl_ep *ep_ptr, tduffy> + DAT_RMR_COOKIE user_cookie, tduffy> + enum dat_completion_flags cflags) tduffy> +{ tduffy> + struct dapl_cookie *cookie; tduffy> + u32 status = DAT_SUCCESS; tduffy> + boolean_t is_signaled; tduffy> + tduffy> + /* tduffy> + * if the ep in unconnected return an error. IB requires that the tduffy> + * QP be connected to change a memory window binding since: tduffy> + * tduffy> + * - memory window bind operations are WQEs placed on a QP's tduffy> + * send queue tduffy> + * tduffy> + * - QP's only process WQEs on the send queue when the QP is in tduffy> + * the RTS state tduffy> + */ tduffy> + if (DAT_EP_STATE_CONNECTED != ep_ptr->param.ep_state) { tduffy> + status = DAT_ERROR(DAT_INVALID_STATE, tduffy> + dapl_ep_state_subtype(ep_ptr)); tduffy> + goto bail1; tduffy> + } tduffy> + tduffy> + /* If the RMR and EP are not in the same PZ, there is an error */ tduffy> + if (ep_ptr->param.pz_handle != rmr->param.pz_handle) { tduffy> + status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG2); tduffy> + goto bail1; tduffy> + } tduffy> + tduffy> + if (!dapl_rmr_validate_completion_flag(DAT_COMPLETION_SUPPRESS_FLAG, tduffy> + ep_ptr->param.ep_attr. tduffy> + request_completion_flags, tduffy> + cflags) || tduffy> + !dapl_rmr_validate_completion_flag(DAT_COMPLETION_UNSIGNALLED_FLAG, tduffy> + ep_ptr->param.ep_attr. tduffy> + request_completion_flags, tduffy> + cflags) || tduffy> + !dapl_rmr_validate_completion_flag( tduffy> + DAT_COMPLETION_BARRIER_FENCE_FLAG, tduffy> + ep_ptr->param.ep_attr.request_completion_flags, cflags)) { tduffy> + status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG2); tduffy> + goto bail1; tduffy> + } tduffy> + tduffy> + status = dapl_rmr_cookie_alloc(&ep_ptr->req_buffer, rmr, user_cookie, tduffy> + &cookie); tduffy> + if (DAT_SUCCESS != status) tduffy> + goto bail1; tduffy> + tduffy> + is_signaled = (cflags & DAT_COMPLETION_UNSIGNALLED_FLAG) ? FALSE : TRUE; tduffy> + tduffy> + /* tduffy> + * Take reference before posting to avoid race conditions with tduffy> + * completions tduffy> + */ tduffy> + atomic_inc(&ep_ptr->req_count); tduffy> + tduffy> + status = dapl_ib_mw_unbind(rmr, ep_ptr, cookie, is_signaled); tduffy> + if (DAT_SUCCESS != status) { tduffy> + atomic_dec(&ep_ptr->req_count); tduffy> + dapl_cookie_dealloc(&ep_ptr->req_buffer, cookie); tduffy> + goto bail1; tduffy> + } tduffy> + tduffy> + /* if the RMR was previously bound */ tduffy> + if (NULL != rmr->lmr) tduffy> + atomic_dec(&rmr->lmr->lmr_ref_count); tduffy> + tduffy> + rmr->param.mem_priv = DAT_MEM_PRIV_NONE_FLAG; tduffy> + rmr->param.lmr_triplet.lmr_context = 0; tduffy> + rmr->param.lmr_triplet.virtual_address = 0; tduffy> + rmr->param.lmr_triplet.segment_length = 0; tduffy> + rmr->ep = ep_ptr; tduffy> + rmr->lmr = NULL; tduffy> + tduffy> +bail1: tduffy> + return status; tduffy> +} tduffy> + tduffy> +/* tduffy> + * dapl_rmr_bind tduffy> + * tduffy> + * DAPL Requirements Version xxx, 6.6.4.4 tduffy> + * tduffy> + * Bind the RMR to the specified memory region within the LMR and tduffy> + * provide a new rmr_context value. tduffy> + * tduffy> + * Input: tduffy> + * Output: tduffy> + */ tduffy> +u32 dapl_rmr_bind(DAT_RMR_HANDLE rmr_handle, tduffy> + const struct dat_lmr_triplet *lmr_triplet, tduffy> + enum dat_mem_priv_flags mem_priv, DAT_EP_HANDLE ep_handle, tduffy> + DAT_RMR_COOKIE user_cookie, tduffy> + enum dat_completion_flags completion_flags, tduffy> + DAT_RMR_CONTEXT *rmr_context) tduffy> +{ tduffy> + struct dapl_rmr *rmr; tduffy> + struct dapl_ep *ep_ptr; tduffy> + tduffy> + if (DAPL_BAD_HANDLE(rmr_handle, DAPL_MAGIC_RMR)) tduffy> + return DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_RMR); tduffy> + tduffy> + if (DAPL_BAD_HANDLE(ep_handle, DAPL_MAGIC_EP)) tduffy> + return DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EP); tduffy> + tduffy> + rmr = (struct dapl_rmr *)rmr_handle; tduffy> + ep_ptr = (struct dapl_ep *)ep_handle; tduffy> + tduffy> + /* if the rmr should be bound */ tduffy> + if (0 != lmr_triplet->segment_length) tduffy> + return dapl_rmr_bind_fuse(rmr, lmr_triplet, mem_priv, ep_ptr, tduffy> + user_cookie, completion_flags, tduffy> + rmr_context); tduffy> + else /* the rmr should be unbound */ tduffy> + return dapl_rmr_bind_unfuse(rmr, ep_ptr, user_cookie, tduffy> + completion_flags); tduffy> +} tduffy> + tduffy> +/* tduffy> + * dapl_rmr_create tduffy> + * tduffy> + * Create a remote memory region for the specified protection zone tduffy> + * tduffy> + * Input: tduffy> + * pz_handle tduffy> + * tduffy> + * Output: tduffy> + * rmr_handle tduffy> + * tduffy> + * Returns: tduffy> + * DAT_SUCCESS tduffy> + * DAT_INSUFFICIENT_RESOURCES tduffy> + * DAT_INVALID_PARAMETER tduffy> + */ tduffy> +u32 dapl_rmr_create(DAT_PZ_HANDLE pz_handle, DAT_RMR_HANDLE *rmr_handle) tduffy> +{ tduffy> + struct dapl_pz *pz; tduffy> + struct dapl_rmr *rmr; tduffy> + u32 status = DAT_SUCCESS; tduffy> + tduffy> + if (DAPL_BAD_HANDLE(pz_handle, DAPL_MAGIC_PZ)) { tduffy> + status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_PZ); tduffy> + goto bail; tduffy> + } tduffy> + tduffy> + pz = (struct dapl_pz *)pz_handle; tduffy> + tduffy> + rmr = dapl_rmr_alloc(pz); tduffy> + tduffy> + if (rmr == NULL) { tduffy> + status = DAT_ERROR(DAT_INSUFFICIENT_RESOURCES, tduffy> + DAT_RESOURCE_MEMORY); tduffy> + goto bail; tduffy> + } tduffy> + tduffy> + status = dapl_ib_mw_alloc(rmr); tduffy> + tduffy> + if (status != DAT_SUCCESS) { tduffy> + dapl_rmr_dealloc(rmr); tduffy> + status = DAT_ERROR(DAT_INSUFFICIENT_RESOURCES, tduffy> + DAT_RESOURCE_MEMORY_REGION); tduffy> + goto bail; tduffy> + } tduffy> + tduffy> + atomic_inc(&pz->pz_ref_count); tduffy> + tduffy> + *rmr_handle = rmr; tduffy> + tduffy> +bail: tduffy> + return status; tduffy> +} tduffy> + tduffy> +/* tduffy> + * dapl_rmr_free tduffy> + * tduffy> + * Destroy an instance of the Remote Memory Region tduffy> + * tduffy> + * Input: tduffy> + * rmr_handle tduffy> + * tduffy> + * Output: tduffy> + * none tduffy> + * tduffy> + * Returns: tduffy> + * DAT_SUCCESS tduffy> + * DAT_INVALID_PARAMETER tduffy> + */ tduffy> +u32 dapl_rmr_free(DAT_RMR_HANDLE rmr_handle) tduffy> +{ tduffy> + struct dapl_rmr *rmr; tduffy> + u32 status = DAT_SUCCESS; tduffy> + tduffy> + if (DAPL_BAD_HANDLE(rmr_handle, DAPL_MAGIC_RMR)) { tduffy> + status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_RMR); tduffy> + goto bail; tduffy> + } tduffy> + tduffy> + rmr = (struct dapl_rmr *)rmr_handle; tduffy> + tduffy> + /* tduffy> + * If the user did not perform an unbind op, release tduffy> + * counts here. tduffy> + */ tduffy> + if (rmr->param.lmr_triplet.virtual_address != 0) { tduffy> + atomic_dec(&rmr->lmr->lmr_ref_count); tduffy> + rmr->param.lmr_triplet.virtual_address = 0; tduffy> + } tduffy> + tduffy> + status = dapl_ib_mw_free(rmr); tduffy> + tduffy> + if (status != DAT_SUCCESS) tduffy> + goto bail; tduffy> + tduffy> + atomic_dec(&rmr->pz->pz_ref_count); tduffy> + tduffy> + dapl_rmr_dealloc(rmr); tduffy> + tduffy> +bail: tduffy> + return status; tduffy> +} tduffy> + tduffy> +u32 dapl_rmr_query(DAT_RMR_HANDLE rmr_handle, struct dat_rmr_param *rmr_param) tduffy> +{ tduffy> + struct dapl_rmr *rmr; tduffy> + u32 status = DAT_SUCCESS; tduffy> + tduffy> + if (DAPL_BAD_HANDLE(rmr_handle, DAPL_MAGIC_RMR)) { tduffy> + status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_RMR); tduffy> + goto bail; tduffy> + } tduffy> + if (NULL == rmr_param) { tduffy> + status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG3); tduffy> + goto bail; tduffy> + } tduffy> + tduffy> + rmr = (struct dapl_rmr *)rmr_handle; tduffy> + tduffy> + memcpy(rmr_param, &rmr->param, sizeof *rmr_param); tduffy> + tduffy> +bail: tduffy> + return status; tduffy> +} tduffy> Index: linux-kernel-rmr/dat-provider/dapl_rmr_util.h tduffy> =================================================================== tduffy> --- linux-kernel-rmr/dat-provider/dapl_rmr_util.h (revision 2483) tduffy> +++ linux-kernel-rmr/dat-provider/dapl_rmr_util.h (working copy) tduffy> @@ -1,52 +0,0 @@ tduffy> -/* tduffy> - * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. tduffy> - * tduffy> - * This Software is licensed under one of the following licenses: tduffy> - * tduffy> - * 1) under the terms of the "Common Public License 1.0" a copy of which is tduffy> - * available from the Open Source Initiative, see tduffy> - * http://www.opensource.org/licenses/cpl.php. tduffy> - * tduffy> - * 2) under the terms of the "The BSD License" a copy of which is tduffy> - * available from the Open Source Initiative, see tduffy> - * http://www.opensource.org/licenses/bsd-license.php. tduffy> - * tduffy> - * 3) under the terms of the "GNU General Public License (GPL) Version 2" a tduffy> - * copy of which is available from the Open Source Initiative, see tduffy> - * http://www.opensource.org/licenses/gpl-license.php. tduffy> - * tduffy> - * Licensee has the right to choose one of the above licenses. tduffy> - * tduffy> - * Redistributions of source code must retain the above copyright tduffy> - * notice and one of the license notices. tduffy> - * tduffy> - * Redistributions in binary form must reproduce both the above copyright tduffy> - * notice, one of the license notices in the documentation tduffy> - * and/or other materials provided with the distribution. tduffy> - */ tduffy> - tduffy> -/* tduffy> - * $Id$ tduffy> - */ tduffy> - tduffy> -#ifndef DAPL_RMR_UTIL_H tduffy> -#define DAPL_RMR_UTIL_H tduffy> - tduffy> -#include "dapl_mr_util.h" tduffy> - tduffy> -extern struct dapl_rmr *dapl_rmr_alloc(struct dapl_pz *pz); tduffy> - tduffy> -extern void dapl_rmr_dealloc(struct dapl_rmr *rmr); tduffy> - tduffy> -static inline boolean_t tduffy> -dapl_rmr_validate_completion_flag(enum dat_completion_flags mask, tduffy> - enum dat_completion_flags allow, tduffy> - enum dat_completion_flags request) tduffy> -{ tduffy> - if ((mask & request) && !(mask & allow)) tduffy> - return FALSE; tduffy> - else tduffy> - return TRUE; tduffy> -} tduffy> - tduffy> -#endif /* DAPL_RMR_UTIL_H */ tduffy> Index: linux-kernel-rmr/patches/alt_dat_provider_makefile tduffy> =================================================================== tduffy> --- linux-kernel-rmr/patches/alt_dat_provider_makefile (revision 2483) tduffy> +++ linux-kernel-rmr/patches/alt_dat_provider_makefile (working copy) tduffy> @@ -16,7 +16,6 @@ PROVIDER_MODULES := \ tduffy> dapl_evd_kquery \ tduffy> dapl_evd_kcreate \ tduffy> dapl_evd_modify_upcall \ tduffy> - dapl_lmr_kcreate \ tduffy> dapl_cookie \ tduffy> dapl_cno_util \ tduffy> dapl_cr_accept \ tduffy> @@ -61,11 +60,7 @@ PROVIDER_MODULES := \ tduffy> dapl_ia_query \ tduffy> dapl_ia_util \ tduffy> dapl_llist \ tduffy> - dapl_lmr_free \ tduffy> - dapl_lmr_query \ tduffy> - dapl_lmr_sync_rdma_read \ tduffy> - dapl_lmr_sync_rdma_write \ tduffy> - dapl_lmr_util \ tduffy> + dapl_lmr \ tduffy> dapl_mr_util \ tduffy> dapl_provider \ tduffy> dapl_sp_util \ tduffy> @@ -73,16 +68,9 @@ PROVIDER_MODULES := \ tduffy> dapl_psp_create_any \ tduffy> dapl_psp_free \ tduffy> dapl_psp_query \ tduffy> - dapl_pz_create \ tduffy> - dapl_pz_free \ tduffy> - dapl_pz_query \ tduffy> - dapl_pz_util \ tduffy> + dapl_pz \ tduffy> dapl_ring_buffer_util \ tduffy> - dapl_rmr_bind \ tduffy> - dapl_rmr_create \ tduffy> - dapl_rmr_free \ tduffy> - dapl_rmr_query \ tduffy> - dapl_rmr_util \ tduffy> + dapl_rmr \ tduffy> dapl_rsp_create \ tduffy> dapl_rsp_free \ tduffy> dapl_rsp_query \ tduffy> @@ -103,7 +91,7 @@ PROVIDER_OBJS := $(foreach s, $(PROVIDER tduffy> KDAPL_DEBUG = 1 tduffy> ifeq (1,$(KDAPL_DEBUG)) tduffy> EXTRA_CFLAGS += -O0 -g tduffy> - EXTRA_CFLAGS += -DDAPL_DBG # -DDAPL_DBG_IO_TRC tduffy> + EXTRA_CFLAGS += -DDAPL_DBG tduffy> endif tduffy> tduffy> EXTRA_CFLAGS += -DDAPL_ATS -Idrivers/infiniband/include -I$(obj)/../dat -I$(obj)/../patches/ tduffy> @@ -121,4 +109,4 @@ default: tduffy> endif tduffy> tduffy> clean: tduffy> - rm -f *.o *.ko tduffy> + rm -f *.o *.ko .*.d .*.o.tmp *.mod.* .tmp_versions .*.cmd tduffy> Index: linux-kernel-rmr/patches/Makefile tduffy> =================================================================== tduffy> --- linux-kernel-rmr/patches/Makefile (revision 2483) tduffy> +++ linux-kernel-rmr/patches/Makefile (working copy) tduffy> @@ -20,4 +20,4 @@ default: tduffy> endif tduffy> tduffy> clean: tduffy> - rm -f *.o *.ko tduffy> + rm -rf *.o *.ko .*.d .*.o.tmp *.mod.* .tmp_versions .*.cmd tduffy> _______________________________________________ openib-general mailing list [email protected] http://openib.org/mailman/listinfo/openib-general To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
