[openib-general] Re: [PATCH 3/3] kDAPL: consolidate dapl_psp*.c into one file

James Lentini jlentini at netapp.com
Fri May 27 08:21:34 PDT 2005


Committed in revision 2502.

On Thu, 26 May 2005, Tom Duffy wrote:

tduffy> Signed-off-by: Tom Duffy <tduffy at sun.com>
tduffy> 
tduffy> diff -Nurp -X /home/tduffy/dontdiff linux-kernel-rsp/dat-provider/dapl_psp.c linux-kernel-psp/dat-provider/dapl_psp.c
tduffy> --- linux-kernel-rsp/dat-provider/dapl_psp.c	1969-12-31 16:00:00.000000000 -0800
tduffy> +++ linux-kernel-psp/dat-provider/dapl_psp.c	2005-05-25 15:11:42.274000000 -0700
tduffy> @@ -0,0 +1,446 @@
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: dapl_psp_create_any.c 2462 2005-05-24 02:28:24Z jlentini $
tduffy> + */
tduffy> +
tduffy> +#include "dapl.h"
tduffy> +#include "dapl_sp_util.h"
tduffy> +#include "dapl_ia_util.h"
tduffy> +#include "dapl_openib_util.h"
tduffy> +
tduffy> +/*
tduffy> + * dapl_psp_create_any
tduffy> + *
tduffy> + * Create a persistent Public Service Point that can recieve multiple
tduffy> + * requests for connections and generate multiple connection request
tduffy> + * instances that wil be delivered to the specified Event Dispatcher
tduffy> + * in a notification event. Differs from dapl_psp_create() in that
tduffy> + * the conn_qual is selected by the implementation and returned to
tduffy> + * the user.
tduffy> + *
tduffy> + * Input:
tduffy> + * 	ia_handle
tduffy> + * 	evd_handle
tduffy> + * 	psp_flags
tduffy> + *
tduffy> + * Output:
tduffy> + * 	conn_qual
tduffy> + * 	psp_handle
tduffy> + *
tduffy> + * Returns:
tduffy> + * 	DAT_SUCCESS
tduffy> + * 	DAT_INSUFFICIENT_RESOURCES
tduffy> + * 	DAT_INVALID_HANDLE
tduffy> + * 	DAT_INVALID_PARAMETER
tduffy> + * 	DAT_CONN_QUAL_IN_USE
tduffy> + * 	DAT_MODEL_NOT_SUPPORTED
tduffy> + */
tduffy> +u32 dapl_psp_create_any(DAT_IA_HANDLE ia_handle, DAT_CONN_QUAL *conn_qual,
tduffy> +			DAT_EVD_HANDLE evd_handle, enum dat_psp_flags psp_flags,
tduffy> +			DAT_PSP_HANDLE *psp_handle)
tduffy> +{
tduffy> +	static DAT_CONN_QUAL hint_conn_qual = 1000;	/* seed value */
tduffy> +	struct dapl_ia *ia_ptr;
tduffy> +	struct dapl_sp *sp_ptr;
tduffy> +	struct dapl_evd *evd_ptr;
tduffy> +	u32 status = DAT_SUCCESS;
tduffy> +	int i;
tduffy> +
tduffy> +	ia_ptr = (struct dapl_ia *)ia_handle;
tduffy> +
tduffy> +	if (DAPL_BAD_HANDLE(ia_ptr, DAPL_MAGIC_IA)) {
tduffy> +		status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_IA);
tduffy> +		goto bail;
tduffy> +	}
tduffy> +	if (DAPL_BAD_HANDLE(evd_handle, DAPL_MAGIC_EVD)) {
tduffy> +		status =
tduffy> +		    DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EVD_CR);
tduffy> +		goto bail;
tduffy> +	}
tduffy> +
tduffy> +	if (psp_handle == NULL) {
tduffy> +		status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG5);
tduffy> +		goto bail;
tduffy> +	}
tduffy> +	if (conn_qual == NULL) {
tduffy> +		status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG2);
tduffy> +		goto bail;
tduffy> +	}
tduffy> +
tduffy> +	evd_ptr = (struct dapl_evd *)evd_handle;
tduffy> +	if (!(evd_ptr->evd_flags & DAT_EVD_CR_FLAG)) {
tduffy> +		status = DAT_ERROR(DAT_INVALID_HANDLE,
tduffy> +				   DAT_INVALID_HANDLE_EVD_CR);
tduffy> +		goto bail;
tduffy> +	}
tduffy> +
tduffy> +	if (psp_flags != DAT_PSP_CONSUMER_FLAG &&
tduffy> +	    psp_flags != DAT_PSP_PROVIDER_FLAG) {
tduffy> +		status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG4);
tduffy> +		goto bail;
tduffy> +	}
tduffy> +
tduffy> +	/* Allocate PSP */
tduffy> +	sp_ptr = dapl_sp_alloc(ia_ptr, TRUE);
tduffy> +	if (sp_ptr == NULL) {
tduffy> +		status = DAT_ERROR(DAT_INSUFFICIENT_RESOURCES,
tduffy> +				   DAT_RESOURCE_MEMORY);
tduffy> +		goto bail;
tduffy> +	}
tduffy> +
tduffy> +	/*
tduffy> +	 * Fill out the args for a PSP
tduffy> +	 */
tduffy> +	sp_ptr->ia_handle = ia_handle;
tduffy> +	sp_ptr->evd_handle = evd_handle;
tduffy> +	sp_ptr->psp_flags = psp_flags;
tduffy> +	sp_ptr->ep_handle = NULL;
tduffy> +
tduffy> +	/*
tduffy> +	 * Take a reference on the EVD handle
tduffy> +	 */
tduffy> +	atomic_inc(&evd_ptr->evd_ref_count);
tduffy> +
tduffy> +	/* Link it onto the IA */
tduffy> +	dapl_ia_link_psp(ia_ptr, sp_ptr);
tduffy> +
tduffy> +	/* 
tduffy> +	 * Set up a listener for a connection. Connections can arrive
tduffy> +	 * even before this call returns!
tduffy> +	 */
tduffy> +	sp_ptr->state = DAPL_SP_STATE_PSP_LISTENING;
tduffy> +	sp_ptr->listening = TRUE;
tduffy> +
tduffy> +	/*
tduffy> +	 * If we have a big number of tries and we still haven't
tduffy> +	 * found a service_ID we can use, bail out with an error,
tduffy> +	 * something is wrong!
tduffy> +	 */
tduffy> +	for (i = 0, sp_ptr->conn_qual = hint_conn_qual; i < 100000; i++) {
tduffy> +		status = dapl_ib_setup_conn_listener(ia_ptr, sp_ptr);
tduffy> +		if (DAT_SUCCESS == status)
tduffy> +			break;
tduffy> +		else 
tduffy> +			sp_ptr->conn_qual++;
tduffy> +	}
tduffy> +	hint_conn_qual = sp_ptr->conn_qual + 1;
tduffy> +
tduffy> +	if (status != DAT_SUCCESS) {
tduffy> +		atomic_dec(&evd_ptr->evd_ref_count);
tduffy> +		sp_ptr->evd_handle = NULL;
tduffy> +		dapl_ia_unlink_sp(ia_ptr, sp_ptr);
tduffy> +		dapl_sp_dealloc(sp_ptr);
tduffy> +
tduffy> +		dapl_dbg_log(DAPL_DBG_TYPE_ERR, 
tduffy> +			"dapl_psp_create cannot set up conn listener: %x\n",
tduffy> +			status);
tduffy> +
tduffy> +		goto bail;
tduffy> +	}
tduffy> +
tduffy> +	/*
tduffy> +	 * Return handle to the user
tduffy> +	 */
tduffy> +	*conn_qual = sp_ptr->conn_qual;
tduffy> +	*psp_handle = (DAT_PSP_HANDLE) sp_ptr;
tduffy> +
tduffy> +bail:
tduffy> +	return status;
tduffy> +}
tduffy> +
tduffy> +/*
tduffy> + * dapl_psp_create
tduffy> + *
tduffy> + * Create a persistent Public Service Point that can recieve multiple
tduffy> + * requests for connections and generate multiple connection request
tduffy> + * instances that wil be delivered to the specified Event Dispatcher
tduffy> + * in a notification event.
tduffy> + *
tduffy> + * Input:
tduffy> + * 	ia_handle
tduffy> + * 	conn_qual
tduffy> + * 	evd_handle
tduffy> + * 	psp_flags
tduffy> + *
tduffy> + * Output:
tduffy> + * 	psp_handle
tduffy> + *
tduffy> + * Returns:
tduffy> + * 	DAT_SUCCESS
tduffy> + * 	DAT_INSUFFICIENT_RESOURCES
tduffy> + * 	DAT_INVALID_PARAMETER
tduffy> + * 	DAT_CONN_QUAL_IN_USE
tduffy> + * 	DAT_MODEL_NOT_SUPPORTED
tduffy> + */
tduffy> +u32 dapl_psp_create(DAT_IA_HANDLE ia_handle, DAT_CONN_QUAL conn_qual,
tduffy> +		    DAT_EVD_HANDLE evd_handle, enum dat_psp_flags psp_flags,
tduffy> +		    DAT_PSP_HANDLE *psp_handle)
tduffy> +{
tduffy> +	struct dapl_ia *ia_ptr;
tduffy> +	struct dapl_sp *sp_ptr;
tduffy> +	struct dapl_evd *evd_ptr;
tduffy> +	boolean_t sp_found;
tduffy> +	u32 status = DAT_SUCCESS;
tduffy> +
tduffy> +	ia_ptr = (struct dapl_ia *)ia_handle;
tduffy> +
tduffy> +	if (DAPL_BAD_HANDLE(ia_ptr, DAPL_MAGIC_IA)) {
tduffy> +		status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_IA);
tduffy> +		goto bail;
tduffy> +	}
tduffy> +	if (DAPL_BAD_HANDLE(evd_handle, DAPL_MAGIC_EVD)) {
tduffy> +		status = DAT_ERROR(DAT_INVALID_HANDLE,
tduffy> +				   DAT_INVALID_HANDLE_EVD_CR);
tduffy> +		goto bail;
tduffy> +	}
tduffy> +
tduffy> +	if (psp_handle == NULL) {
tduffy> +		status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG5);
tduffy> +		goto bail;
tduffy> +	}
tduffy> +
tduffy> +	evd_ptr = (struct dapl_evd *)evd_handle;
tduffy> +	if (!(evd_ptr->evd_flags & DAT_EVD_CR_FLAG)) {
tduffy> +		status = DAT_ERROR(DAT_INVALID_HANDLE,
tduffy> +				   DAT_INVALID_HANDLE_EVD_CR);
tduffy> +		goto bail;
tduffy> +	}
tduffy> +
tduffy> +	if (psp_flags != DAT_PSP_CONSUMER_FLAG &&
tduffy> +	    psp_flags != DAT_PSP_PROVIDER_FLAG) {
tduffy> +		status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG4);
tduffy> +		goto bail;
tduffy> +	}
tduffy> +
tduffy> +	/*
tduffy> +	 * See if we have a quiescent listener to use for this PSP, else
tduffy> +	 * create one and set it listening
tduffy> +	 */
tduffy> +	sp_ptr = dapl_ia_sp_search(ia_ptr, conn_qual, TRUE);
tduffy> +	sp_found = TRUE;
tduffy> +	if (sp_ptr == NULL) {
tduffy> +		/* Allocate PSP */
tduffy> +		sp_found = FALSE;
tduffy> +		sp_ptr = dapl_sp_alloc(ia_ptr, TRUE);
tduffy> +		if (sp_ptr == NULL) {
tduffy> +			status = DAT_ERROR(DAT_INSUFFICIENT_RESOURCES,
tduffy> +					   DAT_RESOURCE_MEMORY);
tduffy> +			goto bail;
tduffy> +		}
tduffy> +	} else if (sp_ptr->listening == TRUE) {
tduffy> +		status = DAT_ERROR(DAT_CONN_QUAL_IN_USE, 0);
tduffy> +		goto bail;
tduffy> +	}
tduffy> +
tduffy> +	/*
tduffy> +	 * Fill out the args for a PSP
tduffy> +	 */
tduffy> +	sp_ptr->ia_handle = ia_handle;
tduffy> +	sp_ptr->conn_qual = conn_qual;
tduffy> +	sp_ptr->evd_handle = evd_handle;
tduffy> +	sp_ptr->psp_flags = psp_flags;
tduffy> +	sp_ptr->ep_handle = NULL;
tduffy> +
tduffy> +	/*
tduffy> +	 * Take a reference on the EVD handle
tduffy> +	 */
tduffy> +	atomic_inc(&evd_ptr->evd_ref_count);
tduffy> +
tduffy> +	/* 
tduffy> +	 * Set up a listener for a connection. Connections can arrive
tduffy> +	 * even before this call returns!
tduffy> +	 */
tduffy> +	sp_ptr->state = DAPL_SP_STATE_PSP_LISTENING;
tduffy> +	sp_ptr->listening = TRUE;
tduffy> +
tduffy> +	/*
tduffy> +	 * If this is a new sp we need to add it to the IA queue, and set up
tduffy> +	 * a conn_listener.
tduffy> +	 */
tduffy> +	if (sp_found == FALSE) {
tduffy> +		/*
tduffy> +		 * Link it onto the IA before enabling it to receive conn
tduffy> +		 * requests
tduffy> +		 */
tduffy> +		dapl_ia_link_psp(ia_ptr, sp_ptr);
tduffy> +
tduffy> +		status = dapl_ib_setup_conn_listener(ia_ptr, sp_ptr);
tduffy> +
tduffy> +		if (status != DAT_SUCCESS) {
tduffy> +			/*
tduffy> +			 * Have a problem setting up the connection, something
tduffy> +			 * wrong!  Decrements the EVD refcount & release it.
tduffy> +			 */
tduffy> +			atomic_dec(&evd_ptr->evd_ref_count);
tduffy> +			sp_ptr->evd_handle = NULL;
tduffy> +			dapl_ia_unlink_sp(ia_ptr, sp_ptr);
tduffy> +			dapl_sp_dealloc(sp_ptr);
tduffy> +
tduffy> +			dapl_dbg_log(DAPL_DBG_TYPE_CM, "dapl_psp_create "
tduffy> +				     "setup_conn_listener failed: %x\n", 
tduffy> +				     status);
tduffy> +
tduffy> +			goto bail;
tduffy> +		}
tduffy> +	}
tduffy> +
tduffy> +	/*
tduffy> +	 * Return handle to the user
tduffy> +	 */
tduffy> +	*psp_handle = (DAT_PSP_HANDLE) sp_ptr;
tduffy> +
tduffy> +bail:
tduffy> +	return status;
tduffy> +}
tduffy> +
tduffy> +/*
tduffy> + * dapl_psp_free
tduffy> + *
tduffy> + * Destroy a specific instance of a Service Point.
tduffy> + *
tduffy> + * Input:
tduffy> + * 	psp_handle
tduffy> + *
tduffy> + * Output:
tduffy> + * 	none
tduffy> + *
tduffy> + * Returns:
tduffy> + * 	DAT_SUCCESS
tduffy> + * 	DAT_INVALID_PARAMETER
tduffy> + */
tduffy> +u32 dapl_psp_free(DAT_PSP_HANDLE psp_handle)
tduffy> +{
tduffy> +	struct dapl_ia *ia_ptr;
tduffy> +	struct dapl_sp *sp_ptr;
tduffy> +	DAPL_SP_STATE save_state;
tduffy> +	u32 status = DAT_SUCCESS;
tduffy> +
tduffy> +	sp_ptr = (struct dapl_sp *)psp_handle;
tduffy> +	/*
tduffy> +	 * Verify handle
tduffy> +	 */
tduffy> +	dapl_dbg_log(DAPL_DBG_TYPE_CM, ">>> dapl_psp_free %p\n", psp_handle);
tduffy> +
tduffy> +	if (DAPL_BAD_HANDLE(sp_ptr, DAPL_MAGIC_PSP)) {
tduffy> +		status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_PSP);
tduffy> +		goto bail;
tduffy> +	}
tduffy> +
tduffy> +	/* ia_ptr = (struct dapl_ia *)sp_ptr->header.owner_ia; */
tduffy> +	ia_ptr = sp_ptr->header.owner_ia;
tduffy> +	/* 
tduffy> +	 * Remove the connection listener if it has been established
tduffy> +	 * and there are no current connections in progress.
tduffy> +	 * If we defer removing the sp it becomes something of a zombie
tduffy> +	 * container until the last connection is disconnected, after
tduffy> +	 * which it will be cleaned up.
tduffy> +	 */
tduffy> +	spin_lock_irqsave(&sp_ptr->header.lock, sp_ptr->header.flags);
tduffy> +
tduffy> +	sp_ptr->listening = FALSE;
tduffy> +
tduffy> +	/*
tduffy> +	 * Release reference on EVD. If an error was encountered in a previous
tduffy> +	 * free the evd_handle will be NULL
tduffy> +	 */
tduffy> +	if (sp_ptr->evd_handle) {
tduffy> +		atomic_dec(&((struct dapl_evd *)sp_ptr->evd_handle)->
tduffy> +				   evd_ref_count);
tduffy> +		sp_ptr->evd_handle = NULL;
tduffy> +	}
tduffy> +
tduffy> +	/*
tduffy> +	 * Release the base resource if there are no outstanding
tduffy> +	 * connections; else the last disconnect on this PSP will free it
tduffy> +	 * up. The PSP is used to contain CR records for each connection,
tduffy> +	 * which contain information necessary to disconnect.
tduffy> +	 */
tduffy> +	dapl_dbg_log(DAPL_DBG_TYPE_CM,
tduffy> +		     ">>> dapl_psp_free: state %d cr_list_count %d\n",
tduffy> +		     sp_ptr->state, sp_ptr->cr_list_count);
tduffy> +	if ((sp_ptr->state == DAPL_SP_STATE_PSP_LISTENING ||
tduffy> +	     sp_ptr->state == DAPL_SP_STATE_PSP_PENDING) &&
tduffy> +	    sp_ptr->cr_list_count == 0) {
tduffy> +		save_state = sp_ptr->state;
tduffy> +		sp_ptr->state = DAPL_SP_STATE_FREE;
tduffy> +		spin_unlock_irqrestore(&sp_ptr->header.lock,
tduffy> +				       sp_ptr->header.flags);
tduffy> +
tduffy> +		status = dapl_ib_remove_conn_listener(ia_ptr, sp_ptr);
tduffy> +		if (status != DAT_SUCCESS) {
tduffy> +			/* revert to entry state on error */
tduffy> +			sp_ptr->state = save_state;
tduffy> +			goto bail;
tduffy> +		}
tduffy> +		dapl_ia_unlink_sp(ia_ptr, sp_ptr);
tduffy> +		dapl_sp_dealloc(sp_ptr);
tduffy> +	} else {
tduffy> +		/*
tduffy> +		 * The PSP is now in the pending state, where it will sit until
tduffy> +		 * the last connection terminates or the app uses the same
tduffy> +		 * ServiceID again, which will reactivate it.
tduffy> +		 */
tduffy> +		sp_ptr->state = DAPL_SP_STATE_PSP_PENDING;
tduffy> +		spin_unlock_irqrestore(&sp_ptr->header.lock, sp_ptr->header.flags);
tduffy> +		dapl_dbg_log(DAPL_DBG_TYPE_CM,
tduffy> +			     ">>> dapl_psp_free: PSP PENDING\n");
tduffy> +	}
tduffy> +
tduffy> +bail:
tduffy> +	return status;
tduffy> +}
tduffy> +
tduffy> +u32 dapl_psp_query(DAT_PSP_HANDLE psp_handle, struct dat_psp_param *psp_param)
tduffy> +{
tduffy> +	struct dapl_sp *sp_ptr;
tduffy> +	u32 status;
tduffy> +
tduffy> +	if (DAPL_BAD_HANDLE(psp_handle, DAPL_MAGIC_PSP) ||
tduffy> +	    ((struct dapl_sp *)psp_handle)->listening != TRUE) {
tduffy> +		status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_PSP);
tduffy> +		goto bail;
tduffy> +	}
tduffy> +
tduffy> +	if (NULL == psp_param) {
tduffy> +		status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG3);
tduffy> +		goto bail;
tduffy> +	}
tduffy> +
tduffy> +	sp_ptr = (struct dapl_sp *)psp_handle;
tduffy> +
tduffy> +	psp_param->ia_handle = sp_ptr->ia_handle;
tduffy> +	psp_param->conn_qual = sp_ptr->conn_qual;
tduffy> +	psp_param->evd_handle = sp_ptr->evd_handle;
tduffy> +	psp_param->psp_flags = sp_ptr->psp_flags;
tduffy> +
tduffy> +	status = DAT_SUCCESS;
tduffy> +
tduffy> +bail:
tduffy> +	return status;
tduffy> +}
tduffy> diff -Nurp -X /home/tduffy/dontdiff linux-kernel-rsp/dat-provider/dapl_psp_create_any.c linux-kernel-psp/dat-provider/dapl_psp_create_any.c
tduffy> --- linux-kernel-rsp/dat-provider/dapl_psp_create_any.c	2005-05-23 22:21:46.111018000 -0700
tduffy> +++ linux-kernel-psp/dat-provider/dapl_psp_create_any.c	1969-12-31 16:00:00.000000000 -0800
tduffy> @@ -1,177 +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: dapl_psp_create_any.c 2462 2005-05-24 02:28:24Z jlentini $
tduffy> - */
tduffy> -
tduffy> -#include "dapl.h"
tduffy> -#include "dapl_sp_util.h"
tduffy> -#include "dapl_ia_util.h"
tduffy> -#include "dapl_openib_util.h"
tduffy> -
tduffy> -/*
tduffy> - * dapl_psp_create_any
tduffy> - *
tduffy> - * Create a persistent Public Service Point that can recieve multiple
tduffy> - * requests for connections and generate multiple connection request
tduffy> - * instances that wil be delivered to the specified Event Dispatcher
tduffy> - * in a notification event. Differs from dapl_psp_create() in that
tduffy> - * the conn_qual is selected by the implementation and returned to
tduffy> - * the user.
tduffy> - *
tduffy> - * Input:
tduffy> - * 	ia_handle
tduffy> - * 	evd_handle
tduffy> - * 	psp_flags
tduffy> - *
tduffy> - * Output:
tduffy> - * 	conn_qual
tduffy> - * 	psp_handle
tduffy> - *
tduffy> - * Returns:
tduffy> - * 	DAT_SUCCESS
tduffy> - * 	DAT_INSUFFICIENT_RESOURCES
tduffy> - * 	DAT_INVALID_HANDLE
tduffy> - * 	DAT_INVALID_PARAMETER
tduffy> - * 	DAT_CONN_QUAL_IN_USE
tduffy> - * 	DAT_MODEL_NOT_SUPPORTED
tduffy> - */
tduffy> -u32 dapl_psp_create_any(DAT_IA_HANDLE ia_handle, DAT_CONN_QUAL *conn_qual,
tduffy> -			DAT_EVD_HANDLE evd_handle, enum dat_psp_flags psp_flags,
tduffy> -			DAT_PSP_HANDLE *psp_handle)
tduffy> -{
tduffy> -	static DAT_CONN_QUAL hint_conn_qual = 1000;	/* seed value */
tduffy> -	struct dapl_ia *ia_ptr;
tduffy> -	struct dapl_sp *sp_ptr;
tduffy> -	struct dapl_evd *evd_ptr;
tduffy> -	u32 status = DAT_SUCCESS;
tduffy> -	int i;
tduffy> -
tduffy> -	ia_ptr = (struct dapl_ia *)ia_handle;
tduffy> -
tduffy> -	if (DAPL_BAD_HANDLE(ia_ptr, DAPL_MAGIC_IA)) {
tduffy> -		status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_IA);
tduffy> -		goto bail;
tduffy> -	}
tduffy> -	if (DAPL_BAD_HANDLE(evd_handle, DAPL_MAGIC_EVD)) {
tduffy> -		status =
tduffy> -		    DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EVD_CR);
tduffy> -		goto bail;
tduffy> -	}
tduffy> -
tduffy> -	if (psp_handle == NULL) {
tduffy> -		status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG5);
tduffy> -		goto bail;
tduffy> -	}
tduffy> -	if (conn_qual == NULL) {
tduffy> -		status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG2);
tduffy> -		goto bail;
tduffy> -	}
tduffy> -
tduffy> -	evd_ptr = (struct dapl_evd *)evd_handle;
tduffy> -	if (!(evd_ptr->evd_flags & DAT_EVD_CR_FLAG)) {
tduffy> -		status =
tduffy> -		    DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EVD_CR);
tduffy> -		goto bail;
tduffy> -	}
tduffy> -
tduffy> -	if (psp_flags != DAT_PSP_CONSUMER_FLAG &&
tduffy> -	    psp_flags != DAT_PSP_PROVIDER_FLAG) {
tduffy> -		status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG4);
tduffy> -		goto bail;
tduffy> -	}
tduffy> -
tduffy> -	/* Allocate PSP */
tduffy> -	sp_ptr = dapl_sp_alloc(ia_ptr, TRUE);
tduffy> -	if (sp_ptr == NULL) {
tduffy> -		status =
tduffy> -		    DAT_ERROR(DAT_INSUFFICIENT_RESOURCES, DAT_RESOURCE_MEMORY);
tduffy> -		goto bail;
tduffy> -	}
tduffy> -
tduffy> -	/*
tduffy> -	 * Fill out the args for a PSP
tduffy> -	 */
tduffy> -	sp_ptr->ia_handle = ia_handle;
tduffy> -	sp_ptr->evd_handle = evd_handle;
tduffy> -	sp_ptr->psp_flags = psp_flags;
tduffy> -	sp_ptr->ep_handle = NULL;
tduffy> -
tduffy> -	/*
tduffy> -	 * Take a reference on the EVD handle
tduffy> -	 */
tduffy> -	atomic_inc(&evd_ptr->evd_ref_count);
tduffy> -
tduffy> -	/* Link it onto the IA */
tduffy> -	dapl_ia_link_psp(ia_ptr, sp_ptr);
tduffy> -
tduffy> -	/* 
tduffy> -	 * Set up a listener for a connection. Connections can arrive
tduffy> -	 * even before this call returns!
tduffy> -	 */
tduffy> -	sp_ptr->state = DAPL_SP_STATE_PSP_LISTENING;
tduffy> -	sp_ptr->listening = TRUE;
tduffy> -
tduffy> -	/*
tduffy> -	 * If we have a big number of tries and we still haven't
tduffy> -	 * found a service_ID we can use, bail out with an error,
tduffy> -	 * something is wrong!
tduffy> -	 */
tduffy> -	for (i = 0, sp_ptr->conn_qual = hint_conn_qual; i < 100000; i++) {
tduffy> -
tduffy> -		status = dapl_ib_setup_conn_listener(ia_ptr, sp_ptr);
tduffy> -
tduffy> -		if (DAT_SUCCESS == status)
tduffy> -			break;
tduffy> -		else 
tduffy> -			sp_ptr->conn_qual++;
tduffy> -	}
tduffy> -	hint_conn_qual = sp_ptr->conn_qual + 1;
tduffy> -
tduffy> -	if (status != DAT_SUCCESS) {
tduffy> -		atomic_dec(&evd_ptr->evd_ref_count);
tduffy> -		sp_ptr->evd_handle = NULL;
tduffy> -		dapl_ia_unlink_sp(ia_ptr, sp_ptr);
tduffy> -		dapl_sp_dealloc(sp_ptr);
tduffy> -
tduffy> -		dapl_dbg_log(DAPL_DBG_TYPE_ERR, 
tduffy> -			"dapl_psp_create cannot set up conn listener: %x\n",
tduffy> -			status);
tduffy> -
tduffy> -		goto bail;
tduffy> -	}
tduffy> -
tduffy> -	/*
tduffy> -	 * Return handle to the user
tduffy> -	 */
tduffy> -	*conn_qual = sp_ptr->conn_qual;
tduffy> -	*psp_handle = (DAT_PSP_HANDLE) sp_ptr;
tduffy> -
tduffy> -      bail:
tduffy> -	return status;
tduffy> -}
tduffy> diff -Nurp -X /home/tduffy/dontdiff linux-kernel-rsp/dat-provider/dapl_psp_create.c linux-kernel-psp/dat-provider/dapl_psp_create.c
tduffy> --- linux-kernel-rsp/dat-provider/dapl_psp_create.c	2005-05-23 22:21:46.086003000 -0700
tduffy> +++ linux-kernel-psp/dat-provider/dapl_psp_create.c	1969-12-31 16:00:00.000000000 -0800
tduffy> @@ -1,181 +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: dapl_psp_create.c 2462 2005-05-24 02:28:24Z jlentini $
tduffy> - */
tduffy> -
tduffy> -#include "dapl.h"
tduffy> -#include "dapl_sp_util.h"
tduffy> -#include "dapl_ia_util.h"
tduffy> -#include "dapl_openib_util.h"
tduffy> -
tduffy> -/*
tduffy> - * dapl_psp_create
tduffy> - *
tduffy> - * Create a persistent Public Service Point that can recieve multiple
tduffy> - * requests for connections and generate multiple connection request
tduffy> - * instances that wil be delivered to the specified Event Dispatcher
tduffy> - * in a notification event.
tduffy> - *
tduffy> - * Input:
tduffy> - * 	ia_handle
tduffy> - * 	conn_qual
tduffy> - * 	evd_handle
tduffy> - * 	psp_flags
tduffy> - *
tduffy> - * Output:
tduffy> - * 	psp_handle
tduffy> - *
tduffy> - * Returns:
tduffy> - * 	DAT_SUCCESS
tduffy> - * 	DAT_INSUFFICIENT_RESOURCES
tduffy> - * 	DAT_INVALID_PARAMETER
tduffy> - * 	DAT_CONN_QUAL_IN_USE
tduffy> - * 	DAT_MODEL_NOT_SUPPORTED
tduffy> - */
tduffy> -u32 dapl_psp_create(DAT_IA_HANDLE ia_handle, DAT_CONN_QUAL conn_qual,
tduffy> -		    DAT_EVD_HANDLE evd_handle, enum dat_psp_flags psp_flags,
tduffy> -		    DAT_PSP_HANDLE *psp_handle)
tduffy> -{
tduffy> -	struct dapl_ia *ia_ptr;
tduffy> -	struct dapl_sp *sp_ptr;
tduffy> -	struct dapl_evd *evd_ptr;
tduffy> -	boolean_t sp_found;
tduffy> -	u32 dat_status = DAT_SUCCESS;
tduffy> -
tduffy> -	ia_ptr = (struct dapl_ia *)ia_handle;
tduffy> -
tduffy> -	if (DAPL_BAD_HANDLE(ia_ptr, DAPL_MAGIC_IA)) {
tduffy> -		dat_status =
tduffy> -		    DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_IA);
tduffy> -		goto bail;
tduffy> -	}
tduffy> -	if (DAPL_BAD_HANDLE(evd_handle, DAPL_MAGIC_EVD)) {
tduffy> -		dat_status =
tduffy> -		    DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EVD_CR);
tduffy> -		goto bail;
tduffy> -	}
tduffy> -
tduffy> -	if (psp_handle == NULL) {
tduffy> -		dat_status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG5);
tduffy> -		goto bail;
tduffy> -	}
tduffy> -
tduffy> -	evd_ptr = (struct dapl_evd *)evd_handle;
tduffy> -	if (!(evd_ptr->evd_flags & DAT_EVD_CR_FLAG)) {
tduffy> -		dat_status =
tduffy> -		    DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EVD_CR);
tduffy> -		goto bail;
tduffy> -	}
tduffy> -
tduffy> -	if (psp_flags != DAT_PSP_CONSUMER_FLAG &&
tduffy> -	    psp_flags != DAT_PSP_PROVIDER_FLAG) {
tduffy> -		dat_status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG4);
tduffy> -		goto bail;
tduffy> -	}
tduffy> -
tduffy> -	/*
tduffy> -	 * See if we have a quiescent listener to use for this PSP, else
tduffy> -	 * create one and set it listening
tduffy> -	 */
tduffy> -	sp_ptr = dapl_ia_sp_search(ia_ptr, conn_qual, TRUE);
tduffy> -	sp_found = TRUE;
tduffy> -	if (sp_ptr == NULL) {
tduffy> -		/* Allocate PSP */
tduffy> -		sp_found = FALSE;
tduffy> -		sp_ptr = dapl_sp_alloc(ia_ptr, TRUE);
tduffy> -		if (sp_ptr == NULL) {
tduffy> -			dat_status =
tduffy> -			    DAT_ERROR(DAT_INSUFFICIENT_RESOURCES,
tduffy> -				      DAT_RESOURCE_MEMORY);
tduffy> -			goto bail;
tduffy> -		}
tduffy> -	} else if (sp_ptr->listening == TRUE) {
tduffy> -		dat_status = DAT_ERROR(DAT_CONN_QUAL_IN_USE, 0);
tduffy> -		goto bail;
tduffy> -	}
tduffy> -
tduffy> -	/*
tduffy> -	 * Fill out the args for a PSP
tduffy> -	 */
tduffy> -	sp_ptr->ia_handle = ia_handle;
tduffy> -	sp_ptr->conn_qual = conn_qual;
tduffy> -	sp_ptr->evd_handle = evd_handle;
tduffy> -	sp_ptr->psp_flags = psp_flags;
tduffy> -	sp_ptr->ep_handle = NULL;
tduffy> -
tduffy> -	/*
tduffy> -	 * Take a reference on the EVD handle
tduffy> -	 */
tduffy> -	atomic_inc(&evd_ptr->evd_ref_count);
tduffy> -
tduffy> -	/* 
tduffy> -	 * Set up a listener for a connection. Connections can arrive
tduffy> -	 * even before this call returns!
tduffy> -	 */
tduffy> -	sp_ptr->state = DAPL_SP_STATE_PSP_LISTENING;
tduffy> -	sp_ptr->listening = TRUE;
tduffy> -
tduffy> -	/*
tduffy> -	 * If this is a new sp we need to add it to the IA queue, and set up
tduffy> -	 * a conn_listener.
tduffy> -	 */
tduffy> -	if (sp_found == FALSE) {
tduffy> -		/* Link it onto the IA before enabling it to receive conn
tduffy> -		 * requests
tduffy> -		 */
tduffy> -		dapl_ia_link_psp(ia_ptr, sp_ptr);
tduffy> -
tduffy> -		dat_status = dapl_ib_setup_conn_listener(ia_ptr, sp_ptr);
tduffy> -
tduffy> -		if (dat_status != DAT_SUCCESS) {
tduffy> -			/*
tduffy> -			 * Have a problem setting up the connection, something
tduffy> -			 * wrong!  Decrements the EVD refcount & release it.
tduffy> -			 */
tduffy> -			atomic_dec(&evd_ptr->evd_ref_count);
tduffy> -			sp_ptr->evd_handle = NULL;
tduffy> -			dapl_ia_unlink_sp(ia_ptr, sp_ptr);
tduffy> -			dapl_sp_dealloc(sp_ptr);
tduffy> -
tduffy> -			dapl_dbg_log(DAPL_DBG_TYPE_CM, "dapl_psp_create "
tduffy> -				     "setup_conn_listener failed: %x\n", 
tduffy> -				     dat_status);
tduffy> -
tduffy> -			goto bail;
tduffy> -		}
tduffy> -	}
tduffy> -
tduffy> -	/*
tduffy> -	 * Return handle to the user
tduffy> -	 */
tduffy> -	*psp_handle = (DAT_PSP_HANDLE) sp_ptr;
tduffy> -
tduffy> -      bail:
tduffy> -	return dat_status;
tduffy> -}
tduffy> diff -Nurp -X /home/tduffy/dontdiff linux-kernel-rsp/dat-provider/dapl_psp_free.c linux-kernel-psp/dat-provider/dapl_psp_free.c
tduffy> --- linux-kernel-rsp/dat-provider/dapl_psp_free.c	2005-05-20 22:55:17.285001000 -0700
tduffy> +++ linux-kernel-psp/dat-provider/dapl_psp_free.c	1969-12-31 16:00:00.000000000 -0800
tduffy> @@ -1,131 +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: dapl_psp_free.c 2433 2005-05-21 04:11:03Z jlentini $
tduffy> - */
tduffy> -
tduffy> -#include "dapl.h"
tduffy> -#include "dapl_sp_util.h"
tduffy> -#include "dapl_ia_util.h"
tduffy> -#include "dapl_openib_util.h"
tduffy> -
tduffy> -/*
tduffy> - * dapl_psp_free
tduffy> - *
tduffy> - * Destroy a specific instance of a Service Point.
tduffy> - *
tduffy> - * Input:
tduffy> - * 	psp_handle
tduffy> - *
tduffy> - * Output:
tduffy> - * 	none
tduffy> - *
tduffy> - * Returns:
tduffy> - * 	DAT_SUCCESS
tduffy> - * 	DAT_INVALID_PARAMETER
tduffy> - */
tduffy> -u32 dapl_psp_free(DAT_PSP_HANDLE psp_handle)
tduffy> -{
tduffy> -	struct dapl_ia *ia_ptr;
tduffy> -	struct dapl_sp *sp_ptr;
tduffy> -	DAPL_SP_STATE save_state;
tduffy> -	u32 dat_status = DAT_SUCCESS;
tduffy> -
tduffy> -	sp_ptr = (struct dapl_sp *)psp_handle;
tduffy> -	/*
tduffy> -	 * Verify handle
tduffy> -	 */
tduffy> -	dapl_dbg_log(DAPL_DBG_TYPE_CM, ">>> dapl_psp_free %p\n", psp_handle);
tduffy> -
tduffy> -	if (DAPL_BAD_HANDLE(sp_ptr, DAPL_MAGIC_PSP)) {
tduffy> -		dat_status =
tduffy> -		    DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_PSP);
tduffy> -		goto bail;
tduffy> -	}
tduffy> -
tduffy> -	/* ia_ptr = (struct dapl_ia *)sp_ptr->header.owner_ia; */
tduffy> -	ia_ptr = sp_ptr->header.owner_ia;
tduffy> -	/* 
tduffy> -	 * Remove the connection listener if it has been established
tduffy> -	 * and there are no current connections in progress.
tduffy> -	 * If we defer removing the sp it becomes something of a zombie
tduffy> -	 * container until the last connection is disconnected, after
tduffy> -	 * which it will be cleaned up.
tduffy> -	 */
tduffy> -	spin_lock_irqsave(&sp_ptr->header.lock, sp_ptr->header.flags);
tduffy> -
tduffy> -	sp_ptr->listening = FALSE;
tduffy> -
tduffy> -	/* Release reference on EVD. If an error was encountered in a previous
tduffy> -	 * free the evd_handle will be NULL
tduffy> -	 */
tduffy> -	if (sp_ptr->evd_handle) {
tduffy> -		atomic_dec(&((struct dapl_evd *)sp_ptr->evd_handle)->
tduffy> -				   evd_ref_count);
tduffy> -		sp_ptr->evd_handle = NULL;
tduffy> -	}
tduffy> -
tduffy> -	/*
tduffy> -	 * Release the base resource if there are no outstanding
tduffy> -	 * connections; else the last disconnect on this PSP will free it
tduffy> -	 * up. The PSP is used to contain CR records for each connection,
tduffy> -	 * which contain information necessary to disconnect.
tduffy> -	 */
tduffy> -	dapl_dbg_log(DAPL_DBG_TYPE_CM,
tduffy> -		     ">>> dapl_psp_free: state %d cr_list_count %d\n",
tduffy> -		     sp_ptr->state, sp_ptr->cr_list_count);
tduffy> -	if ((sp_ptr->state == DAPL_SP_STATE_PSP_LISTENING ||
tduffy> -	     sp_ptr->state == DAPL_SP_STATE_PSP_PENDING) &&
tduffy> -	    sp_ptr->cr_list_count == 0) {
tduffy> -		save_state = sp_ptr->state;
tduffy> -		sp_ptr->state = DAPL_SP_STATE_FREE;
tduffy> -		spin_unlock_irqrestore(&sp_ptr->header.lock,
tduffy> -				       sp_ptr->header.flags);
tduffy> -
tduffy> -		dat_status = dapl_ib_remove_conn_listener(ia_ptr, sp_ptr);
tduffy> -		if (dat_status != DAT_SUCCESS) {
tduffy> -			/* revert to entry state on error */
tduffy> -			sp_ptr->state = save_state;
tduffy> -			goto bail;
tduffy> -		}
tduffy> -		dapl_ia_unlink_sp(ia_ptr, sp_ptr);
tduffy> -		dapl_sp_dealloc(sp_ptr);
tduffy> -	} else {
tduffy> -		/* The PSP is now in the pending state, where it will sit until
tduffy> -		 * the last connection terminates or the app uses the same
tduffy> -		 * ServiceID again, which will reactivate it.
tduffy> -		 */
tduffy> -		sp_ptr->state = DAPL_SP_STATE_PSP_PENDING;
tduffy> -		spin_unlock_irqrestore(&sp_ptr->header.lock, sp_ptr->header.flags);
tduffy> -		dapl_dbg_log(DAPL_DBG_TYPE_CM,
tduffy> -			     ">>> dapl_psp_free: PSP PENDING\n");
tduffy> -	}
tduffy> -
tduffy> -      bail:
tduffy> -	return dat_status;
tduffy> -}
tduffy> diff -Nurp -X /home/tduffy/dontdiff linux-kernel-rsp/dat-provider/dapl_psp_query.c linux-kernel-psp/dat-provider/dapl_psp_query.c
tduffy> --- linux-kernel-rsp/dat-provider/dapl_psp_query.c	2005-05-20 22:55:18.853022000 -0700
tduffy> +++ linux-kernel-psp/dat-provider/dapl_psp_query.c	1969-12-31 16:00:00.000000000 -0800
tduffy> @@ -1,62 +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: dapl_psp_query.c 2433 2005-05-21 04:11:03Z jlentini $
tduffy> - */
tduffy> -
tduffy> -#include "dapl.h"
tduffy> -
tduffy> -u32 dapl_psp_query(DAT_PSP_HANDLE psp_handle, struct dat_psp_param *psp_param)
tduffy> -{
tduffy> -	struct dapl_sp *sp_ptr;
tduffy> -	u32 status;
tduffy> -
tduffy> -	if (DAPL_BAD_HANDLE(psp_handle, DAPL_MAGIC_PSP) ||
tduffy> -	    ((struct dapl_sp *)psp_handle)->listening != TRUE) {
tduffy> -		status =
tduffy> -		    DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_PSP);
tduffy> -		goto bail;
tduffy> -	}
tduffy> -
tduffy> -	if (NULL == psp_param) {
tduffy> -		status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG3);
tduffy> -		goto bail;
tduffy> -	}
tduffy> -
tduffy> -	sp_ptr = (struct dapl_sp *)psp_handle;
tduffy> -
tduffy> -	psp_param->ia_handle = sp_ptr->ia_handle;
tduffy> -	psp_param->conn_qual = sp_ptr->conn_qual;
tduffy> -	psp_param->evd_handle = sp_ptr->evd_handle;
tduffy> -	psp_param->psp_flags = sp_ptr->psp_flags;
tduffy> -
tduffy> -	status = DAT_SUCCESS;
tduffy> -
tduffy> -bail:
tduffy> -	return status;
tduffy> -}
tduffy> diff -Nurp -X /home/tduffy/dontdiff linux-kernel-rsp/dat-provider/Makefile linux-kernel-psp/dat-provider/Makefile
tduffy> --- linux-kernel-rsp/dat-provider/Makefile	2005-05-25 15:01:00.683014000 -0700
tduffy> +++ linux-kernel-psp/dat-provider/Makefile	2005-05-25 15:12:34.054000000 -0700
tduffy> @@ -70,10 +70,7 @@ PROVIDER_MODULES := \
tduffy>          dapl_mr_util                  	\
tduffy>          dapl_provider                 	\
tduffy>          dapl_sp_util                  	\
tduffy> -        dapl_psp_create               	\
tduffy> -        dapl_psp_create_any           	\
tduffy> -        dapl_psp_free                 	\
tduffy> -        dapl_psp_query                	\
tduffy> +        dapl_psp                	\
tduffy>          dapl_pz                         \
tduffy>          dapl_ring_buffer_util         	\
tduffy>          dapl_rmr                 	\
tduffy> diff -Nurp -X /home/tduffy/dontdiff linux-kernel-rsp/patches/alt_dat_provider_makefile linux-kernel-psp/patches/alt_dat_provider_makefile
tduffy> --- linux-kernel-rsp/patches/alt_dat_provider_makefile	2005-05-25 14:53:43.453015000 -0700
tduffy> +++ linux-kernel-psp/patches/alt_dat_provider_makefile	2005-05-25 15:05:08.065003000 -0700
tduffy> @@ -64,10 +64,7 @@ PROVIDER_MODULES := \
tduffy>          dapl_mr_util                  	\
tduffy>          dapl_provider                 	\
tduffy>          dapl_sp_util                  	\
tduffy> -        dapl_psp_create               	\
tduffy> -        dapl_psp_create_any           	\
tduffy> -        dapl_psp_free                 	\
tduffy> -        dapl_psp_query                	\
tduffy> +        dapl_psp                	\
tduffy>          dapl_pz                  	\
tduffy>          dapl_ring_buffer_util         	\
tduffy>          dapl_rmr                        \
tduffy> 



More information about the general mailing list