[openib-general] [PATCHv3] kDAPL: remove use of HANDLE's (vs. r2564)
Tom Duffy
tduffy at sun.com
Mon Jun 6 16:48:45 PDT 2005
Rebased against r2564.
James, you think you will apply this? Does it need more work?
Signed-off-by: Tom Duffy <tduffy at sun.com>
dat-provider/dapl.h | 258 ++++-------
dat-provider/dapl_cr_accept.c | 106 +---
dat-provider/dapl_cr_callback.c | 147 ++----
dat-provider/dapl_cr_handoff.c | 2
dat-provider/dapl_cr_query.c | 10
dat-provider/dapl_cr_reject.c | 28 -
dat-provider/dapl_cr_util.c | 21
dat-provider/dapl_ep.c | 605 +++++++++++---------------
dat-provider/dapl_evd.c | 175 +++----
dat-provider/dapl_evd.h | 6
dat-provider/dapl_get_consumer_context.c | 80 ---
dat-provider/dapl_get_handle_type.c | 74 ---
dat-provider/dapl_ia_close.c | 19
dat-provider/dapl_ia_memtype_hint.c | 10
dat-provider/dapl_ia_open.c | 62 +-
dat-provider/dapl_ia_query.c | 20
dat-provider/dapl_ia_util.c | 180 +++----
dat-provider/dapl_lmr.c | 221 ++++-----
dat-provider/dapl_mr_util.c | 2
dat-provider/dapl_openib_cm.c | 64 +-
dat-provider/dapl_openib_qp.c | 10
dat-provider/dapl_openib_util.c | 12
dat-provider/dapl_openib_util.h | 14
dat-provider/dapl_provider.c | 5
dat-provider/dapl_psp.c | 105 ++--
dat-provider/dapl_pz.c | 79 +--
dat-provider/dapl_rmr.c | 78 +--
dat-provider/dapl_rsp.c | 87 +--
dat-provider/dapl_set_consumer_context.c | 74 ---
dat-provider/dapl_sp_util.c | 46 -
dat-provider/dapl_srq.c | 117 ++---
dat/api.c | 16
dat/dat.h | 469 ++++++++++----------
patches/alt_dat_provider_makefile | 3
test/dapltest/include/dapl_bpool.h | 10
test/dapltest/include/dapl_fft_util.h | 12
test/dapltest/include/dapl_performance_test.h | 14
test/dapltest/include/dapl_proto.h | 84 +--
test/dapltest/include/dapl_tdep.h | 12
test/dapltest/include/dapl_test_data.h | 20
test/dapltest/include/dapl_transaction_test.h | 18
test/dapltest/kdapl/kdapl_tdep_evd.c | 34 -
test/dapltest/test/dapl_bpool.c | 38 -
test/dapltest/test/dapl_client.c | 94 ++--
test/dapltest/test/dapl_cnxn.c | 4
test/dapltest/test/dapl_fft_connmgt.c | 4
test/dapltest/test/dapl_fft_dataxfer.c | 4
test/dapltest/test/dapl_fft_dataxfer_client.c | 12
test/dapltest/test/dapl_fft_endpoint.c | 118 ++---
test/dapltest/test/dapl_fft_hwconn.c | 22
test/dapltest/test/dapl_fft_mem.c | 42 -
test/dapltest/test/dapl_fft_pz.c | 90 +--
test/dapltest/test/dapl_fft_queryinfo.c | 190 ++++----
test/dapltest/test/dapl_fft_util.c | 102 ++--
test/dapltest/test/dapl_limit.c | 204 ++++----
test/dapltest/test/dapl_performance_client.c | 24 -
test/dapltest/test/dapl_performance_server.c | 68 +-
test/dapltest/test/dapl_performance_util.c | 88 +--
test/dapltest/test/dapl_server.c | 102 ++--
test/dapltest/test/dapl_test_util.c | 108 ++--
test/dapltest/test/dapl_transaction_test.c | 164 +++----
test/dapltest/test/dapl_transaction_util.c | 50 +-
62 files changed, 2227 insertions(+), 2710 deletions(-)
Index: linux-kernel/test/dapltest/test/dapl_performance_util.c
===================================================================
--- linux-kernel/test/dapltest/test/dapl_performance_util.c (revision 2564)
+++ linux-kernel/test/dapltest/test/dapl_performance_util.c (working copy)
@@ -33,7 +33,7 @@
boolean_t
DT_Performance_Test_Create (
Per_Test_Data_t *pt_ptr,
- DAT_IA_HANDLE *ia_handle,
+ struct dat_ia *ia,
struct sockaddr * remote_ia_addr,
boolean_t is_server,
boolean_t is_remote_little_endian,
@@ -61,10 +61,10 @@ DT_Performance_Test_Create (
test_ptr->remote_ia_addr = remote_ia_addr;
test_ptr->is_remote_little_endian = is_remote_little_endian;
test_ptr->base_port = (DAT_CONN_QUAL) pt_ptr->Server_Info.first_port_number;
- test_ptr->ia_handle = ia_handle;
+ test_ptr->ia = ia;
test_ptr->cmd = &pt_ptr->Params.u.Performance_Cmd;
- ret = dat_ia_query (test_ptr->ia_handle,
+ ret = dat_ia_query (test_ptr->ia,
NULL,
&test_ptr->ia_attr,
NULL);
@@ -95,17 +95,17 @@ DT_Performance_Test_Create (
test_ptr->creq_evd_length = DT_PERF_DFLT_EVD_LENGTH;
/* create a protection zone */
- ret = dat_pz_create (test_ptr->ia_handle, &test_ptr->pz_handle);
+ ret = dat_pz_create (test_ptr->ia, &test_ptr->pz);
if ( DAT_SUCCESS != ret)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_pz_create error: %s\n",
test_ptr->base_port, DT_RetToString (ret));
- test_ptr->pz_handle = DAT_HANDLE_NULL;
+ test_ptr->pz = NULL;
return FALSE;
}
/* create 4 EVDs - recv, request+RMR, conn-request, connect */
- ret = DT_Tdep_evd_create (test_ptr->ia_handle,
+ ret = DT_Tdep_evd_create (test_ptr->ia,
test_ptr->recv_evd_length,
test_ptr->cno_handle,
DAT_EVD_DTO_FLAG,
@@ -114,11 +114,11 @@ DT_Performance_Test_Create (
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_evd_create (recv) error: %s\n",
test_ptr->base_port, DT_RetToString (ret));
- test_ptr->recv_evd_hdl = DAT_HANDLE_NULL;
+ test_ptr->recv_evd_hdl = NULL;
return FALSE;
}
- ret = DT_Tdep_evd_create (test_ptr->ia_handle,
+ ret = DT_Tdep_evd_create (test_ptr->ia,
test_ptr->reqt_evd_length,
test_ptr->cno_handle,
DAT_EVD_DTO_FLAG | DAT_EVD_RMR_BIND_FLAG,
@@ -127,7 +127,7 @@ DT_Performance_Test_Create (
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: 0x%x dat_evd_create (request) error: %s\n",
test_ptr->reqt_evd_length,test_ptr->base_port, DT_RetToString (ret));
- test_ptr->reqt_evd_hdl = DAT_HANDLE_NULL;
+ test_ptr->reqt_evd_hdl = NULL;
return FALSE;
}
@@ -135,30 +135,30 @@ DT_Performance_Test_Create (
if ( is_server )
{
/* Client-side doesn't need CR events */
- ret = DT_Tdep_evd_create (test_ptr->ia_handle,
+ ret = DT_Tdep_evd_create (test_ptr->ia,
test_ptr->creq_evd_length,
- DAT_HANDLE_NULL,
+ NULL,
DAT_EVD_CR_FLAG,
&test_ptr->creq_evd_hdl); /* cr */
if ( DAT_SUCCESS != ret)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_evd_create (cr) error: %s\n",
test_ptr->base_port, DT_RetToString (ret));
- test_ptr->creq_evd_hdl = DAT_HANDLE_NULL;
+ test_ptr->creq_evd_hdl = NULL;
return FALSE;
}
}
- ret = DT_Tdep_evd_create (test_ptr->ia_handle,
+ ret = DT_Tdep_evd_create (test_ptr->ia,
test_ptr->conn_evd_length,
- DAT_HANDLE_NULL,
+ NULL,
DAT_EVD_CONNECTION_FLAG,
&test_ptr->conn_evd_hdl); /* conn */
if ( DAT_SUCCESS != ret)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_evd_create (conn) error: %s\n",
test_ptr->base_port, DT_RetToString (ret));
- test_ptr->conn_evd_hdl = DAT_HANDLE_NULL;
+ test_ptr->conn_evd_hdl = NULL;
return FALSE;
}
@@ -176,18 +176,18 @@ DT_Performance_Test_Create (
test_ptr->ep_context.ep_attr.max_request_dtos = pipeline_len;
/* Create EP */
- ret = dat_ep_create (test_ptr->ia_handle, /* IA */
- test_ptr->pz_handle, /* PZ */
+ ret = dat_ep_create (test_ptr->ia, /* IA */
+ test_ptr->pz, /* PZ */
test_ptr->recv_evd_hdl, /* recv */
test_ptr->reqt_evd_hdl, /* request */
test_ptr->conn_evd_hdl, /* connect */
&test_ptr->ep_context.ep_attr, /* EP attrs */
- &test_ptr->ep_context.ep_handle);
+ &test_ptr->ep_context.ep);
if ( DAT_SUCCESS != ret)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_ep_create error: %s\n",
test_ptr->base_port, DT_RetToString (ret));
- test_ptr->ep_context.ep_handle = DAT_HANDLE_NULL;
+ test_ptr->ep_context.ep = NULL;
return FALSE;
}
@@ -197,10 +197,10 @@ DT_Performance_Test_Create (
*/
test_ptr->ep_context.bp = DT_BpoolAlloc (test_ptr->pt_ptr,
phead,
- test_ptr->ia_handle,
- test_ptr->pz_handle,
- test_ptr->ep_context.ep_handle,
- DAT_HANDLE_NULL, /* rmr */
+ test_ptr->ia,
+ test_ptr->pz,
+ test_ptr->ep_context.ep,
+ NULL, /* rmr */
DT_PERF_SYNC_BUFF_SIZE,
2, /* 2 RMIs */
255, /* FIXME should query for this */
@@ -226,7 +226,7 @@ DT_Performance_Test_Create (
* Post recv and sync buffers
*/
if ( !DT_post_recv_buffer (phead,
- test_ptr->ep_context.ep_handle,
+ test_ptr->ep_context.ep,
test_ptr->ep_context.bp,
DT_PERF_SYNC_RECV_BUFFER_ID,
DT_PERF_SYNC_BUFF_SIZE) )
@@ -269,13 +269,13 @@ DT_Performance_Test_Destroy (
boolean_t is_server)
{
u32 ret;
- DAT_EP_HANDLE ep_handle;
+ struct dat_ep * ep;
DT_Tdep_Print_Head *phead;
int status = 0;
phead = pt_ptr->Params.phead;
- ep_handle = DAT_HANDLE_NULL;
+ ep = NULL;
/* Free the per-op buffers */
if (test_ptr->ep_context.op.bp)
@@ -310,9 +310,9 @@ DT_Performance_Test_Destroy (
* bailed out mid-setup, or ran to completion
* normally, so we use abrupt closure.
*/
- if (test_ptr->ep_context.ep_handle)
+ if (test_ptr->ep_context.ep)
{
- ret = dat_ep_disconnect (test_ptr->ep_context.ep_handle,
+ ret = dat_ep_disconnect (test_ptr->ep_context.ep,
DAT_CLOSE_ABRUPT_FLAG);
if (ret != DAT_SUCCESS)
{
@@ -323,7 +323,7 @@ DT_Performance_Test_Destroy (
status = 1;
}
else if (!DT_disco_event_wait ( phead, test_ptr->conn_evd_hdl,
- &ep_handle))
+ &ep))
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: bad disconnect event\n",
test_ptr->base_port);
@@ -331,10 +331,10 @@ DT_Performance_Test_Destroy (
}
}
- if ( DAT_HANDLE_NULL != ep_handle)
+ if ( NULL != ep)
{
/* Destroy the EP */
- ret = dat_ep_free (ep_handle);
+ ret = dat_ep_free (ep);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_ep_free error: %s\n",
@@ -394,9 +394,9 @@ DT_Performance_Test_Destroy (
}
/* clean up the PZ */
- if (test_ptr->pz_handle)
+ if (test_ptr->pz)
{
- ret = dat_pz_free (test_ptr->pz_handle);
+ ret = dat_pz_free (test_ptr->pz);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_pz_free error: %s\n",
@@ -417,7 +417,7 @@ DT_Performance_Test_Destroy (
boolean_t
DT_performance_post_rdma_op (
Performance_Ep_Context_t *ep_context,
- DAT_EVD_HANDLE reqt_evd_hdl,
+ struct dat_evd * reqt_evd_hdl,
Performance_Stats_t *stats)
{
unsigned int j;
@@ -456,7 +456,7 @@ DT_performance_post_rdma_op (
pre_ctxt_num = DT_Mdep_GetContextSwitchNum ();
pre_ts = DT_Mdep_GetTimeStamp ();
- ret = dat_ep_post_rdma_write (ep_context->ep_handle,
+ ret = dat_ep_post_rdma_write (ep_context->ep,
op->num_segs,
iov,
cookie,
@@ -473,7 +473,7 @@ DT_performance_post_rdma_op (
pre_ctxt_num = DT_Mdep_GetContextSwitchNum ();
pre_ts = DT_Mdep_GetTimeStamp ();
- ret = dat_ep_post_rdma_read (ep_context->ep_handle,
+ ret = dat_ep_post_rdma_read (ep_context->ep,
op->num_segs,
iov,
cookie,
@@ -502,17 +502,17 @@ DT_performance_post_rdma_op (
unsigned int
DT_performance_reap (
DT_Tdep_Print_Head *phead,
- DAT_EVD_HANDLE evd_handle,
+ struct dat_evd * evd,
Performance_Mode_Type mode,
Performance_Stats_t *stats)
{
if ( BLOCKING_MODE == mode )
{
- return DT_performance_wait (phead, evd_handle, stats);
+ return DT_performance_wait (phead, evd, stats);
}
else
{
- return DT_performance_poll (phead, evd_handle, stats);
+ return DT_performance_poll (phead, evd, stats);
}
}
@@ -520,7 +520,7 @@ DT_performance_reap (
unsigned int
DT_performance_wait (
DT_Tdep_Print_Head *phead,
- DAT_EVD_HANDLE evd_handle,
+ struct dat_evd * evd,
Performance_Stats_t *stats)
{
int i;
@@ -537,7 +537,7 @@ DT_performance_wait (
pre_ctxt_num = DT_Mdep_GetContextSwitchNum ();
pre_ts = DT_Mdep_GetTimeStamp ();
- ret = DT_Tdep_evd_wait ( evd_handle,
+ ret = DT_Tdep_evd_wait ( evd,
DAT_TIMEOUT_MAX,
&event);
@@ -571,7 +571,7 @@ DT_performance_wait (
pre_ctxt_num = DT_Mdep_GetContextSwitchNum ();
pre_ts = DT_Mdep_GetTimeStamp ();
- ret = DT_Tdep_evd_dequeue ( evd_handle,
+ ret = DT_Tdep_evd_dequeue ( evd,
&event);
post_ts = DT_Mdep_GetTimeStamp ();
@@ -611,7 +611,7 @@ DT_performance_wait (
unsigned int
DT_performance_poll (
DT_Tdep_Print_Head *phead,
- DAT_EVD_HANDLE evd_handle,
+ struct dat_evd * evd,
Performance_Stats_t *stats)
{
u32 ret;
@@ -626,7 +626,7 @@ DT_performance_poll (
pre_ctxt_num = DT_Mdep_GetContextSwitchNum ();
pre_ts = DT_Mdep_GetTimeStamp ();
- ret = DT_Tdep_evd_dequeue ( evd_handle,
+ ret = DT_Tdep_evd_dequeue ( evd,
&event);
post_ts = DT_Mdep_GetTimeStamp ();
Index: linux-kernel/test/dapltest/test/dapl_performance_client.c
===================================================================
--- linux-kernel/test/dapltest/test/dapl_performance_client.c (revision 2564)
+++ linux-kernel/test/dapltest/test/dapl_performance_client.c (working copy)
@@ -34,7 +34,7 @@ int
DT_Performance_Test_Client (
Params_t *params_ptr,
Per_Test_Data_t *pt_ptr,
- DAT_IA_HANDLE *ia_handle,
+ struct dat_ia *ia,
struct sockaddr * remote_ia_addr)
{
Performance_Test_t *test_ptr = NULL;
@@ -47,7 +47,7 @@ DT_Performance_Test_Client (
DT_Tdep_PT_Debug (1,(phead,"Client: Starting performance test\n"));
if ( !DT_Performance_Test_Create (pt_ptr,
- ia_handle,
+ ia,
remote_ia_addr,
FALSE,
pt_ptr->Server_Info.is_little_endian,
@@ -102,7 +102,7 @@ DT_Performance_Test_Client_Connect (
test_ptr->base_port, test_ptr->ep_context.port));
retry:
- ret = dat_ep_connect (test_ptr->ep_context.ep_handle,
+ ret = dat_ep_connect (test_ptr->ep_context.ep,
test_ptr->remote_ia_addr,
test_ptr->ep_context.port,
DAT_TIMEOUT_MAX,
@@ -119,7 +119,7 @@ retry:
/* wait for DAT_CONNECTION_EVENT_ESTABLISHED */
if (!DT_conn_event_wait (phead,
- test_ptr->ep_context.ep_handle,
+ test_ptr->ep_context.ep,
test_ptr->conn_evd_hdl,
&event_num))
{
@@ -297,7 +297,7 @@ DT_Performance_Test_Client_Phase2 (
{
pre_ts = DT_Mdep_GetTimeStamp ();
- ret = dat_ep_post_rdma_write (ep_context->ep_handle,
+ ret = dat_ep_post_rdma_write (ep_context->ep,
op->num_segs,
iov,
cookie,
@@ -308,7 +308,7 @@ DT_Performance_Test_Client_Phase2 (
{
pre_ts = DT_Mdep_GetTimeStamp ();
- ret = dat_ep_post_rdma_read (ep_context->ep_handle,
+ ret = dat_ep_post_rdma_read (ep_context->ep,
op->num_segs,
iov,
cookie,
@@ -375,9 +375,9 @@ DT_Performance_Test_Client_Exchange (
test_ptr->ep_context.op.bp =
DT_BpoolAlloc (test_ptr->pt_ptr,
phead,
- test_ptr->ia_handle,
- test_ptr->pz_handle,
- test_ptr->ep_context.ep_handle,
+ test_ptr->ia,
+ test_ptr->pz,
+ test_ptr->ep_context.ep,
test_ptr->reqt_evd_hdl,
test_ptr->ep_context.op.seg_size,
test_ptr->ep_context.op.num_segs,
@@ -406,7 +406,7 @@ DT_Performance_Test_Client_Exchange (
if ( !DT_dto_event_wait (phead, test_ptr->recv_evd_hdl, &dto_stat) ||
!DT_dto_check ( phead,
&dto_stat,
- test_ptr->ep_context.ep_handle,
+ test_ptr->ep_context.ep,
DT_PERF_SYNC_BUFF_SIZE,
dto_cookie,
"Recieve Sync_Msg") )
@@ -461,7 +461,7 @@ DT_Performance_Test_Client_Exchange (
DT_Tdep_PT_Debug (1,(phead,"Test[" F64x "]: Sending Sync Msg\n", test_ptr->base_port));
if (!DT_post_send_buffer (phead,
- test_ptr->ep_context.ep_handle,
+ test_ptr->ep_context.ep,
test_ptr->ep_context.bp,
DT_PERF_SYNC_SEND_BUFFER_ID,
DT_PERF_SYNC_BUFF_SIZE))
@@ -478,7 +478,7 @@ DT_Performance_Test_Client_Exchange (
if (!DT_dto_event_wait (phead, test_ptr->reqt_evd_hdl, &dto_stat) ||
!DT_dto_check ( phead,
&dto_stat,
- test_ptr->ep_context.ep_handle,
+ test_ptr->ep_context.ep,
DT_PERF_SYNC_BUFF_SIZE,
dto_cookie,
"Client_Sync_Send"))
Index: linux-kernel/test/dapltest/test/dapl_cnxn.c
===================================================================
--- linux-kernel/test/dapltest/test/dapl_cnxn.c (revision 2564)
+++ linux-kernel/test/dapltest/test/dapl_cnxn.c (working copy)
@@ -29,7 +29,7 @@
/****************************************************************************/
int
-get_ep_connection_state (DT_Tdep_Print_Head *phead, DAT_EP_HANDLE ep_handle)
+get_ep_connection_state (DT_Tdep_Print_Head *phead, struct dat_ep *ep)
{
enum dat_ep_state ep_state;
boolean_t in_dto_idle;
@@ -39,7 +39,7 @@ get_ep_connection_state (DT_Tdep_Print_H
char *req_status = "Idle";
- ret = dat_ep_get_status (ep_handle, &ep_state, &in_dto_idle,
+ ret = dat_ep_get_status (ep, &ep_state, &in_dto_idle,
&out_dto_idle);
if (ret != 0)
{
Index: linux-kernel/test/dapltest/test/dapl_server.c
===================================================================
--- linux-kernel/test/dapltest/test/dapl_server.c (revision 2564)
+++ linux-kernel/test/dapltest/test/dapl_server.c (working copy)
@@ -103,7 +103,7 @@ DT_cs_Server (Params_t * params_ptr)
ret = dat_ia_open (Server_Cmd->dapl_name,
DFLT_QLEN,
&ps_ptr->async_evd_hdl,
- &ps_ptr->ia_handle);
+ &ps_ptr->ia);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead,
@@ -111,28 +111,28 @@ DT_cs_Server (Params_t * params_ptr)
module,
Server_Cmd->dapl_name,
DT_RetToString (ret));
- ps_ptr->ia_handle = DAT_HANDLE_NULL;
+ ps_ptr->ia = NULL;
status = 1;
goto server_exit;
}
DT_Tdep_PT_Debug (1,(phead,"%s: IA %s opened\n", module, Server_Cmd->dapl_name));
/* Create a PZ */
- ret = dat_pz_create (ps_ptr->ia_handle, &ps_ptr->pz_handle);
+ ret = dat_pz_create (ps_ptr->ia, &ps_ptr->pz);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead,
"%s: dat_pz_create error: %s\n",
module,
DT_RetToString (ret));
- ps_ptr->pz_handle = DAT_HANDLE_NULL;
+ ps_ptr->pz = NULL;
status = 1;
goto server_exit;
}
DT_Tdep_PT_Debug (1,(phead,"%s: PZ created\n", module));
/* Create 4 events - recv, request, connection-request, connect */
- ret = DT_Tdep_evd_create (ps_ptr->ia_handle,
+ ret = DT_Tdep_evd_create (ps_ptr->ia,
DFLT_QLEN,
NULL,
DAT_EVD_DTO_FLAG,
@@ -142,11 +142,11 @@ DT_cs_Server (Params_t * params_ptr)
DT_Tdep_PT_Printf (phead,
"%s: dat_evd_create (recv) failed %s\n",
module, DT_RetToString (ret));
- ps_ptr->recv_evd_hdl = DAT_HANDLE_NULL;
+ ps_ptr->recv_evd_hdl = NULL;
status = 1;
goto server_exit;
}
- ret = DT_Tdep_evd_create (ps_ptr->ia_handle,
+ ret = DT_Tdep_evd_create (ps_ptr->ia,
DFLT_QLEN,
NULL,
DAT_EVD_DTO_FLAG | DAT_EVD_RMR_BIND_FLAG,
@@ -156,11 +156,11 @@ DT_cs_Server (Params_t * params_ptr)
DT_Tdep_PT_Printf (phead,
"%s: dat_evd_create (send) failed %s\n",
module, DT_RetToString (ret));
- ps_ptr->reqt_evd_hdl = DAT_HANDLE_NULL;
+ ps_ptr->reqt_evd_hdl = NULL;
status = 1;
goto server_exit;
}
- ret = DT_Tdep_evd_create (ps_ptr->ia_handle,
+ ret = DT_Tdep_evd_create (ps_ptr->ia,
DFLT_QLEN,
NULL,
DAT_EVD_CR_FLAG,
@@ -170,11 +170,11 @@ DT_cs_Server (Params_t * params_ptr)
DT_Tdep_PT_Printf (phead,
"%s: dat_evd_create (cr) failed %s\n",
module, DT_RetToString (ret));
- ps_ptr->creq_evd_hdl = DAT_HANDLE_NULL;
+ ps_ptr->creq_evd_hdl = NULL;
status = 1;
goto server_exit;
}
- ret = DT_Tdep_evd_create (ps_ptr->ia_handle,
+ ret = DT_Tdep_evd_create (ps_ptr->ia,
DFLT_QLEN,
NULL,
DAT_EVD_CONNECTION_FLAG,
@@ -184,44 +184,44 @@ DT_cs_Server (Params_t * params_ptr)
DT_Tdep_PT_Printf (phead,
"%s: dat_evd_create (conn) failed %s\n",
module, DT_RetToString (ret));
- ps_ptr->conn_evd_hdl = DAT_HANDLE_NULL;
+ ps_ptr->conn_evd_hdl = NULL;
status = 1;
goto server_exit;
}
/* Create the EP */
- ret = dat_ep_create (ps_ptr->ia_handle, /* IA */
- ps_ptr->pz_handle, /* PZ */
+ ret = dat_ep_create (ps_ptr->ia, /* IA */
+ ps_ptr->pz, /* PZ */
ps_ptr->recv_evd_hdl, /* recv */
ps_ptr->reqt_evd_hdl, /* request */
ps_ptr->conn_evd_hdl, /* connect */
(struct dat_ep_attr *) NULL,
- &ps_ptr->ep_handle);
+ &ps_ptr->ep);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead,
"%s: dat_ep_create error: %s\n",
module,
DT_RetToString (ret));
- ps_ptr->ep_handle = DAT_HANDLE_NULL;
+ ps_ptr->ep = NULL;
status = 1;
goto server_exit;
}
DT_Tdep_PT_Debug (1,(phead,"%s: EP created\n", module));
/* Create PSP */
- ret = dat_psp_create (ps_ptr->ia_handle,
+ ret = dat_psp_create (ps_ptr->ia,
SERVER_PORT_NUMBER,
ps_ptr->creq_evd_hdl,
DAT_PSP_CONSUMER_FLAG,
- &ps_ptr->psp_handle);
+ &ps_ptr->psp);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead,
"%s: dat_psp_create error: %s\n",
module,
DT_RetToString (ret));
- ps_ptr->psp_handle = DAT_HANDLE_NULL;
+ ps_ptr->psp = NULL;
status = 1;
goto server_exit;
}
@@ -233,10 +233,10 @@ DT_cs_Server (Params_t * params_ptr)
*/
ps_ptr->bpool = DT_BpoolAlloc (NULL,
phead,
- ps_ptr->ia_handle,
- ps_ptr->pz_handle,
- ps_ptr->ep_handle,
- DAT_HANDLE_NULL, /* no RMR */
+ ps_ptr->ia,
+ ps_ptr->pz,
+ ps_ptr->ep,
+ NULL, /* no RMR */
DT_RoundSize (sizeof (Transaction_Cmd_t), 8192),
3, /* num_buffers */
256, /* FIXME query for this value */
@@ -275,7 +275,7 @@ DT_cs_Server (Params_t * params_ptr)
*/
for (;/* EVER */;)
{
- DAT_CR_HANDLE cr_handle;
+ struct dat_cr * cr;
struct dat_cr_arrival_event_data cr_stat;
enum dat_event_number event_num;
@@ -299,7 +299,7 @@ DT_cs_Server (Params_t * params_ptr)
/* Server_Info, Client_Info, Params set up below */
/* Gather whatever info we want about defaults */
- if (!DT_query (pt_ptr, ps_ptr->ia_handle, ps_ptr->ep_handle))
+ if (!DT_query (pt_ptr, ps_ptr->ia, ps_ptr->ep))
{
status = 1;
goto server_exit;
@@ -308,7 +308,7 @@ DT_cs_Server (Params_t * params_ptr)
/* Post recv buffers for ClientInfo and Transaction_Cmd_t */
DT_Tdep_PT_Debug (1,(phead,"%s: Posting 2 recvs\n", module));
if (!DT_post_recv_buffer (phead,
- ps_ptr->ep_handle,
+ ps_ptr->ep,
ps_ptr->bpool,
0,
DT_Bpool_GetBuffSize (ps_ptr->bpool, 0)))
@@ -320,7 +320,7 @@ DT_cs_Server (Params_t * params_ptr)
goto server_exit;
}
if (!DT_post_recv_buffer (phead,
- ps_ptr->ep_handle,
+ ps_ptr->ep,
ps_ptr->bpool,
1,
DT_Bpool_GetBuffSize (ps_ptr->bpool, 1)))
@@ -343,9 +343,9 @@ DT_cs_Server (Params_t * params_ptr)
if (!DT_cr_event_wait (phead, ps_ptr->creq_evd_hdl, &cr_stat) ||
!DT_cr_check (phead,
&cr_stat,
- ps_ptr->psp_handle,
+ ps_ptr->psp,
SERVER_PORT_NUMBER,
- &cr_handle,
+ &cr,
module))
{
@@ -357,7 +357,7 @@ DT_cs_Server (Params_t * params_ptr)
}
DT_Tdep_PT_Debug (1,(phead,"%s: Accepting Connection Request\n", module));
- ret = dat_cr_accept (cr_handle, ps_ptr->ep_handle, 0, (void *)0);
+ ret = dat_cr_accept (cr, ps_ptr->ep, 0, (void *)0);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead,
@@ -370,7 +370,7 @@ DT_cs_Server (Params_t * params_ptr)
DT_Tdep_PT_Debug (1,(phead,"%s: Awaiting connection ...\n", module));
if (!DT_conn_event_wait (phead,
- ps_ptr->ep_handle,
+ ps_ptr->ep,
ps_ptr->conn_evd_hdl,
&event_num))
{
@@ -384,7 +384,7 @@ DT_cs_Server (Params_t * params_ptr)
if (DT_dapltest_debug)
{
DT_Tdep_PT_Debug (1,(phead, "%s: Connected!\n", module));
- get_ep_connection_state (phead, ps_ptr->ep_handle);
+ get_ep_connection_state (phead, ps_ptr->ep);
}
/* Wait for Client_Info */
@@ -395,7 +395,7 @@ DT_cs_Server (Params_t * params_ptr)
if (!DT_dto_event_wait (phead, ps_ptr->recv_evd_hdl, &dto_stat) ||
!DT_dto_check ( phead,
&dto_stat,
- ps_ptr->ep_handle,
+ ps_ptr->ep,
DT_Bpool_GetBuffSize (ps_ptr->bpool, 0),
dto_cookie,
"Client_Info_Recv"))
@@ -420,7 +420,7 @@ DT_cs_Server (Params_t * params_ptr)
if (!DT_dto_event_wait (phead, ps_ptr->recv_evd_hdl, &dto_stat) ||
!DT_dto_check ( phead,
&dto_stat,
- ps_ptr->ep_handle,
+ ps_ptr->ep,
DT_Bpool_GetBuffSize (ps_ptr->bpool, 1),
dto_cookie,
"Client_Cmd_Recv"))
@@ -585,7 +585,7 @@ DT_cs_Server (Params_t * params_ptr)
/* Send the Server_Info */
DT_Tdep_PT_Debug (1,(phead,"%s: Send Server_Info\n", module));
- if (!DT_post_send_buffer ( phead, ps_ptr->ep_handle,
+ if (!DT_post_send_buffer ( phead, ps_ptr->ep,
ps_ptr->bpool,
2,
DT_Bpool_GetBuffSize (ps_ptr->bpool, 2)))
@@ -601,7 +601,7 @@ DT_cs_Server (Params_t * params_ptr)
if (!DT_dto_event_wait (phead, ps_ptr->reqt_evd_hdl, &dto_stat) ||
!DT_dto_check ( phead,
&dto_stat,
- ps_ptr->ep_handle,
+ ps_ptr->ep,
DT_Bpool_GetBuffSize (ps_ptr->bpool, 2),
dto_cookie,
"Server_Info_Send"))
@@ -619,7 +619,7 @@ DT_cs_Server (Params_t * params_ptr)
/* we passed the pt_ptr to the thread and must now 'forget' it */
pt_ptr = NULL;
- ret = dat_ep_disconnect (ps_ptr->ep_handle, DAT_CLOSE_GRACEFUL_FLAG);
+ ret = dat_ep_disconnect (ps_ptr->ep, DAT_CLOSE_GRACEFUL_FLAG);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "%s: dat_ep_disconnect fails: %s\n",
@@ -635,7 +635,7 @@ DT_cs_Server (Params_t * params_ptr)
}
/* reset the EP to get back into the game */
- dat_ep_reset (ps_ptr->ep_handle);
+ dat_ep_reset (ps_ptr->ep);
DT_Tdep_PT_Debug (1,(phead,"%s: Waiting for another client...\n", module));
} /* end loop accepting connections */
@@ -669,9 +669,9 @@ server_exit:
* we also get here on error, hence abrupt closure to
* flush any lingering buffers posted.
*/
- if (ps_ptr->ep_handle)
+ if (ps_ptr->ep)
{
- ret = dat_ep_disconnect (ps_ptr->ep_handle,
+ ret = dat_ep_disconnect (ps_ptr->ep,
DAT_CLOSE_ABRUPT_FLAG);
if (ret != DAT_SUCCESS)
{
@@ -704,9 +704,9 @@ server_exit:
}
/* Free the PSP */
- if (ps_ptr->psp_handle)
+ if (ps_ptr->psp)
{
- ret = dat_psp_free (ps_ptr->psp_handle);
+ ret = dat_psp_free (ps_ptr->psp);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "%s: dat_psp_free error: %s\n",
@@ -718,9 +718,9 @@ server_exit:
}
/* Free the EP */
- if (ps_ptr->ep_handle)
+ if (ps_ptr->ep)
{
- ret = dat_ep_free (ps_ptr->ep_handle);
+ ret = dat_ep_free (ps_ptr->ep);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "%s: dat_ep_free error: %s\n",
@@ -781,9 +781,9 @@ server_exit:
}
/* Free the PZ */
- if (ps_ptr->pz_handle)
+ if (ps_ptr->pz)
{
- ret = dat_pz_free (ps_ptr->pz_handle);
+ ret = dat_pz_free (ps_ptr->pz);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "%s: dat_pz_free error: %s\n",
@@ -794,17 +794,17 @@ server_exit:
}
/* Close the IA */
- if (ps_ptr->ia_handle)
+ if (ps_ptr->ia)
{
/* dat_ia_close cleans up async evd handle, too */
- ret = dat_ia_close (ps_ptr->ia_handle, DAT_CLOSE_GRACEFUL_FLAG);
+ ret = dat_ia_close (ps_ptr->ia, DAT_CLOSE_GRACEFUL_FLAG);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead,
"%s: dat_ia_close (graceful) error: %s\n",
module, DT_RetToString (ret));
status = 1;
- ret = dat_ia_close (ps_ptr->ia_handle, DAT_CLOSE_ABRUPT_FLAG);
+ ret = dat_ia_close (ps_ptr->ia, DAT_CLOSE_ABRUPT_FLAG);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead,
@@ -871,7 +871,7 @@ send_control_data (
sizeof (Server_Info_t));
DT_Server_Info_Endian ((Server_Info_t *) buffp);
- if (!DT_post_send_buffer ( phead, ps_ptr->ep_handle,
+ if (!DT_post_send_buffer ( phead, ps_ptr->ep,
ps_ptr->bpool,
2,
DT_Bpool_GetBuffSize (ps_ptr->bpool, 2)))
@@ -886,7 +886,7 @@ send_control_data (
if (!DT_dto_event_wait (phead, ps_ptr->reqt_evd_hdl, &dto_stat) ||
!DT_dto_check (phead,
&dto_stat,
- ps_ptr->ep_handle,
+ ps_ptr->ep,
DT_Bpool_GetBuffSize (ps_ptr->bpool, 2),
dto_cookie,
"Server_Info_Send"))
Index: linux-kernel/test/dapltest/test/dapl_fft_util.c
===================================================================
--- linux-kernel/test/dapltest/test/dapl_fft_util.c (revision 2564)
+++ linux-kernel/test/dapltest/test/dapl_fft_util.c (working copy)
@@ -55,22 +55,22 @@ void DT_assert_fail (DT_Tdep_Print_Head
}
/* helper function to open an IA */
-int DT_ia_open (char *dev_name, DAT_IA_HANDLE *ia_handle)
+int DT_ia_open (char *dev_name, struct dat_ia **ia)
{
- DAT_EVD_HANDLE evd_handle;
- evd_handle = DAT_HANDLE_NULL;
- return dat_ia_open (dev_name, DEFAULT_QUEUE_LEN, &evd_handle, ia_handle);
+ struct dat_evd *evd;
+ evd = NULL;
+ return dat_ia_open (dev_name, DEFAULT_QUEUE_LEN, &evd, ia);
}
/* helper function to create an endpoint and its associated EVDs */
int DT_ep_create (Params_t *params_ptr,
- DAT_IA_HANDLE ia_handle,
- DAT_PZ_HANDLE pz_handle,
- DAT_EVD_HANDLE *cr_evd,
- DAT_EVD_HANDLE *conn_evd,
- DAT_EVD_HANDLE *send_evd,
- DAT_EVD_HANDLE *recv_evd,
- DAT_EP_HANDLE *ep_handle)
+ struct dat_ia *ia,
+ struct dat_pz *pz,
+ struct dat_evd **cr_evd,
+ struct dat_evd **conn_evd,
+ struct dat_evd **send_evd,
+ struct dat_evd **recv_evd,
+ struct dat_ep **ep)
{
u32 status;
DT_Tdep_Print_Head *phead;
@@ -80,7 +80,7 @@ int DT_ep_create (Params_t *params_ptr,
*cr_evd = NULL;
phead = params_ptr->phead;
- status = DT_Tdep_evd_create (ia_handle, DEFAULT_QUEUE_LEN, DAT_HANDLE_NULL,
+ status = DT_Tdep_evd_create (ia, DEFAULT_QUEUE_LEN, NULL,
DAT_EVD_CR_FLAG, cr_evd);
if (status != DAT_SUCCESS)
{
@@ -88,7 +88,7 @@ int DT_ep_create (Params_t *params_ptr,
return status;
}
- status = DT_Tdep_evd_create (ia_handle, DEFAULT_QUEUE_LEN, DAT_HANDLE_NULL,
+ status = DT_Tdep_evd_create (ia, DEFAULT_QUEUE_LEN, NULL,
DAT_EVD_CONNECTION_FLAG, conn_evd);
if (status != DAT_SUCCESS)
{
@@ -96,7 +96,7 @@ int DT_ep_create (Params_t *params_ptr,
return status;
}
- status = DT_Tdep_evd_create (ia_handle, DEFAULT_QUEUE_LEN, DAT_HANDLE_NULL,
+ status = DT_Tdep_evd_create (ia, DEFAULT_QUEUE_LEN, NULL,
DAT_EVD_DTO_FLAG | DAT_EVD_RMR_BIND_FLAG,
send_evd);
if (status != DAT_SUCCESS)
@@ -105,7 +105,7 @@ int DT_ep_create (Params_t *params_ptr,
return status;
}
- status = DT_Tdep_evd_create (ia_handle, DEFAULT_QUEUE_LEN, DAT_HANDLE_NULL,
+ status = DT_Tdep_evd_create (ia, DEFAULT_QUEUE_LEN, NULL,
DAT_EVD_DTO_FLAG, recv_evd);
if (status != DAT_SUCCESS)
{
@@ -113,8 +113,8 @@ int DT_ep_create (Params_t *params_ptr,
return status;
}
- status = dat_ep_create (ia_handle, pz_handle, *recv_evd,
- *send_evd, *conn_evd, NULL, ep_handle);
+ status = dat_ep_create (ia, pz, *recv_evd,
+ *send_evd, *conn_evd, NULL, ep);
if (status != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "dat_ep_create failed %s\n", DT_RetToString (status));
@@ -125,15 +125,15 @@ int DT_ep_create (Params_t *params_ptr,
/* function that initializes the connection struct */
void DT_fft_init_conn_struct (FFT_Connection_t *conn)
{
- conn->ia_handle = NULL;
- conn->pz_handle = NULL;
- conn->psp_handle = NULL;
- conn->ep_handle = NULL;
+ conn->ia = NULL;
+ conn->pz = NULL;
+ conn->psp = NULL;
+ conn->ep = NULL;
conn->cr_evd = NULL;
conn->send_evd = NULL;
conn->conn_evd = NULL;
conn->recv_evd = NULL;
- conn->cr_handle = NULL;
+ conn->cr = NULL;
conn->remote_netaddr = NULL;
conn->bpool = NULL;
conn->pt_ptr = NULL;
@@ -154,27 +154,27 @@ void DT_fft_init_client (Params_t *param
DT_fft_init_conn_struct (conn);
/* open the IA */
- rc = DT_ia_open (cmd->device_name, &conn->ia_handle);
+ rc = DT_ia_open (cmd->device_name, &conn->ia);
if (rc != DAT_SUCCESS)
{
/* make sure the handle has an invalid value */
- conn->ia_handle = NULL;
+ conn->ia = NULL;
}
DT_assert_dat (phead, rc == DAT_SUCCESS);
/* create a PZ */
- rc = dat_pz_create (conn->ia_handle, &conn->pz_handle);
+ rc = dat_pz_create (conn->ia, &conn->pz);
DT_assert_dat (phead, rc == DAT_SUCCESS);
/* create an EP and its EVDs */
rc =DT_ep_create (params_ptr,
- conn->ia_handle,
- conn->pz_handle,
+ conn->ia,
+ conn->pz,
&conn->cr_evd,
&conn->conn_evd,
&conn->send_evd,
&conn->recv_evd,
- &conn->ep_handle);
+ &conn->ep);
DT_assert_dat (phead, rc == DAT_SUCCESS);
/* if a server name is given, allocate memory for a net address and set it
@@ -198,11 +198,11 @@ int DT_fft_destroy_conn_struct (Params_t
DT_Tdep_Print_Head *phead;
phead = params_ptr->phead;
- if (conn->ep_handle)
+ if (conn->ep)
{
if (conn->connected)
{
- rc = dat_ep_disconnect (conn->ep_handle, DAT_CLOSE_DEFAULT);
+ rc = dat_ep_disconnect (conn->ep, DAT_CLOSE_DEFAULT);
DT_assert_clean (phead, rc == DAT_SUCCESS);
if (!DT_disco_event_wait ( phead, conn->cr_evd, NULL ))
@@ -211,16 +211,16 @@ int DT_fft_destroy_conn_struct (Params_t
DT_Tdep_PT_Printf (phead, "DT_fft_destroy_conn_struct: bad disconnect event\n");
}
}
- rc = dat_ep_free (conn->ep_handle);
+ rc = dat_ep_free (conn->ep);
DT_assert_clean (phead, rc == DAT_SUCCESS);
}
if (conn->bpool)
{
DT_Bpool_Destroy (NULL, phead, conn->bpool);
}
- if (conn->psp_handle)
+ if (conn->psp)
{
- rc = dat_psp_free (conn->psp_handle);
+ rc = dat_psp_free (conn->psp);
DT_assert_clean (phead, rc == DAT_SUCCESS);
}
if (conn->cr_evd)
@@ -247,14 +247,14 @@ int DT_fft_destroy_conn_struct (Params_t
{
DT_Free_Per_Test_Data (conn->pt_ptr);
}
- if (conn->pz_handle)
+ if (conn->pz)
{
- rc = dat_pz_free (conn->pz_handle);
+ rc = dat_pz_free (conn->pz);
DT_assert_clean (phead, rc == DAT_SUCCESS);
}
- if (conn->ia_handle)
+ if (conn->ia)
{
- rc = dat_ia_close (conn->ia_handle, DAT_CLOSE_ABRUPT_FLAG);
+ rc = dat_ia_close (conn->ia, DAT_CLOSE_ABRUPT_FLAG);
DT_assert_clean (phead, rc == DAT_SUCCESS);
}
return rc;
@@ -272,31 +272,31 @@ void DT_fft_init_server (Params_t *param
DT_fft_init_conn_struct (conn);
/* open the IA */
- rc = DT_ia_open (cmd->device_name, &conn->ia_handle);
+ rc = DT_ia_open (cmd->device_name, &conn->ia);
DT_assert_dat (phead, rc == DAT_SUCCESS);
/* create a PZ */
- rc = dat_pz_create (conn->ia_handle, &conn->pz_handle);
+ rc = dat_pz_create (conn->ia, &conn->pz);
DT_assert_dat (phead, rc == DAT_SUCCESS);
/* create an EP and its EVDs */
rc =DT_ep_create (params_ptr,
- conn->ia_handle,
- conn->pz_handle,
+ conn->ia,
+ conn->pz,
&conn->cr_evd,
&conn->conn_evd,
&conn->send_evd,
&conn->recv_evd,
- &conn->ep_handle);
+ &conn->ep);
DT_assert_dat (phead, rc == DAT_SUCCESS);
/* create a PSP */
- rc = dat_psp_create (conn->ia_handle, SERVER_PORT_NUMBER, conn->cr_evd,
- DAT_PSP_CONSUMER_FLAG, &conn->psp_handle);
+ rc = dat_psp_create (conn->ia, SERVER_PORT_NUMBER, conn->cr_evd,
+ DAT_PSP_CONSUMER_FLAG, &conn->psp);
DT_assert_dat (phead, rc == DAT_SUCCESS);
/* allocate memory for buffers */
- conn->bpool = DT_BpoolAlloc (NULL, phead, conn->ia_handle, conn->pz_handle,
+ conn->bpool = DT_BpoolAlloc (NULL, phead, conn->ia, conn->pz,
NULL, NULL, 8192, 2, 256 /* FIXME query */,
FALSE, FALSE);
DT_assert (phead, conn->bpool);
@@ -316,19 +316,19 @@ void DT_fft_listen (Params_t *params_ptr
DT_assert_dat (phead, DT_cr_event_wait (phead, conn->cr_evd, &conn->cr_stat) &&
DT_cr_check (phead,
&conn->cr_stat,
- conn->psp_handle,
+ conn->psp,
SERVER_PORT_NUMBER,
- &conn->cr_handle,
+ &conn->cr,
"DT_fft_listen"));
/* accept the connection */
- rc =dat_cr_accept (conn->cr_handle, conn->ep_handle, 0, (void *)0);
+ rc =dat_cr_accept (conn->cr, conn->ep, 0, (void *)0);
DT_assert_dat (phead, rc == DAT_SUCCESS);
/* wait on a conn event via the conn EVD */
DT_assert (phead,
DT_conn_event_wait (phead,
- conn->ep_handle,
+ conn->ep,
conn->conn_evd,
&conn->event_num) == TRUE);
conn->connected = TRUE;
@@ -351,7 +351,7 @@ int DT_fft_connect (Params_t *params_ptr
DT_Tdep_PT_Printf (phead, "Connection to server, attempt #%d\n", wait_count+1);
/* attempt to connect, timeout = 10 secs */
- rc = dat_ep_connect (conn->ep_handle, conn->remote_netaddr,
+ rc = dat_ep_connect (conn->ep, conn->remote_netaddr,
SERVER_PORT_NUMBER, 10*1000000, 0, (void *)0,
DAT_QOS_BEST_EFFORT, DAT_CONNECT_DEFAULT_FLAG);
DT_assert_dat (phead, rc == DAT_SUCCESS);
@@ -359,7 +359,7 @@ int DT_fft_connect (Params_t *params_ptr
/* wait on conn event */
DT_assert (phead,
DT_conn_event_wait (phead,
- conn->ep_handle,
+ conn->ep,
conn->conn_evd,
&conn->event_num) == TRUE);
Index: linux-kernel/test/dapltest/test/dapl_fft_mem.c
===================================================================
--- linux-kernel/test/dapltest/test/dapl_fft_mem.c (revision 2564)
+++ linux-kernel/test/dapltest/test/dapl_fft_mem.c (working copy)
@@ -37,28 +37,28 @@ int DT_mem_generic (Params_t *params_ptr
FFT_Connection_t conn;
DAT_REGION_DESCRIPTION region;
u64 reg_size;
- DAT_LMR_HANDLE lmr_handle;
+ struct dat_lmr *lmr;
DAT_LMR_CONTEXT lmr_context;
u64 reg_addr;
unsigned char *alloc_ptr;
int res;
u64 buffer_size;
- DAT_IA_HANDLE ia_handle;
- DAT_PZ_HANDLE pz_handle;
+ struct dat_ia *ia;
+ struct dat_pz *pz;
DT_Tdep_Print_Head *phead;
phead = params_ptr->phead;
rc = 0;
expect = 0;
res = 1;
- lmr_handle = NULL;
+ lmr = NULL;
lmr_context = 0;
reg_addr = 0;
alloc_ptr = NULL;
- ia_handle = NULL;
- pz_handle = NULL;
+ ia = NULL;
+ pz = NULL;
DT_fft_init_client (params_ptr, cmd, &conn);
- DT_assert (phead, NULL != conn.ia_handle);
+ DT_assert (phead, NULL != conn.ia);
if (flag == 2)
{
@@ -76,24 +76,24 @@ int DT_mem_generic (Params_t *params_ptr
memset (®ion, 0, sizeof (region));
region.for_va = alloc_ptr;
- ia_handle = conn.ia_handle;
+ ia = conn.ia;
if (flag != 3)
{
- pz_handle = conn.pz_handle;
+ pz = conn.pz;
}
if (flag != 4)
{
DT_Tdep_PT_Printf (phead, "Registering memory\n");
- rc = dat_lmr_kcreate (ia_handle,
+ rc = dat_lmr_kcreate (ia,
DAT_MEM_TYPE_VIRTUAL,
region,
buffer_size,
- conn.pz_handle,
+ conn.pz,
DAT_MEM_PRIV_ALL_FLAG,
DAT_MEM_OPTIMIZE_DONT_CARE,
- &lmr_handle,
+ &lmr,
&lmr_context,
NULL, /* FIXME */
®_size,
@@ -110,21 +110,21 @@ int DT_mem_generic (Params_t *params_ptr
}
if (flag == 1)
{
- if (lmr_handle)
+ if (lmr)
{
- rc = dat_lmr_free (lmr_handle);
+ rc = dat_lmr_free (lmr);
DT_assert_dat (phead, rc == DAT_SUCCESS);
}
- lmr_handle = NULL;
+ lmr = NULL;
- rc = dat_lmr_kcreate (conn.ia_handle,
+ rc = dat_lmr_kcreate (conn.ia,
DAT_MEM_TYPE_VIRTUAL,
region,
buffer_size,
- conn.pz_handle,
+ conn.pz,
DAT_MEM_PRIV_ALL_FLAG,
DAT_MEM_OPTIMIZE_DONT_CARE,
- &lmr_handle,
+ &lmr,
&lmr_context,
NULL, /* FIXME */
®_size,
@@ -133,9 +133,9 @@ int DT_mem_generic (Params_t *params_ptr
}
cleanup:
- if (lmr_handle)
+ if (lmr)
{
- rc = dat_lmr_free (lmr_handle);
+ rc = dat_lmr_free (lmr);
DT_assert_clean (phead, rc == DAT_SUCCESS);
}
if (alloc_ptr)
@@ -197,7 +197,7 @@ int DT_mem_case4 ( Params_t *params_ptr,
DT_Tdep_Print_Head *phead;
phead = params_ptr->phead;
DT_Tdep_PT_Printf (phead, "\
- Description: Try to deregister memory with null lmr_handle\n");
+ Description: Try to deregister memory with null lmr\n");
return DT_mem_generic (params_ptr, cmd, 4);
}
Index: linux-kernel/test/dapltest/test/dapl_limit.c
===================================================================
--- linux-kernel/test/dapltest/test/dapl_limit.c (revision 2564)
+++ linux-kernel/test/dapltest/test/dapl_limit.c (working copy)
@@ -33,13 +33,13 @@
static boolean_t
more_handles (DT_Tdep_Print_Head *phead,
- DAT_HANDLE **old_ptrptr, /* pointer to current pointer */
+ void ***old_ptrptr, /* pointer to current pointer */
unsigned int *old_count, /* number pointed to */
unsigned int size) /* size of one datum */
{
unsigned int count = *old_count;
- DAT_HANDLE *old_handles = *old_ptrptr;
- DAT_HANDLE *handle_tmp = DT_Mdep_Malloc (count * 2 * size);
+ void * *old_handles = *old_ptrptr;
+ void * *handle_tmp = DT_Mdep_Malloc (count * 2 * size);
if (!handle_tmp)
{
@@ -74,19 +74,19 @@ limit_test ( DT_Tdep_Print_Head *phead,
Limit_Cmd_t *cmd,
Limit_Index depth)
{
- DAT_EVD_HANDLE conn_handle;
+ struct dat_evd * conn_handle;
typedef struct obj_set
{
- DAT_IA_HANDLE ia_handle;
- DAT_EVD_HANDLE ia_async_handle;
- DAT_PZ_HANDLE pz_handle;
+ struct dat_ia * ia;
+ struct dat_evd * ia_async_handle;
+ struct dat_pz * pz;
DAT_CNO_HANDLE cno_handle;
- DAT_EVD_HANDLE evd_handle;
- DAT_EP_HANDLE ep_handle;
- DAT_LMR_HANDLE lmr_handle;
+ struct dat_evd * evd;
+ struct dat_ep * ep;
+ struct dat_lmr * lmr;
char * lmr_buffer;
DAT_LMR_CONTEXT lmr_context;
- DAT_RMR_HANDLE rmr_handle;
+ struct dat_rmr * rmr_handle;
DAT_RMR_CONTEXT rmr_context;
} Obj_Set;
@@ -135,19 +135,19 @@ limit_test ( DT_Tdep_Print_Head *phead,
for (w = 0; w < cmd->width; w++)
{
/* Specify that we want to get back an async EVD. */
- hdl_sets[w].ia_async_handle = DAT_HANDLE_NULL;
+ hdl_sets[w].ia_async_handle = NULL;
ret = dat_ia_open (cmd->device_name,
DFLT_QLEN,
&hdl_sets[w].ia_async_handle,
- &hdl_sets[w].ia_handle);
+ &hdl_sets[w].ia);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "%s: dat_ia_open (%s) #%d fails: %s\n",
module, cmd->device_name,
w+1, DT_RetToString (ret));
/* handle contents undefined on failure */
- hdl_sets[w].ia_async_handle = DAT_HANDLE_NULL;
- hdl_sets[w].ia_handle = DAT_HANDLE_NULL;
+ hdl_sets[w].ia_async_handle = NULL;
+ hdl_sets[w].ia = NULL;
goto clean_up_now;
}
}
@@ -159,8 +159,8 @@ limit_test ( DT_Tdep_Print_Head *phead,
*/
typedef struct _ia
{
- DAT_IA_HANDLE ia_handle;
- DAT_EVD_HANDLE ia_async_handle;
+ struct dat_ia * ia;
+ struct dat_evd * ia_async_handle;
}
OneOpen;
unsigned int count = START_COUNT;
@@ -178,7 +178,7 @@ limit_test ( DT_Tdep_Print_Head *phead,
{
DT_Mdep_Schedule();
if (w == count
- && !more_handles (phead, (DAT_HANDLE **) &hdlptr,
+ && !more_handles (phead, (void ***) &hdlptr,
&count,
sizeof (*hdlptr)))
{
@@ -187,11 +187,11 @@ limit_test ( DT_Tdep_Print_Head *phead,
break;
}
/* Specify that we want to get back an async EVD. */
- hdlptr[w].ia_async_handle = DAT_HANDLE_NULL;
+ hdlptr[w].ia_async_handle = NULL;
ret = dat_ia_open (cmd->device_name,
DFLT_QLEN,
&hdlptr[w].ia_async_handle,
- &hdlptr[w].ia_handle);
+ &hdlptr[w].ia);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "%s: dat_ia_open (%s) #%d fails: %s\n",
@@ -209,14 +209,14 @@ limit_test ( DT_Tdep_Print_Head *phead,
for (tmp = 0; tmp < w; tmp++)
{
DT_Mdep_Schedule();
- ret = dat_ia_close (hdlptr[tmp].ia_handle,
+ ret = dat_ia_close (hdlptr[tmp].ia,
DAT_CLOSE_GRACEFUL_FLAG);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "%s: dat_ia_close (graceful) fails: %s\n",
module, DT_RetToString (ret));
retval = FALSE;
- ret = dat_ia_close (hdlptr[tmp].ia_handle,
+ ret = dat_ia_close (hdlptr[tmp].ia,
DAT_CLOSE_ABRUPT_FLAG);
if (ret != DAT_SUCCESS)
{
@@ -245,14 +245,14 @@ limit_test ( DT_Tdep_Print_Head *phead,
cmd->width));
for (w = 0; w < cmd->width; w++)
{
- ret = dat_pz_create (hdl_sets[w].ia_handle,
- &hdl_sets[w].pz_handle);
+ ret = dat_pz_create (hdl_sets[w].ia,
+ &hdl_sets[w].pz);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "%s: dat_pz_create #%d fails: %s\n",
module, w+1, DT_RetToString (ret));
/* handle contents undefined on failure */
- hdl_sets[w].pz_handle = DAT_HANDLE_NULL;
+ hdl_sets[w].pz = NULL;
goto clean_up_now;
}
}
@@ -263,7 +263,7 @@ limit_test ( DT_Tdep_Print_Head *phead,
* See how many PZs we can create
*/
unsigned int count = START_COUNT;
- DAT_PZ_HANDLE *hdlptr = (DAT_PZ_HANDLE *)
+ struct dat_pz **hdlptr = (struct dat_pz **)
DT_Mdep_Malloc (count * sizeof (*hdlptr));
/* PZ Exhaustion test loop */
@@ -279,7 +279,7 @@ limit_test ( DT_Tdep_Print_Head *phead,
{
DT_Mdep_Schedule();
if (w == count
- && !more_handles (phead, (DAT_HANDLE **) &hdlptr,
+ && !more_handles (phead, (void ***) &hdlptr,
&count,
sizeof (*hdlptr)))
{
@@ -287,7 +287,7 @@ limit_test ( DT_Tdep_Print_Head *phead,
retval = TRUE;
break;
}
- ret = dat_pz_create (hdl_sets[w % cmd->width].ia_handle,
+ ret = dat_pz_create (hdl_sets[w % cmd->width].ia,
&hdlptr[w]);
if (ret != DAT_SUCCESS)
{
@@ -335,13 +335,13 @@ limit_test ( DT_Tdep_Print_Head *phead,
cmd->width));
for (w = 0; w < cmd->width; w++)
{
- ret = dat_cno_create (hdl_sets[w].ia_handle,
+ ret = dat_cno_create (hdl_sets[w].ia,
DAT_OS_WAIT_PROXY_AGENT_NULL,
&hdl_sets[w].cno_handle);
if (DAT_GET_TYPE (ret) == DAT_NOT_IMPLEMENTED)
{
DT_Tdep_PT_Printf (phead, "%s: dat_cno_create unimplemented\n", module);
- hdl_sets[w].cno_handle = DAT_HANDLE_NULL;
+ hdl_sets[w].cno_handle = NULL;
/* ignore this error */
break;
}
@@ -350,7 +350,7 @@ limit_test ( DT_Tdep_Print_Head *phead,
DT_Tdep_PT_Printf (phead, "%s: dat_cno_create #%d fails: %s\n",
module, w+1, DT_RetToString (ret));
/* handle contents undefined on failure */
- hdl_sets[w].cno_handle = DAT_HANDLE_NULL;
+ hdl_sets[w].cno_handle = NULL;
goto clean_up_now;
}
}
@@ -377,7 +377,7 @@ limit_test ( DT_Tdep_Print_Head *phead,
{
DT_Mdep_Schedule();
if (w == count
- && !more_handles (phead, (DAT_HANDLE **) &hdlptr,
+ && !more_handles (phead, (void ***) &hdlptr,
&count,
sizeof (*hdlptr)))
{
@@ -385,7 +385,7 @@ limit_test ( DT_Tdep_Print_Head *phead,
retval = TRUE;
break;
}
- ret = dat_cno_create (hdl_sets[w % cmd->width].ia_handle,
+ ret = dat_cno_create (hdl_sets[w % cmd->width].ia,
DAT_OS_WAIT_PROXY_AGENT_NULL,
&hdlptr[w]);
if (DAT_GET_TYPE (ret) == DAT_NOT_IMPLEMENTED)
@@ -446,7 +446,7 @@ limit_test ( DT_Tdep_Print_Head *phead,
* First create a connection EVD to be used for EP creation
*/
- ret = DT_Tdep_evd_create (hdl_sets[0].ia_handle,
+ ret = DT_Tdep_evd_create (hdl_sets[0].ia,
DFLT_QLEN,
NULL,
DAT_EVD_CONNECTION_FLAG,
@@ -456,22 +456,22 @@ limit_test ( DT_Tdep_Print_Head *phead,
DT_Tdep_PT_Printf (phead, "%s: conn dat_evd_create #%d fails: %s\n",
module, w+1, DT_RetToString (ret));
/* handle contents undefined on failure */
- conn_handle = DAT_HANDLE_NULL;
+ conn_handle = NULL;
goto clean_up_now;
}
for (w = 0; w < cmd->width; w++)
{
- ret = DT_Tdep_evd_create (hdl_sets[w].ia_handle,
+ ret = DT_Tdep_evd_create (hdl_sets[w].ia,
DFLT_QLEN,
hdl_sets[w].cno_handle,
flags,
- &hdl_sets[w].evd_handle);
+ &hdl_sets[w].evd);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "%s: dat_evd_create #%d fails: %s\n",
module, w+1, DT_RetToString (ret));
/* handle contents undefined on failure */
- hdl_sets[w].evd_handle = DAT_HANDLE_NULL;
+ hdl_sets[w].evd = NULL;
goto clean_up_now;
}
}
@@ -482,7 +482,7 @@ limit_test ( DT_Tdep_Print_Head *phead,
* See how many EVDs we can create
*/
unsigned int count = START_COUNT;
- DAT_EVD_HANDLE *hdlptr = (DAT_EVD_HANDLE *)
+ struct dat_evd **hdlptr = (struct dat_evd **)
DT_Mdep_Malloc (count * sizeof (*hdlptr));
enum dat_evd_flags flags = ( DAT_EVD_DTO_FLAG
| DAT_EVD_RMR_BIND_FLAG
@@ -500,7 +500,7 @@ limit_test ( DT_Tdep_Print_Head *phead,
/*
* First create a connection EVD to be used for EP creation
*/
- ret = DT_Tdep_evd_create (hdl_sets[0].ia_handle,
+ ret = DT_Tdep_evd_create (hdl_sets[0].ia,
DFLT_QLEN,
NULL,
DAT_EVD_CONNECTION_FLAG,
@@ -510,13 +510,13 @@ limit_test ( DT_Tdep_Print_Head *phead,
DT_Tdep_PT_Printf (phead, "%s: conn dat_evd_create #%d fails: %s\n",
module, w+1, DT_RetToString (ret));
/* handle contents undefined on failure */
- conn_handle = DAT_HANDLE_NULL;
+ conn_handle = NULL;
}
for (w = 0; w < cmd->maximum; w++)
{
DT_Mdep_Schedule();
if (w == count
- && !more_handles (phead, (DAT_HANDLE **) &hdlptr,
+ && !more_handles (phead, (void ***) &hdlptr,
&count,
sizeof (*hdlptr)))
{
@@ -524,7 +524,7 @@ limit_test ( DT_Tdep_Print_Head *phead,
retval = TRUE;
break;
}
- ret = DT_Tdep_evd_create (hdl_sets[w % cmd->width].ia_handle,
+ ret = DT_Tdep_evd_create (hdl_sets[w % cmd->width].ia,
DFLT_QLEN,
hdl_sets[w % cmd->width].cno_handle,
flags,
@@ -542,10 +542,10 @@ limit_test ( DT_Tdep_Print_Head *phead,
retval = TRUE;
/* EVD Cleanup loop */
- if (conn_handle != DAT_HANDLE_NULL)
+ if (conn_handle != NULL)
{
ret = DT_Tdep_evd_free (conn_handle);
- conn_handle = DAT_HANDLE_NULL;
+ conn_handle = NULL;
}
for (tmp = 0; tmp < w; tmp++)
{
@@ -578,19 +578,19 @@ limit_test ( DT_Tdep_Print_Head *phead,
cmd->width));
for (w = 0; w < cmd->width; w++)
{
- ret = dat_ep_create (hdl_sets[w].ia_handle,
- hdl_sets[w].pz_handle,
- hdl_sets[w].evd_handle, /* recv */
- hdl_sets[w].evd_handle, /* request */
+ ret = dat_ep_create (hdl_sets[w].ia,
+ hdl_sets[w].pz,
+ hdl_sets[w].evd, /* recv */
+ hdl_sets[w].evd, /* request */
conn_handle, /* connect */
(struct dat_ep_attr *) NULL,
- &hdl_sets[w].ep_handle);
+ &hdl_sets[w].ep);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "%s: dat_ep_create #%d fails: %s\n",
module, w+1, DT_RetToString (ret));
/* handle contents undefined on failure */
- hdl_sets[w].ep_handle = DAT_HANDLE_NULL;
+ hdl_sets[w].ep = NULL;
goto clean_up_now;
}
}
@@ -601,7 +601,7 @@ limit_test ( DT_Tdep_Print_Head *phead,
* See how many EPs we can create
*/
unsigned int count = START_COUNT;
- DAT_EP_HANDLE *hdlptr = (DAT_EP_HANDLE *)
+ struct dat_ep **hdlptr = (struct dat_ep **)
DT_Mdep_Malloc (count * sizeof (*hdlptr));
/* EP Exhaustion test loop */
@@ -615,7 +615,7 @@ limit_test ( DT_Tdep_Print_Head *phead,
{
DT_Mdep_Schedule();
if (w == count
- && !more_handles (phead, (DAT_HANDLE **) &hdlptr,
+ && !more_handles (phead, (void ***) &hdlptr,
&count,
sizeof (*hdlptr)))
{
@@ -623,10 +623,10 @@ limit_test ( DT_Tdep_Print_Head *phead,
retval = TRUE;
break;
}
- ret = dat_ep_create (hdl_sets[w % cmd->width].ia_handle,
- hdl_sets[w % cmd->width].pz_handle,
- hdl_sets[w % cmd->width].evd_handle,
- hdl_sets[w % cmd->width].evd_handle,
+ ret = dat_ep_create (hdl_sets[w % cmd->width].ia,
+ hdl_sets[w % cmd->width].pz,
+ hdl_sets[w % cmd->width].evd,
+ hdl_sets[w % cmd->width].evd,
conn_handle, /* connect */
(struct dat_ep_attr *) NULL,
&hdlptr[w]);
@@ -672,9 +672,9 @@ limit_test ( DT_Tdep_Print_Head *phead,
* See how many RSPs we can create
*/
unsigned int count = START_COUNT;
- DAT_RSP_HANDLE *hdlptr = (DAT_RSP_HANDLE *)
+ struct dat_sp **hdlptr = (struct dat_sp **)
DT_Mdep_Malloc (count * sizeof (*hdlptr));
- DAT_EP_HANDLE *epptr = (DAT_EP_HANDLE *)
+ struct dat_ep **epptr = (struct dat_ep **)
DT_Mdep_Malloc (count * sizeof (*epptr));
/* RSP Exhaustion test loop */
@@ -692,7 +692,7 @@ limit_test ( DT_Tdep_Print_Head *phead,
unsigned int count1 = count;
unsigned int count2 = count;
- if (!more_handles (phead, (DAT_HANDLE **) &hdlptr,
+ if (!more_handles (phead, (void ***) &hdlptr,
&count1,
sizeof (*hdlptr)))
{
@@ -700,7 +700,7 @@ limit_test ( DT_Tdep_Print_Head *phead,
retval = TRUE;
break;
}
- if (!more_handles (phead, (DAT_HANDLE **) &epptr,
+ if (!more_handles (phead, (void ***) &epptr,
&count2,
sizeof (*epptr)))
{
@@ -723,10 +723,10 @@ limit_test ( DT_Tdep_Print_Head *phead,
/*
* Each RSP needs a unique EP, so create one first
*/
- ret = dat_ep_create (hdl_sets[w % cmd->width].ia_handle,
- hdl_sets[w % cmd->width].pz_handle,
- hdl_sets[w % cmd->width].evd_handle,
- hdl_sets[w % cmd->width].evd_handle,
+ ret = dat_ep_create (hdl_sets[w % cmd->width].ia,
+ hdl_sets[w % cmd->width].pz,
+ hdl_sets[w % cmd->width].evd,
+ hdl_sets[w % cmd->width].evd,
conn_handle,
(struct dat_ep_attr *) NULL,
&epptr[w]);
@@ -738,10 +738,10 @@ limit_test ( DT_Tdep_Print_Head *phead,
break;
}
- ret = dat_rsp_create (hdl_sets[w % cmd->width].ia_handle,
+ ret = dat_rsp_create (hdl_sets[w % cmd->width].ia,
CONN_QUAL0 + w,
epptr[w],
- hdl_sets[w % cmd->width].evd_handle,
+ hdl_sets[w % cmd->width].evd,
&hdlptr[w]);
if (DAT_GET_TYPE (ret) == DAT_NOT_IMPLEMENTED)
{
@@ -808,7 +808,7 @@ limit_test ( DT_Tdep_Print_Head *phead,
* See how many PSPs we can create
*/
unsigned int count = START_COUNT;
- DAT_PSP_HANDLE *hdlptr = (DAT_PSP_HANDLE *)
+ struct dat_sp **hdlptr = (struct dat_sp **)
DT_Mdep_Malloc (count * sizeof (*hdlptr));
/* PSP Exhaustion test loop */
@@ -822,7 +822,7 @@ limit_test ( DT_Tdep_Print_Head *phead,
{
DT_Mdep_Schedule();
if (w == count
- && !more_handles (phead, (DAT_HANDLE **) &hdlptr,
+ && !more_handles (phead, (void ***) &hdlptr,
&count,
sizeof (*hdlptr)))
{
@@ -830,9 +830,9 @@ limit_test ( DT_Tdep_Print_Head *phead,
retval = TRUE;
break;
}
- ret = dat_psp_create (hdl_sets[w % cmd->width].ia_handle,
+ ret = dat_psp_create (hdl_sets[w % cmd->width].ia,
CONN_QUAL0 + w,
- hdl_sets[w % cmd->width].evd_handle,
+ hdl_sets[w % cmd->width].evd,
DAT_PSP_CONSUMER_FLAG,
&hdlptr[w]);
if (ret != DAT_SUCCESS)
@@ -840,7 +840,7 @@ limit_test ( DT_Tdep_Print_Head *phead,
DT_Tdep_PT_Printf (phead, "%s: dat_psp_create #%d fails: %s\n",
module, w+1, DT_RetToString (ret));
retval = TRUE;
- hdlptr[w] = DAT_HANDLE_NULL;
+ hdlptr[w] = NULL;
break;
}
}
@@ -897,14 +897,14 @@ limit_test ( DT_Tdep_Print_Head *phead,
memset (®ion, 0, sizeof (region));
region.for_va = hdl_sets[w].lmr_buffer;
- ret = dat_lmr_kcreate (hdl_sets[w].ia_handle,
+ ret = dat_lmr_kcreate (hdl_sets[w].ia,
DAT_MEM_TYPE_VIRTUAL,
region,
DFLT_BUFFSZ,
- hdl_sets[w].pz_handle,
+ hdl_sets[w].pz,
DAT_MEM_PRIV_ALL_FLAG,
DAT_MEM_OPTIMIZE_DONT_CARE,
- &hdl_sets[w].lmr_handle,
+ &hdl_sets[w].lmr,
&hdl_sets[w].lmr_context,
NULL, /* FIXME */
®_size, ®_addr);
@@ -913,7 +913,7 @@ limit_test ( DT_Tdep_Print_Head *phead,
DT_Tdep_PT_Printf (phead, "%s: dat_lmr_kcreate #%d fails: %s\n",
module, w+1, DT_RetToString (ret));
/* handle contents undefined on failure */
- hdl_sets[w].lmr_handle = DAT_HANDLE_NULL;
+ hdl_sets[w].lmr = NULL;
goto clean_up_now;
}
if ((uintptr_t)reg_addr > (uintptr_t)hdl_sets[w].lmr_buffer
@@ -949,7 +949,7 @@ limit_test ( DT_Tdep_Print_Head *phead,
{
DT_Mdep_Schedule();
if (w == count
- && !more_handles (phead, (DAT_HANDLE **) &hdlptr,
+ && !more_handles (phead, (void ***) &hdlptr,
&count,
sizeof (*hdlptr)))
{
@@ -966,10 +966,10 @@ limit_test ( DT_Tdep_Print_Head *phead,
*/
hdlptr[w] = DT_BpoolAlloc ((Per_Test_Data_t *)0,
phead,
- hdl_sets[w % cmd->width].ia_handle,
- hdl_sets[w % cmd->width].pz_handle,
- hdl_sets[w % cmd->width].ep_handle,
- hdl_sets[w % cmd->width].evd_handle,
+ hdl_sets[w % cmd->width].ia,
+ hdl_sets[w % cmd->width].pz,
+ hdl_sets[w % cmd->width].ep,
+ hdl_sets[w % cmd->width].evd,
DFLT_BUFFSZ,
1,
256, /* FIXME should query for this */
@@ -1026,7 +1026,7 @@ limit_test ( DT_Tdep_Print_Head *phead,
{
DT_Mdep_Schedule();
if (w == count
- && !more_handles (phead, (DAT_HANDLE **) &hdlptr,
+ && !more_handles (phead, (void ***) &hdlptr,
&count,
cmd->width * sizeof (*hdlptr)))
{
@@ -1054,7 +1054,7 @@ limit_test ( DT_Tdep_Print_Head *phead,
DT_Tdep_PT_Printf (phead, "%s: dat_ep_post_recv #%d\n", module,
w * cmd->width + i + 1);
- ret = dat_ep_post_recv (hdl_sets[i].ep_handle,
+ ret = dat_ep_post_recv (hdl_sets[i].ep,
1,
iovp,
cookie,
@@ -1091,7 +1091,7 @@ limit_test ( DT_Tdep_Print_Head *phead,
* outstanding recv DTOs in error, and otherwise
* be a no-op.
*/
- ret = dat_ep_reset (hdl_sets[i].ep_handle);
+ ret = dat_ep_reset (hdl_sets[i].ep);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "%s: dat_ep_disconnect (abrupt) fails: %s\n",
@@ -1107,7 +1107,7 @@ limit_test ( DT_Tdep_Print_Head *phead,
*/
do
{
- ret = DT_Tdep_evd_dequeue ( hdl_sets[i].evd_handle,
+ ret = DT_Tdep_evd_dequeue ( hdl_sets[i].evd,
&event);
} while (ret == DAT_SUCCESS);
}
@@ -1130,10 +1130,10 @@ limit_test ( DT_Tdep_Print_Head *phead,
DT_Mdep_Schedule();
test_bpool = DT_BpoolAlloc ((Per_Test_Data_t *)0,
phead,
- hdl_sets[0].ia_handle,
- hdl_sets[0].pz_handle,
- hdl_sets[0].ep_handle,
- hdl_sets[0].evd_handle,
+ hdl_sets[0].ia,
+ hdl_sets[0].pz,
+ hdl_sets[0].ep,
+ hdl_sets[0].evd,
test_size,
1,
256, /* FIXME should query for this */
@@ -1185,9 +1185,9 @@ clean_up_now:
for (w = 0; w < cmd->width; w++)
{
- if (hdl_sets[w].lmr_handle)
+ if (hdl_sets[w].lmr)
{
- ret = dat_lmr_free (hdl_sets[w].lmr_handle);
+ ret = dat_lmr_free (hdl_sets[w].lmr);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "%s: dat_lmr_free fails: %s\n",
@@ -1220,9 +1220,9 @@ clean_up_now:
for (w = 0; w < cmd->width; w++)
{
- if (hdl_sets[w].ep_handle)
+ if (hdl_sets[w].ep)
{
- ret = dat_ep_free (hdl_sets[w].ep_handle);
+ ret = dat_ep_free (hdl_sets[w].ep);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "%s: dat_ep_free fails: %s\n",
@@ -1237,16 +1237,16 @@ clean_up_now:
{
unsigned int w;
- if (conn_handle != DAT_HANDLE_NULL)
+ if (conn_handle != NULL)
{
ret = DT_Tdep_evd_free (conn_handle);
- conn_handle = DAT_HANDLE_NULL;
+ conn_handle = NULL;
}
for (w = 0; w < cmd->width; w++)
{
- if (hdl_sets[w].evd_handle)
+ if (hdl_sets[w].evd)
{
- ret = DT_Tdep_evd_free (hdl_sets[w].evd_handle);
+ ret = DT_Tdep_evd_free (hdl_sets[w].evd);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "%s: dat_evd_free fails: %s\n",
@@ -1284,9 +1284,9 @@ clean_up_now:
for (w = 0; w < cmd->width; w++)
{
- if (hdl_sets[w].pz_handle)
+ if (hdl_sets[w].pz)
{
- ret = dat_pz_free (hdl_sets[w].pz_handle);
+ ret = dat_pz_free (hdl_sets[w].pz);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "%s: dat_pz_free fails: %s\n",
@@ -1303,10 +1303,10 @@ clean_up_now:
for (w = 0; w < cmd->width; w++)
{
- if (hdl_sets[w].ia_handle)
+ if (hdl_sets[w].ia)
{
/* dat_ia_close cleans up async evd handle, too */
- ret = dat_ia_close (hdl_sets[w].ia_handle,
+ ret = dat_ia_close (hdl_sets[w].ia,
DAT_CLOSE_GRACEFUL_FLAG);
if (ret != DAT_SUCCESS)
{
@@ -1318,7 +1318,7 @@ clean_up_now:
* we may as well try the largest hammer we have.
*/
retval = FALSE;
- ret = dat_ia_close (hdl_sets[w].ia_handle,
+ ret = dat_ia_close (hdl_sets[w].ia,
DAT_CLOSE_ABRUPT_FLAG);
if (ret != DAT_SUCCESS)
{
Index: linux-kernel/test/dapltest/test/dapl_fft_queryinfo.c
===================================================================
--- linux-kernel/test/dapltest/test/dapl_fft_queryinfo.c (revision 2564)
+++ linux-kernel/test/dapltest/test/dapl_fft_queryinfo.c (working copy)
@@ -37,31 +37,31 @@ int DT_queryinfo_basic (Params_t *params
u32 result_wanted)
{
char *dev_name;
- DAT_IA_HANDLE ia_handle;
+ struct dat_ia *ia;
struct dat_ia_attr ia_attributes;
struct dat_provider_attr provider_attributes;
- DAT_EVD_HANDLE evd_handle;
- DAT_EVD_HANDLE conn_evd_handle;
- DAT_EVD_HANDLE cr_evd_handle;
- DAT_EVD_HANDLE send_evd_handle;
- DAT_EVD_HANDLE recv_evd_handle;
- DAT_EP_HANDLE ep_handle;
+ struct dat_evd *evd;
+ struct dat_evd *conn_evd;
+ struct dat_evd *cr_evd;
+ struct dat_evd *send_evd;
+ struct dat_evd *recv_evd;
+ struct dat_ep *ep;
struct dat_ep_param ep_param;
DAT_CNO_HANDLE cno_handle;
#ifndef __KDAPLTEST__
DAT_CNO_PARAM cno_param;
#endif
struct dat_evd_param evd_param;
- DAT_PSP_HANDLE psp_handle;
+ struct dat_sp * psp;
struct dat_psp_param psp_param;
- DAT_RSP_HANDLE rsp_handle;
+ struct dat_sp * rsp;
struct dat_rsp_param rsp_param;
- DAT_PZ_HANDLE pz_handle;
+ struct dat_pz *pz;
struct dat_pz_param pz_param;
- DAT_LMR_HANDLE lmr_handle;
+ struct dat_lmr *lmr;
struct dat_lmr_param lmr_param;
DAT_LMR_CONTEXT lmr_context;
- DAT_RMR_HANDLE rmr_handle;
+ struct dat_rmr * rmr_handle;
struct dat_rmr_param rmr_param;
DAT_REGION_DESCRIPTION region;
u64 reg_size;
@@ -77,30 +77,30 @@ int DT_queryinfo_basic (Params_t *params
reg_addr = 0;
alloc_ptr = NULL;
- ia_handle = NULL;
- pz_handle = NULL;
- ep_handle = NULL;
- lmr_handle = NULL;
+ ia = NULL;
+ pz = NULL;
+ ep = NULL;
+ lmr = NULL;
rmr_handle = NULL;
- pz_handle = NULL;
- psp_handle = NULL;
- rsp_handle = NULL;
+ pz = NULL;
+ psp = NULL;
+ rsp = NULL;
cno_handle = NULL;
- evd_handle = DAT_HANDLE_NULL;
- conn_evd_handle = DAT_HANDLE_NULL;
- cr_evd_handle = DAT_HANDLE_NULL;
- recv_evd_handle = DAT_HANDLE_NULL;
- send_evd_handle = DAT_HANDLE_NULL;
+ evd = NULL;
+ conn_evd = NULL;
+ cr_evd = NULL;
+ recv_evd = NULL;
+ send_evd = NULL;
dev_name = cmd->device_name;
- /* All functions require an ia_handle to be created */
+ /* All functions require an ia to be created */
rc = dat_ia_open ((const char *)dev_name,
DEFAULT_QUEUE_LEN,
- &evd_handle,
- &ia_handle);
+ &evd,
+ &ia);
DT_assert_dat (phead, rc == DAT_SUCCESS);
- /* These functions require a pz_handle to be created */
+ /* These functions require a pz to be created */
if ( (object_to_query == QUERY_EVD) ||
(object_to_query == QUERY_RMR) ||
(object_to_query == QUERY_LMR) ||
@@ -108,43 +108,43 @@ int DT_queryinfo_basic (Params_t *params
(object_to_query == QUERY_RSP) ||
(object_to_query == QUERY_PZ) )
{
- rc = dat_pz_create (ia_handle,
- &pz_handle);
+ rc = dat_pz_create (ia,
+ &pz);
DT_assert_dat (phead, rc == DAT_SUCCESS);
}
- /* These functions require a ep_handle to be created */
+ /* These functions require a ep to be created */
if ( (object_to_query == QUERY_EP) ||
(object_to_query == QUERY_RSP) )
{
- rc = DT_Tdep_evd_create (ia_handle,
+ rc = DT_Tdep_evd_create (ia,
DEFAULT_QUEUE_LEN,
cno_handle,
DAT_EVD_DTO_FLAG | DAT_EVD_RMR_BIND_FLAG,
- &send_evd_handle);
+ &send_evd);
DT_assert_dat (phead, rc == DAT_SUCCESS);
- rc = DT_Tdep_evd_create (ia_handle,
+ rc = DT_Tdep_evd_create (ia,
DEFAULT_QUEUE_LEN,
cno_handle,
DAT_EVD_DTO_FLAG,
- &recv_evd_handle);
+ &recv_evd);
DT_assert_dat (phead, rc == DAT_SUCCESS);
- rc = DT_Tdep_evd_create (ia_handle,
+ rc = DT_Tdep_evd_create (ia,
DEFAULT_QUEUE_LEN,
cno_handle,
DAT_EVD_CONNECTION_FLAG,
- &conn_evd_handle);
+ &conn_evd);
DT_assert_dat (phead, rc == DAT_SUCCESS);
- rc = dat_ep_create (ia_handle,
- pz_handle,
- recv_evd_handle,
- send_evd_handle,
- conn_evd_handle,
+ rc = dat_ep_create (ia,
+ pz,
+ recv_evd,
+ send_evd,
+ conn_evd,
NULL,
- &ep_handle);
+ &ep);
DT_assert_dat (phead, rc == DAT_SUCCESS);
}
@@ -152,11 +152,11 @@ int DT_queryinfo_basic (Params_t *params
if ( (object_to_query == QUERY_PSP) ||
(object_to_query == QUERY_RSP) )
{
- rc = DT_Tdep_evd_create (ia_handle,
+ rc = DT_Tdep_evd_create (ia,
DEFAULT_QUEUE_LEN,
cno_handle,
DAT_EVD_CR_FLAG,
- &cr_evd_handle);
+ &cr_evd);
DT_assert_dat (phead, rc == DAT_SUCCESS);
}
@@ -165,8 +165,8 @@ int DT_queryinfo_basic (Params_t *params
{
if (result_wanted == DAT_SUCCESS)
{
- rc = dat_ia_query (ia_handle,
- &evd_handle,
+ rc = dat_ia_query (ia,
+ &evd,
&ia_attributes,
&provider_attributes);
}
@@ -177,15 +177,15 @@ int DT_queryinfo_basic (Params_t *params
* NULL out ia_attr and for the DAT_IA_ATTR_MASK to
* have values
*/
- rc = dat_ia_query (ia_handle,
- &evd_handle,
+ rc = dat_ia_query (ia,
+ &evd,
NULL,
&provider_attributes);
}
else if (result_wanted == DAT_INVALID_HANDLE)
{
- rc = dat_ia_query (evd_handle,
- &evd_handle,
+ rc = dat_ia_query (ia,
+ &evd,
&ia_attributes,
&provider_attributes);
}
@@ -197,11 +197,11 @@ int DT_queryinfo_basic (Params_t *params
#ifndef __KDAPLTEST__
#if defined(WIN32)
- rc = dat_cno_create (ia_handle,
+ rc = dat_cno_create (ia,
NULLPROXY,
&cno_handle);
#else
- rc = dat_cno_create (ia_handle,
+ rc = dat_cno_create (ia,
DAT_OS_WAIT_PROXY_AGENT_NULL,
&cno_handle);
#endif
@@ -220,7 +220,7 @@ int DT_queryinfo_basic (Params_t *params
}
else if (result_wanted == DAT_INVALID_HANDLE)
{
- rc = dat_cno_query (ia_handle,
+ rc = dat_cno_query (ia,
&cno_param);
}
#endif
@@ -230,17 +230,17 @@ int DT_queryinfo_basic (Params_t *params
{
if (result_wanted == DAT_SUCCESS)
{
- rc = dat_evd_query (evd_handle,
+ rc = dat_evd_query (evd,
&evd_param);
}
else if (result_wanted == DAT_INVALID_PARAMETER)
{
- rc = dat_evd_query (evd_handle,
+ rc = dat_evd_query (evd,
NULL);
}
else if (result_wanted == DAT_INVALID_HANDLE)
{
- rc = dat_evd_query (ia_handle,
+ rc = dat_evd_query (evd,
&evd_param);
}
}
@@ -248,25 +248,25 @@ int DT_queryinfo_basic (Params_t *params
/* Test dat_psp_query function */
else if (object_to_query == QUERY_PSP)
{
- rc = dat_psp_create (ia_handle,
+ rc = dat_psp_create (ia,
SERVER_PORT_NUMBER,
- cr_evd_handle,
+ cr_evd,
DAT_PSP_PROVIDER_FLAG,
- &psp_handle);
+ &psp);
DT_assert_dat (phead, rc == DAT_SUCCESS);
if (result_wanted == DAT_SUCCESS)
{
- rc = dat_psp_query (psp_handle,
+ rc = dat_psp_query (psp,
&psp_param);
}
else if (result_wanted == DAT_INVALID_PARAMETER)
{
- rc = dat_psp_query (psp_handle,
+ rc = dat_psp_query (psp,
NULL);
}
else if (result_wanted == DAT_INVALID_HANDLE)
{
- rc = dat_psp_query (evd_handle,
+ rc = dat_psp_query (psp,
&psp_param);
}
}
@@ -274,13 +274,13 @@ int DT_queryinfo_basic (Params_t *params
/* Test dat_rsp_query function */
else if (object_to_query == QUERY_RSP)
{
- rc = dat_rsp_create (ia_handle,
+ rc = dat_rsp_create (ia,
SERVER_PORT_NUMBER,
- ep_handle,
- cr_evd_handle,
- &rsp_handle);
+ ep,
+ cr_evd,
+ &rsp);
DT_assert_dat (phead, rc == DAT_SUCCESS);
- rc = dat_rsp_query (rsp_handle,
+ rc = dat_rsp_query (rsp,
&rsp_param);
}
@@ -294,14 +294,14 @@ int DT_queryinfo_basic (Params_t *params
/* Test dat_ep_query function */
else if (object_to_query == QUERY_EP)
{
- rc = dat_ep_query (ep_handle,
+ rc = dat_ep_query (ep,
&ep_param);
}
/* Test dat_pz_query function */
else if (object_to_query == QUERY_PZ)
{
- rc = dat_pz_query (pz_handle,
+ rc = dat_pz_query (pz,
&pz_param);
}
@@ -312,27 +312,27 @@ int DT_queryinfo_basic (Params_t *params
DT_assert (phead, alloc_ptr);
memset (®ion, 0, sizeof (region));
region.for_va = alloc_ptr;
- rc = dat_lmr_kcreate (ia_handle,
+ rc = dat_lmr_kcreate (ia,
DAT_MEM_TYPE_VIRTUAL,
region,
buffer_size,
- pz_handle,
+ pz,
DAT_MEM_PRIV_ALL_FLAG,
DAT_MEM_OPTIMIZE_DONT_CARE,
- &lmr_handle,
+ &lmr,
&lmr_context,
NULL, /* FIXME */
®_size,
®_addr);
DT_assert_dat (phead, rc == DAT_SUCCESS);
- rc = dat_lmr_query (lmr_handle,
+ rc = dat_lmr_query (lmr,
&lmr_param);
}
/* Test dat_rmr_query function */
else if (object_to_query == QUERY_RMR)
{
- rc = dat_rmr_create (pz_handle,
+ rc = dat_rmr_create (pz,
&rmr_handle);
DT_assert_dat (phead, rc == DAT_SUCCESS);
rc = dat_rmr_query (rmr_handle,
@@ -342,39 +342,39 @@ int DT_queryinfo_basic (Params_t *params
DT_assert_dat (phead, DAT_GET_TYPE (rc) == result_wanted);
cleanup:
- if (rsp_handle)
+ if (rsp)
{
- rc = dat_rsp_free (rsp_handle);
+ rc = dat_rsp_free (rsp);
DT_assert_clean (phead, rc == DAT_SUCCESS);
}
- if (ep_handle)
+ if (ep)
{
- rc = dat_ep_free (ep_handle);
+ rc = dat_ep_free (ep);
DT_assert_clean (phead, rc == DAT_SUCCESS);
}
- if (send_evd_handle)
+ if (send_evd)
{
- rc = DT_Tdep_evd_free (send_evd_handle);
+ rc = DT_Tdep_evd_free (send_evd);
DT_assert_clean (phead, rc == DAT_SUCCESS);
}
- if (recv_evd_handle)
+ if (recv_evd)
{
- rc = DT_Tdep_evd_free (recv_evd_handle);
+ rc = DT_Tdep_evd_free (recv_evd);
DT_assert_clean (phead, rc == DAT_SUCCESS);
}
- if (conn_evd_handle)
+ if (conn_evd)
{
- rc = DT_Tdep_evd_free (conn_evd_handle);
+ rc = DT_Tdep_evd_free (conn_evd);
DT_assert_clean (phead, rc == DAT_SUCCESS);
}
- if (lmr_handle)
+ if (lmr)
{
- rc = dat_lmr_free (lmr_handle);
+ rc = dat_lmr_free (lmr);
DT_assert_clean (phead, rc == DAT_SUCCESS);
}
@@ -391,27 +391,27 @@ cleanup:
DT_assert_clean (phead, rc == DAT_SUCCESS);
}
#endif
- if (psp_handle)
+ if (psp)
{
- rc = dat_psp_free (psp_handle);
+ rc = dat_psp_free (psp);
DT_assert_clean (phead, rc == DAT_SUCCESS);
}
- if (cr_evd_handle)
+ if (cr_evd)
{
- rc = DT_Tdep_evd_free (cr_evd_handle);
+ rc = DT_Tdep_evd_free (cr_evd);
DT_assert_clean (phead, rc == DAT_SUCCESS);
}
- if (pz_handle)
+ if (pz)
{
- rc = dat_pz_free (pz_handle);
+ rc = dat_pz_free (pz);
DT_assert_clean (phead, rc == DAT_SUCCESS);
}
- if (ia_handle)
+ if (ia)
{
- rc = dat_ia_close (ia_handle, DAT_CLOSE_ABRUPT_FLAG);
+ rc = dat_ia_close (ia, DAT_CLOSE_ABRUPT_FLAG);
DT_assert_clean (phead, rc == DAT_SUCCESS);
}
Index: linux-kernel/test/dapltest/test/dapl_transaction_test.c
===================================================================
--- linux-kernel/test/dapltest/test/dapl_transaction_test.c (revision 2564)
+++ linux-kernel/test/dapltest/test/dapl_transaction_test.c (working copy)
@@ -47,7 +47,7 @@
/****************************************************************************/
int
DT_Transaction_Test_Client (Per_Test_Data_t * pt_ptr,
- DAT_IA_HANDLE ia_handle,
+ struct dat_ia *ia,
struct sockaddr *remote_ia_addr)
{
Transaction_Cmd_t *cmd = &pt_ptr->Params.u.Transaction_Cmd;
@@ -68,7 +68,7 @@ DT_Transaction_Test_Client (Per_Test_Dat
DT_Tdep_PT_Debug (1,(phead,"Client: Starting Client side of test\n"));
if (!DT_Transaction_Create_Test (pt_ptr,
- ia_handle,
+ ia,
FALSE,
port_num,
pt_ptr->Server_Info.is_little_endian,
@@ -110,7 +110,7 @@ DT_Transaction_Test_Server (void *params
+ i * cmd->eps_per_thread;
if (!DT_Transaction_Create_Test (pt_ptr,
- pt_ptr->ps_ptr->ia_handle,
+ pt_ptr->ps_ptr->ia,
TRUE,
port_num,
pt_ptr->Client_Info.is_little_endian,
@@ -156,7 +156,7 @@ DT_Transaction_Test_Server (void *params
boolean_t
DT_Transaction_Create_Test (Per_Test_Data_t * pt_ptr,
- DAT_IA_HANDLE *ia_handle,
+ struct dat_ia *ia,
boolean_t is_server,
unsigned int port_num,
boolean_t remote_is_little_endian,
@@ -181,7 +181,7 @@ DT_Transaction_Create_Test (Per_Test_Dat
test_ptr->remote_is_little_endian = remote_is_little_endian;
test_ptr->is_server = is_server;
test_ptr->pt_ptr = pt_ptr;
- test_ptr->ia_handle = ia_handle;
+ test_ptr->ia = ia;
test_ptr->base_port = (DAT_CONN_QUAL) port_num;
test_ptr->cmd = &pt_ptr->Params.u.Transaction_Cmd;
test_ptr->time_out = DFLT_TMO * 1000; /* DFLT_TMO seconds */
@@ -244,18 +244,18 @@ DT_Transaction_Main (void *param)
private_data_str = "DAPL and RDMA rule! Test 4321.";
/* create a protection zone */
- ret = dat_pz_create (test_ptr->ia_handle, &test_ptr->pz_handle);
+ ret = dat_pz_create (test_ptr->ia, &test_ptr->pz);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_pz_create error: %s\n",
test_ptr->base_port, DT_RetToString (ret));
- test_ptr->pz_handle = DAT_HANDLE_NULL;
+ test_ptr->pz = NULL;
status = 1;
goto test_failure;
}
/* create 4 EVDs - recv, request+RMR, conn-request, connect */
- ret = DT_Tdep_evd_create (test_ptr->ia_handle,
+ ret = DT_Tdep_evd_create (test_ptr->ia,
test_ptr->evd_length,
NULL,
DAT_EVD_DTO_FLAG,
@@ -264,12 +264,12 @@ DT_Transaction_Main (void *param)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_evd_create (recv) error: %s\n",
test_ptr->base_port, DT_RetToString (ret));
- test_ptr->recv_evd_hdl = DAT_HANDLE_NULL;
+ test_ptr->recv_evd_hdl = NULL;
status = 1;
goto test_failure;
}
- ret = DT_Tdep_evd_create (test_ptr->ia_handle,
+ ret = DT_Tdep_evd_create (test_ptr->ia,
test_ptr->evd_length,
NULL,
DAT_EVD_DTO_FLAG | DAT_EVD_RMR_BIND_FLAG,
@@ -278,7 +278,7 @@ DT_Transaction_Main (void *param)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_evd_create (request) error: %s\n",
test_ptr->base_port, DT_RetToString (ret));
- test_ptr->reqt_evd_hdl = DAT_HANDLE_NULL;
+ test_ptr->reqt_evd_hdl = NULL;
status = 1;
goto test_failure;
}
@@ -286,7 +286,7 @@ DT_Transaction_Main (void *param)
if (pt_ptr->local_is_server)
{
/* Client-side doesn't need CR events */
- ret = DT_Tdep_evd_create (test_ptr->ia_handle,
+ ret = DT_Tdep_evd_create (test_ptr->ia,
test_ptr->evd_length,
NULL,
DAT_EVD_CR_FLAG,
@@ -295,13 +295,13 @@ DT_Transaction_Main (void *param)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_evd_create (cr) error: %s\n",
test_ptr->base_port, DT_RetToString (ret));
- test_ptr->creq_evd_hdl = DAT_HANDLE_NULL;
+ test_ptr->creq_evd_hdl = NULL;
status = 1;
goto test_failure;
}
}
- ret = DT_Tdep_evd_create (test_ptr->ia_handle,
+ ret = DT_Tdep_evd_create (test_ptr->ia,
test_ptr->evd_length,
NULL,
DAT_EVD_CONNECTION_FLAG,
@@ -310,7 +310,7 @@ DT_Transaction_Main (void *param)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_evd_create (conn) error: %s\n",
test_ptr->base_port, DT_RetToString (ret));
- test_ptr->conn_evd_hdl = DAT_HANDLE_NULL;
+ test_ptr->conn_evd_hdl = NULL;
status = 1;
goto test_failure;
}
@@ -363,18 +363,18 @@ DT_Transaction_Main (void *param)
}
/* Create EP */
- ret = dat_ep_create (test_ptr->ia_handle, /* IA */
- test_ptr->pz_handle, /* PZ */
+ ret = dat_ep_create (test_ptr->ia, /* IA */
+ test_ptr->pz, /* PZ */
test_ptr->recv_evd_hdl, /* recv */
test_ptr->reqt_evd_hdl, /* request */
test_ptr->conn_evd_hdl, /* connect */
&ep_attr, /* EP attrs */
- &test_ptr->ep_context[i].ep_handle);
+ &test_ptr->ep_context[i].ep);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_ep_create #%d error: %s\n",
test_ptr->base_port, i, DT_RetToString (ret));
- test_ptr->ep_context[i].ep_handle = DAT_HANDLE_NULL;
+ test_ptr->ep_context[i].ep = NULL;
status = 1;
goto test_failure;
}
@@ -385,10 +385,10 @@ DT_Transaction_Main (void *param)
*/
test_ptr->ep_context[i].bp = DT_BpoolAlloc (pt_ptr,
phead,
- test_ptr->ia_handle,
- test_ptr->pz_handle,
- test_ptr->ep_context[i].ep_handle,
- DAT_HANDLE_NULL, /* rmr */
+ test_ptr->ia,
+ test_ptr->pz,
+ test_ptr->ep_context[i].ep,
+ NULL, /* rmr */
buff_size,
4,
pt_ptr->provider_attr.optimal_buffer_alignment,
@@ -423,7 +423,7 @@ DT_Transaction_Main (void *param)
* Post recv and sync buffers
*/
if (!DT_post_recv_buffer ( phead,
- test_ptr->ep_context[i].ep_handle,
+ test_ptr->ep_context[i].ep,
test_ptr->ep_context[i].bp,
RMI_RECV_BUFFER_ID,
buff_size))
@@ -433,7 +433,7 @@ DT_Transaction_Main (void *param)
goto test_failure;
}
if (!DT_post_recv_buffer ( phead,
- test_ptr->ep_context[i].ep_handle,
+ test_ptr->ep_context[i].ep,
test_ptr->ep_context[i].bp,
SYNC_RECV_BUFFER_ID,
SYNC_BUFF_SIZE))
@@ -457,11 +457,11 @@ DT_Transaction_Main (void *param)
* await a connection for this EP
*/
- ret = dat_rsp_create (test_ptr->ia_handle,
+ ret = dat_rsp_create (test_ptr->ia,
test_ptr->ep_context[i].ia_port,
- test_ptr->ep_context[i].ep_handle,
+ test_ptr->ep_context[i].ep,
test_ptr->creq_evd_hdl,
- &test_ptr->ep_context[i].rsp_handle);
+ &test_ptr->ep_context[i].rsp);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_rsp_create #%d error: %s\n",
@@ -472,11 +472,11 @@ DT_Transaction_Main (void *param)
}
else
{
- ret = dat_psp_create (test_ptr->ia_handle,
+ ret = dat_psp_create (test_ptr->ia,
test_ptr->ep_context[i].ia_port,
test_ptr->creq_evd_hdl,
DAT_PSP_CONSUMER_FLAG,
- &test_ptr->ep_context[i].psp_handle);
+ &test_ptr->ep_context[i].psp);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_psp_create #%d error: %s\n",
@@ -519,7 +519,7 @@ DT_Transaction_Main (void *param)
RemoteMemoryInfo *RemoteMemInfo;
struct dat_dto_completion_event_data dto_stat;
struct dat_cr_arrival_event_data cr_stat;
- DAT_CR_HANDLE cr_handle;
+ struct dat_cr * cr;
/*
* Establish the connection
@@ -538,16 +538,16 @@ DT_Transaction_Main (void *param)
&cr_stat) ||
!DT_cr_check ( phead,
&cr_stat,
- test_ptr->ep_context[i].rsp_handle,
+ test_ptr->ep_context[i].rsp,
test_ptr->ep_context[i].ia_port,
- &cr_handle,
+ &cr,
"Server") )
{
status = 1;
goto test_failure;
}
- ret = dat_cr_query (cr_handle, &cr_param);
+ ret = dat_cr_query (cr, &cr_param);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_cr_query #%d error:(%x) %s\n",
@@ -571,21 +571,21 @@ DT_Transaction_Main (void *param)
}
/* what, me query? just try to accept the connection */
- ret = dat_cr_accept (cr_handle,
+ ret = dat_cr_accept (cr,
NULL, /* NULL for RSP */
0, (void *)0 /* no private data */ );
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_cr_accept #%d error: %s\n",
test_ptr->base_port, i, DT_RetToString (ret));
- /* cr_handle consumed on failure */
+ /* cr consumed on failure */
status = 1;
goto test_failure;
}
/* wait for DAT_CONNECTION_EVENT_ESTABLISHED */
if (!DT_conn_event_wait ( phead,
- test_ptr->ep_context[i].ep_handle,
+ test_ptr->ep_context[i].ep,
test_ptr->conn_evd_hdl,
&event_num))
{
@@ -594,7 +594,7 @@ DT_Transaction_Main (void *param)
goto test_failure;
}
/* throw away single-use PSP */
- ret = dat_rsp_free (test_ptr->ep_context[i].rsp_handle);
+ ret = dat_rsp_free (test_ptr->ep_context[i].rsp);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_rsp_free #%d error: %s\n",
@@ -622,16 +622,16 @@ DT_Transaction_Main (void *param)
if ( !DT_cr_check ( phead,
&cr_stat,
- test_ptr->ep_context[i].psp_handle,
+ test_ptr->ep_context[i].psp,
test_ptr->ep_context[i].ia_port,
- &cr_handle,
+ &cr,
"Server") )
{
status = 1;
goto test_failure;
}
- ret = dat_cr_query (cr_handle, &cr_param);
+ ret = dat_cr_query (cr, &cr_param);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_cr_query #%d error: %s\n",
@@ -656,33 +656,33 @@ DT_Transaction_Main (void *param)
/* what, me query? just try to accept the connection */
- ret = dat_cr_accept (cr_handle,
- test_ptr->ep_context[i].ep_handle,
+ ret = dat_cr_accept (cr,
+ test_ptr->ep_context[i].ep,
0, (void *)0 /* no private data */ );
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_cr_accept #%d error: %s\n",
test_ptr->base_port, i, DT_RetToString (ret));
- /* cr_handle consumed on failure */
- (void) dat_psp_free (test_ptr->ep_context[i].psp_handle);
+ /* cr consumed on failure */
+ (void) dat_psp_free (test_ptr->ep_context[i].psp);
status = 1;
goto test_failure;
}
/* wait for DAT_CONNECTION_EVENT_ESTABLISHED */
if (!DT_conn_event_wait ( phead,
- test_ptr->ep_context[i].ep_handle,
+ test_ptr->ep_context[i].ep,
test_ptr->conn_evd_hdl,
&event_num))
{
/* error message printed by DT_cr_event_wait */
- (void) dat_psp_free (&test_ptr->ep_context[i].psp_handle);
+ (void) dat_psp_free (test_ptr->ep_context[i].psp);
status = 1;
goto test_failure;
}
/* throw away single-use PSP */
- ret = dat_psp_free (test_ptr->ep_context[i].psp_handle);
+ ret = dat_psp_free (test_ptr->ep_context[i].psp);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_psp_free #%d error: %s\n",
@@ -709,7 +709,7 @@ DT_Transaction_Main (void *param)
test_ptr->ep_context[i].ia_port));
retry:
- ret = dat_ep_connect (test_ptr->ep_context[i].ep_handle,
+ ret = dat_ep_connect (test_ptr->ep_context[i].ep,
test_ptr->remote_ia_addr,
test_ptr->ep_context[i].ia_port,
DAT_TIMEOUT_MAX,
@@ -726,7 +726,7 @@ retry:
/* wait for DAT_CONNECTION_EVENT_ESTABLISHED */
if (!DT_conn_event_wait ( phead,
- test_ptr->ep_context[i].ep_handle,
+ test_ptr->ep_context[i].ep,
test_ptr->conn_evd_hdl,
&event_num))
{
@@ -742,7 +742,7 @@ retry:
struct dat_event event;
int drained = 0;
- dat_ep_reset (test_ptr->ep_context[i].ep_handle);
+ dat_ep_reset (test_ptr->ep_context[i].ep);
do
{
ret = DT_Tdep_evd_dequeue ( test_ptr->recv_evd_hdl,
@@ -756,7 +756,7 @@ retry:
* Post recv and sync buffers
*/
if (!DT_post_recv_buffer ( phead,
- test_ptr->ep_context[i].ep_handle,
+ test_ptr->ep_context[i].ep,
test_ptr->ep_context[i].bp,
RMI_RECV_BUFFER_ID,
buff_size))
@@ -766,7 +766,7 @@ retry:
goto test_failure;
}
if (!DT_post_recv_buffer ( phead,
- test_ptr->ep_context[i].ep_handle,
+ test_ptr->ep_context[i].ep,
test_ptr->ep_context[i].bp,
SYNC_RECV_BUFFER_ID,
SYNC_BUFF_SIZE))
@@ -835,9 +835,9 @@ retry:
test_ptr->ep_context[i].op[j].bp =
DT_BpoolAlloc (pt_ptr,
phead,
- test_ptr->ia_handle,
- test_ptr->pz_handle,
- test_ptr->ep_context[i].ep_handle,
+ test_ptr->ia,
+ test_ptr->pz,
+ test_ptr->ep_context[i].ep,
test_ptr->reqt_evd_hdl,
test_ptr->ep_context[i].op[j].seg_size,
test_ptr->ep_context[i].op[j].num_segs,
@@ -871,9 +871,9 @@ retry:
test_ptr->ep_context[i].op[j].bp =
DT_BpoolAlloc (pt_ptr,
phead,
- test_ptr->ia_handle,
- test_ptr->pz_handle,
- test_ptr->ep_context[i].ep_handle,
+ test_ptr->ia,
+ test_ptr->pz,
+ test_ptr->ep_context[i].ep,
test_ptr->reqt_evd_hdl,
test_ptr->ep_context[i].op[j].seg_size,
test_ptr->ep_context[i].op[j].num_segs,
@@ -906,10 +906,10 @@ retry:
test_ptr->ep_context[i].op[j].bp =
DT_BpoolAlloc (pt_ptr,
phead,
- test_ptr->ia_handle,
- test_ptr->pz_handle,
- test_ptr->ep_context[i].ep_handle,
- DAT_HANDLE_NULL, /* rmr */
+ test_ptr->ia,
+ test_ptr->pz,
+ test_ptr->ep_context[i].ep,
+ NULL, /* rmr */
test_ptr->ep_context[i].op[j].seg_size,
test_ptr->ep_context[i].op[j].num_segs,
pt_ptr->provider_attr.optimal_buffer_alignment,
@@ -976,7 +976,7 @@ retry:
/* post the send buffer */
if (!DT_post_send_buffer (phead,
- test_ptr->ep_context[i].ep_handle,
+ test_ptr->ep_context[i].ep,
test_ptr->ep_context[i].bp,
RMI_SEND_BUFFER_ID,
buff_size))
@@ -993,7 +993,7 @@ retry:
if (!DT_dto_event_wait (phead, test_ptr->reqt_evd_hdl, &dto_stat) ||
!DT_dto_check ( phead,
&dto_stat,
- test_ptr->ep_context[i].ep_handle,
+ test_ptr->ep_context[i].ep,
buff_size,
dto_cookie,
test_ptr->is_server ? "Client_Mem_Info_Send"
@@ -1017,7 +1017,7 @@ retry:
if (!DT_dto_event_wait (phead, test_ptr->recv_evd_hdl, &dto_stat) ||
!DT_dto_check ( phead,
&dto_stat,
- test_ptr->ep_context[i].ep_handle,
+ test_ptr->ep_context[i].ep,
buff_size,
dto_cookie,
test_ptr->is_server ? "Client_Mem_Info_Recv"
@@ -1082,9 +1082,9 @@ test_failure:
/* Foreach EP */
for (i = 0; i < test_ptr->cmd->eps_per_thread; i++)
{
- DAT_EP_HANDLE ep_handle;
+ struct dat_ep * ep;
- ep_handle = DAT_HANDLE_NULL;
+ ep = NULL;
/* Free the per-op buffers */
for (j = 0; j < test_ptr->cmd->num_ops; j++)
@@ -1122,9 +1122,9 @@ test_failure:
* bailed out mid-setup, or ran to completion
* normally, so we use abrupt closure.
*/
- if (test_ptr->ep_context[i].ep_handle)
+ if (test_ptr->ep_context[i].ep)
{
- ret = dat_ep_disconnect (test_ptr->ep_context[i].ep_handle,
+ ret = dat_ep_disconnect (test_ptr->ep_context[i].ep,
DAT_CLOSE_ABRUPT_FLAG);
if (ret != DAT_SUCCESS)
{
@@ -1148,7 +1148,7 @@ test_failure:
{
if (!DT_disco_event_wait ( phead,
test_ptr->conn_evd_hdl,
- &ep_handle))
+ &ep))
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: bad disconnect event\n",
test_ptr->base_port);
@@ -1164,16 +1164,16 @@ test_failure:
*/
for (j = 0; j < test_ptr->cmd->eps_per_thread; j++)
{
- if ( test_ptr->ep_context[j].ep_handle == ep_handle )
+ if ( test_ptr->ep_context[j].ep == ep )
{
- test_ptr->ep_context[j].ep_handle = NULL;
+ test_ptr->ep_context[j].ep = NULL;
}
}
}
}
else /* !success - QP may be in error state */
{
- ep_handle = test_ptr->ep_context[i].ep_handle;
+ ep = test_ptr->ep_context[i].ep;
}
/*
@@ -1182,7 +1182,7 @@ test_failure:
* disconnected as we are racing with the remote side
* disconnects.
*/
- if ( DAT_HANDLE_NULL != ep_handle)
+ if ( NULL != ep)
{
struct dat_event event;
/*
@@ -1195,7 +1195,7 @@ test_failure:
&event);
} while (ret == DAT_SUCCESS);
/* Destroy the EP */
- ret = dat_ep_free (ep_handle);
+ ret = dat_ep_free (ep);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_ep_free #%d error: %s\n",
@@ -1259,9 +1259,9 @@ test_failure:
}
/* clean up the PZ */
- if (test_ptr->pz_handle)
+ if (test_ptr->pz)
{
- ret = dat_pz_free (test_ptr->pz_handle);
+ ret = dat_pz_free (test_ptr->pz);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_pz_free error: %s\n",
@@ -1357,7 +1357,7 @@ DT_Transaction_Run (DT_Tdep_Print_Head *
for (i = 0; i < test_ptr->cmd->eps_per_thread; i++)
{
if (!DT_post_send_buffer (phead,
- test_ptr->ep_context[i].ep_handle,
+ test_ptr->ep_context[i].ep,
test_ptr->ep_context[i].bp,
SYNC_SEND_BUFFER_ID,
SYNC_BUFF_SIZE))
@@ -1432,7 +1432,7 @@ DT_Transaction_Run (DT_Tdep_Print_Head *
for (i = 0; i < test_ptr->cmd->eps_per_thread; i++)
{
if (!DT_post_send_buffer (phead,
- test_ptr->ep_context[i].ep_handle,
+ test_ptr->ep_context[i].ep,
test_ptr->ep_context[i].bp,
SYNC_SEND_BUFFER_ID,
SYNC_BUFF_SIZE))
@@ -1923,8 +1923,8 @@ DT_Print_Transaction_Test (DT_Tdep_Print
test_ptr->remote_is_little_endian);
DT_Tdep_PT_Printf (phead, "TransTest.base_port : " F64x "\n",
test_ptr->base_port);
- DT_Tdep_PT_Printf (phead, "TransTest.pz_handle : %p\n",
- test_ptr->pz_handle);
+ DT_Tdep_PT_Printf (phead, "TransTest.pz : %p\n",
+ test_ptr->pz);
/* statistics */
DT_Tdep_PT_Printf (phead, "TransTest.bytes_send : %d\n",
test_ptr->stats.stat_bytes_send);
Index: linux-kernel/test/dapltest/test/dapl_performance_server.c
===================================================================
--- linux-kernel/test/dapltest/test/dapl_performance_server.c (revision 2564)
+++ linux-kernel/test/dapltest/test/dapl_performance_server.c (working copy)
@@ -41,7 +41,7 @@ DT_Performance_Test_Server (
DT_Tdep_PT_Debug (1,(phead,"Server: Starting performance test\n"));
if ( !DT_Performance_Test_Create (pt_ptr,
- pt_ptr->ps_ptr->ia_handle,
+ pt_ptr->ps_ptr->ia,
(struct sockaddr *) 0,
TRUE,
pt_ptr->Client_Info.is_little_endian,
@@ -97,15 +97,15 @@ DT_Performance_Test_Server_Connect (
{
u32 ret;
boolean_t status;
- DAT_RSP_HANDLE rsp_handle;
- DAT_PSP_HANDLE psp_handle;
+ struct dat_sp * rsp;
+ struct dat_sp * psp;
struct dat_cr_arrival_event_data cr_stat;
- DAT_CR_HANDLE cr_handle;
+ struct dat_cr * cr;
enum dat_event_number event_num;
- rsp_handle = DAT_HANDLE_NULL;
- psp_handle = DAT_HANDLE_NULL;
+ rsp = NULL;
+ psp = NULL;
#if 0 /* FIXME */
if (test_ptr->cmd->use_rsp)
{
@@ -113,11 +113,11 @@ DT_Performance_Test_Server_Connect (
* Server - create a single-use RSP and
* await a connection for this EP
*/
- ret = dat_rsp_create (test_ptr->ia_handle,
+ ret = dat_rsp_create (test_ptr->ia,
test_ptr->ep_context.port,
- test_ptr->ep_context.ep_handle,
+ test_ptr->ep_context.ep,
test_ptr->creq_evd_hdl,
- &rsp_handle);
+ &rsp);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_rsp_create error: %s\n",
@@ -132,9 +132,9 @@ DT_Performance_Test_Server_Connect (
/* wait for the connection request */
if (!DT_cr_event_wait (test_ptr->conn_evd_hdl, &cr_stat) ||
!DT_cr_check ( &cr_stat,
- DAT_HANDLE_NULL,
+ NULL,
test_ptr->ep_context.port,
- &cr_handle,
+ &cr,
"Server") )
{
status = FALSE;
@@ -142,20 +142,20 @@ DT_Performance_Test_Server_Connect (
}
/* what, me query? just try to accept the connection */
- ret = dat_cr_accept (cr_handle,
- test_ptr->ep_context.ep_handle,
+ ret = dat_cr_accept (cr,
+ test_ptr->ep_context.ep,
0, (void *)0 /* no private data */ );
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_cr_accept error: %s\n",
test_ptr->base_port, DT_RetToString (ret));
- /* cr_handle consumed on failure */
+ /* cr consumed on failure */
status = FALSE;
goto psp_free;
}
/* wait for DAT_CONNECTION_EVENT_ESTABLISHED */
- if (!DT_conn_event_wait ( test_ptr->ep_context.ep_handle,
+ if (!DT_conn_event_wait ( test_ptr->ep_context.ep,
test_ptr->conn_evd_hdl,
&event_num))
{
@@ -173,17 +173,17 @@ DT_Performance_Test_Server_Connect (
*/
status = TRUE;
- ret = dat_psp_create (test_ptr->ia_handle,
+ ret = dat_psp_create (test_ptr->ia,
test_ptr->ep_context.port,
test_ptr->creq_evd_hdl,
DAT_PSP_CONSUMER_FLAG,
- &psp_handle);
+ &psp);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_psp_create error: %s\n",
test_ptr->base_port, DT_RetToString (ret));
status = FALSE;
- psp_handle = DAT_HANDLE_NULL;
+ psp = NULL;
return (status);
}
@@ -204,9 +204,9 @@ DT_Performance_Test_Server_Connect (
if (!DT_cr_event_wait (phead, test_ptr->creq_evd_hdl, &cr_stat) ||
!DT_cr_check ( phead,
&cr_stat,
- psp_handle,
+ psp,
test_ptr->ep_context.port,
- &cr_handle,
+ &cr,
"Server") )
{
status = FALSE;
@@ -214,22 +214,22 @@ DT_Performance_Test_Server_Connect (
}
/* what, me query? just try to accept the connection */
- ret = dat_cr_accept (cr_handle,
- test_ptr->ep_context.ep_handle,
+ ret = dat_cr_accept (cr,
+ test_ptr->ep_context.ep,
0,
(void *)0 /* no private data */ );
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_cr_accept error: %s\n",
test_ptr->base_port, DT_RetToString (ret));
- /* cr_handle consumed on failure */
+ /* cr consumed on failure */
status = FALSE;
goto psp_free;
}
/* wait for DAT_CONNECTION_EVENT_ESTABLISHED */
if (!DT_conn_event_wait (phead,
- test_ptr->ep_context.ep_handle,
+ test_ptr->ep_context.ep,
test_ptr->conn_evd_hdl,
&event_num ) )
{
@@ -241,10 +241,10 @@ DT_Performance_Test_Server_Connect (
DT_Tdep_PT_Debug (1, (phead,"Server[" F64x "]: Accept on port 0x" F64x "\n",
test_ptr->base_port, test_ptr->ep_context.port));
psp_free:
- if ( DAT_HANDLE_NULL != psp_handle )
+ if ( NULL != psp )
{
/* throw away single-use PSP */
- ret = dat_psp_free (psp_handle);
+ ret = dat_psp_free (psp);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_psp_free error: %s\n",
@@ -252,10 +252,10 @@ psp_free:
status = FALSE;
}
}
- if ( DAT_HANDLE_NULL != rsp_handle )
+ if ( NULL != rsp )
{
/* throw away single-use PSP */
- ret = dat_rsp_free (rsp_handle);
+ ret = dat_rsp_free (rsp);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "Test[" F64x "]: dat_rsp_free error: %s\n",
@@ -282,9 +282,9 @@ DT_Performance_Test_Server_Exchange (
test_ptr->ep_context.op.bp =
DT_BpoolAlloc (test_ptr->pt_ptr,
phead,
- test_ptr->ia_handle,
- test_ptr->pz_handle,
- test_ptr->ep_context.ep_handle,
+ test_ptr->ia,
+ test_ptr->pz,
+ test_ptr->ep_context.ep,
test_ptr->reqt_evd_hdl,
test_ptr->ep_context.op.seg_size,
test_ptr->ep_context.op.num_segs,
@@ -340,7 +340,7 @@ DT_Performance_Test_Server_Exchange (
/* post the send buffer */
if (!DT_post_send_buffer (phead,
- test_ptr->ep_context.ep_handle,
+ test_ptr->ep_context.ep,
test_ptr->ep_context.bp,
DT_PERF_SYNC_SEND_BUFFER_ID,
DT_PERF_SYNC_BUFF_SIZE))
@@ -358,7 +358,7 @@ DT_Performance_Test_Server_Exchange (
if ( !DT_dto_event_wait (phead, test_ptr->reqt_evd_hdl, &dto_stat) ||
!DT_dto_check (phead,
&dto_stat,
- test_ptr->ep_context.ep_handle,
+ test_ptr->ep_context.ep,
DT_PERF_SYNC_BUFF_SIZE,
dto_cookie,
"Send Sync_Msg") )
@@ -380,7 +380,7 @@ DT_Performance_Test_Server_Exchange (
if ( !DT_dto_event_wait (phead, test_ptr->recv_evd_hdl, &dto_stat) ||
!DT_dto_check ( phead,
&dto_stat,
- test_ptr->ep_context.ep_handle,
+ test_ptr->ep_context.ep,
DT_PERF_SYNC_BUFF_SIZE,
dto_cookie,
"Recieve Sync_Msg") )
Index: linux-kernel/test/dapltest/test/dapl_fft_dataxfer_client.c
===================================================================
--- linux-kernel/test/dapltest/test/dapl_fft_dataxfer_client.c (revision 2564)
+++ linux-kernel/test/dapltest/test/dapl_fft_dataxfer_client.c (working copy)
@@ -40,7 +40,7 @@ int DT_dataxfer_client_generic (DT_Tdep_
u32 rc=0;
DT_fft_init_client (phead, cmd, &conn);
- DT_assert_dat (phead, conn.ia_handle != NULL)
+ DT_assert_dat (phead, conn.ia != NULL)
DT_assert (phead, DT_fft_connect (phead, &conn));
@@ -58,8 +58,8 @@ int DT_dataxfer_client_generic (DT_Tdep_
{
conn.bpool = DT_BpoolAlloc (0,
phead,
- conn.ia_handle,
- conn.pz_handle,
+ conn.ia,
+ conn.pz,
NULL,
NULL,
4096,
@@ -68,7 +68,7 @@ int DT_dataxfer_client_generic (DT_Tdep_
FALSE,
FALSE);
DT_assert (phead, conn.bpool != 0);
- rc = DT_post_send_buffer (phead, conn.ep_handle, conn.bpool, 0,
+ rc = DT_post_send_buffer (phead, conn.ep, conn.bpool, 0,
DT_Bpool_GetBuffSize (conn.bpool, 0));
DT_assert_dat (phead, rc == DAT_SUCCESS);
rc = dat_evd_wait (conn.send_evd, 10*1000000, 1, &conn.event,
@@ -80,11 +80,11 @@ int DT_dataxfer_client_generic (DT_Tdep_
/* cleanup */
cleanup:
- if (conn.ep_handle)
+ if (conn.ep)
{
/* disconnect */
DT_Tdep_PT_Printf (phead, "Disconnect\n");
- rc = dat_ep_disconnect (conn.ep_handle, DAT_CLOSE_ABRUPT_FLAG);
+ rc = dat_ep_disconnect (conn.ep, DAT_CLOSE_ABRUPT_FLAG);
DT_assert_clean (phead, rc == DAT_SUCCESS);
}
rc = DT_fft_destroy_conn_struct (phead, &conn);
Index: linux-kernel/test/dapltest/test/dapl_fft_connmgt.c
===================================================================
--- linux-kernel/test/dapltest/test/dapl_fft_connmgt.c (revision 2564)
+++ linux-kernel/test/dapltest/test/dapl_fft_connmgt.c (working copy)
@@ -39,7 +39,7 @@ int DT_connmgt_case0 (Params_t *params_p
Description: Ensure time in dat_evd_wait works correctly\n");
DT_fft_init_server (params_ptr, cmd, &conn);
- DT_assert (phead, NULL != conn.ia_handle);
+ DT_assert (phead, NULL != conn.ia);
rc = DT_Tdep_evd_wait (conn.cr_evd, 10000, &conn.event);
DT_assert_dat (phead, DAT_GET_TYPE (rc) == DAT_TIMEOUT_EXPIRED);
@@ -62,7 +62,7 @@ int DT_connmgt_case1 (Params_t *params_p
Description: Attempt to use timeout of 0 in dat_evd_wait\n");
DT_fft_init_server (params_ptr, cmd, &conn);
- DT_assert (phead, NULL != conn.ia_handle);
+ DT_assert (phead, NULL != conn.ia);
rc = DT_Tdep_evd_wait (conn.cr_evd, 0, &conn.event);
DT_assert_dat (phead, DAT_GET_TYPE (rc) == DAT_TIMEOUT_EXPIRED);
Index: linux-kernel/test/dapltest/test/dapl_bpool.c
===================================================================
--- linux-kernel/test/dapltest/test/dapl_bpool.c (revision 2564)
+++ linux-kernel/test/dapltest/test/dapl_bpool.c (working copy)
@@ -86,10 +86,10 @@ Bpool *
DT_BpoolAlloc (
Per_Test_Data_t *pt_ptr,
DT_Tdep_Print_Head *phead,
- DAT_IA_HANDLE ia_handle,
- DAT_PZ_HANDLE pz_handle,
- DAT_EP_HANDLE ep_handle,
- DAT_EVD_HANDLE rmr_evd_handle,
+ struct dat_ia * ia,
+ struct dat_pz * pz,
+ struct dat_ep * ep,
+ struct dat_evd * rmr_evd,
int seg_size,
int num_segs,
int alignment,
@@ -131,16 +131,16 @@ DT_BpoolAlloc (
bpool_ptr->alloc_ptr = alloc_ptr;
bpool_ptr->alloc_size = alloc_size;
- bpool_ptr->pz_handle = pz_handle;
+ bpool_ptr->pz = pz;
bpool_ptr->num_segs = num_segs;
- bpool_ptr->ep_handle = ep_handle;
+ bpool_ptr->ep = ep;
bpool_ptr->buffer_size = seg_size * num_segs;
bpool_ptr->buffer_start = DT_AlignPtr (alloc_ptr, alignment) + GG_ALLOC_OFFSET;
bpool_ptr->tripl_start = (struct dat_lmr_triplet *) (bpool_ptr + 1);
bpool_ptr->seg_size = seg_size;
bpool_ptr->enable_rdma_write = enable_rdma_write;
bpool_ptr->enable_rdma_read = enable_rdma_read;
- bpool_ptr->rmr_evd_handle = rmr_evd_handle;
+ bpool_ptr->rmr_evd = rmr_evd;
DT_Tdep_PT_Debug (3,
(phead,
"lmr_create [%p, " F64x "]\n",
@@ -160,14 +160,14 @@ DT_BpoolAlloc (
region.for_pa = virt_to_phys(region.for_va);
}
- ret = dat_lmr_kcreate (ia_handle,
+ ret = dat_lmr_kcreate (ia,
DT_mem_type,
region,
bp_len,
- pz_handle,
+ pz,
DAT_MEM_PRIV_ALL_FLAG,
DAT_MEM_OPTIMIZE_DONT_CARE,
- &bpool_ptr->lmr_handle,
+ &bpool_ptr->lmr,
&bpool_ptr->lmr_context,
&bpool_ptr->rmr_context,
&bpool_ptr->reg_size,
@@ -213,7 +213,7 @@ DT_BpoolAlloc (
struct dat_rmr_bind_completion_event_data rmr_stat;
/* create the RMR */
- ret = dat_rmr_create (pz_handle, &bpool_ptr->rmr_handle);
+ ret = dat_rmr_create (pz, &bpool_ptr->rmr_handle);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "%s: dat_rmr_create failed %s\n",
@@ -238,7 +238,7 @@ DT_BpoolAlloc (
ret = dat_rmr_bind ( bpool_ptr->rmr_handle,
&iov,
mflags,
- bpool_ptr->ep_handle,
+ bpool_ptr->ep,
cookie,
DAT_COMPLETION_DEFAULT_FLAG,
&bpool_ptr->rmr_context);
@@ -253,7 +253,7 @@ DT_BpoolAlloc (
/* await the bind result */
if (!DT_rmr_event_wait (phead,
- bpool_ptr->rmr_evd_handle,
+ bpool_ptr->rmr_evd,
&rmr_stat) ||
!DT_rmr_check (phead,
&rmr_stat,
@@ -290,9 +290,9 @@ err:
DT_RetToString (ret));
}
}
- if (bpool_ptr->lmr_handle)
+ if (bpool_ptr->lmr)
{
- ret = dat_lmr_free (bpool_ptr->lmr_handle);
+ ret = dat_lmr_free (bpool_ptr->lmr);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead,
@@ -357,9 +357,9 @@ DT_Bpool_Destroy (Per_Test_Data_t * pt_p
}
}
- if (bpool_ptr->lmr_handle)
+ if (bpool_ptr->lmr)
{
- u32 ret = dat_lmr_free (bpool_ptr->lmr_handle);
+ u32 ret = dat_lmr_free (bpool_ptr->lmr);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead,
@@ -433,8 +433,8 @@ DT_Bpool_print (DT_Tdep_Print_Head *phea
"BPOOL alloc_size %x\n",
(int) bpool_ptr->alloc_size);
DT_Tdep_PT_Printf (phead,
- "BPOOL pz_handle %p\n",
- bpool_ptr->pz_handle);
+ "BPOOL pz %p\n",
+ bpool_ptr->pz);
DT_Tdep_PT_Printf (phead,
"BPOOL num_segs %x\n",
(int) bpool_ptr->num_segs);
Index: linux-kernel/test/dapltest/test/dapl_test_util.c
===================================================================
--- linux-kernel/test/dapltest/test/dapl_test_util.c (revision 2564)
+++ linux-kernel/test/dapltest/test/dapl_test_util.c (working copy)
@@ -32,11 +32,11 @@
*/
boolean_t
DT_query ( Per_Test_Data_t *pt_ptr,
- DAT_IA_HANDLE ia_handle,
- DAT_EP_HANDLE ep_handle)
+ struct dat_ia * ia,
+ struct dat_ep * ep)
{
unsigned char *module = "DT_query";
- DAT_EVD_HANDLE async_evd_hdl; /* not used */
+ struct dat_evd * async_evd_hdl; /* not used */
struct dat_ep_param ep_params;
u32 ret;
DT_Tdep_Print_Head *phead;
@@ -44,7 +44,7 @@ DT_query ( Per_Test_Data_t *pt_ptr,
phead = pt_ptr->Params.phead;
/* Query the IA */
- ret = dat_ia_query (ia_handle,
+ ret = dat_ia_query (ia,
&async_evd_hdl,
&pt_ptr->ia_attr,
&pt_ptr->provider_attr);
@@ -57,7 +57,7 @@ DT_query ( Per_Test_Data_t *pt_ptr,
}
/* Query the EP */
- ret = dat_ep_query (ep_handle, &ep_params);
+ ret = dat_ep_query (ep, &ep_params);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "%s: dat_ep_query error: %s\n",
@@ -160,7 +160,7 @@ DT_query ( Per_Test_Data_t *pt_ptr,
*/
boolean_t
DT_post_recv_buffer (DT_Tdep_Print_Head *phead,
- DAT_EP_HANDLE ep_handle,
+ struct dat_ep *ep,
Bpool * bp,
int index,
int size)
@@ -184,7 +184,7 @@ DT_post_recv_buffer (DT_Tdep_Print_Head
DT_Tdep_PT_Debug (3, (phead, "Post-Recv #%d [%p, %x]\n", index, buff, size));
/* Post the recv buffer */
- ret = dat_ep_post_recv (ep_handle,
+ ret = dat_ep_post_recv (ep,
1,
iov,
cookie,
@@ -205,7 +205,7 @@ DT_post_recv_buffer (DT_Tdep_Print_Head
*/
boolean_t
DT_post_send_buffer (DT_Tdep_Print_Head *phead,
- DAT_EP_HANDLE ep_handle,
+ struct dat_ep *ep,
Bpool * bp,
int index,
int size)
@@ -228,7 +228,7 @@ DT_post_send_buffer (DT_Tdep_Print_Head
DT_Tdep_PT_Debug (3, (phead, "Post-Send #%d [%p, %x]\n", index, buff, size));
/* Post the recv buffer */
- ret = dat_ep_post_send (ep_handle,
+ ret = dat_ep_post_send (ep,
1,
iov,
cookie,
@@ -249,7 +249,7 @@ DT_post_send_buffer (DT_Tdep_Print_Head
*/
boolean_t
DT_cr_event_wait ( DT_Tdep_Print_Head *phead,
- DAT_EVD_HANDLE evd_handle,
+ struct dat_evd *evd,
struct dat_cr_arrival_event_data *cr_stat_p)
{
int err_cnt;
@@ -261,7 +261,7 @@ DT_cr_event_wait ( DT_Tdep_Print_Head *p
u32 ret;
struct dat_event event;
- ret = DT_Tdep_evd_wait (evd_handle, DAT_TIMEOUT_MAX, &event);
+ ret = DT_Tdep_evd_wait (evd, DAT_TIMEOUT_MAX, &event);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "Test Error: dapl_event_wait (CR) failed: %s\n",
@@ -306,8 +306,8 @@ DT_cr_event_wait ( DT_Tdep_Print_Head *p
*/
boolean_t
DT_conn_event_wait (DT_Tdep_Print_Head *phead,
- DAT_EP_HANDLE ep_handle,
- DAT_EVD_HANDLE evd_handle,
+ struct dat_ep * ep,
+ struct dat_evd *evd,
enum dat_event_number *event_number)
{
@@ -316,7 +316,7 @@ DT_conn_event_wait (DT_Tdep_Print_Head *
u32 ret;
struct dat_event event;
- ret = DT_Tdep_evd_wait (evd_handle, DAT_TIMEOUT_MAX, &event);
+ ret = DT_Tdep_evd_wait (evd, DAT_TIMEOUT_MAX, &event);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "Test Error: dapl_event_wait (CONN) failed: %s\n",
@@ -341,7 +341,7 @@ DT_conn_event_wait (DT_Tdep_Print_Head *
{
/*
* Could return struct dat_connection_event_data and verify:
- * event.event_data.connect_event_data.ep_handle
+ * event.event_data.connect_event_data.ep
* event.event_data.connect_event_data.private_data_size
* event.event_data.connect_event_data.private_data
*/
@@ -361,15 +361,15 @@ DT_conn_event_wait (DT_Tdep_Print_Head *
*/
boolean_t
DT_disco_event_wait ( DT_Tdep_Print_Head *phead,
- DAT_EVD_HANDLE evd_handle,
- DAT_EP_HANDLE *ep_handle )
+ struct dat_evd *evd,
+ struct dat_ep * *ep )
{
for (;;)
{
u32 ret;
struct dat_event event;
- ret = DT_Tdep_evd_wait (evd_handle, DAT_TIMEOUT_MAX, &event);
+ ret = DT_Tdep_evd_wait (evd, DAT_TIMEOUT_MAX, &event);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "Test Error: dapl_event_wait (DISCONN) failed: %s\n",
@@ -392,9 +392,9 @@ DT_disco_event_wait ( DT_Tdep_Print_Head
if (event.event_number == DAT_CONNECTION_EVENT_DISCONNECTED)
{
- if ( ep_handle != NULL )
+ if ( ep != NULL )
{
- *ep_handle = event.event_data.connect_event_data.ep_handle;
+ *ep = event.event_data.connect_event_data.ep;
}
return (TRUE);
}
@@ -412,17 +412,17 @@ DT_disco_event_wait ( DT_Tdep_Print_Head
*/
boolean_t
DT_dto_event_reap (DT_Tdep_Print_Head *phead,
- DAT_EVD_HANDLE evd_handle,
+ struct dat_evd *evd,
boolean_t poll,
struct dat_dto_completion_event_data *dto_statusp)
{
if (poll)
{
- return DT_dto_event_poll (phead, evd_handle, dto_statusp);
+ return DT_dto_event_poll (phead, evd, dto_statusp);
}
else
{
- return DT_dto_event_wait (phead, evd_handle, dto_statusp);
+ return DT_dto_event_wait (phead, evd, dto_statusp);
}
}
@@ -432,7 +432,7 @@ DT_dto_event_reap (DT_Tdep_Print_Head *p
*/
boolean_t
DT_dto_event_poll (DT_Tdep_Print_Head *phead,
- DAT_EVD_HANDLE evd_handle,
+ struct dat_evd *evd,
struct dat_dto_completion_event_data *dto_statusp)
{
for (;;)
@@ -440,7 +440,7 @@ DT_dto_event_poll (DT_Tdep_Print_Head *p
u32 ret;
struct dat_event event;
- ret = DT_Tdep_evd_dequeue ( evd_handle,
+ ret = DT_Tdep_evd_dequeue ( evd,
&event);
if (DAT_GET_TYPE (ret) == DAT_QUEUE_EMPTY)
@@ -460,7 +460,7 @@ DT_dto_event_poll (DT_Tdep_Print_Head *p
{
/*
* Pass back all the useful bits if requested:
- * ep_handle, user_cookie.as_ptr
+ * ep, user_cookie.as_ptr
* status, transfered_length
*/
if (dto_statusp)
@@ -484,7 +484,7 @@ DT_dto_event_poll (DT_Tdep_Print_Head *p
*/
boolean_t
DT_dto_event_wait (DT_Tdep_Print_Head *phead,
- DAT_EVD_HANDLE evd_handle,
+ struct dat_evd *evd,
struct dat_dto_completion_event_data *dto_statusp)
{
for (;;)
@@ -492,7 +492,7 @@ DT_dto_event_wait (DT_Tdep_Print_Head *p
u32 ret;
struct dat_event event;
- ret = DT_Tdep_evd_wait (evd_handle, DAT_TIMEOUT_MAX, &event);
+ ret = DT_Tdep_evd_wait (evd, DAT_TIMEOUT_MAX, &event);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "Test Error: dapl_event_wait (DTO) failed: %s\n",
@@ -505,7 +505,7 @@ DT_dto_event_wait (DT_Tdep_Print_Head *p
{
/*
* Pass back all the useful bits if requested:
- * ep_handle, user_cookie.as_ptr
+ * ep, user_cookie.as_ptr
* status, transfered_length
*/
if (dto_statusp)
@@ -528,7 +528,7 @@ DT_dto_event_wait (DT_Tdep_Print_Head *p
*/
boolean_t
DT_rmr_event_wait (DT_Tdep_Print_Head *phead,
- DAT_EVD_HANDLE evd_handle,
+ struct dat_evd *evd,
struct dat_rmr_bind_completion_event_data *rmr_statusp)
{
for (;;)
@@ -536,7 +536,7 @@ DT_rmr_event_wait (DT_Tdep_Print_Head *p
u32 ret;
struct dat_event event;
- ret = DT_Tdep_evd_wait (evd_handle, DAT_TIMEOUT_MAX, &event);
+ ret = DT_Tdep_evd_wait (evd, DAT_TIMEOUT_MAX, &event);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "Test Error: dapl_event_wait (RMR) failed: %s\n",
@@ -572,12 +572,12 @@ DT_rmr_event_wait (DT_Tdep_Print_Head *p
boolean_t
DT_dto_check ( DT_Tdep_Print_Head *phead,
struct dat_dto_completion_event_data *dto_p,
- DAT_EP_HANDLE ep_expected,
+ struct dat_ep * ep_expected,
int len_expected,
DAT_DTO_COOKIE cookie_expected,
char *message )
{
- if ( ( (ep_expected != NULL) && (dto_p->ep_handle != ep_expected) )
+ if ( ( (ep_expected != NULL) && (dto_p->ep != ep_expected) )
|| dto_p->transfered_length != len_expected
|| dto_p->user_cookie.as_64 != cookie_expected.as_64
|| dto_p->status != DAT_DTO_SUCCESS )
@@ -588,10 +588,10 @@ DT_dto_check ( DT_Tdep_Print_Head *phead
: (dto_p->status == DAT_DTO_ERR_FLUSHED ? "FAILURE"
: "LengthError")));
DT_Test_Error ();
- if ( (ep_expected != NULL) && (dto_p->ep_handle != ep_expected) )
+ if ( (ep_expected != NULL) && (dto_p->ep != ep_expected) )
{
DT_Tdep_PT_Printf (phead, "\tEndPoint mismatch (got %p wanted %p)\n",
- dto_p->ep_handle,
+ dto_p->ep,
ep_expected);
}
if (dto_p->transfered_length != len_expected)
@@ -620,11 +620,11 @@ DT_dto_check ( DT_Tdep_Print_Head *phead
boolean_t
DT_rmr_check ( DT_Tdep_Print_Head *phead,
struct dat_rmr_bind_completion_event_data *rmr_p,
- DAT_RMR_HANDLE rmr_expected,
+ struct dat_rmr * rmr_expected,
void * cookie_expected,
char *message)
{
- if ( rmr_p->rmr_handle != rmr_expected
+ if ( rmr_p->rmr != rmr_expected
|| rmr_p->user_cookie.as_ptr != cookie_expected
|| rmr_p->status != DAT_RMR_BIND_SUCCESS )
{
@@ -634,10 +634,10 @@ DT_rmr_check ( DT_Tdep_Print_Head *phead
(rmr_p->status == DAT_RMR_BIND_SUCCESS
? "OK" : "FAILURE"));
DT_Test_Error ();
- if (rmr_p->rmr_handle != rmr_expected)
+ if (rmr_p->rmr != rmr_expected)
{
DT_Tdep_PT_Printf (phead, "\tRMR handle mismatch (got 0x%p wanted 0x%p)\n",
- rmr_p->rmr_handle,
+ rmr_p->rmr,
rmr_expected);
}
if (rmr_p->user_cookie.as_ptr != cookie_expected)
@@ -659,21 +659,21 @@ DT_rmr_check ( DT_Tdep_Print_Head *phead
boolean_t
DT_cr_check ( DT_Tdep_Print_Head *phead,
struct dat_cr_arrival_event_data *cr_stat_p,
- DAT_PSP_HANDLE psp_handle_expected,
+ struct dat_sp * psp_expected,
DAT_CONN_QUAL port_expected,
- DAT_CR_HANDLE *cr_handlep,
+ struct dat_cr * *crp,
char *message)
{
u32 ret;
- if (cr_handlep)
+ if (crp)
{
- *cr_handlep = (DAT_CR_HANDLE) 0;
+ *crp = (struct dat_cr *) 0;
}
if (cr_stat_p->conn_qual != port_expected ||
- (psp_handle_expected &&
- cr_stat_p->sp_handle.psp_handle != psp_handle_expected))
+ (psp_expected &&
+ cr_stat_p->sp != psp_expected))
{
DT_Tdep_PT_Printf (phead, "Test Error: %s CR data problem\n", message);
@@ -684,20 +684,20 @@ DT_cr_check ( DT_Tdep_Print_Head *phead
" (got 0x" F64x " wanted 0x" F64x ")\n",
cr_stat_p->conn_qual, port_expected);
}
- if (psp_handle_expected &&
- cr_stat_p->sp_handle.psp_handle != psp_handle_expected)
+ if (psp_expected &&
+ cr_stat_p->sp != psp_expected)
{
DT_Tdep_PT_Printf (phead, "\tPSP mismatch (got 0x%p wanted 0x%p)\n",
- cr_stat_p->sp_handle.psp_handle,
- psp_handle_expected);
+ cr_stat_p->sp,
+ psp_expected);
}
- if (!cr_stat_p->cr_handle)
+ if (!cr_stat_p->cr)
{
- DT_Tdep_PT_Printf (phead, "\tGot NULL cr_handle\n");
+ DT_Tdep_PT_Printf (phead, "\tGot NULL cr\n");
}
else
{
- ret = dat_cr_reject (cr_stat_p->cr_handle);
+ ret = dat_cr_reject (cr_stat_p->cr);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "\tdat_cr_reject error: %s\n",
@@ -707,9 +707,9 @@ DT_cr_check ( DT_Tdep_Print_Head *phead
return ( FALSE );
}
- if (cr_handlep)
+ if (crp)
{
- *cr_handlep = cr_stat_p->cr_handle;
+ *crp = cr_stat_p->cr;
}
return ( TRUE );
}
Index: linux-kernel/test/dapltest/test/dapl_client.c
===================================================================
--- linux-kernel/test/dapltest/test/dapl_client.c (revision 2564)
+++ linux-kernel/test/dapltest/test/dapl_client.c (working copy)
@@ -41,13 +41,13 @@ DT_cs_Client (Params_t * params_ptr,
u32 total_threads)
{
Per_Test_Data_t *pt_ptr = NULL;
- DAT_IA_HANDLE ia_handle = DAT_HANDLE_NULL;
- DAT_PZ_HANDLE pz_handle = DAT_HANDLE_NULL;
- DAT_EVD_HANDLE recv_evd_hdl = DAT_HANDLE_NULL;
- DAT_EVD_HANDLE reqt_evd_hdl = DAT_HANDLE_NULL;
- DAT_EVD_HANDLE conn_evd_hdl = DAT_HANDLE_NULL;
- DAT_EVD_HANDLE async_evd_hdl = DAT_HANDLE_NULL;
- DAT_EP_HANDLE ep_handle = DAT_HANDLE_NULL;
+ struct dat_ia *ia = NULL;
+ struct dat_pz *pz = NULL;
+ struct dat_evd *recv_evd_hdl = NULL;
+ struct dat_evd *reqt_evd_hdl = NULL;
+ struct dat_evd *conn_evd_hdl = NULL;
+ struct dat_evd *async_evd_hdl = NULL;
+ struct dat_ep *ep = NULL;
Server_Info_t *sinfo = NULL;
Transaction_Cmd_t *Transaction_Cmd = NULL;
Quit_Cmd_t *Quit_Cmd = NULL;
@@ -98,7 +98,7 @@ DT_cs_Client (Params_t * params_ptr,
ret = dat_ia_open (dapl_name,
DFLT_QLEN,
&async_evd_hdl,
- &ia_handle);
+ &ia);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead,
@@ -106,28 +106,28 @@ DT_cs_Client (Params_t * params_ptr,
module,
dapl_name,
DT_RetToString (ret));
- ia_handle = DAT_HANDLE_NULL;
+ ia = NULL;
status = 1;
goto client_exit;
}
DT_Tdep_PT_Debug (1,(phead, "%s: IA %s opened\n", module, dapl_name));
/* Create a PZ */
- ret = dat_pz_create (ia_handle, &pz_handle);
+ ret = dat_pz_create (ia, &pz);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead,
"%s: dat_pz_create error: %s\n",
module,
DT_RetToString (ret));
- pz_handle = DAT_HANDLE_NULL;
+ pz = NULL;
status = 1;
goto client_exit;
}
/* Create 3 events - recv, request, connect */
- ret = DT_Tdep_evd_create (ia_handle,
+ ret = DT_Tdep_evd_create (ia,
DFLT_QLEN,
NULL,
DAT_EVD_DTO_FLAG,
@@ -138,11 +138,11 @@ DT_cs_Client (Params_t * params_ptr,
"%s: dat_evd_create (recv) failed %s\n",
module,
DT_RetToString (ret));
- recv_evd_hdl = DAT_HANDLE_NULL;
+ recv_evd_hdl = NULL;
status = 1;
goto client_exit;
}
- ret = DT_Tdep_evd_create (ia_handle,
+ ret = DT_Tdep_evd_create (ia,
DFLT_QLEN,
NULL,
DAT_EVD_DTO_FLAG | DAT_EVD_RMR_BIND_FLAG,
@@ -153,11 +153,11 @@ DT_cs_Client (Params_t * params_ptr,
"%s: dat_evd_create (send) failed %s\n",
module,
DT_RetToString (ret));
- reqt_evd_hdl = DAT_HANDLE_NULL;
+ reqt_evd_hdl = NULL;
status = 1;
goto client_exit;
}
- ret = DT_Tdep_evd_create (ia_handle,
+ ret = DT_Tdep_evd_create (ia,
DFLT_QLEN,
NULL,
DAT_EVD_CONNECTION_FLAG,
@@ -168,26 +168,26 @@ DT_cs_Client (Params_t * params_ptr,
"%s: dat_evd_create (conn) failed %s\n",
module,
DT_RetToString (ret));
- conn_evd_hdl = DAT_HANDLE_NULL;
+ conn_evd_hdl = NULL;
status = 1;
goto client_exit;
}
/* Create an EP */
- ret = dat_ep_create (ia_handle, /* IA */
- pz_handle, /* PZ */
+ ret = dat_ep_create (ia, /* IA */
+ pz, /* PZ */
recv_evd_hdl, /* recv */
reqt_evd_hdl, /* request */
conn_evd_hdl, /* connect */
(struct dat_ep_attr *) NULL,
- &ep_handle);
+ &ep);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead,
"%s: dat_ep_create error: %s\n",
module,
DT_RetToString (ret));
- ep_handle = DAT_HANDLE_NULL;
+ ep = NULL;
status = 1;
goto client_exit;
}
@@ -197,7 +197,7 @@ DT_cs_Client (Params_t * params_ptr,
* Gather whatever info we want about defaults,
* and check that we can handle the requested parameters.
*/
- if (!DT_query (pt_ptr, ia_handle, ep_handle) ||
+ if (!DT_query (pt_ptr, ia, ep) ||
!DT_check_params (pt_ptr, module))
{
status = 1;
@@ -206,10 +206,10 @@ DT_cs_Client (Params_t * params_ptr,
bpool = DT_BpoolAlloc (pt_ptr,
phead,
- ia_handle,
- pz_handle,
- ep_handle,
- DAT_HANDLE_NULL, /* no RMR */
+ ia,
+ pz,
+ ep,
+ NULL, /* no RMR */
DT_RoundSize (sizeof (Transaction_Cmd_t), 8192),
3, /* num_buffers */
pt_ptr->provider_attr.optimal_buffer_alignment,
@@ -238,7 +238,7 @@ DT_cs_Client (Params_t * params_ptr,
DT_Tdep_PT_Debug (1,(phead, "%s: Posting 1 recv buffer\n", module));
retry_repost:
if (!DT_post_recv_buffer (phead,
- ep_handle,
+ ep,
bpool,
0,
DT_Bpool_GetBuffSize (bpool, 0)))
@@ -253,7 +253,7 @@ retry_repost:
DT_Tdep_PT_Debug (1,(phead, "%s: Connect Endpoint\n", module));
try_connect =1;
retry:
- ret = dat_ep_connect (ep_handle,
+ ret = dat_ep_connect (ep,
server_netaddr,
SERVER_PORT_NUMBER,
DAT_TIMEOUT_MAX,
@@ -271,7 +271,7 @@ retry:
}
DT_Tdep_PT_Debug (1,(phead, "%s: Await connection ...\n", module));
- if (!DT_conn_event_wait (phead, ep_handle, conn_evd_hdl, &event_num))
+ if (!DT_conn_event_wait (phead, ep, conn_evd_hdl, &event_num))
{
if ( event_num == DAT_CONNECTION_EVENT_PEER_REJECTED )
{
@@ -287,7 +287,7 @@ retry:
* See if any buffers were flushed as a result of
* the REJECT; clean them up and repost if so
*/
- dat_ep_reset (ep_handle);
+ dat_ep_reset (ep);
do
{
@@ -315,7 +315,7 @@ retry:
if (DT_dapltest_debug)
{
DT_Tdep_PT_Debug (1,(phead, "%s: Connected!\n", module));
- get_ep_connection_state (phead, ep_handle);
+ get_ep_connection_state (phead, ep);
}
/* Send Client_Info (using 2nd buffer in the pool) */
@@ -326,7 +326,7 @@ retry:
sizeof (Client_Info_t));
DT_Client_Info_Endian ((Client_Info_t *) buffp);
if (!DT_post_send_buffer ( phead,
- ep_handle,
+ ep,
bpool,
1,
DT_Bpool_GetBuffSize (bpool, 1)))
@@ -343,7 +343,7 @@ retry:
if (!DT_dto_event_wait (phead, reqt_evd_hdl, &dto_stat) ||
!DT_dto_check ( phead,
&dto_stat,
- ep_handle,
+ ep,
DT_Bpool_GetBuffSize (bpool, 1),
dto_cookie,
"Client_Info_Send"))
@@ -396,7 +396,7 @@ retry:
/* Send the Command buffer */
if (!DT_post_send_buffer ( phead,
- ep_handle,
+ ep,
bpool,
2,
DT_Bpool_GetBuffSize (bpool, 2)))
@@ -414,7 +414,7 @@ retry:
if (!DT_dto_event_wait (phead, reqt_evd_hdl, &dto_stat) ||
!DT_dto_check ( phead,
&dto_stat,
- ep_handle,
+ ep,
DT_Bpool_GetBuffSize (bpool, 2),
dto_cookie,
"Client_Cmd_Send"))
@@ -430,7 +430,7 @@ retry:
if (!DT_dto_event_wait (phead, recv_evd_hdl, &dto_stat) ||
!DT_dto_check ( phead,
&dto_stat,
- ep_handle,
+ ep,
DT_Bpool_GetBuffSize (bpool, 0),
dto_cookie,
"Server_Info_Recv"))
@@ -476,7 +476,7 @@ retry:
DT_Transaction_Cmd_PT_Print (phead, Transaction_Cmd);
}
status = DT_Transaction_Test_Client (pt_ptr,
- ia_handle,
+ ia,
server_netaddr);
params_ptr->Client_Stats_T.bytes_rdma_read =
pt_ptr->Client_Stats.bytes_rdma_read;
@@ -508,7 +508,7 @@ retry:
status = DT_Performance_Test_Client (params_ptr,
pt_ptr,
- ia_handle,
+ (struct dat_ia *)ia,
server_netaddr);
break;
}
@@ -521,13 +521,13 @@ client_exit:
DT_Tdep_PT_Debug (1,(phead, "%s: Cleaning Up ...\n", module));
/* Disconnect the EP */
- if (ep_handle && try_connect)
+ if (ep && try_connect)
{
/*
* graceful attempt might fail because we got here due to
* some error above, so we may as well try harder.
*/
- ret = dat_ep_disconnect (ep_handle, DAT_CLOSE_ABRUPT_FLAG);
+ ret = dat_ep_disconnect (ep, DAT_CLOSE_ABRUPT_FLAG);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead,
@@ -547,7 +547,7 @@ client_exit:
DT_Bpool_Destroy (pt_ptr, phead, bpool);
/* Free the EP */
- if (ep_handle)
+ if (ep)
{
struct dat_event event;
/*
@@ -560,7 +560,7 @@ client_exit:
&event);
} while (ret == DAT_SUCCESS);
- ret = dat_ep_free (ep_handle);
+ ret = dat_ep_free (ep);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead,
@@ -614,9 +614,9 @@ client_exit:
}
/* Free the PZ */
- if (pz_handle)
+ if (pz)
{
- ret = dat_pz_free (pz_handle);
+ ret = dat_pz_free (pz);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead,
@@ -629,10 +629,10 @@ client_exit:
}
/* Close the IA */
- if (ia_handle)
+ if (ia)
{
/* dat_ia_close cleans up async evd handle, too */
- ret = dat_ia_close (ia_handle, DAT_CLOSE_GRACEFUL_FLAG);
+ ret = dat_ia_close (ia, DAT_CLOSE_GRACEFUL_FLAG);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead,
@@ -640,7 +640,7 @@ client_exit:
module,
DT_RetToString (ret));
status = 1;
- ret = dat_ia_close (ia_handle, DAT_CLOSE_ABRUPT_FLAG);
+ ret = dat_ia_close (ia, DAT_CLOSE_ABRUPT_FLAG);
if (ret != DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead,
Index: linux-kernel/test/dapltest/test/dapl_fft_endpoint.c
===================================================================
--- linux-kernel/test/dapltest/test/dapl_fft_endpoint.c (revision 2564)
+++ linux-kernel/test/dapltest/test/dapl_fft_endpoint.c (working copy)
@@ -36,59 +36,59 @@ int DT_endpoint_generic (Params_t *param
boolean_t destroy_pz_early)
{
char *dev_name;
- DAT_IA_HANDLE ia_handle;
- DAT_PZ_HANDLE pz_handle;
- DAT_EP_HANDLE ep_handle;
- DAT_EVD_HANDLE evd_handle;
- DAT_EVD_HANDLE conn_evd_handle;
- DAT_EVD_HANDLE send_evd_handle;
- DAT_EVD_HANDLE recv_evd_handle;
+ struct dat_ia *ia;
+ struct dat_pz *pz;
+ struct dat_ep *ep;
+ struct dat_evd *evd;
+ struct dat_evd *conn_evd;
+ struct dat_evd *send_evd;
+ struct dat_evd *recv_evd;
u32 rc, wanted;
int res;
DT_Tdep_Print_Head *phead;
res = 1;
- ia_handle = NULL;
- pz_handle = NULL;
- ep_handle = NULL;
- evd_handle = NULL;
- conn_evd_handle = NULL;
- send_evd_handle = NULL;
- recv_evd_handle = NULL;
+ ia = NULL;
+ pz = NULL;
+ ep = NULL;
+ evd = NULL;
+ conn_evd = NULL;
+ send_evd = NULL;
+ recv_evd = NULL;
dev_name = cmd->device_name;
- evd_handle = DAT_HANDLE_NULL;
+ evd = NULL;
phead = params_ptr->phead;
- rc = dat_ia_open (dev_name, DEFAULT_QUEUE_LEN, &evd_handle, &ia_handle);
+ rc = dat_ia_open (dev_name, DEFAULT_QUEUE_LEN, &evd, &ia);
DT_assert_dat (phead, rc == DAT_SUCCESS);
- rc = dat_pz_create (ia_handle, &pz_handle);
+ rc = dat_pz_create (ia, &pz);
DT_assert_dat (phead, rc == DAT_SUCCESS);
if (destroy_pz_early)
{
- if (pz_handle)
+ if (pz)
{
- rc = dat_pz_free (pz_handle);
+ rc = dat_pz_free (pz);
DT_assert_dat (phead, rc == DAT_SUCCESS);
}
}
- rc = DT_Tdep_evd_create (ia_handle, DEFAULT_QUEUE_LEN, NULL,
+ rc = DT_Tdep_evd_create (ia, DEFAULT_QUEUE_LEN, NULL,
DAT_EVD_DTO_FLAG | DAT_EVD_RMR_BIND_FLAG,
- &send_evd_handle);
+ &send_evd);
DT_assert_dat (phead, rc == DAT_SUCCESS);
- rc = DT_Tdep_evd_create (ia_handle, DEFAULT_QUEUE_LEN, NULL, DAT_EVD_DTO_FLAG,
- &recv_evd_handle);
+ rc = DT_Tdep_evd_create (ia, DEFAULT_QUEUE_LEN, NULL, DAT_EVD_DTO_FLAG,
+ &recv_evd);
DT_assert_dat (phead, rc == DAT_SUCCESS);
- rc = DT_Tdep_evd_create (ia_handle, DEFAULT_QUEUE_LEN, NULL,
- DAT_EVD_CONNECTION_FLAG, &conn_evd_handle);
+ rc = DT_Tdep_evd_create (ia, DEFAULT_QUEUE_LEN, NULL,
+ DAT_EVD_CONNECTION_FLAG, &conn_evd);
DT_assert_dat (phead, rc == DAT_SUCCESS);
- rc = dat_ep_create (ia_handle, pz_handle, recv_evd_handle, send_evd_handle,
- conn_evd_handle, NULL, &ep_handle);
+ rc = dat_ep_create (ia, pz, recv_evd, send_evd,
+ conn_evd, NULL, &ep);
if (destroy_pz_early)
{
wanted = DAT_INVALID_HANDLE;
@@ -100,39 +100,39 @@ int DT_endpoint_generic (Params_t *param
DT_assert_dat (phead, DAT_GET_TYPE (rc) == wanted);
cleanup:
- if (ep_handle)
+ if (ep)
{
- rc = dat_ep_free (ep_handle);
+ rc = dat_ep_free (ep);
DT_assert_clean (phead, rc == DAT_SUCCESS);
}
- if (send_evd_handle)
+ if (send_evd)
{
- rc = DT_Tdep_evd_free (send_evd_handle);
+ rc = DT_Tdep_evd_free (send_evd);
DT_assert_clean (phead, rc == DAT_SUCCESS);
}
- if (recv_evd_handle)
+ if (recv_evd)
{
- rc = DT_Tdep_evd_free (recv_evd_handle);
+ rc = DT_Tdep_evd_free (recv_evd);
DT_assert_clean (phead, rc == DAT_SUCCESS);
}
- if (conn_evd_handle)
+ if (conn_evd)
{
- rc = DT_Tdep_evd_free (conn_evd_handle);
+ rc = DT_Tdep_evd_free (conn_evd);
DT_assert_clean (phead, rc == DAT_SUCCESS);
}
- if (!destroy_pz_early && pz_handle)
+ if (!destroy_pz_early && pz)
{
- rc = dat_pz_free (pz_handle);
+ rc = dat_pz_free (pz);
DT_assert_clean (phead, rc == DAT_SUCCESS);
}
- if (ia_handle)
+ if (ia)
{
- rc = dat_ia_close (ia_handle, DAT_CLOSE_ABRUPT_FLAG);
+ rc = dat_ia_close (ia, DAT_CLOSE_ABRUPT_FLAG);
DT_assert_clean (phead, rc == DAT_SUCCESS);
}
return res;
@@ -163,10 +163,10 @@ int DT_endpoint_case1 (Params_t *params_
int DT_endpoint_case2 (Params_t *params_ptr, FFT_Cmd_t *cmd)
{
char *dev_name;
- DAT_IA_HANDLE ia_handle;
- DAT_EP_HANDLE ep_handle;
- DAT_EVD_HANDLE send_evd, conn_evd, recv_evd, cr_evd;
- DAT_PZ_HANDLE pz_handle;
+ struct dat_ia *ia;
+ struct dat_ep *ep;
+ struct dat_evd *send_evd, *conn_evd, *recv_evd, *cr_evd;
+ struct dat_pz *pz;
struct dat_event event;
Bpool *bpool;
int res;
@@ -177,39 +177,39 @@ int DT_endpoint_case2 (Params_t *params_
Description: try to destroy ep with descriptor still in working queue\n");
res = 1;
bpool = NULL;
- pz_handle = NULL;
- ia_handle = NULL;
- ep_handle = NULL;
+ pz = NULL;
+ ia = NULL;
+ ep = NULL;
send_evd = NULL;
conn_evd = NULL;
recv_evd = NULL;
cr_evd = NULL;
dev_name = cmd->device_name;
- rc = DT_ia_open (dev_name, &ia_handle);
+ rc = DT_ia_open (dev_name, &ia);
DT_assert_dat (phead, rc == DAT_SUCCESS);
- rc = dat_pz_create (ia_handle, &pz_handle);
+ rc = dat_pz_create (ia, &pz);
DT_assert_dat (phead, rc == DAT_SUCCESS);
rc = DT_ep_create (params_ptr,
- ia_handle,
- pz_handle,
+ ia,
+ pz,
&cr_evd,
&conn_evd,
&send_evd,
&recv_evd,
- &ep_handle);
+ &ep);
DT_assert_dat (phead, rc == DAT_SUCCESS);
- bpool = DT_BpoolAlloc (NULL, phead, ia_handle, pz_handle, NULL, NULL, 4096,
+ bpool = DT_BpoolAlloc (NULL, phead, ia, pz, NULL, NULL, 4096,
1, 256 /* FIXME query */, FALSE, FALSE);
DT_assert (phead, bpool != 0);
DT_assert (phead, DT_post_recv_buffer (phead,
- ep_handle,
+ ep,
bpool,
0,
4096) == TRUE);
- if (ep_handle)
+ if (ep)
{
- rc = dat_ep_free (ep_handle);
+ rc = dat_ep_free (ep);
DT_assert_dat (phead, rc == DAT_SUCCESS);
}
@@ -229,14 +229,14 @@ cleanup:
rc = DT_Bpool_Destroy (NULL, phead, bpool);
DT_assert_clean (phead, rc != FALSE);
}
- if (pz_handle)
+ if (pz)
{
- rc = dat_pz_free (pz_handle);
+ rc = dat_pz_free (pz);
DT_assert_clean (phead, rc == DAT_SUCCESS);
}
- if (ia_handle)
+ if (ia)
{
- rc = dat_ia_close (ia_handle, DAT_CLOSE_ABRUPT_FLAG);
+ rc = dat_ia_close (ia, DAT_CLOSE_ABRUPT_FLAG);
DT_assert_clean (phead, rc == DAT_SUCCESS);
}
return res;
Index: linux-kernel/test/dapltest/test/dapl_transaction_util.c
===================================================================
--- linux-kernel/test/dapltest/test/dapl_transaction_util.c (revision 2564)
+++ linux-kernel/test/dapltest/test/dapl_transaction_util.c (working copy)
@@ -59,7 +59,7 @@ DT_handle_post_recv_buf (DT_Tdep_Print_H
| (((uintptr_t) DT_Bpool_GetBuffer (op->bp, 0)) & 0xffffffffUL));
/* Post the recv */
- ret = dat_ep_post_recv ( ep_context[i].ep_handle,
+ ret = dat_ep_post_recv ( ep_context[i].ep,
op->num_segs,
iov,
cookie,
@@ -85,7 +85,7 @@ DT_handle_post_recv_buf (DT_Tdep_Print_H
boolean_t
DT_handle_send_op (DT_Tdep_Print_Head *phead,
Ep_Context_t * ep_context,
- DAT_EVD_HANDLE reqt_evd_hdl,
+ struct dat_evd *reqt_evd_hdl,
unsigned int num_eps,
int op_indx,
boolean_t poll)
@@ -122,7 +122,7 @@ DT_handle_send_op (DT_Tdep_Print_Head *p
| (((uintptr_t) DT_Bpool_GetBuffer (op->bp, 0)) & 0xffffffffUL));
/* Post the send */
- ret = dat_ep_post_send ( ep_context[i].ep_handle,
+ ret = dat_ep_post_send ( ep_context[i].ep,
op->num_segs,
iov,
cookie,
@@ -173,7 +173,7 @@ DT_handle_send_op (DT_Tdep_Print_Head *p
DT_Tdep_PT_Printf (phead,
"Test Error: Send: Invalid endpoint completion reaped.\n"
"\tEndpoint: 0x%p, Cookie: 0x" F64x ", Length: " F64u "\n",
- dto_stat.ep_handle, dto_stat.user_cookie.as_64,
+ dto_stat.ep, dto_stat.user_cookie.as_64,
dto_stat.transfered_length);
DT_Test_Error ();
DT_Mdep_Free (completion_reaped);
@@ -188,7 +188,7 @@ DT_handle_send_op (DT_Tdep_Print_Head *p
if (!DT_dto_check (phead,
&dto_stat,
- ep_context[epnum].ep_handle,
+ ep_context[epnum].ep,
op->num_segs * op->seg_size,
dto_cookie,
"Send"))
@@ -201,7 +201,7 @@ DT_handle_send_op (DT_Tdep_Print_Head *p
{
DT_Tdep_PT_Printf (phead,
"Test Error: Send: Secondary completion seen for endpoint 0x%p (%d)\n",
- ep_context[epnum].ep_handle, epnum);
+ ep_context[epnum].ep, epnum);
DT_Test_Error ();
DT_Mdep_Free (completion_reaped);
return ( FALSE );
@@ -215,7 +215,7 @@ DT_handle_send_op (DT_Tdep_Print_Head *p
{
DT_Tdep_PT_Printf (phead,
"Test Error: Send: No completion seen for endpoint 0x%p (#%d)\n",
- ep_context[i].ep_handle, i);
+ ep_context[i].ep, i);
DT_Test_Error ();
DT_Mdep_Free (completion_reaped);
return ( FALSE );
@@ -235,8 +235,8 @@ DT_handle_send_op (DT_Tdep_Print_Head *p
boolean_t
DT_handle_recv_op (DT_Tdep_Print_Head *phead,
Ep_Context_t * ep_context,
- DAT_EVD_HANDLE recv_evd_hdl,
- DAT_EVD_HANDLE reqt_evd_hdl,
+ struct dat_evd *recv_evd_hdl,
+ struct dat_evd *reqt_evd_hdl,
unsigned int num_eps,
int op_indx,
boolean_t poll,
@@ -283,7 +283,7 @@ DT_handle_recv_op (DT_Tdep_Print_Head *p
DT_Tdep_PT_Printf (phead,
"Test Error: Receive: Invalid endpoint completion reaped.\n"
"\tEndpoint: 0x%p, Cookie: 0x" F64x ", Length: " F64u "\n",
- dto_stat.ep_handle, dto_stat.user_cookie.as_64,
+ dto_stat.ep, dto_stat.user_cookie.as_64,
dto_stat.transfered_length);
DT_Test_Error ();
DT_Mdep_Free (recv_completion_reaped);
@@ -298,7 +298,7 @@ DT_handle_recv_op (DT_Tdep_Print_Head *p
if (!DT_dto_check (phead,
&dto_stat,
- ep_context[epnum].ep_handle,
+ ep_context[epnum].ep,
op->num_segs * op->seg_size,
dto_cookie,
"Recv"))
@@ -315,7 +315,7 @@ DT_handle_recv_op (DT_Tdep_Print_Head *p
{
DT_Tdep_PT_Printf (phead,
"Test Error: Receive: Secondary completion seen for endpoint 0x%p (%d)\n",
- ep_context[epnum].ep_handle, epnum);
+ ep_context[epnum].ep, epnum);
DT_Test_Error ();
DT_Mdep_Free (recv_completion_reaped);
DT_Mdep_Free (send_completion_reaped);
@@ -353,7 +353,7 @@ DT_handle_recv_op (DT_Tdep_Print_Head *p
DT_Tdep_PT_Printf (phead,
"Test Error: Send (ror): Invalid endpoint completion reaped.\n"
"\tEndpoint: 0x%p, Cookie: 0x" F64x ", Length: "F64u "\n",
- dto_stat.ep_handle, dto_stat.user_cookie.as_64,
+ dto_stat.ep, dto_stat.user_cookie.as_64,
dto_stat.transfered_length);
DT_Test_Error ();
DT_Mdep_Free (recv_completion_reaped);
@@ -374,11 +374,11 @@ DT_handle_recv_op (DT_Tdep_Print_Head *p
/*
* If we have multiple EPs we can't guarantee the order of
- * completions, so disable ep_handle check
+ * completions, so disable ep check
*/
if (!DT_dto_check (phead,
&dto_stat,
- num_eps == 1?ep_context[i].ep_handle: NULL,
+ num_eps == 1?ep_context[i].ep: NULL,
op->num_segs * op->seg_size,
dto_cookie,
"Send-reaped-on-recv"))
@@ -395,7 +395,7 @@ DT_handle_recv_op (DT_Tdep_Print_Head *p
{
DT_Tdep_PT_Printf (phead,
"Test Error: Send (ror): Secondary completion seen for endpoint 0x%p (%d)\n",
- ep_context[epnum].ep_handle, epnum);
+ ep_context[epnum].ep, epnum);
DT_Test_Error ();
DT_Mdep_Free (recv_completion_reaped);
DT_Mdep_Free (send_completion_reaped);
@@ -411,7 +411,7 @@ DT_handle_recv_op (DT_Tdep_Print_Head *p
{
DT_Tdep_PT_Printf (phead,
"Test Error: Receive: No completion seen for endpoint 0x%p (#%d)\n",
- ep_context[i].ep_handle, i);
+ ep_context[i].ep, i);
DT_Test_Error ();
DT_Mdep_Free (recv_completion_reaped);
DT_Mdep_Free (send_completion_reaped);
@@ -428,7 +428,7 @@ DT_handle_recv_op (DT_Tdep_Print_Head *p
{
DT_Tdep_PT_Printf (phead,
"Test Error: Send (ror): No completion seen for endpoint 0x%p (#%d)\n",
- ep_context[i].ep_handle, i);
+ ep_context[i].ep, i);
DT_Test_Error ();
DT_Mdep_Free (recv_completion_reaped);
DT_Mdep_Free (send_completion_reaped);
@@ -463,7 +463,7 @@ DT_handle_recv_op (DT_Tdep_Print_Head *p
boolean_t
DT_handle_rdma_op (DT_Tdep_Print_Head *phead,
Ep_Context_t * ep_context,
- DAT_EVD_HANDLE reqt_evd_hdl,
+ struct dat_evd *reqt_evd_hdl,
unsigned int num_eps,
DT_Transfer_Type opcode,
int op_indx,
@@ -516,7 +516,7 @@ DT_handle_rdma_op (DT_Tdep_Print_Head *p
if (opcode == RDMA_WRITE)
{
- ret = dat_ep_post_rdma_write (ep_context[i].ep_handle,
+ ret = dat_ep_post_rdma_write (ep_context[i].ep,
op->num_segs,
iov,
cookie,
@@ -527,7 +527,7 @@ DT_handle_rdma_op (DT_Tdep_Print_Head *p
else /* opcode == RDMA_READ */
{
- ret = dat_ep_post_rdma_read ( ep_context[i].ep_handle,
+ ret = dat_ep_post_rdma_read ( ep_context[i].ep,
op->num_segs,
iov,
cookie,
@@ -574,7 +574,7 @@ DT_handle_rdma_op (DT_Tdep_Print_Head *p
DT_Tdep_PT_Printf (phead, "Test Error: %s: Invalid endpoint completion reaped.\n"
"\tEndpoint: 0x%p, Cookie: 0x" F64x ", Length: " F64u "\n",
opcode == RDMA_WRITE ? "RDMA/WR" : "RDMA/RD",
- dto_stat.ep_handle, dto_stat.user_cookie.as_64,
+ dto_stat.ep, dto_stat.user_cookie.as_64,
dto_stat.transfered_length);
DT_Test_Error ();
DT_Mdep_Free (completion_reaped);
@@ -588,7 +588,7 @@ DT_handle_rdma_op (DT_Tdep_Print_Head *p
if (!DT_dto_check (phead,
&dto_stat,
- ep_context[epnum].ep_handle,
+ ep_context[epnum].ep,
op->num_segs * op->seg_size,
dto_cookie,
(opcode == RDMA_WRITE ? "RDMA/WR" : "RDMA/RD")))
@@ -601,7 +601,7 @@ DT_handle_rdma_op (DT_Tdep_Print_Head *p
{
DT_Tdep_PT_Printf (phead, "Test Error: %s: Secondary completion seen for endpoint 0x%p (%d)\n",
opcode == RDMA_WRITE ? "RDMA/WR" : "RDMA/RD",
- ep_context[epnum].ep_handle, epnum);
+ ep_context[epnum].ep, epnum);
DT_Test_Error ();
DT_Mdep_Free (completion_reaped);
return ( FALSE );
@@ -619,7 +619,7 @@ DT_handle_rdma_op (DT_Tdep_Print_Head *p
{
DT_Tdep_PT_Printf (phead, "Test Error: %s: No completion seen for endpoint 0x%p (#%d)\n",
opcode == RDMA_WRITE ? "RDMA/WR" : "RDMA/RD",
- ep_context[i].ep_handle, i);
+ ep_context[i].ep, i);
DT_Test_Error ();
DT_Mdep_Free (completion_reaped);
return ( FALSE );
Index: linux-kernel/test/dapltest/test/dapl_fft_pz.c
===================================================================
--- linux-kernel/test/dapltest/test/dapl_fft_pz.c (revision 2564)
+++ linux-kernel/test/dapltest/test/dapl_fft_pz.c (working copy)
@@ -35,9 +35,9 @@ int DT_pz_case0 ( Params_t *params_ptr,
FFT_Cmd_t *cmd)
{
char* dev_name;
- DAT_IA_HANDLE ia_handle;
- DAT_PZ_HANDLE pz_handle;
- DAT_EVD_HANDLE evd_handle;
+ struct dat_ia * ia;
+ struct dat_pz *pz;
+ struct dat_evd *evd;
u32 rc;
int res;
DT_Tdep_Print_Head *phead;
@@ -47,25 +47,25 @@ int DT_pz_case0 ( Params_t *params_ptr,
Description: Test if we can normally create pz and destroy it.\n");
res=1;
- ia_handle = NULL;
- pz_handle = NULL;
- evd_handle = DAT_HANDLE_NULL;
+ ia = NULL;
+ pz = NULL;
+ evd = NULL;
dev_name= cmd->device_name;
- rc = DT_ia_open (dev_name, &ia_handle);
+ rc = DT_ia_open (dev_name, &ia);
DT_assert_dat (phead, rc == DAT_SUCCESS);
- rc = dat_pz_create (ia_handle, &pz_handle);
+ rc = dat_pz_create (ia, &pz);
DT_assert_dat (phead, rc == DAT_SUCCESS);
cleanup:
- if (pz_handle)
+ if (pz)
{
- rc = dat_pz_free (pz_handle);
+ rc = dat_pz_free (pz);
DT_assert_dat (phead, rc == DAT_SUCCESS);
}
- if (ia_handle)
+ if (ia)
{
- rc = dat_ia_close (ia_handle, DAT_CLOSE_ABRUPT_FLAG);
+ rc = dat_ia_close (ia, DAT_CLOSE_ABRUPT_FLAG);
DT_assert_dat (phead, rc == DAT_SUCCESS);
}
return res;
@@ -75,10 +75,10 @@ cleanup:
int DT_pz_case1 (Params_t *params_ptr, FFT_Cmd_t *cmd)
{
char* dev_name;
- DAT_IA_HANDLE ia_handle;
- DAT_PZ_HANDLE pz_handle;
- DAT_EP_HANDLE ep_handle;
- DAT_EVD_HANDLE conn_evd, send_evd, recv_evd, cr_evd;
+ struct dat_ia * ia;
+ struct dat_pz *pz;
+ struct dat_ep *ep;
+ struct dat_evd *conn_evd, *send_evd, *recv_evd, *cr_evd;
u32 rc;
int res;
DT_Tdep_Print_Head *phead;
@@ -88,42 +88,42 @@ int DT_pz_case1 (Params_t *params_ptr, F
Description: try to destroy pz with vi still associated with it\n");
res=1;
- ia_handle = NULL;
- pz_handle = NULL;
- ep_handle = NULL;
+ ia = NULL;
+ pz = NULL;
+ ep = NULL;
conn_evd = NULL;
send_evd = NULL;
recv_evd = NULL;
cr_evd = NULL;
dev_name= cmd->device_name;
- rc = DT_ia_open (dev_name, &ia_handle);
+ rc = DT_ia_open (dev_name, &ia);
DT_assert_dat (phead, rc == DAT_SUCCESS);
- rc = dat_pz_create (ia_handle, &pz_handle);
+ rc = dat_pz_create (ia, &pz);
DT_assert_dat (phead, rc == DAT_SUCCESS);
rc = DT_ep_create (params_ptr,
- ia_handle,
- pz_handle,
+ ia,
+ pz,
&cr_evd,
&conn_evd,
&send_evd,
&recv_evd,
- &ep_handle);
+ &ep);
DT_assert_dat (phead, rc == DAT_SUCCESS);
- if (pz_handle)
+ if (pz)
{
- rc = dat_pz_free (pz_handle);
+ rc = dat_pz_free (pz);
DT_assert_dat (phead, DAT_GET_TYPE (rc) == DAT_INVALID_STATE);
}
cleanup:
/* corrrect order */
- if (ep_handle)
+ if (ep)
{
- rc=dat_ep_free (ep_handle);
+ rc=dat_ep_free (ep);
DT_assert_clean (phead, rc == DAT_SUCCESS);
}
if (conn_evd)
@@ -141,15 +141,15 @@ cleanup:
rc = DT_Tdep_evd_free (recv_evd);
DT_assert_clean (phead, rc == DAT_SUCCESS);
}
- if (pz_handle)
+ if (pz)
{
- rc=dat_pz_free (pz_handle);
+ rc=dat_pz_free (pz);
DT_assert_clean (phead, rc == DAT_SUCCESS);
}
- if (ia_handle)
+ if (ia)
{
- rc=dat_ia_close (ia_handle, DAT_CLOSE_ABRUPT_FLAG);
+ rc=dat_ia_close (ia, DAT_CLOSE_ABRUPT_FLAG);
DT_assert_clean (phead, rc == DAT_SUCCESS);
}
@@ -160,8 +160,8 @@ cleanup:
int DT_pz_case2 (Params_t *params_ptr, FFT_Cmd_t *cmd)
{
char* dev_name;
- DAT_IA_HANDLE ia_handle;
- DAT_PZ_HANDLE pz_handle;
+ struct dat_ia * ia;
+ struct dat_pz *pz;
Bpool *bpool;
u32 rc;
int res;
@@ -174,26 +174,26 @@ int DT_pz_case2 (Params_t *params_ptr, F
associated with it\n");
res=1;
- ia_handle = NULL;
- pz_handle = NULL;
+ ia = NULL;
+ pz = NULL;
bpool = NULL;
dev_name= cmd->device_name;
- rc = DT_ia_open (dev_name, &ia_handle);
+ rc = DT_ia_open (dev_name, &ia);
DT_assert_dat (phead, rc == DAT_SUCCESS);
- rc = dat_pz_create (ia_handle, &pz_handle);
+ rc = dat_pz_create (ia, &pz);
DT_assert_dat (phead, rc == DAT_SUCCESS);
/* allocate and register bpool */
- bpool = DT_BpoolAlloc (NULL, phead, ia_handle, pz_handle, NULL,
+ bpool = DT_BpoolAlloc (NULL, phead, ia, pz, NULL,
NULL, BUFFSIZE, 1, 256 /* FIXME query */,
FALSE, FALSE);
DT_assert (phead, bpool != 0);
- if (pz_handle)
+ if (pz)
{
- rc = dat_pz_free (pz_handle);
+ rc = dat_pz_free (pz);
DT_assert_dat (phead, DAT_GET_TYPE (rc) == DAT_INVALID_STATE);
}
@@ -205,15 +205,15 @@ cleanup:
DT_Tdep_PT_Printf (phead, "Warning: Destroy bpool fails, reboot for cleanup\n");
return 0;
}
- if (pz_handle)
+ if (pz)
{
- rc=dat_pz_free (pz_handle);
+ rc=dat_pz_free (pz);
DT_assert_clean (phead, rc == DAT_SUCCESS);
}
- if (ia_handle)
+ if (ia)
{
- rc=dat_ia_close (ia_handle, DAT_CLOSE_ABRUPT_FLAG);
+ rc=dat_ia_close (ia, DAT_CLOSE_ABRUPT_FLAG);
DT_assert_clean (phead, rc == DAT_SUCCESS);
}
Index: linux-kernel/test/dapltest/test/dapl_fft_hwconn.c
===================================================================
--- linux-kernel/test/dapltest/test/dapl_fft_hwconn.c (revision 2564)
+++ linux-kernel/test/dapltest/test/dapl_fft_hwconn.c (working copy)
@@ -31,8 +31,8 @@
int DT_hwconn_case0 ( Params_t *params_ptr, FFT_Cmd_t *cmd)
{
char* dev_name;
- DAT_IA_HANDLE nic_handle;
- DAT_EVD_HANDLE evd_handle;
+ struct dat_ia * nic_handle;
+ struct dat_evd *evd;
u32 rc;
int res = 1;
DT_Tdep_Print_Head *phead;
@@ -43,9 +43,9 @@ int DT_hwconn_case0 ( Params_t *params_p
dev_name= cmd->device_name;
nic_handle = NULL;
- evd_handle = DAT_HANDLE_NULL;
+ evd = NULL;
- rc=dat_ia_open ((const char *)dev_name, 10, &evd_handle, &nic_handle);
+ rc=dat_ia_open ((const char *)dev_name, 10, &evd, &nic_handle);
DT_assert_dat (phead, rc == DAT_SUCCESS);
rc=dat_ia_close (nic_handle, DAT_CLOSE_ABRUPT_FLAG);
@@ -58,9 +58,9 @@ cleanup:
/*--------------------------------------------------------*/
int DT_hwconn_case1 ( Params_t *params_ptr, FFT_Cmd_t *cmd)
{
- DAT_IA_HANDLE nic_handle;
+ struct dat_ia * nic_handle;
u32 rc;
- DAT_EVD_HANDLE evd_handle;
+ struct dat_evd *evd;
char dev_name[100];
int i;
DT_Tdep_Print_Head *phead;
@@ -94,8 +94,8 @@ int DT_hwconn_case1 ( Params_t *params_p
sprintf (dev_name, "%s", "34df"); /* number_letter */
}
- evd_handle = DAT_HANDLE_NULL;
- rc=dat_ia_open ((const char *)dev_name, 10, &evd_handle, &nic_handle);
+ evd = NULL;
+ rc=dat_ia_open ((const char *)dev_name, 10, &evd, &nic_handle);
if (DAT_GET_TYPE (rc) != DAT_PROVIDER_NOT_FOUND)
{
const char *major_msg, *minor_msg;
@@ -120,7 +120,7 @@ int DT_hwconn_case1 ( Params_t *params_p
/*--------------------------------------------------------*/
int DT_hwconn_case2 (Params_t *params_ptr, FFT_Cmd_t *cmd)
{
- DAT_IA_HANDLE nic_handle;
+ struct dat_ia * nic_handle;
u32 rc;
int res=1;
DT_Tdep_Print_Head *phead;
@@ -156,9 +156,9 @@ int DT_hwconn_case3 (Params_t *params_pt
DT_fft_init_client (params_ptr, cmd, &conn);
/* try to close nic when vi have not destroyed */
- if (conn.ia_handle)
+ if (conn.ia)
{
- rc= dat_ia_close (conn.ia_handle, DAT_CLOSE_ABRUPT_FLAG);
+ rc= dat_ia_close (conn.ia, DAT_CLOSE_ABRUPT_FLAG);
if (rc !=DAT_SUCCESS)
{
DT_Tdep_PT_Printf (phead, "Warning: dat_ia_close fails %s, reboot for cleanup\n",
Index: linux-kernel/test/dapltest/test/dapl_fft_dataxfer.c
===================================================================
--- linux-kernel/test/dapltest/test/dapl_fft_dataxfer.c (revision 2564)
+++ linux-kernel/test/dapltest/test/dapl_fft_dataxfer.c (working copy)
@@ -34,7 +34,7 @@ int DT_dataxfer_generic ( DT_Tdep_Print_
u32 rc=0;
int res=1;
DT_fft_init_server (phead, cmd, &conn);
- DT_assert (phead, NULL != conn.ia_handle);
+ DT_assert (phead, NULL != conn.ia);
DT_fft_listen (phead, &conn);
@@ -81,7 +81,7 @@ cleanup:
int DT_dataxfer_case0 ( DT_Tdep_Print_Head *phead, FFT_Cmd_t *cmd)
{
DT_Tdep_PT_Printf (phead, "\
- Description: Call dat_ep_post_send with null ep_handle.\n");
+ Description: Call dat_ep_post_send with null ep.\n");
return DT_dataxfer_generic (phead, cmd, 0);
}
Index: linux-kernel/test/dapltest/include/dapl_tdep.h
===================================================================
--- linux-kernel/test/dapltest/include/dapl_tdep.h (revision 2564)
+++ linux-kernel/test/dapltest/include/dapl_tdep.h (working copy)
@@ -31,7 +31,7 @@
#include "dapl_proto.h"
#ifdef __KDAPL__
-typedef DAT_HANDLE DAT_CNO_HANDLE;
+typedef void * DAT_CNO_HANDLE;
#endif
/* function prototypes */
@@ -45,21 +45,21 @@ int
DT_Tdep_Execute_Test ( Params_t *params_ptr ) ;
u32
-DT_Tdep_evd_create (DAT_IA_HANDLE ia_handle,
+DT_Tdep_evd_create (struct dat_ia * ia,
int evd_min_qlen,
DAT_CNO_HANDLE cno_handle,
enum dat_evd_flags evd_flags,
- DAT_EVD_HANDLE *evd_handle_ptr);
+ struct dat_evd * *evd_ptr);
u32
-DT_Tdep_evd_free (DAT_EVD_HANDLE evd_handle);
+DT_Tdep_evd_free (struct dat_evd * evd);
u32
-DT_Tdep_evd_wait (DAT_EVD_HANDLE evd_handle,
+DT_Tdep_evd_wait (struct dat_evd * evd,
unsigned long timeout,
struct dat_event *event);
u32
-DT_Tdep_evd_dequeue (DAT_EVD_HANDLE evd_handle,
+DT_Tdep_evd_dequeue (struct dat_evd * evd,
struct dat_event *event);
#endif
Index: linux-kernel/test/dapltest/include/dapl_performance_test.h
===================================================================
--- linux-kernel/test/dapltest/include/dapl_performance_test.h (revision 2564)
+++ linux-kernel/test/dapltest/include/dapl_performance_test.h (working copy)
@@ -54,7 +54,7 @@ typedef struct {
typedef struct
{
- DAT_EP_HANDLE ep_handle;
+ struct dat_ep * ep;
struct dat_ep_attr ep_attr;
DAT_CONN_QUAL port;
int pipeline_len;
@@ -70,17 +70,17 @@ typedef struct
boolean_t is_remote_little_endian;
DAT_CONN_QUAL base_port;
struct dat_ia_attr ia_attr;
- DAT_IA_HANDLE ia_handle;
- DAT_PZ_HANDLE pz_handle;
+ struct dat_ia * ia;
+ struct dat_pz * pz;
DAT_CNO_HANDLE cno_handle;
int reqt_evd_length;
- DAT_EVD_HANDLE reqt_evd_hdl; /* request+rmr */
+ struct dat_evd * reqt_evd_hdl; /* request+rmr */
int recv_evd_length;
- DAT_EVD_HANDLE recv_evd_hdl; /* receive */
+ struct dat_evd * recv_evd_hdl; /* receive */
int conn_evd_length;
- DAT_EVD_HANDLE conn_evd_hdl; /* connect */
+ struct dat_evd * conn_evd_hdl; /* connect */
int creq_evd_length;
- DAT_EVD_HANDLE creq_evd_hdl; /* "" request */
+ struct dat_evd * creq_evd_hdl; /* "" request */
Performance_Ep_Context_t ep_context;
} Performance_Test_t;
Index: linux-kernel/test/dapltest/include/dapl_proto.h
===================================================================
--- linux-kernel/test/dapltest/include/dapl_proto.h (revision 2564)
+++ linux-kernel/test/dapltest/include/dapl_proto.h (working copy)
@@ -81,10 +81,10 @@ extern int g_status;
/* dapl_bpool.c */
Bpool * DT_BpoolAlloc (Per_Test_Data_t * pt_ptr,
DT_Tdep_Print_Head* phead,
- DAT_IA_HANDLE ia_handle,
- DAT_PZ_HANDLE pz_handle,
- DAT_EP_HANDLE ep_handle,
- DAT_EVD_HANDLE rmr_evd_handle,
+ struct dat_ia *ia,
+ struct dat_pz *pz,
+ struct dat_ep *ep,
+ struct dat_evd *rmr_evd,
int seg_size,
int num_segs,
int alignment,
@@ -106,7 +106,7 @@ void DT_Bpool_print (DT_Tdep_
/* dapl_cnxn.c */
int get_ep_connection_state (DT_Tdep_Print_Head* phead,
- DAT_EP_HANDLE ep_handle);
+ struct dat_ep *ep);
/* dapl_client.c */
int DT_cs_Client (Params_t * params_ptr,
@@ -236,7 +236,7 @@ void DT_Performance_Cmd_Endia
/* dapl_performance_client.c */
int DT_Performance_Test_Client ( Params_t *params_ptr,
Per_Test_Data_t * pt_ptr,
- DAT_IA_HANDLE * ia_handle,
+ struct dat_ia *ia,
struct sockaddr *remote);
boolean_t DT_Performance_Test_Client_Connect (
@@ -261,7 +261,7 @@ boolean_t DT_Performance_Test
/* dapl_performance_util.c */
boolean_t DT_Performance_Test_Create (Per_Test_Data_t * pt_ptr,
- DAT_IA_HANDLE * ia_handle,
+ struct dat_ia *ia,
struct sockaddr *remote_ia_addr,
boolean_t is_server,
boolean_t is_remote_little_endian,
@@ -272,20 +272,20 @@ int DT_Performance_Test_Dest
boolean_t is_server);
boolean_t DT_performance_post_rdma_op (Performance_Ep_Context_t *ep_context,
- DAT_EVD_HANDLE reqt_evd_hdl,
+ struct dat_evd * reqt_evd_hdl,
Performance_Stats_t *stats);
unsigned int DT_performance_reap (DT_Tdep_Print_Head* phead,
- DAT_EVD_HANDLE evd_handle,
+ struct dat_evd *evd,
Performance_Mode_Type mode,
Performance_Stats_t *stats);
unsigned int DT_performance_wait (DT_Tdep_Print_Head* phead,
- DAT_EVD_HANDLE evd_handle,
+ struct dat_evd *evd,
Performance_Stats_t *stats);
unsigned int DT_performance_poll (DT_Tdep_Print_Head* phead,
- DAT_EVD_HANDLE evd_handle,
+ struct dat_evd *evd,
Performance_Stats_t *stats);
/* dapl_performance_stats.c */
@@ -346,69 +346,69 @@ void DT_Free_Per_Test_Data (Per_Test_D
/* dapl_test_util.c */
boolean_t DT_query (Per_Test_Data_t *pt_ptr,
- DAT_IA_HANDLE ia_handle,
- DAT_EP_HANDLE ep_handle);
+ struct dat_ia * ia,
+ struct dat_ep * ep);
boolean_t DT_post_recv_buffer (DT_Tdep_Print_Head* phead,
- DAT_EP_HANDLE ep_handle,
+ struct dat_ep *ep,
Bpool * bp,
int index,
int size);
boolean_t DT_post_send_buffer (DT_Tdep_Print_Head* phead,
- DAT_EP_HANDLE ep_handle,
+ struct dat_ep *ep,
Bpool * bp,
int index,
int size);
boolean_t DT_conn_event_wait (DT_Tdep_Print_Head* phead,
- DAT_EP_HANDLE ep_handle,
- DAT_EVD_HANDLE evd_handle,
+ struct dat_ep *ep,
+ struct dat_evd *evd,
enum dat_event_number *event_number);
boolean_t DT_disco_event_wait ( DT_Tdep_Print_Head* phead,
- DAT_EVD_HANDLE evd_handle,
- DAT_EP_HANDLE *ep_handle );
+ struct dat_evd *evd,
+ struct dat_ep * *ep );
boolean_t DT_cr_event_wait (DT_Tdep_Print_Head* phead,
- DAT_EVD_HANDLE evd_handle,
+ struct dat_evd *evd,
struct dat_cr_arrival_event_data *cr_stat_p);
boolean_t DT_dto_event_reap (DT_Tdep_Print_Head* phead,
- DAT_EVD_HANDLE evd_handle,
+ struct dat_evd *evd,
boolean_t poll,
struct dat_dto_completion_event_data *dtop);
boolean_t DT_dto_event_wait (DT_Tdep_Print_Head* phead,
- DAT_EVD_HANDLE evd_handle,
+ struct dat_evd *evd,
struct dat_dto_completion_event_data *dtop);
boolean_t DT_dto_event_poll (DT_Tdep_Print_Head* phead,
- DAT_EVD_HANDLE evd_handle,
+ struct dat_evd *evd,
struct dat_dto_completion_event_data *dtop);
boolean_t DT_rmr_event_wait (DT_Tdep_Print_Head* phead,
- DAT_EVD_HANDLE evd_handle,
+ struct dat_evd *evd,
struct dat_rmr_bind_completion_event_data *rmr_ptr);
boolean_t DT_dto_check ( DT_Tdep_Print_Head* phead,
struct dat_dto_completion_event_data *dto_p,
- DAT_EP_HANDLE ep_expected,
+ struct dat_ep * ep_expected,
int len_expected,
DAT_DTO_COOKIE cookie_expected,
char *message);
boolean_t DT_rmr_check ( DT_Tdep_Print_Head* phead,
struct dat_rmr_bind_completion_event_data *rmr_p,
- DAT_RMR_HANDLE rmr_expected,
+ struct dat_rmr * rmr_expected,
void * cookie_expected,
char *message);
boolean_t DT_cr_check (DT_Tdep_Print_Head* phead,
struct dat_cr_arrival_event_data *cr_stat_p,
- DAT_PSP_HANDLE psp_handle_expected,
+ struct dat_sp *psp_expected,
DAT_CONN_QUAL port_expected,
- DAT_CR_HANDLE *cr_handlep,
+ struct dat_cr **crp,
char *message);
/* dapl_thread.c */
@@ -460,13 +460,13 @@ void DT_Transaction_Cmd_Endia
boolean_t to_wire);
/* dapl_transaction_test.c */
int DT_Transaction_Test_Client (Per_Test_Data_t * pt_ptr,
- DAT_IA_HANDLE ia_handle,
+ struct dat_ia *ia,
struct sockaddr *remote);
void DT_Transaction_Test_Server (void *params);
boolean_t DT_Transaction_Create_Test (Per_Test_Data_t * pt_ptr,
- DAT_IA_HANDLE * ia_handle,
+ struct dat_ia *ia,
boolean_t is_server,
unsigned int port_num,
boolean_t remote_is_little_endian,
@@ -491,15 +491,15 @@ boolean_t DT_handle_post_recv
boolean_t DT_handle_send_op (DT_Tdep_Print_Head* phead,
Ep_Context_t * ep_context,
- DAT_EVD_HANDLE reqt_evd_hdl,
+ struct dat_evd *reqt_evd_hdl,
unsigned int num_eps,
int op_indx,
boolean_t poll);
boolean_t DT_handle_recv_op (DT_Tdep_Print_Head* phead,
Ep_Context_t * ep_context,
- DAT_EVD_HANDLE recv_evd_hdl,
- DAT_EVD_HANDLE reqt_evd_hdl,
+ struct dat_evd *recv_evd_hdl,
+ struct dat_evd *reqt_evd_hdl,
unsigned int num_eps,
int op_indx,
boolean_t poll,
@@ -507,7 +507,7 @@ boolean_t DT_handle_recv_op (
boolean_t DT_handle_rdma_op (DT_Tdep_Print_Head* phead,
Ep_Context_t * ep_context,
- DAT_EVD_HANDLE reqt_evd_hdl,
+ struct dat_evd *reqt_evd_hdl,
unsigned int num_eps,
DT_Transfer_Type opcode,
int op_indx,
@@ -600,15 +600,15 @@ void DT_assert_fail (DT_Tdep_Print_H
char *file,
char *baseFile,
int line);
-int DT_ia_open (char *dev_name, DAT_IA_HANDLE *ia_handle);
+int DT_ia_open (char *dev_name, struct dat_ia **ia);
int DT_ep_create (Params_t *params_ptr,
- DAT_IA_HANDLE ia_handle,
- DAT_PZ_HANDLE pz_handle,
- DAT_EVD_HANDLE *cr_evd,
- DAT_EVD_HANDLE *conn_evd,
- DAT_EVD_HANDLE *send_evd,
- DAT_EVD_HANDLE *recv_evd,
- DAT_EP_HANDLE *ep_handle);
+ struct dat_ia *ia,
+ struct dat_pz *pz,
+ struct dat_evd **cr_evd,
+ struct dat_evd **conn_evd,
+ struct dat_evd **send_evd,
+ struct dat_evd **recv_evd,
+ struct dat_ep **ep);
void DT_fft_init_conn_struct (FFT_Connection_t *conn);
void DT_fft_init_client (Params_t *params_ptr,
FFT_Cmd_t *cmd,
Index: linux-kernel/test/dapltest/include/dapl_test_data.h
===================================================================
--- linux-kernel/test/dapltest/include/dapl_test_data.h (revision 2564)
+++ linux-kernel/test/dapltest/include/dapl_test_data.h (working copy)
@@ -46,16 +46,16 @@ typedef struct
int NextPortNumber;
int num_clients;
spinlock_t num_clients_lock;
- DAT_IA_HANDLE ia_handle;
- DAT_PZ_HANDLE pz_handle;
- DAT_EVD_HANDLE recv_evd_hdl;
- DAT_EVD_HANDLE reqt_evd_hdl;
- DAT_EVD_HANDLE conn_evd_hdl;
- DAT_EVD_HANDLE creq_evd_hdl;
- DAT_EVD_HANDLE async_evd_hdl;
- DAT_EVD_HANDLE rmr_evd_hdl;
- DAT_EP_HANDLE ep_handle;
- DAT_PSP_HANDLE psp_handle;
+ struct dat_ia *ia;
+ struct dat_pz *pz;
+ struct dat_evd *recv_evd_hdl;
+ struct dat_evd *reqt_evd_hdl;
+ struct dat_evd *conn_evd_hdl;
+ struct dat_evd *creq_evd_hdl;
+ struct dat_evd *async_evd_hdl;
+ struct dat_evd *rmr_evd_hdl;
+ struct dat_ep *ep;
+ struct dat_sp *psp;
Bpool *bpool;
} Per_Server_Data_t;
Index: linux-kernel/test/dapltest/include/dapl_bpool.h
===================================================================
--- linux-kernel/test/dapltest/include/dapl_bpool.h (revision 2564)
+++ linux-kernel/test/dapltest/include/dapl_bpool.h (working copy)
@@ -38,21 +38,21 @@ typedef struct Bpool_tag Bpool;
struct Bpool_tag {
unsigned char *alloc_ptr;
uint32_t alloc_size;
- DAT_PZ_HANDLE pz_handle;
+ struct dat_pz * pz;
int seg_size;
int num_segs; /* num segments */
unsigned char *buffer_start; /* Start of buffer area */
u64 buffer_size; /* Size of data buffer (rounded) */
u64 reg_addr; /* start of registered area */
u64 reg_size; /* size of registered area */
- DAT_EP_HANDLE ep_handle; /* EP area is registered to */
- DAT_LMR_HANDLE lmr_handle; /* local access */
+ struct dat_ep * ep; /* EP area is registered to */
+ struct dat_lmr * lmr; /* local access */
DAT_LMR_CONTEXT lmr_context;
struct dat_lmr_triplet *tripl_start; /* local IOV */
boolean_t enable_rdma_write; /* remote access */
boolean_t enable_rdma_read;
- DAT_RMR_HANDLE rmr_handle;
+ struct dat_rmr * rmr_handle;
DAT_RMR_CONTEXT rmr_context;
- DAT_EVD_HANDLE rmr_evd_handle;
+ struct dat_evd * rmr_evd;
};
#endif
Index: linux-kernel/test/dapltest/include/dapl_fft_util.h
===================================================================
--- linux-kernel/test/dapltest/include/dapl_fft_util.h (revision 2564)
+++ linux-kernel/test/dapltest/include/dapl_fft_util.h (working copy)
@@ -55,14 +55,14 @@
typedef struct
{
- DAT_IA_HANDLE ia_handle;
- DAT_PZ_HANDLE pz_handle;
- DAT_PSP_HANDLE psp_handle;
- DAT_EP_HANDLE ep_handle;
- DAT_EVD_HANDLE cr_evd, conn_evd, send_evd, recv_evd;
+ struct dat_ia *ia;
+ struct dat_pz *pz;
+ struct dat_sp *psp;
+ struct dat_ep *ep;
+ struct dat_evd *cr_evd, *conn_evd, *send_evd, *recv_evd;
struct dat_event event;
int count;
- DAT_CR_HANDLE cr_handle;
+ struct dat_cr *cr;
Bpool *bpool;
struct dat_cr_arrival_event_data cr_stat;
enum dat_event_number event_num;
Index: linux-kernel/test/dapltest/include/dapl_transaction_test.h
===================================================================
--- linux-kernel/test/dapltest/include/dapl_transaction_test.h (revision 2564)
+++ linux-kernel/test/dapltest/include/dapl_transaction_test.h (working copy)
@@ -49,13 +49,13 @@ typedef struct
typedef struct
{
- DAT_EP_HANDLE ep_handle;
+ struct dat_ep * ep;
struct dat_ep_attr ep_attr;
DAT_CONN_QUAL ia_port;
Bpool *bp;
Transaction_Test_Op_t op[ MAX_OPS ];
- DAT_RSP_HANDLE rsp_handle;
- DAT_PSP_HANDLE psp_handle;
+ struct dat_sp * rsp;
+ struct dat_sp * psp;
} Ep_Context_t;
@@ -75,7 +75,7 @@ typedef struct
boolean_t is_server;
boolean_t remote_is_little_endian;
Per_Test_Data_t *pt_ptr;
- DAT_IA_HANDLE ia_handle;
+ struct dat_ia *ia;
Transaction_Cmd_t *cmd;
struct sockaddr * remote_ia_addr;
DAT_CONN_QUAL base_port;
@@ -84,11 +84,11 @@ typedef struct
Thread *thread;
/* This group set up by each thread in DT_Transaction_Main() */
- DAT_PZ_HANDLE pz_handle;
- DAT_EVD_HANDLE recv_evd_hdl; /* receive */
- DAT_EVD_HANDLE reqt_evd_hdl; /* request+rmr */
- DAT_EVD_HANDLE conn_evd_hdl; /* connect */
- DAT_EVD_HANDLE creq_evd_hdl; /* "" request */
+ struct dat_pz * pz;
+ struct dat_evd * recv_evd_hdl; /* receive */
+ struct dat_evd * reqt_evd_hdl; /* request+rmr */
+ struct dat_evd * conn_evd_hdl; /* connect */
+ struct dat_evd * creq_evd_hdl; /* "" request */
Ep_Context_t *ep_context;
/* Statistics set by DT_Transaction_Run() */
Index: linux-kernel/test/dapltest/kdapl/kdapl_tdep_evd.c
===================================================================
--- linux-kernel/test/dapltest/kdapl/kdapl_tdep_evd.c (revision 2564)
+++ linux-kernel/test/dapltest/kdapl/kdapl_tdep_evd.c (working copy)
@@ -39,7 +39,7 @@ typedef struct Tdep_Evd_Tag
struct Tdep_Evd_Tag *evd_next;
struct Tdep_Event_Tag *event_next;
struct Tdep_Event_Tag *event_last;
- DAT_EVD_HANDLE evd_handle;
+ struct dat_evd * evd;
DT_WAIT_OBJECT wait_object;
} Tdep_Evd;
@@ -94,11 +94,11 @@ KDT_Evd_Destroy(void)
}
u32
-DT_Tdep_evd_create (DAT_IA_HANDLE ia_handle,
+DT_Tdep_evd_create (struct dat_ia * ia,
int evd_min_qlen,
DAT_CNO_HANDLE cno_handle,
enum dat_evd_flags evd_flags,
- DAT_EVD_HANDLE *evd_handle_ptr)
+ struct dat_evd **evd_ptr_ptr)
{
u32 dat_status;
@@ -120,12 +120,12 @@ DT_Tdep_evd_create (DAT_IA_HANDLE ia_ha
upcall.upcall_func = DT_Tdep_Event_Callback;
upcall.instance_data = evd_ptr;
- dat_status = dat_evd_kcreate (ia_handle,
+ dat_status = dat_evd_kcreate (ia,
evd_min_qlen,
DAT_UPCALL_SINGLE_INSTANCE,
&upcall,
evd_flags,
- evd_handle_ptr);
+ evd_ptr_ptr);
if (dat_status != DAT_SUCCESS)
{
goto error;
@@ -134,7 +134,7 @@ DT_Tdep_evd_create (DAT_IA_HANDLE ia_ha
/* initialize evd_ptr */
evd_ptr->event_next = NULL;
evd_ptr->event_last = NULL;
- evd_ptr->evd_handle = *evd_handle_ptr;
+ evd_ptr->evd = *evd_ptr_ptr;
DT_Mdep_wait_object_init (&evd_ptr->wait_object);
/* add evd_ptr to front of evd list */
@@ -154,7 +154,7 @@ error:
return (dat_status);
}
u32
-DT_Tdep_evd_dequeue (DAT_EVD_HANDLE evd_handle,
+DT_Tdep_evd_dequeue (struct dat_evd *evd,
struct dat_event *dat_event)
{
u32 dat_status;
@@ -163,11 +163,11 @@ DT_Tdep_evd_dequeue (DAT_EVD_HANDLE evd_
unsigned long flags;
dat_status = DAT_SUCCESS;
- /* find the evd_ptr associated with evd_handle */
+ /* find the evd_ptr associated with evd */
evd_ptr = DT_Evd_List;
while (evd_ptr)
{
- if (evd_ptr->evd_handle == evd_handle)
+ if (evd_ptr->evd == evd)
{
break;
}
@@ -181,7 +181,7 @@ DT_Tdep_evd_dequeue (DAT_EVD_HANDLE evd_
}
/* Get event */
spin_lock_irqsave (&DT_Evd_Lock, flags);
- event = evd_ptr->event_next; /* event present in evd_ptr corresponding to the given evd_handle */
+ event = evd_ptr->event_next; /* event present in evd_ptr corresponding to the given evd */
if (event)
{
evd_ptr->event_next = event->event_next; /* point to next event */
@@ -212,7 +212,7 @@ DT_Tdep_evd_dequeue (DAT_EVD_HANDLE evd_
}
u32
-DT_Tdep_evd_wait (DAT_EVD_HANDLE evd_handle,
+DT_Tdep_evd_wait (struct dat_evd *evd,
unsigned long timeout,
struct dat_event *dat_event)
{
@@ -223,11 +223,11 @@ DT_Tdep_evd_wait (DAT_EVD_HANDLE evd_han
dat_status = DAT_CLASS_ERROR | DAT_INTERNAL_ERROR;
- /* find the evd_ptr associated with evd_handle */
+ /* find the evd_ptr associated with evd */
evd_ptr = DT_Evd_List;
while (evd_ptr)
{
- if (evd_ptr->evd_handle == evd_handle)
+ if (evd_ptr->evd == evd)
{
break;
}
@@ -290,7 +290,7 @@ DT_Tdep_evd_wait (DAT_EVD_HANDLE evd_han
}
u32
-DT_Tdep_evd_free (DAT_EVD_HANDLE evd_handle)
+DT_Tdep_evd_free (struct dat_evd *evd)
{
Tdep_Evd *next;
Tdep_Evd *last;
@@ -298,13 +298,13 @@ DT_Tdep_evd_free (DAT_EVD_HANDLE evd_han
last = NULL;
spin_lock_irq (&DT_Evd_Lock);
next = DT_Evd_List;
- if (next->evd_handle == evd_handle)
+ if (next->evd == evd)
{
DT_Evd_List = next->evd_next;
}
else
{
- while (next && next->evd_handle != evd_handle)
+ while (next && next->evd != evd)
{
last = next;
next = next->evd_next;
@@ -317,7 +317,7 @@ DT_Tdep_evd_free (DAT_EVD_HANDLE evd_han
spin_unlock_irq (&DT_Evd_Lock);
DT_Mdep_Free (next);
- return dat_evd_free(evd_handle);
+ return dat_evd_free(evd);
}
static void DT_Tdep_Event_Callback (
Index: linux-kernel/dat-provider/dapl_cr_reject.c
===================================================================
--- linux-kernel/dat-provider/dapl_cr_reject.c (revision 2564)
+++ linux-kernel/dat-provider/dapl_cr_reject.c (working copy)
@@ -40,36 +40,36 @@
* Reject a connection request from the active remote side requesting
* an Endpoint.
*/
-u32 dapl_cr_reject(DAT_CR_HANDLE cr_handle)
+u32 dapl_cr_reject(struct dat_cr *cr)
{
struct dapl_cr *cr_ptr;
struct dapl_ep *ep_ptr;
enum dat_ep_state entry_ep_state;
- DAT_EP_HANDLE entry_ep_handle;
+ struct dat_ep *entry_ep;
struct dapl_sp *sp_ptr;
u32 dat_status;
- dapl_dbg_log(DAPL_DBG_TYPE_API, "dapl_cr_reject (%p)\n", cr_handle);
+ dapl_dbg_log(DAPL_DBG_TYPE_API, "dapl_cr_reject (%p)\n", cr);
- if (DAPL_BAD_HANDLE(cr_handle, DAPL_MAGIC_CR)) {
+ if (!cr) {
dat_status =
DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_CR);
goto bail;
}
- cr_ptr = (struct dapl_cr *)cr_handle;
+ cr_ptr = (struct dapl_cr *)cr;
/*
* Clean up provider created EP if there is one: only if
* DAT_PSP_PROVIDER_FLAG was set on the PSP
*/
- ep_ptr = (struct dapl_ep *)cr_ptr->param.local_ep_handle;
- entry_ep_handle = cr_ptr->param.local_ep_handle;
+ ep_ptr = (struct dapl_ep *)cr_ptr->param.local_ep;
+ entry_ep = cr_ptr->param.local_ep;
entry_ep_state = 0;
if (ep_ptr) {
entry_ep_state = ep_ptr->param.ep_state;
ep_ptr->param.ep_state = DAT_EP_STATE_UNCONNECTED;
- cr_ptr->param.local_ep_handle = NULL;
+ cr_ptr->param.local_ep = NULL;
}
dat_status = dapl_ib_reject_connection(cr_ptr->ib_cm_handle);
@@ -77,8 +77,8 @@ u32 dapl_cr_reject(DAT_CR_HANDLE cr_hand
if (ep_ptr != NULL) {
/* Revert our state to the beginning */
ep_ptr->param.ep_state = entry_ep_state;
- cr_ptr->param.local_ep_handle = entry_ep_handle;
- cr_ptr->param.local_ep_handle = (DAT_EP_HANDLE) ep_ptr;
+ cr_ptr->param.local_ep = entry_ep;
+ cr_ptr->param.local_ep = (struct dat_ep *)ep_ptr;
}
} else {
/*
@@ -88,13 +88,13 @@ u32 dapl_cr_reject(DAT_CR_HANDLE cr_hand
*/
sp_ptr = cr_ptr->sp_ptr;
if (ep_ptr && sp_ptr->psp_flags == DAT_PSP_PROVIDER_FLAG)
- (void)dapl_ep_free(ep_ptr);
+ (void)dapl_ep_free((struct dat_ep *)ep_ptr);
/* Remove the CR from the queue, then free it */
- spin_lock_irqsave(&sp_ptr->header.lock, sp_ptr->header.flags);
+ spin_lock_irqsave(&sp_ptr->common.lock, sp_ptr->common.flags);
dapl_sp_remove_cr(sp_ptr, cr_ptr);
- spin_unlock_irqrestore(&sp_ptr->header.lock,
- sp_ptr->header.flags);
+ spin_unlock_irqrestore(&sp_ptr->common.lock,
+ sp_ptr->common.flags);
dapl_cr_free(cr_ptr);
}
Index: linux-kernel/dat-provider/dapl_srq.c
===================================================================
--- linux-kernel/dat-provider/dapl_srq.c (revision 2564)
+++ linux-kernel/dat-provider/dapl_srq.c (working copy)
@@ -51,13 +51,9 @@
*/
static void dapl_srq_dealloc(struct dapl_srq *srq_ptr)
{
- dapl_os_assert(srq_ptr->header.magic == DAPL_MAGIC_SRQ);
-
- /* reset magic to prevent reuse */
- srq_ptr->header.magic = DAPL_MAGIC_INVALID;
- dapl_ia_unlink_srq(srq_ptr->header.owner_ia, srq_ptr);
+ dapl_ia_unlink_srq(srq_ptr->common.owner_ia, srq_ptr);
dapl_cb_free(&srq_ptr->recv_buffer);
- /* no need to destroy srq_ptr->header.lock */
+ /* no need to destroy srq_ptr->common.lock */
kfree(srq_ptr);
}
@@ -91,19 +87,14 @@ static struct dapl_srq *dapl_srq_alloc(s
/* zero the structure */
memset(srq_ptr, 0, sizeof *srq_ptr);
- /*
- * initialize the header
- */
- srq_ptr->header.provider = ia_ptr->header.provider;
- srq_ptr->header.magic = DAPL_MAGIC_SRQ;
- srq_ptr->header.handle_type = DAT_HANDLE_TYPE_SRQ;
- srq_ptr->header.owner_ia = ia_ptr;
- srq_ptr->header.user_context.as_64 = 0;
- srq_ptr->header.user_context.as_ptr = NULL;
+ srq_ptr->srq.provider = ia_ptr->ia.provider;
+ srq_ptr->common.owner_ia = ia_ptr;
+ srq_ptr->common.user_context.as_64 = 0;
+ srq_ptr->common.user_context.as_ptr = NULL;
atomic_set(&srq_ptr->srq_ref_count, 0);
- dapl_llist_init_entry(&srq_ptr->header.ia_list_entry);
- spin_lock_init(&srq_ptr->header.lock);
+ dapl_llist_init_entry(&srq_ptr->common.ia_list_entry);
+ spin_lock_init(&srq_ptr->common.lock);
/*
* Initialize the body.
@@ -130,15 +121,15 @@ bail:
* dapl_srq_create
*
* Create an instance of a Shared Receive Queue that is provided to the
- * consumer at srq_handle.
+ * consumer at srq.
*
* Input:
- * ia_handle
- * pz_handle
+ * ia
+ * pz
* srq_attr
*
* Output:
- * srq_handle
+ * srq
*
* Returns:
* DAT_SUCCESS
@@ -148,8 +139,8 @@ bail:
* ?DAT_INVALID_ATTRIBUTE??
* DAT_MODEL_NOT_SUPPORTED
*/
-u32 dapl_srq_create(DAT_IA_HANDLE ia_handle, DAT_PZ_HANDLE pz_handle,
- struct dat_srq_attr *srq_attr, DAT_SRQ_HANDLE *srq_handle)
+u32 dapl_srq_create(struct dat_ia *ia, struct dat_pz *pz,
+ struct dat_srq_attr *srq_attr, struct dat_srq **srq)
{
struct dapl_ia *ia_ptr;
struct dapl_srq *srq_ptr;
@@ -157,14 +148,14 @@ u32 dapl_srq_create(DAT_IA_HANDLE ia_han
dapl_dbg_log(DAPL_DBG_TYPE_API,
"dapl_srq_create (%p, %p, %p, %p)\n",
- ia_handle, pz_handle, srq_attr, srq_handle);
+ ia, pz, srq_attr, srq);
- ia_ptr = (struct dapl_ia *)ia_handle;
+ ia_ptr = (struct dapl_ia *)ia;
/*
* Verify parameters
*/
- if (DAPL_BAD_HANDLE(ia_ptr, DAPL_MAGIC_IA)) {
+ if (!ia_ptr) {
status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_IA);
goto bail;
}
@@ -175,12 +166,7 @@ u32 dapl_srq_create(DAT_IA_HANDLE ia_han
* modified by dat_ep_modify() is not strictly
* required when the EP is created
*/
- if (pz_handle != NULL && DAPL_BAD_HANDLE(pz_handle, DAPL_MAGIC_PZ)) {
- status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_PZ);
- goto bail;
- }
-
- if (srq_handle == NULL) {
+ if (srq == NULL) {
status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG4);
goto bail;
}
@@ -197,9 +183,9 @@ u32 dapl_srq_create(DAT_IA_HANDLE ia_han
goto bail;
}
- srq_ptr->param.ia_handle = (DAT_IA_HANDLE) ia_ptr;
+ srq_ptr->param.ia = (struct dat_ia *) ia_ptr;
srq_ptr->param.srq_state = DAT_SRQ_STATE_OPERATIONAL;
- srq_ptr->param.pz_handle = pz_handle;
+ srq_ptr->param.pz = pz;
/*
* XXX Allocate provider resource here!!!
@@ -211,7 +197,7 @@ u32 dapl_srq_create(DAT_IA_HANDLE ia_han
/* Link it onto the IA */
dapl_ia_link_srq(ia_ptr, srq_ptr);
- *srq_handle = srq_ptr;
+ *srq = (struct dat_srq *)srq_ptr;
bail:
return status;
@@ -223,7 +209,7 @@ bail:
* Destroy an instance of an SRQ
*
* Input:
- * srq_handle
+ * srq
*
* Output:
* none
@@ -233,22 +219,22 @@ bail:
* DAT_INVALID_PARAMETER
* DAT_INVALID_STATE
*/
-u32 dapl_srq_free(DAT_SRQ_HANDLE srq_handle)
+u32 dapl_srq_free(struct dat_srq *srq)
{
struct dapl_srq *srq_ptr;
struct dapl_ia *ia_ptr;
struct dat_srq_param *param;
u32 status = DAT_SUCCESS;
- dapl_dbg_log(DAPL_DBG_TYPE_API, "dapl_srq_free (%p)\n", srq_handle);
+ dapl_dbg_log(DAPL_DBG_TYPE_API, "dapl_srq_free (%p)\n", srq);
- srq_ptr = (struct dapl_srq *)srq_handle;
+ srq_ptr = (struct dapl_srq *)srq;
param = &srq_ptr->param;
/*
* Verify parameter & state
*/
- if (DAPL_BAD_HANDLE(srq_ptr, DAPL_MAGIC_SRQ)) {
+ if (!srq_ptr) {
status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_SRQ);
goto bail;
}
@@ -263,17 +249,17 @@ u32 dapl_srq_free(DAT_SRQ_HANDLE srq_han
goto bail;
}
- ia_ptr = srq_ptr->header.owner_ia;
+ ia_ptr = srq_ptr->common.owner_ia;
/*
* Do verification of parameters and the state change atomically.
*/
- spin_lock_irqsave(&srq_ptr->header.lock, srq_ptr->header.flags);
+ spin_lock_irqsave(&srq_ptr->common.lock, srq_ptr->common.flags);
/* Remove the SRQ from the IA */
dapl_ia_unlink_srq(ia_ptr, srq_ptr);
- spin_unlock_irqrestore(&srq_ptr->header.lock, srq_ptr->header.flags);
+ spin_unlock_irqrestore(&srq_ptr->common.lock, srq_ptr->common.flags);
/*
* Finish tearing everything down.
@@ -301,7 +287,7 @@ bail:
* over a connection of any ep handle into local_iov
*
* Input:
- * srq_handle
+ * srq
* num_segments
* local_iov
* user_cookie
@@ -318,7 +304,7 @@ bail:
* DAT_PROTECTION_VIOLATION
* DAT_PROVILEGES_VIOLATION
*/
-u32 dapl_srq_post_recv(DAT_SRQ_HANDLE srq_handle, int num_segments,
+u32 dapl_srq_post_recv(struct dat_srq *srq, int num_segments,
struct dat_lmr_triplet *local_iov,
DAT_DTO_COOKIE user_cookie)
{
@@ -328,14 +314,14 @@ u32 dapl_srq_post_recv(DAT_SRQ_HANDLE sr
dapl_dbg_log(DAPL_DBG_TYPE_API,
"dapl_srq_post_recv (%p, %d, %p, %P)\n",
- srq_handle, num_segments, local_iov, user_cookie.as_64);
+ srq, num_segments, local_iov, user_cookie.as_64);
- if (DAPL_BAD_HANDLE(srq_handle, DAPL_MAGIC_SRQ)) {
+ if (!srq) {
status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_SRQ);
goto bail;
}
- srq_ptr = (struct dapl_srq *)srq_handle;
+ srq_ptr = (struct dapl_srq *)srq;
/*
* Synchronization ok since this buffer is only used for receive
@@ -369,16 +355,15 @@ bail:
return status;
}
-u32 dapl_srq_query(DAT_SRQ_HANDLE srq_handle, struct dat_srq_param *srq_param)
+u32 dapl_srq_query(struct dat_srq *srq, struct dat_srq_param *srq_param)
{
struct dapl_srq *srq_ptr;
u32 status = DAT_SUCCESS;
- dapl_dbg_log(DAPL_DBG_TYPE_API,
- "dapl_srq_query (%p, %x, %p)\n",
- srq_handle, srq_param);
+ dapl_dbg_log(DAPL_DBG_TYPE_API, "dapl_srq_query (%p, %x, %p)\n", srq,
+ srq_param);
- if (DAPL_BAD_HANDLE(srq_handle, DAPL_MAGIC_SRQ)) {
+ if (!srq) {
status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_SRQ);
goto bail;
}
@@ -387,7 +372,7 @@ u32 dapl_srq_query(DAT_SRQ_HANDLE srq_ha
goto bail;
}
- srq_ptr = (struct dapl_srq *)srq_handle;
+ srq_ptr = (struct dapl_srq *)srq;
/*
* XXX Need to calculate available_dto_count and outstanding_dto_count
@@ -407,7 +392,7 @@ bail:
* Modify the size fo the event queue of a Shared Recieve Queue
*
* Input:
- * srq_handle
+ * srq
* srq_max_recv_dto
*
* Output:
@@ -421,22 +406,22 @@ bail:
* DAT_INVALID_STATE
*/
-u32 dapl_srq_resize(DAT_SRQ_HANDLE srq_handle, int srq_max_recv_dto)
+u32 dapl_srq_resize(struct dat_srq *srq, int srq_max_recv_dto)
{
struct dapl_ia *ia_ptr;
struct dapl_srq *srq_ptr;
u32 status = DAT_SUCCESS;
dapl_dbg_log(DAPL_DBG_TYPE_API, "dapl_srq_resize (%p, %d)\n",
- srq_handle, srq_max_recv_dto);
+ srq, srq_max_recv_dto);
- if (DAPL_BAD_HANDLE(srq_handle, DAPL_MAGIC_SRQ)) {
+ if (!srq) {
status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_SRQ);
goto bail;
}
- srq_ptr = (struct dapl_srq *)srq_handle;
- ia_ptr = srq_ptr->header.owner_ia;
+ srq_ptr = (struct dapl_srq *)srq;
+ ia_ptr = srq_ptr->common.owner_ia;
/*
* Check for nonsense requests per the spec
@@ -463,7 +448,7 @@ bail:
* event if it is reached.
*
* Input:
- * srq_handle
+ * srq
* srq_max_recv_dto
*
* Output:
@@ -476,20 +461,20 @@ bail:
* DAT_MODEL_NOT_SUPPORTED
*/
-u32 dapl_srq_set_lw(DAT_SRQ_HANDLE srq_handle, int low_watermark)
+u32 dapl_srq_set_lw(struct dat_srq *srq, int low_watermark)
{
struct dapl_srq *srq_ptr;
u32 status = DAT_SUCCESS;
- dapl_dbg_log(DAPL_DBG_TYPE_API, "dapl_srq_set_lw (%p, %d)\n",
- srq_handle, low_watermark);
+ dapl_dbg_log(DAPL_DBG_TYPE_API, "dapl_srq_set_lw (%p, %d)\n", srq,
+ low_watermark);
- if (DAPL_BAD_HANDLE(srq_handle, DAPL_MAGIC_SRQ)) {
+ if (!srq) {
status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_SRQ);
goto bail;
}
- srq_ptr = (struct dapl_srq *)srq_handle;
+ srq_ptr = (struct dapl_srq *)srq;
/* XXX Put implementation here XXX */
Index: linux-kernel/dat-provider/dapl_openib_util.c
===================================================================
--- linux-kernel/dat-provider/dapl_openib_util.c (revision 2564)
+++ linux-kernel/dat-provider/dapl_openib_util.c (working copy)
@@ -171,7 +171,7 @@ u32 dapl_ib_close_hca(struct dapl_hca *h
* Alloc a CQ
*
* Input:
- * ia_handle IA handle
+ * ia IA handle
* evd_ptr pointer to EVD struct
* cqlen minimum QLen
*
@@ -227,7 +227,7 @@ u32 dapl_ib_cq_resize(struct dapl_ia *ia
* Set up CQ completion notifications
*
* Input:
- * ia_handle IA handle
+ * ia IA handle
* evd_ptr pointer to EVD struct
*
* Output:
@@ -253,7 +253,7 @@ u32 dapl_set_cq_notify(struct dapl_ia *i
* Register a virtual memory region
*
* Input:
- * ia_handle IA handle
+ * ia IA handle
* lmr pointer to dapl_lmr struct
* virt_addr virtual address of beginning of mem region
* length length of memory region
@@ -300,7 +300,7 @@ u32 dapl_ib_mr_register_physical(struct
iova = buf_list[0].addr;
acl = dapl_ib_convert_mem_privileges(privileges);
acl |= IB_ACCESS_MW_BIND;
- mr = ib_reg_phys_mr(((struct dapl_pz *)lmr->param.pz_handle)->pd,
+ mr = ib_reg_phys_mr(((struct dapl_pz *)lmr->param.pz)->pd,
buf_list, length, acl, &iova);
kfree(buf_list);
if (IS_ERR(mr)) {
@@ -393,7 +393,7 @@ u32 dapl_ib_mw_alloc(struct dapl_rmr *rm
int ib_status;
struct ib_mw *mw;
- mw = ib_alloc_mw(((struct dapl_pz *)rmr->param.pz_handle)->pd);
+ mw = ib_alloc_mw(((struct dapl_pz *)rmr->param.pz)->pd);
if (IS_ERR(mw)) {
ib_status = PTR_ERR(mw);
dapl_dbg_log(DAPL_DBG_TYPE_ERR,
@@ -540,7 +540,7 @@ u32 dapl_ib_mw_unbind(struct dapl_rmr *r
* Set up an asynchronous callbacks of various kinds
*
* Input:
- * ia_handle IA handle
+ * ia IA handle
* handler_type type of handler to set up
* callback_handle handle param for completion callbacks
* callback callback routine pointer
Index: linux-kernel/dat-provider/dapl_ia_memtype_hint.c
===================================================================
--- linux-kernel/dat-provider/dapl_ia_memtype_hint.c (revision 2564)
+++ linux-kernel/dat-provider/dapl_ia_memtype_hint.c (working copy)
@@ -37,7 +37,7 @@
* Provide a hint about optimal memory alignment and size
*
* Input:
- * ia_handle,
+ * ia,
* mem_type,
* length,
* mem_optimization,
@@ -53,7 +53,7 @@
* DAT_INVALID_HANDLE
* DAT_MODEL_NOT_SUPPORTED
*/
-u32 dapl_ia_memtype_hint(DAT_IA_HANDLE ia_handle, enum dat_mem_type mem_type,
+u32 dapl_ia_memtype_hint(struct dat_ia *ia, enum dat_mem_type mem_type,
u64 length,
enum dat_mem_optimize_flags mem_optimization,
u64 *suggested_length,
@@ -63,11 +63,11 @@ u32 dapl_ia_memtype_hint(DAT_IA_HANDLE i
u32 dat_status = DAT_SUCCESS;
dapl_dbg_log(DAPL_DBG_TYPE_API, "dapl_ia_memtype_hint (%p)\n",
- ia_handle);
+ ia);
- ia_ptr = (struct dapl_ia *)ia_handle;
+ ia_ptr = (struct dapl_ia *)ia;
- if (DAPL_BAD_HANDLE(ia_ptr, DAPL_MAGIC_IA)) {
+ if (!ia_ptr) {
dat_status =
DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_IA);
goto bail;
Index: linux-kernel/dat-provider/dapl_openib_qp.c
===================================================================
--- linux-kernel/dat-provider/dapl_openib_qp.c (revision 2564)
+++ linux-kernel/dat-provider/dapl_openib_qp.c (working copy)
@@ -74,17 +74,17 @@ u32 dapl_ib_qp_alloc(struct dapl_ia *ia_
attr = &ep_ptr->param.ep_attr;
- dapl_os_assert(ep_ptr->param.pz_handle != NULL);
- ib_pd_handle = ((struct dapl_pz *)ep_ptr->param.pz_handle)->pd;
+ dapl_os_assert(ep_ptr->param.pz != NULL);
+ ib_pd_handle = ((struct dapl_pz *)ep_ptr->param.pz)->pd;
ib_hca_handle = ia_ptr->hca_ptr->ib_hca_handle;
cq_recv = NULL;
cq_send = NULL;
cq_recv = dapl_get_dto_cq(ia_ptr,
- (struct dapl_evd *)ep_ptr->param.recv_evd_handle);
+ (struct dapl_evd *)ep_ptr->param.recv_evd);
cq_send = dapl_get_dto_cq(ia_ptr,
(struct dapl_evd *)ep_ptr->param.
- request_evd_handle);
+ request_evd);
qp_attr.send_cq = cq_send;
qp_attr.recv_cq = cq_recv;
@@ -160,7 +160,7 @@ struct ib_cq *dapl_get_dto_cq(struct dap
int cq_entries;
int status;
- if (evd_ptr != DAT_HANDLE_NULL)
+ if (evd_ptr != NULL)
cq = evd_ptr->cq;
else if (ia_ptr->hca_ptr->null_cq != NULL)
cq = ia_ptr->hca_ptr->null_cq;
Index: linux-kernel/dat-provider/dapl_openib_util.h
===================================================================
--- linux-kernel/dat-provider/dapl_openib_util.h (revision 2564)
+++ linux-kernel/dat-provider/dapl_openib_util.h (working copy)
@@ -59,7 +59,7 @@ u32 dapl_ib_qp_free(struct dapl_ep *ep_p
u32 dapl_ib_qp_modify(struct dapl_ia *ia_ptr, struct dapl_ep *ep_ptr,
struct dat_ep_attr *ep_attr);
-u32 dapl_ib_connect(DAT_EP_HANDLE ep_handle,
+u32 dapl_ib_connect(struct dat_ep *ep,
struct sockaddr *remote_ia_address,
DAT_CONN_QUAL remote_conn_qual, unsigned long timeout,
int private_data_size, void *private_data);
@@ -70,12 +70,12 @@ u32 dapl_ib_setup_conn_listener(struct d
u32 dapl_ib_remove_conn_listener(struct dapl_ia *ia_ptr, struct dapl_sp *sp_ptr);
-u32 dapl_ib_accept_connection(DAT_CR_HANDLE cr_handle,
- DAT_EP_HANDLE ep_handle,
+u32 dapl_ib_accept_connection(struct dat_cr *cr,
+ struct dat_ep *ep,
int private_data_size,
const void *private_data);
-u32 dapl_ib_reject_connection(struct dapl_cm_id *cm_handle);
+u32 dapl_ib_reject_connection(struct dapl_cm_id *cm);
u32 dapl_ib_setup_async_callback(struct dapl_ia *ia_ptr,
DAPL_ASYNC_HANDLER_TYPE handler_type,
@@ -126,14 +126,14 @@ u32 dapl_ib_completion_notify(struct dap
enum dat_dto_completion_status dapl_ib_get_dto_status(struct ib_wc *cqe_ptr);
-void dapl_ib_reinit_ep(struct dapl_ep * ep_ptr);
+void dapl_ib_reinit_ep(struct dapl_ep *ep_ptr);
-void dapl_ib_disconnect_clean(struct dapl_ep * ep_ptr, boolean_t passive);
+void dapl_ib_disconnect_clean(struct dapl_ep *ep_ptr, boolean_t passive);
u32 dapl_ib_get_async_event(struct ib_event *cause_ptr,
enum dat_event_number *async_event);
-u32 dapl_ib_cm_remote_addr(DAT_HANDLE dat_handle,
+u32 dapl_ib_cm_remote_addr(void *dat_handle,
struct sockaddr_in6 *remote_ia_address);
static inline u32 dapl_ib_status_convert(int32_t ib_status)
Index: linux-kernel/dat-provider/dapl_ia_close.c
===================================================================
--- linux-kernel/dat-provider/dapl_ia_close.c (revision 2564)
+++ linux-kernel/dat-provider/dapl_ia_close.c (working copy)
@@ -40,7 +40,7 @@
* Close a provider, clean up resources, etc.
*
* Input:
- * ia_handle
+ * ia
*
* Output:
* none
@@ -50,30 +50,29 @@
* DAT_INSUFFICIENT_RESOURCES
* DAT_INVALID_PARAMETER
*/
-u32 dapl_ia_close(DAT_IA_HANDLE ia_handle, enum dat_close_flags ia_flags)
+u32 dapl_ia_close(struct dat_ia *ia, enum dat_close_flags ia_flags)
{
struct dapl_ia *ia_ptr;
u32 dat_status;
dapl_dbg_log(DAPL_DBG_TYPE_API,
- "dapl_ia_close (%p, %d)\n", ia_handle, ia_flags);
+ "dapl_ia_close (%p, %d)\n", ia, ia_flags);
- ia_ptr = (struct dapl_ia *)ia_handle;
+ ia_ptr = (struct dapl_ia *)ia;
- if (DAPL_BAD_HANDLE(ia_ptr, DAPL_MAGIC_IA)) {
+ if (!ia_ptr) {
dat_status =
DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_IA);
goto bail;
}
- if (DAT_CLOSE_ABRUPT_FLAG == ia_flags) {
+ if (DAT_CLOSE_ABRUPT_FLAG == ia_flags)
dat_status = dapl_ia_abrupt_close(ia_ptr);
- } else if (DAT_CLOSE_GRACEFUL_FLAG == ia_flags) {
+ else if (DAT_CLOSE_GRACEFUL_FLAG == ia_flags)
dat_status = dapl_ia_graceful_close(ia_ptr);
- } else {
+ else
dat_status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG2);
- }
- bail:
+bail:
return dat_status;
}
Index: linux-kernel/dat-provider/dapl_cr_callback.c
===================================================================
--- linux-kernel/dat-provider/dapl_cr_callback.c (revision 2564)
+++ linux-kernel/dat-provider/dapl_cr_callback.c (working copy)
@@ -50,9 +50,9 @@ static u32 dapl_connection_request(struc
struct dapl_cr *cr_ptr;
struct dapl_ep *ep_ptr;
struct dapl_ia *ia_ptr;
- DAT_SP_HANDLE sp_handle;
+ struct dat_sp *sp;
- cr_ptr = dapl_cr_alloc(sp_ptr->header.owner_ia);
+ cr_ptr = dapl_cr_alloc(sp_ptr->common.owner_ia);
if (cr_ptr == NULL) {
/* Invoking function will call dapl_ib_cm_reject() */
return DAT_INSUFFICIENT_RESOURCES;
@@ -79,7 +79,7 @@ static u32 dapl_connection_request(struc
}
/* EP will be NULL unless RSP service point */
- ep_ptr = (struct dapl_ep *)sp_ptr->ep_handle;
+ ep_ptr = (struct dapl_ep *)sp_ptr->ep;
if (sp_ptr->psp_flags == DAT_PSP_PROVIDER_FLAG) {
/*
@@ -89,7 +89,7 @@ static u32 dapl_connection_request(struc
* EP we are out of resources and need to tell the
* requestor that we cant help them.
*/
- ia_ptr = sp_ptr->header.owner_ia;
+ ia_ptr = sp_ptr->common.owner_ia;
ep_ptr = dapl_ep_alloc(ia_ptr, NULL);
if (ep_ptr == NULL) {
dapl_cr_free(cr_ptr);
@@ -100,7 +100,7 @@ static u32 dapl_connection_request(struc
dapl_ia_link_ep(ia_ptr, ep_ptr);
}
- cr_ptr->param.local_ep_handle = ep_ptr;
+ cr_ptr->param.local_ep = (struct dat_ep *)ep_ptr;
if (ep_ptr != NULL) {
/* Assign valid EP fields: RSP and PSP_PROVIDER_FLAG only */
@@ -109,12 +109,11 @@ static u32 dapl_connection_request(struc
DAT_EP_STATE_TENTATIVE_CONNECTION_PENDING;
} else {
/* RSP */
- dapl_os_assert(sp_ptr->header.handle_type ==
- DAT_HANDLE_TYPE_RSP);
+ dapl_os_assert(sp_ptr->sp.type == DAT_SP_TYPE_RSP);
ep_ptr->param.ep_state =
DAT_EP_STATE_PASSIVE_CONNECTION_PENDING;
}
- ep_ptr->cm_handle = ib_cm_handle;
+ ep_ptr->cm = ib_cm_handle;
}
/* link the CR onto the SP so we can pick it up later */
@@ -122,16 +121,16 @@ static u32 dapl_connection_request(struc
/* Post the event. */
/* assign sp_ptr to union to avoid typecast errors from some compilers */
- sp_handle.psp_handle = (DAT_PSP_HANDLE) sp_ptr;
- dat_status = dapl_evd_post_cr_arrival_event(evd_ptr, sp_handle,
- (struct sockaddr *) &sp_ptr->header.owner_ia->hca_ptr->hca_address,
- sp_ptr->conn_qual, (DAT_CR_HANDLE) cr_ptr);
+ sp = (struct dat_sp *)sp_ptr;
+ dat_status = dapl_evd_post_cr_arrival_event(evd_ptr, sp,
+ (struct sockaddr *)&sp_ptr->common.owner_ia->hca_ptr->hca_address,
+ sp_ptr->conn_qual, (struct dat_cr *)cr_ptr);
if (dat_status != DAT_SUCCESS) {
/* Take the CR off the list, we can't use it */
- spin_lock_irqsave(&sp_ptr->header.lock, sp_ptr->header.flags);
+ spin_lock_irqsave(&sp_ptr->common.lock, sp_ptr->common.flags);
dapl_sp_remove_cr(sp_ptr, cr_ptr);
- spin_unlock_irqrestore(&sp_ptr->header.lock,
- sp_ptr->header.flags);
+ spin_unlock_irqrestore(&sp_ptr->common.lock,
+ sp_ptr->common.flags);
dapl_cr_free(cr_ptr);
(void)dapl_ib_reject_connection(ib_cm_handle);
@@ -157,13 +156,7 @@ struct dapl_ep *dapl_get_sp_ep(struct da
/*
* acquire the lock, we may be racing with other threads here
*/
- spin_lock_irqsave(&sp_ptr->header.lock, sp_ptr->header.flags);
- /* Verify under lock that the SP is still valid */
- if (sp_ptr->header.magic == DAPL_MAGIC_INVALID) {
- spin_unlock_irqrestore(&sp_ptr->header.lock,
- sp_ptr->header.flags);
- return NULL;
- }
+ spin_lock_irqsave(&sp_ptr->common.lock, sp_ptr->common.flags);
/*
* There are potentially multiple connections in progress. Need to
* go through the list and find the one we are interested
@@ -172,16 +165,12 @@ struct dapl_ep *dapl_get_sp_ep(struct da
*/
cr_ptr = dapl_sp_search_cr(sp_ptr, ib_cm_handle);
if (cr_ptr == NULL) {
- spin_unlock_irqrestore(&sp_ptr->header.lock,
- sp_ptr->header.flags);
+ spin_unlock_irqrestore(&sp_ptr->common.lock,
+ sp_ptr->common.flags);
return NULL;
}
- ep_ptr = (struct dapl_ep *)cr_ptr->param.local_ep_handle;
-
- /* Quick check to ensure our EP is still valid */
- if (DAPL_BAD_HANDLE(ep_ptr, DAPL_MAGIC_EP))
- ep_ptr = NULL;
+ ep_ptr = (struct dapl_ep *)cr_ptr->param.local_ep;
/* The CR record is discarded in all except for the CONNECTED case,
* as it will have no further relevance.
@@ -211,31 +200,31 @@ struct dapl_ep *dapl_get_sp_ep(struct da
"dapl_get_sp_ep disconnect dump sp: %p \n",
sp_ptr);
/* Decrement the ref count on the EVD */
- if (sp_ptr->evd_handle) {
+ if (sp_ptr->evd) {
atomic_dec(&((struct dapl_evd *)sp_ptr->
- evd_handle)->evd_ref_count);
- sp_ptr->evd_handle = NULL;
+ evd)->evd_ref_count);
+ sp_ptr->evd = NULL;
}
sp_ptr->state = DAPL_SP_STATE_FREE;
- spin_unlock_irqrestore(&sp_ptr->header.lock,
- sp_ptr->header.flags);
- (void)dapl_ib_remove_conn_listener(sp_ptr->header.
+ spin_unlock_irqrestore(&sp_ptr->common.lock,
+ sp_ptr->common.flags);
+ (void)dapl_ib_remove_conn_listener(sp_ptr->common.
owner_ia, sp_ptr);
dapl_ia_unlink_sp((struct dapl_ia *)
- sp_ptr->header.owner_ia,
+ sp_ptr->common.owner_ia,
sp_ptr);
dapl_sp_dealloc(sp_ptr);
dapl_cr_free(cr_ptr);
goto skip_unlock;
}
- spin_unlock_irqrestore(&sp_ptr->header.lock,
- sp_ptr->header.flags);
+ spin_unlock_irqrestore(&sp_ptr->common.lock,
+ sp_ptr->common.flags);
/* free memory outside of the lock */
dapl_cr_free(cr_ptr);
} else
- spin_unlock_irqrestore(&sp_ptr->header.lock,
- sp_ptr->header.flags);
+ spin_unlock_irqrestore(&sp_ptr->common.lock,
+ sp_ptr->common.flags);
skip_unlock:
return ep_ptr;
@@ -255,16 +244,6 @@ void dapl_cr_callback(struct dapl_cm_id
ib_cm_handle, event, sp_ptr);
/*
- * The SP pointer could have been cleaned up in a racing
- * CM callback, check to see if we should just exit here
- */
- if (sp_ptr->header.magic == DAPL_MAGIC_INVALID) {
- return;
- }
- dapl_os_assert(sp_ptr->header.magic == DAPL_MAGIC_PSP ||
- sp_ptr->header.magic == DAPL_MAGIC_RSP);
-
- /*
* CONNECT_REQUEST events create an event on the PSP
* EVD, which will trigger connection processing. The
* sequence is:
@@ -277,7 +256,7 @@ void dapl_cr_callback(struct dapl_cm_id
*/
if (event == DAT_CONNECTION_REQUEST_EVENT) {
ep_ptr = NULL;
- evd_ptr = sp_ptr->evd_handle;
+ evd_ptr = (struct dapl_evd *)sp_ptr->evd;
} else {
/* see if there is an EP connected with this CM handle */
ep_ptr = dapl_get_sp_ep(ib_cm_handle, sp_ptr, event);
@@ -286,7 +265,7 @@ void dapl_cr_callback(struct dapl_cm_id
if (ep_ptr == NULL)
return;
- evd_ptr = (struct dapl_evd *)ep_ptr->param.connect_evd_handle;
+ evd_ptr = (struct dapl_evd *)ep_ptr->param.connect_evd;
/* if something has happened to our EVD, bail. */
if (evd_ptr == NULL)
return;
@@ -296,30 +275,29 @@ void dapl_cr_callback(struct dapl_cm_id
switch (event) {
case DAT_CONNECTION_REQUEST_EVENT:
- {
/*
* Requests arriving on a disabled SP are immediately rejected
*/
- spin_lock_irqsave(&sp_ptr->header.lock, sp_ptr->header.flags);
+ spin_lock_irqsave(&sp_ptr->common.lock, sp_ptr->common.flags);
if (sp_ptr->listening == FALSE) {
- spin_unlock_irqrestore(&sp_ptr->header.lock,
- sp_ptr->header.flags);
+ spin_unlock_irqrestore(&sp_ptr->common.lock,
+ sp_ptr->common.flags);
dapl_dbg_log(DAPL_DBG_TYPE_CM,
"---> dapl_cr_callback: conn event on down SP\n");
(void)dapl_ib_reject_connection(ib_cm_handle);
return;
}
- if (sp_ptr->header.handle_type == DAT_HANDLE_TYPE_RSP) {
+ if (sp_ptr->sp.type == DAT_SP_TYPE_RSP) {
/*
* RSP connections only allow a single connection. Close
* it down NOW so we reject any further connections.
*/
sp_ptr->listening = FALSE;
}
- spin_unlock_irqrestore(&sp_ptr->header.lock,
- sp_ptr->header.flags);
+ spin_unlock_irqrestore(&sp_ptr->common.lock,
+ sp_ptr->common.flags);
/*
* Only occurs on the passive side of a connection
@@ -332,24 +310,20 @@ void dapl_cr_callback(struct dapl_cm_id
evd_ptr = NULL;
break;
- }
case DAT_CONNECTION_EVENT_ESTABLISHED:
- {
/* This is just a notification the connection is now
* established, there isn't any private data to deal with.
*
* Update the EP state and cache a copy of the cm handle,
* then let the user know we are ready to go.
*/
- spin_lock_irqsave(&ep_ptr->header.lock, ep_ptr->header.flags);
- if (ep_ptr->header.magic != DAPL_MAGIC_EP ||
- ep_ptr->param.ep_state !=
- DAT_EP_STATE_COMPLETION_PENDING) {
+ spin_lock_irqsave(&ep_ptr->common.lock, ep_ptr->common.flags);
+ if (ep_ptr->param.ep_state != DAT_EP_STATE_COMPLETION_PENDING) {
/* If someone pulled the plug on the EP or connection,
* just exit
*/
- spin_unlock_irqrestore(&ep_ptr->header.lock,
- ep_ptr->header.flags);
+ spin_unlock_irqrestore(&ep_ptr->common.lock,
+ ep_ptr->common.flags);
dat_status = DAT_SUCCESS;
/* Set evd_ptr = NULL so we don't generate an event below */
evd_ptr = NULL;
@@ -358,72 +332,63 @@ void dapl_cr_callback(struct dapl_cm_id
}
ep_ptr->param.ep_state = DAT_EP_STATE_CONNECTED;
- ep_ptr->cm_handle = ib_cm_handle;
- spin_unlock_irqrestore(&ep_ptr->header.lock,
- ep_ptr->header.flags);
+ ep_ptr->cm = ib_cm_handle;
+ spin_unlock_irqrestore(&ep_ptr->common.lock,
+ ep_ptr->common.flags);
break;
- }
case DAT_CONNECTION_EVENT_DISCONNECTED:
- {
/*
* EP is now fully disconnected; initiate any post processing
* to reset the underlying QP and get the EP ready for
* another connection
*/
- spin_lock_irqsave(&ep_ptr->header.lock, ep_ptr->header.flags);
+ spin_lock_irqsave(&ep_ptr->common.lock, ep_ptr->common.flags);
if (ep_ptr->param.ep_state == DAT_EP_STATE_DISCONNECTED) {
/* The disconnect has already occurred, we are now
* cleaned up and ready to exit
*/
- spin_unlock_irqrestore(&ep_ptr->header.lock,
- ep_ptr->header.flags);
+ spin_unlock_irqrestore(&ep_ptr->common.lock,
+ ep_ptr->common.flags);
return;
}
ep_ptr->param.ep_state = DAT_EP_STATE_DISCONNECTED;
dapl_ib_disconnect_clean(ep_ptr, FALSE);
- spin_unlock_irqrestore(&ep_ptr->header.lock,
- ep_ptr->header.flags);
+ spin_unlock_irqrestore(&ep_ptr->common.lock,
+ ep_ptr->common.flags);
break;
- }
case DAT_CONNECTION_EVENT_NON_PEER_REJECTED:
case DAT_CONNECTION_EVENT_PEER_REJECTED:
case DAT_CONNECTION_EVENT_UNREACHABLE:
- {
/*
* After posting an accept the requesting node has
* stopped talking.
*/
- spin_lock_irqsave(&ep_ptr->header.lock, ep_ptr->header.flags);
+ spin_lock_irqsave(&ep_ptr->common.lock, ep_ptr->common.flags);
ep_ptr->param.ep_state = DAT_EP_STATE_DISCONNECTED;
dapl_ib_disconnect_clean(ep_ptr, FALSE);
- spin_unlock_irqrestore(&ep_ptr->header.lock,
- ep_ptr->header.flags);
+ spin_unlock_irqrestore(&ep_ptr->common.lock,
+ ep_ptr->common.flags);
break;
- }
case DAT_CONNECTION_EVENT_BROKEN:
- {
- spin_lock_irqsave(&ep_ptr->header.lock, ep_ptr->header.flags);
+ spin_lock_irqsave(&ep_ptr->common.lock, ep_ptr->common.flags);
ep_ptr->param.ep_state = DAT_EP_STATE_DISCONNECTED;
dapl_ib_disconnect_clean(ep_ptr, FALSE);
- spin_unlock_irqrestore(&ep_ptr->header.lock,
- ep_ptr->header.flags);
+ spin_unlock_irqrestore(&ep_ptr->common.lock,
+ ep_ptr->common.flags);
break;
- }
default:
- {
evd_ptr = NULL;
dapl_os_assert(0); /* shouldn't happen */
break;
}
- }
if (evd_ptr != NULL)
dat_status = dapl_evd_post_connection_event(evd_ptr, event,
- (DAT_HANDLE) ep_ptr,
+ (struct dat_ep *)ep_ptr,
0, NULL);
if (dat_status != DAT_SUCCESS) {
Index: linux-kernel/dat-provider/dapl_cr_accept.c
===================================================================
--- linux-kernel/dat-provider/dapl_cr_accept.c (revision 2564)
+++ linux-kernel/dat-provider/dapl_cr_accept.c (working copy)
@@ -39,42 +39,39 @@
* Establish a connection between active side (remote endpoint)
* and passive side (local endpoint).
*/
-u32 dapl_cr_accept(DAT_CR_HANDLE cr_handle, DAT_EP_HANDLE ep_handle,
- int private_data_size, const void *private_data)
+u32 dapl_cr_accept(struct dat_cr *cr, struct dat_ep *ep, int private_data_size,
+ const void *private_data)
{
struct dapl_ep *ep_ptr;
u32 dat_status;
struct dapl_cr *cr_ptr;
enum dat_ep_state entry_ep_state;
- DAT_EP_HANDLE entry_ep_handle;
+ struct dat_ep *entry_ep;
- dapl_dbg_log(DAPL_DBG_TYPE_API,
- "dapl_cr_accept (%p, %p, %d, %p)\n",
- cr_handle, ep_handle, private_data_size, private_data);
+ dapl_dbg_log(DAPL_DBG_TYPE_API, "dapl_cr_accept (%p, %p, %d, %p)\n",
+ cr, ep, private_data_size, private_data);
- if (DAPL_BAD_HANDLE(cr_handle, DAPL_MAGIC_CR)) {
+ if (!cr) {
dat_status =
DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_CR);
goto bail;
}
- cr_ptr = (struct dapl_cr *)cr_handle;
+ cr_ptr = (struct dapl_cr *)cr;
/*
- * Return an error if we have an ep_handle and the CR already has an
+ * Return an error if we have an ep and the CR already has an
* EP, indicating this is an RSP connection or PSP_PROVIDER_FLAG was
* specified.
*/
- if (ep_handle != NULL &&
- (DAPL_BAD_HANDLE(ep_handle, DAPL_MAGIC_EP) ||
- cr_ptr->param.local_ep_handle != NULL)) {
+ if (ep != NULL && cr_ptr->param.local_ep != NULL) {
dat_status =
DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EP);
goto bail;
}
/* Make sure we have an EP handle in one place or another */
- if (ep_handle == NULL && cr_ptr->param.local_ep_handle == NULL) {
+ if (ep == NULL && cr_ptr->param.local_ep == NULL) {
dat_status =
DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EP);
goto bail;
@@ -86,84 +83,71 @@ u32 dapl_cr_accept(DAT_CR_HANDLE cr_hand
}
/*
- * ep_handle is NULL if the user specified DAT_PSP_PROVIDER_FLAG
+ * ep is NULL if the user specified DAT_PSP_PROVIDER_FLAG
* OR this is an RSP connection; retrieve it from the cr.
*/
- if (ep_handle == NULL) {
- ep_handle = cr_ptr->param.local_ep_handle;
- if ((((struct dapl_ep *)ep_handle)->param.ep_state !=
+ if (ep == NULL) {
+ ep = cr_ptr->param.local_ep;
+ if ((((struct dapl_ep *)ep)->param.ep_state !=
DAT_EP_STATE_TENTATIVE_CONNECTION_PENDING)
- && (((struct dapl_ep *)ep_handle)->param.ep_state !=
+ && (((struct dapl_ep *)ep)->param.ep_state !=
DAT_EP_STATE_PASSIVE_CONNECTION_PENDING)) {
return DAT_INVALID_STATE;
}
} else {
/* ensure this EP isn't connected or in use */
- if (((struct dapl_ep *)ep_handle)->param.ep_state !=
+ if (((struct dapl_ep *)ep)->param.ep_state !=
DAT_EP_STATE_UNCONNECTED) {
return DAT_INVALID_STATE;
}
}
- ep_ptr = (struct dapl_ep *)ep_handle;
+ ep_ptr = (struct dapl_ep *)ep;
/*
* Verify the attributes of the EP handle before we connect it. Test
* all of the handles to make sure they are currently valid.
* Specifically:
- * pz_handle required
- * recv_evd_handle optional, but must be valid
- * request_evd_handle optional, but must be valid
- * connect_evd_handle required
+ * pz required
+ * recv_evd optional, but must be valid
+ * request_evd optional, but must be valid
+ * connect_evd required
* We do all verification and state change under lock, at which
* point the EP state should protect us from most races.
*/
- spin_lock_irqsave(&ep_ptr->header.lock, ep_ptr->header.flags);
- if (ep_ptr->param.pz_handle == NULL
- || DAPL_BAD_HANDLE(ep_ptr->param.pz_handle, DAPL_MAGIC_PZ)
- /* test connect handle */
- || ep_ptr->param.connect_evd_handle == NULL
- || DAPL_BAD_HANDLE(ep_ptr->param.connect_evd_handle, DAPL_MAGIC_EVD)
- || !(((struct dapl_evd *)ep_ptr->param.connect_evd_handle)->
- evd_flags & DAT_EVD_CONNECTION_FLAG)
- /* test optional completion handles */
- || (ep_ptr->param.recv_evd_handle != DAT_HANDLE_NULL &&
- (DAPL_BAD_HANDLE
- (ep_ptr->param.recv_evd_handle, DAPL_MAGIC_EVD)))
-
- || (ep_ptr->param.request_evd_handle != DAT_HANDLE_NULL &&
- (DAPL_BAD_HANDLE
- (ep_ptr->param.request_evd_handle, DAPL_MAGIC_EVD)))) {
- spin_unlock_irqrestore(&ep_ptr->header.lock,
- ep_ptr->header.flags);
+ spin_lock_irqsave(&ep_ptr->common.lock, ep_ptr->common.flags);
+ if (ep_ptr->param.pz == NULL || ep_ptr->param.connect_evd == NULL
+ || !(((struct dapl_evd *)ep_ptr->param.connect_evd)->
+ evd_flags & DAT_EVD_CONNECTION_FLAG)) {
+ spin_unlock_irqrestore(&ep_ptr->common.lock,
+ ep_ptr->common.flags);
dat_status =
DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EP);
goto bail;
}
/* The qp must be attached by this point! */
- if ( ep_ptr->qp_state == DAPL_QP_STATE_UNATTACHED )
- {
- spin_unlock_irqrestore(&ep_ptr->header.lock,
- ep_ptr->header.flags);
+ if (ep_ptr->qp_state == DAPL_QP_STATE_UNATTACHED) {
+ spin_unlock_irqrestore(&ep_ptr->common.lock,
+ ep_ptr->common.flags);
dat_status = DAT_ERROR(DAT_INVALID_HANDLE,
DAT_INVALID_HANDLE_EP);
goto bail;
}
entry_ep_state = ep_ptr->param.ep_state;
- entry_ep_handle = cr_ptr->param.local_ep_handle;
+ entry_ep = cr_ptr->param.local_ep;
ep_ptr->param.ep_state = DAT_EP_STATE_COMPLETION_PENDING;
- ep_ptr->cm_handle = cr_ptr->ib_cm_handle;
+ ep_ptr->cm = cr_ptr->ib_cm_handle;
ep_ptr->cr_ptr = cr_ptr;
ep_ptr->param.remote_ia_address_ptr =
cr_ptr->param.remote_ia_address_ptr;
- cr_ptr->param.local_ep_handle = ep_handle;
+ cr_ptr->param.local_ep = ep;
- spin_unlock_irqrestore(&ep_ptr->header.lock, ep_ptr->header.flags);
+ spin_unlock_irqrestore(&ep_ptr->common.lock, ep_ptr->common.flags);
- dat_status = dapl_ib_accept_connection(cr_handle,
- ep_handle,
+ dat_status = dapl_ib_accept_connection(cr,
+ ep,
private_data_size, private_data);
/*
@@ -176,16 +160,14 @@ u32 dapl_cr_accept(DAT_CR_HANDLE cr_hand
* system error, app termination, perhaps other reasons.
*/
dat_status =
- dapl_evd_post_connection_event(ep_ptr->param.
- request_evd_handle,
+ dapl_evd_post_connection_event((struct dapl_evd *)ep_ptr->param.
+ request_evd,
DAT_CONNECTION_EVENT_ACCEPT_COMPLETION_ERROR,
- (DAT_HANDLE) ep_ptr,
+ (void *) ep_ptr,
0, NULL);
-
- cr_ptr->header.magic = DAPL_MAGIC_CR_DESTROYED;
} else {
ep_ptr->param.ep_state = entry_ep_state;
- cr_ptr->param.local_ep_handle = entry_ep_handle;
+ cr_ptr->param.local_ep = entry_ep;
ep_ptr->cr_ptr = NULL;
ep_ptr->param.remote_ia_address_ptr = NULL;
}
@@ -199,14 +181,8 @@ u32 dapl_cr_accept(DAT_CR_HANDLE cr_hand
DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG3);
}
- } else {
- /* Make this CR invalid. We need to hang on to it until
- * the connection terminates, but it's destroyed from
- * the app point of view.
- */
- cr_ptr->header.magic = DAPL_MAGIC_CR_DESTROYED;
}
- bail:
+bail:
return dat_status;
}
Index: linux-kernel/dat-provider/dapl_cr_handoff.c
===================================================================
--- linux-kernel/dat-provider/dapl_cr_handoff.c (revision 2564)
+++ linux-kernel/dat-provider/dapl_cr_handoff.c (working copy)
@@ -37,7 +37,7 @@
* Hand the connection request to another Sevice pont specified by the
* Connectin Qualifier.
*/
-u32 dapl_cr_handoff(DAT_CR_HANDLE cr_handle, DAT_CONN_QUAL cr_handoff)
+u32 dapl_cr_handoff(struct dat_cr *cr, DAT_CONN_QUAL cr_handoff)
{ /* handoff */
return DAT_ERROR(DAT_NOT_IMPLEMENTED, 0);
}
Index: linux-kernel/dat-provider/dapl_pz.c
===================================================================
--- linux-kernel/dat-provider/dapl_pz.c (revision 2564)
+++ linux-kernel/dat-provider/dapl_pz.c (working copy)
@@ -44,18 +44,13 @@ static struct dapl_pz *dapl_pz_alloc(str
/* zero the structure */
memset(pz, 0, sizeof *pz);
- /*
- * initialize the header
- */
- pz->header.provider = ia->header.provider;
- pz->header.magic = DAPL_MAGIC_PZ;
- pz->header.handle_type = DAT_HANDLE_TYPE_PZ;
- pz->header.owner_ia = ia;
- pz->header.user_context.as_64 = 0;
- pz->header.user_context.as_ptr = NULL;
- dapl_llist_init_entry(&pz->header.ia_list_entry);
+ pz->pz.provider = ia->ia.provider;
+ pz->common.owner_ia = ia;
+ pz->common.user_context.as_64 = 0;
+ pz->common.user_context.as_ptr = NULL;
+ dapl_llist_init_entry(&pz->common.ia_list_entry);
dapl_ia_link_pz(ia, pz);
- spin_lock_init(&pz->header.lock);
+ spin_lock_init(&pz->common.lock);
/*
* initialize the body
@@ -67,83 +62,81 @@ static struct dapl_pz *dapl_pz_alloc(str
static void dapl_pz_dealloc(struct dapl_pz *pz)
{
- /* reset magic to prevent reuse */
- pz->header.magic = DAPL_MAGIC_INVALID;
- dapl_ia_unlink_pz(pz->header.owner_ia, pz);
+ dapl_ia_unlink_pz(pz->common.owner_ia, pz);
kfree(pz);
}
-u32 dapl_pz_create(DAT_IA_HANDLE ia_handle, DAT_PZ_HANDLE *pz_handle)
+u32 dapl_pz_create(struct dat_ia *ia, struct dat_pz **pz)
{
- struct dapl_ia *ia;
- struct dapl_pz *pz;
+ struct dapl_ia *dapl_ia;
+ struct dapl_pz *dapl_pz;
u32 status;
int ib_status;
dapl_dbg_log(DAPL_DBG_TYPE_API, "dapl_pz_create(%p, %p)\n",
- ia_handle, pz_handle);
+ ia, pz);
- if (DAPL_BAD_HANDLE(ia_handle, DAPL_MAGIC_IA)) {
+ if (!ia) {
status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_IA);
goto error1;
}
- if (NULL == pz_handle) {
+ if (NULL == pz) {
status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG2);
goto error1;
}
- ia = (struct dapl_ia *)ia_handle;
+ dapl_ia = (struct dapl_ia *)ia;
- pz = dapl_pz_alloc(ia);
- if (NULL == pz) {
+ dapl_pz = dapl_pz_alloc(dapl_ia);
+ if (!dapl_pz) {
status =
DAT_ERROR(DAT_INSUFFICIENT_RESOURCES, DAT_RESOURCE_MEMORY);
goto error1;
}
- pz->pd = ib_alloc_pd(ia->hca_ptr->ib_hca_handle);
- if (IS_ERR(pz->pd)) {
- ib_status = PTR_ERR(pz->pd);
+ dapl_pz->pd = ib_alloc_pd(dapl_ia->hca_ptr->ib_hca_handle);
+ if (IS_ERR(dapl_pz->pd)) {
+ ib_status = PTR_ERR(dapl_pz->pd);
dapl_dbg_log(DAPL_DBG_TYPE_ERR, "ib_alloc_pd failed: %X\n",
ib_status);
status = dapl_ib_status_convert(ib_status);
goto error2;
}
- *pz_handle = pz;
+ *pz = (struct dat_pz *)dapl_pz;
return DAT_SUCCESS;
error2:
- dapl_pz_dealloc(pz);
+ dapl_pz_dealloc(dapl_pz);
error1:
- *pz_handle = NULL;
+ *pz = NULL;
return status;
}
-u32 dapl_pz_free(DAT_PZ_HANDLE pz_handle)
+u32 dapl_pz_free(struct dat_pz *pz)
{
- struct dapl_pz *pz;
+ struct dapl_pz *dapl_pz;
u32 status;
int ib_status;
- dapl_dbg_log(DAPL_DBG_TYPE_API, "dapl_pz_free(%p)\n", pz_handle);
+ dapl_dbg_log(DAPL_DBG_TYPE_API, "dapl_pz_free(%p)\n", pz);
- if (DAPL_BAD_HANDLE(pz_handle, DAPL_MAGIC_PZ)) {
+ if (!pz) {
status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_PZ);
goto error;
}
- pz = (struct dapl_pz *)pz_handle;
+ dapl_pz = (struct dapl_pz *)pz;
- if (0 != atomic_read(&pz->pz_ref_count)) {
+ if (0 != atomic_read(&dapl_pz->pz_ref_count)) {
status =
DAT_ERROR(DAT_INVALID_STATE, DAT_INVALID_STATE_PZ_IN_USE);
goto error;
}
- ib_status = ib_dealloc_pd(pz->pd);
+ ib_status = ib_dealloc_pd(dapl_pz->pd);
if (ib_status) {
dapl_dbg_log(DAPL_DBG_TYPE_ERR, "ib_dealloc_pd failed: %X\n",
ib_status);
@@ -151,22 +144,22 @@ u32 dapl_pz_free(DAT_PZ_HANDLE pz_handle
goto error;
}
- dapl_pz_dealloc(pz);
+ dapl_pz_dealloc(dapl_pz);
return DAT_SUCCESS;
error:
return status;
}
-u32 dapl_pz_query(DAT_PZ_HANDLE pz_handle, struct dat_pz_param *pz_param)
+u32 dapl_pz_query(struct dat_pz *pz, struct dat_pz_param *pz_param)
{
- struct dapl_pz *pz;
+ struct dapl_pz *dapl_pz;
u32 status;
dapl_dbg_log(DAPL_DBG_TYPE_API, "dapl_pz_query(%p, %x, %p)\n",
- pz_handle, pz_param);
+ pz, pz_param);
- if (DAPL_BAD_HANDLE(pz_handle, DAPL_MAGIC_PZ)) {
+ if (!pz) {
status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_PZ);
goto error;
}
@@ -175,8 +168,8 @@ u32 dapl_pz_query(DAT_PZ_HANDLE pz_handl
goto error;
}
- pz = (struct dapl_pz *)pz_handle;
- pz_param->ia_handle = (DAT_IA_HANDLE)pz->header.owner_ia;
+ dapl_pz = (struct dapl_pz *)pz;
+ pz_param->ia = (struct dat_ia *)dapl_pz->common.owner_ia;
return DAT_SUCCESS;
error:
Index: linux-kernel/dat-provider/dapl_lmr.c
===================================================================
--- linux-kernel/dat-provider/dapl_lmr.c (revision 2564)
+++ linux-kernel/dat-provider/dapl_lmr.c (working copy)
@@ -36,7 +36,7 @@
static struct dapl_lmr *dapl_lmr_alloc(struct dapl_ia *ia,
enum dat_mem_type mem_type,
DAT_REGION_DESCRIPTION region_desc,
- u64 length, DAT_PZ_HANDLE pz_handle,
+ u64 length, struct dat_pz *pz,
enum dat_mem_priv_flags mem_priv)
{
struct dapl_lmr *lmr;
@@ -49,27 +49,22 @@ static struct dapl_lmr *dapl_lmr_alloc(s
/* zero the structure */
memset(lmr, 0, sizeof *lmr);
- /*
- * initialize the header
- */
- lmr->header.provider = ia->header.provider;
- lmr->header.magic = DAPL_MAGIC_LMR;
- lmr->header.handle_type = DAT_HANDLE_TYPE_LMR;
- lmr->header.owner_ia = ia;
- lmr->header.user_context.as_64 = 0;
- lmr->header.user_context.as_ptr = NULL;
- dapl_llist_init_entry(&lmr->header.ia_list_entry);
+ lmr->lmr.provider = ia->ia.provider;
+ lmr->common.owner_ia = ia;
+ lmr->common.user_context.as_64 = 0;
+ lmr->common.user_context.as_ptr = NULL;
+ dapl_llist_init_entry(&lmr->common.ia_list_entry);
dapl_ia_link_lmr(ia, lmr);
- spin_lock_init(&lmr->header.lock);
+ spin_lock_init(&lmr->common.lock);
/*
* initialize the body
*/
- lmr->param.ia_handle = (DAT_IA_HANDLE) ia;
+ lmr->param.ia = (struct dat_ia *)ia;
lmr->param.mem_type = mem_type;
lmr->param.region_desc = region_desc;
lmr->param.length = length;
- lmr->param.pz_handle = pz_handle;
+ lmr->param.pz = pz;
lmr->param.mem_priv = mem_priv;
atomic_set(&lmr->lmr_ref_count, 0);
@@ -78,9 +73,7 @@ static struct dapl_lmr *dapl_lmr_alloc(s
static void dapl_lmr_dealloc(struct dapl_lmr *lmr)
{
- /* reset magic to prevent reuse */
- lmr->header.magic = DAPL_MAGIC_INVALID;
- dapl_ia_unlink_lmr(lmr->header.owner_ia, lmr);
+ dapl_ia_unlink_lmr(lmr->common.owner_ia, lmr);
kfree(lmr);
}
@@ -88,49 +81,50 @@ static void dapl_lmr_dealloc(struct dapl
static inline u32 dapl_lmr_create_virtual(struct dapl_ia *ia, void *virt_addr,
u64 length, struct dapl_pz *pz,
enum dat_mem_priv_flags privileges,
- DAT_LMR_HANDLE *lmr_handle,
+ struct dat_lmr **lmr,
DAT_LMR_CONTEXT *lmr_context,
DAT_RMR_CONTEXT *rmr_context,
u64 *registered_length,
u64 *registered_address)
{
- struct dapl_lmr *lmr;
+ struct dapl_lmr *new_lmr;
DAT_REGION_DESCRIPTION reg_desc;
u32 status;
reg_desc.for_va = virt_addr;
- lmr = dapl_lmr_alloc(ia, DAT_MEM_TYPE_VIRTUAL, reg_desc, length,
- (DAT_PZ_HANDLE) pz, privileges);
- if (NULL == lmr) {
+ new_lmr = dapl_lmr_alloc(ia, DAT_MEM_TYPE_VIRTUAL, reg_desc, length,
+ (struct dat_pz *)pz, privileges);
+ if (!new_lmr) {
status =
DAT_ERROR(DAT_INSUFFICIENT_RESOURCES, DAT_RESOURCE_MEMORY);
goto error1;
}
- status = dapl_ib_mr_register(ia, lmr, virt_addr, length, privileges);
+ status = dapl_ib_mr_register(ia, new_lmr, virt_addr, length,
+ privileges);
if (DAT_SUCCESS != status)
goto error2;
/* if the LMR context is already in the hash table */
status = dapl_hash_search(ia->hca_ptr->lmr_hash_table,
- lmr->param.lmr_context, NULL);
+ new_lmr->param.lmr_context, NULL);
if (status == DAT_SUCCESS)
goto error3;
status = dapl_hash_insert(ia->hca_ptr->lmr_hash_table,
- lmr->param.lmr_context, lmr);
+ new_lmr->param.lmr_context, lmr);
if (status != DAT_SUCCESS)
goto error3;
atomic_inc(&pz->pz_ref_count);
- if (lmr_handle)
- *lmr_handle = (DAT_LMR_HANDLE) lmr;
+ if (lmr)
+ *lmr = (struct dat_lmr *)new_lmr;
if (lmr_context)
- *lmr_context = (DAT_LMR_CONTEXT) lmr->param.lmr_context;
+ *lmr_context = (DAT_LMR_CONTEXT)new_lmr->param.lmr_context;
if (rmr_context)
- *rmr_context = (DAT_LMR_CONTEXT) lmr->param.rmr_context;
+ *rmr_context = (DAT_LMR_CONTEXT)new_lmr->param.rmr_context;
if (registered_address)
*registered_address = (u64)(unsigned long) virt_addr;
if (registered_length)
@@ -139,9 +133,9 @@ static inline u32 dapl_lmr_create_virtua
return DAT_SUCCESS;
error3:
- (void)dapl_ib_mr_deregister(lmr);
+ (void)dapl_ib_mr_deregister(new_lmr);
error2:
- dapl_lmr_dealloc(lmr);
+ dapl_lmr_dealloc(new_lmr);
error1:
return status;
@@ -151,26 +145,26 @@ static inline u32 dapl_lmr_create_physic
DAT_REGION_DESCRIPTION phys_addr,
u64 page_count, struct dapl_pz *pz,
enum dat_mem_priv_flags privileges,
- DAT_LMR_HANDLE *lmr_handle,
+ struct dat_lmr **lmr,
DAT_LMR_CONTEXT *lmr_context,
DAT_RMR_CONTEXT *rmr_context,
u64 *registered_length,
u64 *registered_address)
{
- struct dapl_lmr *lmr;
+ struct dapl_lmr *new_lmr;
u64 *array = phys_addr.for_array;
u32 status;
- lmr = dapl_lmr_alloc(ia, DAT_MEM_TYPE_PHYSICAL, phys_addr, page_count,
- (DAT_PZ_HANDLE) pz, privileges);
+ new_lmr = dapl_lmr_alloc(ia, DAT_MEM_TYPE_PHYSICAL, phys_addr,
+ page_count, (struct dat_pz *) pz, privileges);
- if (NULL == lmr) {
+ if (NULL == new_lmr) {
status =
DAT_ERROR(DAT_INSUFFICIENT_RESOURCES, DAT_RESOURCE_MEMORY);
goto error1;
}
- status = dapl_ib_mr_register_physical(ia, lmr, phys_addr.for_array,
+ status = dapl_ib_mr_register_physical(ia, new_lmr, phys_addr.for_array,
page_count, privileges);
if (DAT_SUCCESS != status)
@@ -178,23 +172,23 @@ static inline u32 dapl_lmr_create_physic
/* if the LMR context is already in the hash table */
status = dapl_hash_search(ia->hca_ptr->lmr_hash_table,
- lmr->param.lmr_context, NULL);
+ new_lmr->param.lmr_context, NULL);
if (status == DAT_SUCCESS)
goto error3;
status = dapl_hash_insert(ia->hca_ptr->lmr_hash_table,
- lmr->param.lmr_context, lmr);
+ new_lmr->param.lmr_context, lmr);
if (status != DAT_SUCCESS)
goto error3;
atomic_inc(&pz->pz_ref_count);
- if (lmr_handle)
- *lmr_handle = (DAT_LMR_HANDLE) lmr;
+ if (lmr)
+ *lmr = (struct dat_lmr *)new_lmr;
if (lmr_context)
- *lmr_context = (DAT_LMR_CONTEXT) lmr->param.lmr_context;
+ *lmr_context = (DAT_LMR_CONTEXT)new_lmr->param.lmr_context;
if (rmr_context)
- *rmr_context = (DAT_LMR_CONTEXT) lmr->param.rmr_context;
+ *rmr_context = (DAT_LMR_CONTEXT)new_lmr->param.rmr_context;
if (registered_address)
*registered_address = array[0];
if (registered_length)
@@ -203,9 +197,9 @@ static inline u32 dapl_lmr_create_physic
return DAT_SUCCESS;
error3:
- (void)dapl_ib_mr_deregister(lmr);
+ (void)dapl_ib_mr_deregister(new_lmr);
error2:
- dapl_lmr_dealloc(lmr);
+ dapl_lmr_dealloc(new_lmr);
error1:
return status;
}
@@ -214,13 +208,13 @@ static inline u32 dapl_lmr_create_lmr(st
struct dapl_lmr *original_lmr,
struct dapl_pz *pz,
enum dat_mem_priv_flags privileges,
- DAT_LMR_HANDLE *lmr_handle,
+ struct dat_lmr **lmr,
DAT_LMR_CONTEXT *lmr_context,
DAT_RMR_CONTEXT *rmr_context,
u64 *registered_length,
u64 *registered_address)
{
- struct dapl_lmr *lmr;
+ struct dapl_lmr *new_lmr;
DAT_REGION_DESCRIPTION reg_desc;
u32 status;
@@ -230,39 +224,39 @@ static inline u32 dapl_lmr_create_lmr(st
if (status != DAT_SUCCESS)
goto error1;
- reg_desc.for_lmr_handle = (DAT_LMR_HANDLE) original_lmr;
+ reg_desc.for_lmr = (struct dat_lmr *) original_lmr;
- lmr = dapl_lmr_alloc(ia, DAT_MEM_TYPE_LMR, reg_desc, 0,
- (DAT_PZ_HANDLE) pz, privileges);
- if (NULL == lmr) {
+ new_lmr = dapl_lmr_alloc(ia, DAT_MEM_TYPE_LMR, reg_desc, 0,
+ (struct dat_pz *) pz, privileges);
+ if (!new_lmr) {
status =
DAT_ERROR(DAT_INSUFFICIENT_RESOURCES, DAT_RESOURCE_MEMORY);
goto error1;
}
- status = dapl_ib_mr_register_shared(ia, lmr, privileges);
+ status = dapl_ib_mr_register_shared(ia, new_lmr, privileges);
if (DAT_SUCCESS != status)
goto error2;
/* if the LMR context is already in the hash table */
status = dapl_hash_search(ia->hca_ptr->lmr_hash_table,
- lmr->param.lmr_context, NULL);
+ new_lmr->param.lmr_context, NULL);
if (status == DAT_SUCCESS)
goto error3;
status = dapl_hash_insert(ia->hca_ptr->lmr_hash_table,
- lmr->param.lmr_context, lmr);
+ new_lmr->param.lmr_context, lmr);
if (status != DAT_SUCCESS)
goto error3;
atomic_inc(&pz->pz_ref_count);
- if (lmr_handle)
- *lmr_handle = (DAT_LMR_HANDLE) lmr;
+ if (lmr)
+ *lmr = (struct dat_lmr *)new_lmr;
if (lmr_context)
- *lmr_context = (DAT_LMR_CONTEXT) lmr->param.lmr_context;
+ *lmr_context = (DAT_LMR_CONTEXT)new_lmr->param.lmr_context;
if (rmr_context)
- *rmr_context = (DAT_LMR_CONTEXT) lmr->param.rmr_context;
+ *rmr_context = (DAT_LMR_CONTEXT)new_lmr->param.rmr_context;
if (registered_address)
*registered_address = (u64) (unsigned long)
original_lmr->param.region_desc.for_va;
@@ -272,73 +266,72 @@ static inline u32 dapl_lmr_create_lmr(st
return DAT_SUCCESS;
error3:
- dapl_ib_mr_deregister(lmr);
+ dapl_ib_mr_deregister(new_lmr);
error2:
- dapl_lmr_dealloc(lmr);
+ dapl_lmr_dealloc(new_lmr);
error1:
return status;
}
-u32 dapl_lmr_kcreate(DAT_IA_HANDLE ia_handle, enum dat_mem_type mem_type,
+u32 dapl_lmr_kcreate(struct dat_ia *ia, enum dat_mem_type mem_type,
DAT_REGION_DESCRIPTION region_description, u64 length,
- DAT_PZ_HANDLE pz_handle,
- enum dat_mem_priv_flags privileges,
+ struct dat_pz *pz, enum dat_mem_priv_flags privileges,
enum dat_mem_optimize_flags optimization,
- DAT_LMR_HANDLE *lmr_handle,
- DAT_LMR_CONTEXT *lmr_context, DAT_RMR_CONTEXT *rmr_context,
- u64 *registered_length, u64 *registered_address)
+ struct dat_lmr **lmr, DAT_LMR_CONTEXT *lmr_context,
+ DAT_RMR_CONTEXT *rmr_context, u64 *registered_length,
+ u64 *registered_address)
{
- struct dapl_ia *ia;
- struct dapl_pz *pz;
+ struct dapl_ia *dapl_ia;
+ struct dapl_pz *dapl_pz;
u32 status;
dapl_dbg_log(DAPL_DBG_TYPE_API,
"dapl_lmr_kcreate(ia:%p, mem_type:%x, ...)\n",
- ia_handle, mem_type);
+ ia, mem_type);
- if (DAPL_BAD_HANDLE(ia_handle, DAPL_MAGIC_IA)) {
+ if (!ia) {
status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_IA);
goto bail;
}
- if (DAPL_BAD_HANDLE(pz_handle, DAPL_MAGIC_PZ)) {
+ if (!pz) {
status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_PZ);
goto bail;
}
- ia = (struct dapl_ia *)ia_handle;
- pz = (struct dapl_pz *)pz_handle;
+ dapl_ia = (struct dapl_ia *)ia;
+ dapl_pz = (struct dapl_pz *)pz;
switch (mem_type) {
case DAT_MEM_TYPE_VIRTUAL:
- status = dapl_lmr_create_virtual(ia, region_description.for_va,
- length, pz, privileges,
- lmr_handle, lmr_context,
+ status = dapl_lmr_create_virtual(dapl_ia,
+ region_description.for_va,
+ length, dapl_pz, privileges,
+ lmr, lmr_context,
rmr_context, registered_length,
registered_address);
break;
case DAT_MEM_TYPE_PHYSICAL:
- status = dapl_lmr_create_physical(ia, region_description,
- length, pz, privileges,
- lmr_handle, lmr_context,
+ status = dapl_lmr_create_physical(dapl_ia, region_description,
+ length, dapl_pz, privileges,
+ lmr, lmr_context,
rmr_context,
registered_length,
registered_address);
break;
case DAT_MEM_TYPE_LMR:
{
- struct dapl_lmr *lmr;
+ struct dapl_lmr *dapl_lmr;
- if (DAPL_BAD_HANDLE(region_description.for_lmr_handle,
- DAPL_MAGIC_LMR)) {
+ if (!region_description.for_lmr) {
status = DAT_ERROR(DAT_INVALID_HANDLE,
DAT_INVALID_HANDLE_LMR);
goto bail;
}
- lmr = (struct dapl_lmr *)region_description.for_lmr_handle;
+ dapl_lmr = (struct dapl_lmr *)region_description.for_lmr;
- status = dapl_lmr_create_lmr(ia, lmr, pz, privileges,
- lmr_handle, lmr_context,
+ status = dapl_lmr_create_lmr(dapl_ia, dapl_lmr, dapl_pz,
+ privileges, lmr, lmr_context,
rmr_context, registered_length,
registered_address);
break;
@@ -357,45 +350,45 @@ bail:
return status;
}
-u32 dapl_lmr_free(DAT_LMR_HANDLE lmr_handle)
+u32 dapl_lmr_free(struct dat_lmr *lmr)
{
- struct dapl_lmr *lmr;
+ struct dapl_lmr *dapl_lmr;
u32 status;
- dapl_dbg_log(DAPL_DBG_TYPE_API, "dapl_lmr_free (%p)\n", lmr_handle);
+ dapl_dbg_log(DAPL_DBG_TYPE_API, "dapl_lmr_free (%p)\n", lmr);
- if (DAPL_BAD_HANDLE(lmr_handle, DAPL_MAGIC_LMR)) {
+ if (!lmr) {
status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_LMR);
goto error;
}
- lmr = (struct dapl_lmr *)lmr_handle;
+ dapl_lmr = (struct dapl_lmr *)lmr;
- switch (lmr->param.mem_type) {
+ switch (dapl_lmr->param.mem_type) {
case DAT_MEM_TYPE_PHYSICAL:
case DAT_MEM_TYPE_VIRTUAL:
case DAT_MEM_TYPE_LMR:
{
struct dapl_pz *pz;
- if (0 != atomic_read(&lmr->lmr_ref_count))
+ if (0 != atomic_read(&dapl_lmr->lmr_ref_count))
return DAT_INVALID_STATE;
status = dapl_hash_remove(
- lmr->header.owner_ia->hca_ptr->lmr_hash_table,
- lmr->param.lmr_context, NULL);
+ dapl_lmr->common.owner_ia->hca_ptr->lmr_hash_table,
+ dapl_lmr->param.lmr_context, NULL);
if (status != DAT_SUCCESS)
goto error;
- status = dapl_ib_mr_deregister(lmr);
+ status = dapl_ib_mr_deregister(dapl_lmr);
if (status == DAT_SUCCESS) {
- pz = (struct dapl_pz *)lmr->param.pz_handle;
+ pz = (struct dapl_pz *)dapl_lmr->param.pz;
atomic_dec(&pz->pz_ref_count);
- dapl_lmr_dealloc(lmr);
- } else /* failure; put lmr back in hash table */
- dapl_hash_insert(lmr->header.owner_ia->
+ dapl_lmr_dealloc(dapl_lmr);
+ } else /* failure; put dapl_lmr back in hash table */
+ dapl_hash_insert(dapl_lmr->common.owner_ia->
hca_ptr->lmr_hash_table,
- lmr->param.lmr_context, lmr);
+ dapl_lmr->param.lmr_context, dapl_lmr);
break;
}
@@ -412,15 +405,15 @@ error:
return status;
}
-u32 dapl_lmr_query(DAT_LMR_HANDLE lmr_handle, struct dat_lmr_param *lmr_param)
+u32 dapl_lmr_query(struct dat_lmr *lmr, struct dat_lmr_param *lmr_param)
{
- struct dapl_lmr *lmr;
+ struct dapl_lmr *dapl_lmr;
u32 status;
dapl_dbg_log(DAPL_DBG_TYPE_API, "dapl_lmr_query (%p, %p)\n",
- lmr_handle, lmr_param);
+ lmr, lmr_param);
- if (DAPL_BAD_HANDLE(lmr_handle, DAPL_MAGIC_LMR)) {
+ if (!lmr) {
status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_LMR);
goto error;
}
@@ -429,8 +422,8 @@ u32 dapl_lmr_query(DAT_LMR_HANDLE lmr_ha
goto error;
}
- lmr = (struct dapl_lmr *)lmr_handle;
- memcpy(lmr_param, &lmr->param, sizeof *lmr_param);
+ dapl_lmr = (struct dapl_lmr *)lmr;
+ memcpy(lmr_param, &dapl_lmr->param, sizeof *lmr_param);
status = DAT_SUCCESS;
error:
return status;
@@ -441,7 +434,7 @@ error:
* will sync the cache with memory.
*/
-u32 dapl_lmr_sync_rdma_read(DAT_IA_HANDLE ia_handle,
+u32 dapl_lmr_sync_rdma_read(struct dat_ia *ia,
const struct dat_lmr_triplet *local_segments,
u64 num_segments)
{
@@ -449,11 +442,11 @@ u32 dapl_lmr_sync_rdma_read(DAT_IA_HANDL
u32 status = DAT_SUCCESS;
dapl_dbg_log(DAPL_DBG_TYPE_API, "dat_lmr_sync_rdma_read(%p, %p, %ld)\n",
- ia_handle, local_segments, num_segments);
+ ia, local_segments, num_segments);
- ia_ptr = (struct dapl_ia *)ia_handle;
+ ia_ptr = (struct dapl_ia *)ia;
- if (DAPL_BAD_HANDLE(ia_ptr, DAPL_MAGIC_IA)) {
+ if (!ia_ptr) {
status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_IA);
goto error;
}
@@ -462,7 +455,7 @@ error:
return status;
}
-u32 dapl_lmr_sync_rdma_write(DAT_IA_HANDLE ia_handle,
+u32 dapl_lmr_sync_rdma_write(struct dat_ia *ia,
const struct dat_lmr_triplet *local_segments,
u64 num_segments)
{
@@ -470,11 +463,11 @@ u32 dapl_lmr_sync_rdma_write(DAT_IA_HAND
u32 status = DAT_SUCCESS;
dapl_dbg_log(DAPL_DBG_TYPE_API, "dat_lmr_sync_rdma_write(%p, %p, %ld)\n",
- ia_handle, local_segments, num_segments);
+ ia, local_segments, num_segments);
- ia_ptr = (struct dapl_ia *)ia_handle;
+ ia_ptr = (struct dapl_ia *)ia;
- if (DAPL_BAD_HANDLE(ia_ptr, DAPL_MAGIC_IA)) {
+ if (!ia_ptr) {
status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_IA);
goto error;
}
Index: linux-kernel/dat-provider/dapl_get_handle_type.c
===================================================================
--- linux-kernel/dat-provider/dapl_get_handle_type.c (revision 2564)
+++ linux-kernel/dat-provider/dapl_get_handle_type.c (working copy)
@@ -1,74 +0,0 @@
-/*
- * 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
- * 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
- * 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
- * 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.
- */
-
-/*
- * $Id$
- */
-
-#include "dapl.h"
-
-/*
- * dapl_get_handle_type
- *
- * Gets the handle type for the given dat_handle
- *
- * Input:
- * dat_handle
- *
- * Output:
- * handle_type
- *
- * Returns:
- * DAT_SUCCESS
- * DAT_INVALID_PARAMETER
- */
-
-u32 dapl_get_handle_type(DAT_HANDLE dat_handle, enum dat_handle_type *type)
-{
- u32 dat_status = DAT_SUCCESS;
- struct dapl_header *header;
-
- header = (struct dapl_header *)dat_handle;
- if (((header) == NULL) ||
- ((unsigned long)(header) & 3) ||
- (header->magic != DAPL_MAGIC_IA &&
- header->magic != DAPL_MAGIC_EVD &&
- header->magic != DAPL_MAGIC_EP &&
- header->magic != DAPL_MAGIC_LMR &&
- header->magic != DAPL_MAGIC_RMR &&
- header->magic != DAPL_MAGIC_PZ &&
- header->magic != DAPL_MAGIC_PSP &&
- header->magic != DAPL_MAGIC_RSP &&
- header->magic != DAPL_MAGIC_CR)) {
- dat_status = DAT_ERROR(DAT_INVALID_HANDLE, 0);
- goto bail;
- }
- *type = header->handle_type;
-
-bail:
- return dat_status;
-}
Index: linux-kernel/dat-provider/dapl_get_consumer_context.c
===================================================================
--- linux-kernel/dat-provider/dapl_get_consumer_context.c (revision 2564)
+++ linux-kernel/dat-provider/dapl_get_consumer_context.c (working copy)
@@ -1,80 +0,0 @@
-/*
- * 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
- * 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
- * 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
- * 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.
- */
-
-/*
- * $Id$
- */
-
-#include "dapl.h"
-
-/*
- * dapl_get_consumer_context
- *
- * DAPL Requirements Version xxx, 6.2.2.2
- *
- * Gets the consumer context from the specified dat_object
- *
- * Input:
- * dat_handle
- *
- * Output:
- * context
- *
- * Returns:
- * DAT_SUCCESS
- * DAT_INVALID_PARAMETER
- */
-u32 dapl_get_consumer_context(DAT_HANDLE dat_handle, union dat_context *context)
-{
- u32 dat_status = DAT_SUCCESS;
- struct dapl_header *header;
-
- header = (struct dapl_header *)dat_handle;
- if (((header) == NULL) ||
- ((unsigned long)(header) & 3) ||
- (header->magic != DAPL_MAGIC_IA &&
- header->magic != DAPL_MAGIC_EVD &&
- header->magic != DAPL_MAGIC_EP &&
- header->magic != DAPL_MAGIC_LMR &&
- header->magic != DAPL_MAGIC_RMR &&
- header->magic != DAPL_MAGIC_PZ &&
- header->magic != DAPL_MAGIC_PSP &&
- header->magic != DAPL_MAGIC_RSP &&
- header->magic != DAPL_MAGIC_CR)) {
- dat_status = DAT_ERROR(DAT_INVALID_HANDLE, 0);
- goto bail;
- }
- if (context == NULL || ((unsigned long)(header) & 3)) {
- dat_status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG2);
- goto bail;
- }
-
- *context = header->user_context;
-
- bail:
- return dat_status;
-}
Index: linux-kernel/dat-provider/dapl_rmr.c
===================================================================
--- linux-kernel/dat-provider/dapl_rmr.c (revision 2564)
+++ linux-kernel/dat-provider/dapl_rmr.c (working copy)
@@ -61,24 +61,19 @@ static struct dapl_rmr *dapl_rmr_alloc(s
/* zero the structure */
memset(rmr, 0, sizeof *rmr);
- /*
- * initialize the header
- */
- rmr->header.provider = pz->header.provider;
- rmr->header.magic = DAPL_MAGIC_RMR;
- rmr->header.handle_type = DAT_HANDLE_TYPE_RMR;
- rmr->header.owner_ia = pz->header.owner_ia;
- rmr->header.user_context.as_64 = 0;
- rmr->header.user_context.as_ptr = NULL;
- dapl_llist_init_entry(&rmr->header.ia_list_entry);
- dapl_ia_link_rmr(rmr->header.owner_ia, rmr);
- spin_lock_init(&rmr->header.lock);
+ rmr->rmr.provider = pz->pz.provider;
+ rmr->common.owner_ia = pz->common.owner_ia;
+ rmr->common.user_context.as_64 = 0;
+ rmr->common.user_context.as_ptr = NULL;
+ dapl_llist_init_entry(&rmr->common.ia_list_entry);
+ dapl_ia_link_rmr(rmr->common.owner_ia, rmr);
+ spin_lock_init(&rmr->common.lock);
/*
* initialize the body
*/
- rmr->param.ia_handle = (DAT_IA_HANDLE)pz->header.owner_ia;
- rmr->param.pz_handle = (DAT_PZ_HANDLE)pz;
+ rmr->param.ia = (struct dat_ia *)pz->common.owner_ia;
+ rmr->param.pz = (struct dat_pz *)pz;
rmr->param.lmr_triplet.lmr_context = 0;
rmr->param.lmr_triplet.pad = 0;
rmr->param.lmr_triplet.virtual_address = 0;
@@ -93,11 +88,8 @@ static struct dapl_rmr *dapl_rmr_alloc(s
static void dapl_rmr_dealloc(struct dapl_rmr *rmr)
{
- /* reset magic to prevent reuse */
- rmr->header.magic = DAPL_MAGIC_INVALID;
-
- dapl_ia_unlink_rmr(rmr->header.owner_ia, rmr);
- /* no need to destroy rmr->header.lock */
+ dapl_ia_unlink_rmr(rmr->common.owner_ia, rmr);
+ /* no need to destroy rmr->common.lock */
kfree(rmr);
}
@@ -115,7 +107,7 @@ static inline u32 dapl_rmr_bind_fuse(str
u32 status;
boolean_t is_signaled;
- status = dapl_hash_search(rmr->header.owner_ia->hca_ptr->lmr_hash_table,
+ status = dapl_hash_search(rmr->common.owner_ia->hca_ptr->lmr_hash_table,
lmr_triplet->lmr_context,
(DAPL_HASH_DATA *) &lmr);
if (DAT_SUCCESS != status) {
@@ -150,8 +142,8 @@ static inline u32 dapl_rmr_bind_fuse(str
}
/* If the LMR, RMR, and EP are not in the same PZ, there is an error */
- if ((ep_ptr->param.pz_handle != lmr->param.pz_handle) ||
- (ep_ptr->param.pz_handle != rmr->param.pz_handle)) {
+ if ((ep_ptr->param.pz != lmr->param.pz) ||
+ (ep_ptr->param.pz != rmr->param.pz)) {
status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG4);
goto bail;
}
@@ -240,7 +232,7 @@ static inline u32 dapl_rmr_bind_unfuse(s
}
/* If the RMR and EP are not in the same PZ, there is an error */
- if (ep_ptr->param.pz_handle != rmr->param.pz_handle) {
+ if (ep_ptr->param.pz != rmr->param.pz) {
status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG2);
goto bail1;
}
@@ -306,9 +298,9 @@ bail1:
* Input:
* Output:
*/
-u32 dapl_rmr_bind(DAT_RMR_HANDLE rmr_handle,
+u32 dapl_rmr_bind(struct dat_rmr *rmr_handle,
const struct dat_lmr_triplet *lmr_triplet,
- enum dat_mem_priv_flags mem_priv, DAT_EP_HANDLE ep_handle,
+ enum dat_mem_priv_flags mem_priv, struct dat_ep *ep,
DAT_RMR_COOKIE user_cookie,
enum dat_completion_flags completion_flags,
DAT_RMR_CONTEXT *rmr_context)
@@ -316,14 +308,14 @@ u32 dapl_rmr_bind(DAT_RMR_HANDLE rmr_han
struct dapl_rmr *rmr;
struct dapl_ep *ep_ptr;
- if (DAPL_BAD_HANDLE(rmr_handle, DAPL_MAGIC_RMR))
+ if (!rmr_handle)
return DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_RMR);
- if (DAPL_BAD_HANDLE(ep_handle, DAPL_MAGIC_EP))
+ if (!ep)
return DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EP);
rmr = (struct dapl_rmr *)rmr_handle;
- ep_ptr = (struct dapl_ep *)ep_handle;
+ ep_ptr = (struct dapl_ep *)ep;
/* if the rmr should be bound */
if (0 != lmr_triplet->segment_length)
@@ -341,7 +333,7 @@ u32 dapl_rmr_bind(DAT_RMR_HANDLE rmr_han
* Create a remote memory region for the specified protection zone
*
* Input:
- * pz_handle
+ * pz
*
* Output:
* rmr_handle
@@ -351,20 +343,20 @@ u32 dapl_rmr_bind(DAT_RMR_HANDLE rmr_han
* DAT_INSUFFICIENT_RESOURCES
* DAT_INVALID_PARAMETER
*/
-u32 dapl_rmr_create(DAT_PZ_HANDLE pz_handle, DAT_RMR_HANDLE *rmr_handle)
+u32 dapl_rmr_create(struct dat_pz *pz, struct dat_rmr **rmr)
{
- struct dapl_pz *pz;
- struct dapl_rmr *rmr;
+ struct dapl_pz *dapl_pz;
+ struct dapl_rmr *dapl_rmr;
u32 status = DAT_SUCCESS;
- if (DAPL_BAD_HANDLE(pz_handle, DAPL_MAGIC_PZ)) {
+ if (!pz) {
status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_PZ);
goto bail;
}
- pz = (struct dapl_pz *)pz_handle;
+ dapl_pz = (struct dapl_pz *)pz;
- rmr = dapl_rmr_alloc(pz);
+ dapl_rmr = dapl_rmr_alloc(dapl_pz);
if (rmr == NULL) {
status = DAT_ERROR(DAT_INSUFFICIENT_RESOURCES,
@@ -372,18 +364,18 @@ u32 dapl_rmr_create(DAT_PZ_HANDLE pz_han
goto bail;
}
- status = dapl_ib_mw_alloc(rmr);
+ status = dapl_ib_mw_alloc(dapl_rmr);
if (status != DAT_SUCCESS) {
- dapl_rmr_dealloc(rmr);
+ dapl_rmr_dealloc(dapl_rmr);
status = DAT_ERROR(DAT_INSUFFICIENT_RESOURCES,
DAT_RESOURCE_MEMORY_REGION);
goto bail;
}
- atomic_inc(&pz->pz_ref_count);
+ atomic_inc(&dapl_pz->pz_ref_count);
- *rmr_handle = rmr;
+ *rmr = (struct dat_rmr *)dapl_rmr;
bail:
return status;
@@ -404,12 +396,12 @@ bail:
* DAT_SUCCESS
* DAT_INVALID_PARAMETER
*/
-u32 dapl_rmr_free(DAT_RMR_HANDLE rmr_handle)
+u32 dapl_rmr_free(struct dat_rmr *rmr_handle)
{
struct dapl_rmr *rmr;
u32 status = DAT_SUCCESS;
- if (DAPL_BAD_HANDLE(rmr_handle, DAPL_MAGIC_RMR)) {
+ if (!rmr_handle) {
status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_RMR);
goto bail;
}
@@ -438,12 +430,12 @@ bail:
return status;
}
-u32 dapl_rmr_query(DAT_RMR_HANDLE rmr_handle, struct dat_rmr_param *rmr_param)
+u32 dapl_rmr_query(struct dat_rmr *rmr_handle, struct dat_rmr_param *rmr_param)
{
struct dapl_rmr *rmr;
u32 status = DAT_SUCCESS;
- if (DAPL_BAD_HANDLE(rmr_handle, DAPL_MAGIC_RMR)) {
+ if (!rmr_handle) {
status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_RMR);
goto bail;
}
Index: linux-kernel/dat-provider/dapl_cr_util.c
===================================================================
--- linux-kernel/dat-provider/dapl_cr_util.c (revision 2564)
+++ linux-kernel/dat-provider/dapl_cr_util.c (working copy)
@@ -49,17 +49,12 @@ struct dapl_cr *dapl_cr_alloc(struct dap
/* zero the structure */
memset(cr_ptr, 0, sizeof *cr_ptr);
- /*
- * initialize the header
- */
- cr_ptr->header.provider = ia_ptr->header.provider;
- cr_ptr->header.magic = DAPL_MAGIC_CR;
- cr_ptr->header.handle_type = DAT_HANDLE_TYPE_CR;
- cr_ptr->header.owner_ia = ia_ptr;
- cr_ptr->header.user_context.as_64 = 0;
- cr_ptr->header.user_context.as_ptr = NULL;
- dapl_llist_init_entry(&cr_ptr->header.ia_list_entry);
- spin_lock_init(&cr_ptr->header.lock);
+ cr_ptr->cr.provider = ia_ptr->ia.provider;
+ cr_ptr->common.owner_ia = ia_ptr;
+ cr_ptr->common.user_context.as_64 = 0;
+ cr_ptr->common.user_context.as_ptr = NULL;
+ dapl_llist_init_entry(&cr_ptr->common.ia_list_entry);
+ spin_lock_init(&cr_ptr->common.lock);
return cr_ptr;
}
@@ -69,9 +64,5 @@ struct dapl_cr *dapl_cr_alloc(struct dap
*/
void dapl_cr_free(struct dapl_cr *cr_ptr)
{
- dapl_os_assert(cr_ptr->header.magic == DAPL_MAGIC_CR ||
- cr_ptr->header.magic == DAPL_MAGIC_CR_DESTROYED);
- /* reset magic to prevent reuse */
- cr_ptr->header.magic = DAPL_MAGIC_INVALID;
kfree(cr_ptr);
}
Index: linux-kernel/dat-provider/dapl_psp.c
===================================================================
--- linux-kernel/dat-provider/dapl_psp.c (revision 2564)
+++ linux-kernel/dat-provider/dapl_psp.c (working copy)
@@ -45,13 +45,13 @@
* the user.
*
* Input:
- * ia_handle
- * evd_handle
+ * ia
+ * evd
* psp_flags
*
* Output:
* conn_qual
- * psp_handle
+ * psp
*
* Returns:
* DAT_SUCCESS
@@ -61,9 +61,9 @@
* DAT_CONN_QUAL_IN_USE
* DAT_MODEL_NOT_SUPPORTED
*/
-u32 dapl_psp_create_any(DAT_IA_HANDLE ia_handle, DAT_CONN_QUAL *conn_qual,
- DAT_EVD_HANDLE evd_handle, enum dat_psp_flags psp_flags,
- DAT_PSP_HANDLE *psp_handle)
+u32 dapl_psp_create_any(struct dat_ia *ia, DAT_CONN_QUAL *conn_qual,
+ struct dat_evd *evd, enum dat_psp_flags psp_flags,
+ struct dat_sp **psp)
{
static DAT_CONN_QUAL hint_conn_qual = 1000; /* seed value */
struct dapl_ia *ia_ptr;
@@ -72,19 +72,19 @@ u32 dapl_psp_create_any(DAT_IA_HANDLE ia
u32 status = DAT_SUCCESS;
int i;
- ia_ptr = (struct dapl_ia *)ia_handle;
+ ia_ptr = (struct dapl_ia *)ia;
- if (DAPL_BAD_HANDLE(ia_ptr, DAPL_MAGIC_IA)) {
+ if (!ia_ptr) {
status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_IA);
goto bail;
}
- if (DAPL_BAD_HANDLE(evd_handle, DAPL_MAGIC_EVD)) {
+ if (!evd) {
status =
DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EVD_CR);
goto bail;
}
- if (psp_handle == NULL) {
+ if (psp == NULL) {
status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG5);
goto bail;
}
@@ -93,7 +93,7 @@ u32 dapl_psp_create_any(DAT_IA_HANDLE ia
goto bail;
}
- evd_ptr = (struct dapl_evd *)evd_handle;
+ evd_ptr = (struct dapl_evd *)evd;
if (!(evd_ptr->evd_flags & DAT_EVD_CR_FLAG)) {
status = DAT_ERROR(DAT_INVALID_HANDLE,
DAT_INVALID_HANDLE_EVD_CR);
@@ -117,10 +117,10 @@ u32 dapl_psp_create_any(DAT_IA_HANDLE ia
/*
* Fill out the args for a PSP
*/
- sp_ptr->ia_handle = ia_handle;
- sp_ptr->evd_handle = evd_handle;
+ sp_ptr->ia = ia;
+ sp_ptr->evd = evd;
sp_ptr->psp_flags = psp_flags;
- sp_ptr->ep_handle = NULL;
+ sp_ptr->ep = NULL;
/*
* Take a reference on the EVD handle
@@ -153,7 +153,7 @@ u32 dapl_psp_create_any(DAT_IA_HANDLE ia
if (status != DAT_SUCCESS) {
atomic_dec(&evd_ptr->evd_ref_count);
- sp_ptr->evd_handle = NULL;
+ sp_ptr->evd = NULL;
dapl_ia_unlink_sp(ia_ptr, sp_ptr);
dapl_sp_dealloc(sp_ptr);
@@ -168,7 +168,7 @@ u32 dapl_psp_create_any(DAT_IA_HANDLE ia
* Return handle to the user
*/
*conn_qual = sp_ptr->conn_qual;
- *psp_handle = (DAT_PSP_HANDLE) sp_ptr;
+ *psp = (struct dat_sp *) sp_ptr;
bail:
return status;
@@ -183,13 +183,13 @@ bail:
* in a notification event.
*
* Input:
- * ia_handle
+ * ia
* conn_qual
- * evd_handle
+ * evd
* psp_flags
*
* Output:
- * psp_handle
+ * psp
*
* Returns:
* DAT_SUCCESS
@@ -198,9 +198,9 @@ bail:
* DAT_CONN_QUAL_IN_USE
* DAT_MODEL_NOT_SUPPORTED
*/
-u32 dapl_psp_create(DAT_IA_HANDLE ia_handle, DAT_CONN_QUAL conn_qual,
- DAT_EVD_HANDLE evd_handle, enum dat_psp_flags psp_flags,
- DAT_PSP_HANDLE *psp_handle)
+u32 dapl_psp_create(struct dat_ia *ia, DAT_CONN_QUAL conn_qual,
+ struct dat_evd *evd, enum dat_psp_flags psp_flags,
+ struct dat_sp **psp)
{
struct dapl_ia *ia_ptr;
struct dapl_sp *sp_ptr;
@@ -208,24 +208,24 @@ u32 dapl_psp_create(DAT_IA_HANDLE ia_han
boolean_t sp_found;
u32 status = DAT_SUCCESS;
- ia_ptr = (struct dapl_ia *)ia_handle;
+ ia_ptr = (struct dapl_ia *)ia;
- if (DAPL_BAD_HANDLE(ia_ptr, DAPL_MAGIC_IA)) {
+ if (!ia_ptr) {
status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_IA);
goto bail;
}
- if (DAPL_BAD_HANDLE(evd_handle, DAPL_MAGIC_EVD)) {
+ if (!evd) {
status = DAT_ERROR(DAT_INVALID_HANDLE,
DAT_INVALID_HANDLE_EVD_CR);
goto bail;
}
- if (psp_handle == NULL) {
+ if (psp == NULL) {
status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG5);
goto bail;
}
- evd_ptr = (struct dapl_evd *)evd_handle;
+ evd_ptr = (struct dapl_evd *)evd;
if (!(evd_ptr->evd_flags & DAT_EVD_CR_FLAG)) {
status = DAT_ERROR(DAT_INVALID_HANDLE,
DAT_INVALID_HANDLE_EVD_CR);
@@ -261,11 +261,11 @@ u32 dapl_psp_create(DAT_IA_HANDLE ia_han
/*
* Fill out the args for a PSP
*/
- sp_ptr->ia_handle = ia_handle;
+ sp_ptr->ia = ia;
sp_ptr->conn_qual = conn_qual;
- sp_ptr->evd_handle = evd_handle;
+ sp_ptr->evd = evd;
sp_ptr->psp_flags = psp_flags;
- sp_ptr->ep_handle = NULL;
+ sp_ptr->ep = NULL;
/*
* Take a reference on the EVD handle
@@ -298,7 +298,7 @@ u32 dapl_psp_create(DAT_IA_HANDLE ia_han
* wrong! Decrements the EVD refcount & release it.
*/
atomic_dec(&evd_ptr->evd_ref_count);
- sp_ptr->evd_handle = NULL;
+ sp_ptr->evd = NULL;
dapl_ia_unlink_sp(ia_ptr, sp_ptr);
dapl_sp_dealloc(sp_ptr);
@@ -313,7 +313,7 @@ u32 dapl_psp_create(DAT_IA_HANDLE ia_han
/*
* Return handle to the user
*/
- *psp_handle = (DAT_PSP_HANDLE) sp_ptr;
+ *psp = (struct dat_sp *) sp_ptr;
bail:
return status;
@@ -325,7 +325,7 @@ bail:
* Destroy a specific instance of a Service Point.
*
* Input:
- * psp_handle
+ * psp
*
* Output:
* none
@@ -334,26 +334,25 @@ bail:
* DAT_SUCCESS
* DAT_INVALID_PARAMETER
*/
-u32 dapl_psp_free(DAT_PSP_HANDLE psp_handle)
+u32 dapl_psp_free(struct dat_sp *psp)
{
struct dapl_ia *ia_ptr;
struct dapl_sp *sp_ptr;
DAPL_SP_STATE save_state;
u32 status = DAT_SUCCESS;
- sp_ptr = (struct dapl_sp *)psp_handle;
+ sp_ptr = (struct dapl_sp *)psp;
/*
* Verify handle
*/
- dapl_dbg_log(DAPL_DBG_TYPE_CM, ">>> dapl_psp_free %p\n", psp_handle);
+ dapl_dbg_log(DAPL_DBG_TYPE_CM, ">>> dapl_psp_free %p\n", psp);
- if (DAPL_BAD_HANDLE(sp_ptr, DAPL_MAGIC_PSP)) {
+ if (!sp_ptr) {
status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_PSP);
goto bail;
}
- /* ia_ptr = (struct dapl_ia *)sp_ptr->header.owner_ia; */
- ia_ptr = sp_ptr->header.owner_ia;
+ ia_ptr = sp_ptr->common.owner_ia;
/*
* Remove the connection listener if it has been established
* and there are no current connections in progress.
@@ -361,18 +360,18 @@ u32 dapl_psp_free(DAT_PSP_HANDLE psp_han
* container until the last connection is disconnected, after
* which it will be cleaned up.
*/
- spin_lock_irqsave(&sp_ptr->header.lock, sp_ptr->header.flags);
+ spin_lock_irqsave(&sp_ptr->common.lock, sp_ptr->common.flags);
sp_ptr->listening = FALSE;
/*
* Release reference on EVD. If an error was encountered in a previous
- * free the evd_handle will be NULL
+ * free the evd will be NULL
*/
- if (sp_ptr->evd_handle) {
- atomic_dec(&((struct dapl_evd *)sp_ptr->evd_handle)->
+ if (sp_ptr->evd) {
+ atomic_dec(&((struct dapl_evd *)sp_ptr->evd)->
evd_ref_count);
- sp_ptr->evd_handle = NULL;
+ sp_ptr->evd = NULL;
}
/*
@@ -389,8 +388,8 @@ u32 dapl_psp_free(DAT_PSP_HANDLE psp_han
sp_ptr->cr_list_count == 0) {
save_state = sp_ptr->state;
sp_ptr->state = DAPL_SP_STATE_FREE;
- spin_unlock_irqrestore(&sp_ptr->header.lock,
- sp_ptr->header.flags);
+ spin_unlock_irqrestore(&sp_ptr->common.lock,
+ sp_ptr->common.flags);
status = dapl_ib_remove_conn_listener(ia_ptr, sp_ptr);
if (status != DAT_SUCCESS) {
@@ -407,7 +406,8 @@ u32 dapl_psp_free(DAT_PSP_HANDLE psp_han
* ServiceID again, which will reactivate it.
*/
sp_ptr->state = DAPL_SP_STATE_PSP_PENDING;
- spin_unlock_irqrestore(&sp_ptr->header.lock, sp_ptr->header.flags);
+ spin_unlock_irqrestore(&sp_ptr->common.lock,
+ sp_ptr->common.flags);
dapl_dbg_log(DAPL_DBG_TYPE_CM,
">>> dapl_psp_free: PSP PENDING\n");
}
@@ -416,13 +416,12 @@ bail:
return status;
}
-u32 dapl_psp_query(DAT_PSP_HANDLE psp_handle, struct dat_psp_param *psp_param)
+u32 dapl_psp_query(struct dat_sp *psp, struct dat_psp_param *psp_param)
{
struct dapl_sp *sp_ptr;
u32 status;
- if (DAPL_BAD_HANDLE(psp_handle, DAPL_MAGIC_PSP) ||
- ((struct dapl_sp *)psp_handle)->listening != TRUE) {
+ if (!psp || ((struct dapl_sp *)psp)->listening != TRUE) {
status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_PSP);
goto bail;
}
@@ -432,11 +431,11 @@ u32 dapl_psp_query(DAT_PSP_HANDLE psp_ha
goto bail;
}
- sp_ptr = (struct dapl_sp *)psp_handle;
+ sp_ptr = (struct dapl_sp *)psp;
- psp_param->ia_handle = sp_ptr->ia_handle;
+ psp_param->ia = sp_ptr->ia;
psp_param->conn_qual = sp_ptr->conn_qual;
- psp_param->evd_handle = sp_ptr->evd_handle;
+ psp_param->evd = sp_ptr->evd;
psp_param->psp_flags = sp_ptr->psp_flags;
status = DAT_SUCCESS;
Index: linux-kernel/dat-provider/dapl_ep.c
===================================================================
--- linux-kernel/dat-provider/dapl_ep.c (revision 2564)
+++ linux-kernel/dat-provider/dapl_ep.c (working copy)
@@ -43,11 +43,6 @@
static void dapl_ep_dealloc(struct dapl_ep *ep_ptr)
{
- dapl_os_assert(ep_ptr->header.magic == DAPL_MAGIC_EP);
-
- /* reset magic to prevent reuse */
- ep_ptr->header.magic = DAPL_MAGIC_INVALID;
-
dapl_cb_free(&ep_ptr->req_buffer);
dapl_cb_free(&ep_ptr->recv_buffer);
@@ -73,18 +68,12 @@ struct dapl_ep *dapl_ep_alloc(struct dap
/* zero the structure */
memset(ep_ptr, 0, sizeof *ep_ptr + sizeof (struct sockaddr));
- /*
- * initialize the header
- */
- ep_ptr->header.provider = ia_ptr->header.provider;
- ep_ptr->header.magic = DAPL_MAGIC_EP;
- ep_ptr->header.handle_type = DAT_HANDLE_TYPE_EP;
- ep_ptr->header.owner_ia = ia_ptr;
- ep_ptr->header.user_context.as_64 = 0;
- ep_ptr->header.user_context.as_ptr = NULL;
-
- dapl_llist_init_entry(&ep_ptr->header.ia_list_entry);
- spin_lock_init(&ep_ptr->header.lock);
+ ep_ptr->ep.provider = ia_ptr->ia.provider;
+ ep_ptr->common.owner_ia = ia_ptr;
+ ep_ptr->common.user_context.as_64 = 0;
+ ep_ptr->common.user_context.as_ptr = NULL;
+ dapl_llist_init_entry(&ep_ptr->common.ia_list_entry);
+ spin_lock_init(&ep_ptr->common.lock);
/*
* Initialize the body
@@ -105,7 +94,7 @@ struct dapl_ep *dapl_ep_alloc(struct dap
ep_ptr->qp = NULL;
ep_ptr->qp_state = DAPL_QP_STATE_UNATTACHED;
- ep_ptr->cm_handle = NULL;
+ ep_ptr->cm = NULL;
atomic_set(&ep_ptr->req_count, 0);
atomic_set(&ep_ptr->recv_count, 0);
@@ -165,7 +154,7 @@ static u32 dapl_ep_check_recv_completion
return DAT_SUCCESS;
}
-static u32 dapl_ep_post_send_req(DAT_EP_HANDLE ep_handle, int num_segments,
+static u32 dapl_ep_post_send_req(struct dat_ep *ep, int num_segments,
struct dat_lmr_triplet *local_iov,
DAT_DTO_COOKIE user_cookie,
const struct dat_rmr_triplet *remote_iov,
@@ -177,13 +166,13 @@ static u32 dapl_ep_post_send_req(DAT_EP_
struct dapl_cookie *cookie;
u32 dat_status;
- if (DAPL_BAD_HANDLE(ep_handle, DAPL_MAGIC_EP)) {
+ if (!ep) {
dat_status =
DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EP);
goto bail;
}
- ep_ptr = (struct dapl_ep *)ep_handle;
+ ep_ptr = (struct dapl_ep *)ep;
/*
* Synchronization ok since this buffer is only used for send
@@ -281,11 +270,11 @@ enum dat_return_subtype dapl_ep_state_su
return dat_status;
}
-u32 dapl_ep_create(DAT_IA_HANDLE ia_handle, DAT_PZ_HANDLE pz_handle,
- DAT_EVD_HANDLE recv_evd_handle,
- DAT_EVD_HANDLE request_evd_handle,
- DAT_EVD_HANDLE connect_evd_handle,
- const struct dat_ep_attr *ep_attr, DAT_EP_HANDLE *ep_handle)
+u32 dapl_ep_create(struct dat_ia *ia, struct dat_pz *pz,
+ struct dat_evd *recv_evd,
+ struct dat_evd *request_evd,
+ struct dat_evd *connect_evd,
+ const struct dat_ep_attr *ep_attr, struct dat_ep **ep)
{
struct dapl_ia *ia_ptr;
struct dapl_ep *ep_ptr;
@@ -294,18 +283,18 @@ u32 dapl_ep_create(DAT_IA_HANDLE ia_hand
dapl_dbg_log(DAPL_DBG_TYPE_API,
"dapl_ep_create (%p, %p, %p, %p, %p, %p, %p)\n",
- ia_handle,
- pz_handle,
- recv_evd_handle,
- request_evd_handle,
- connect_evd_handle, ep_attr, ep_handle);
+ ia,
+ pz,
+ recv_evd,
+ request_evd,
+ connect_evd, ep_attr, ep);
- ia_ptr = (struct dapl_ia *)ia_handle;
+ ia_ptr = (struct dapl_ia *)ia;
/*
* Verify parameters
*/
- if (DAPL_BAD_HANDLE(ia_ptr, DAPL_MAGIC_IA)) {
+ if (!ia_ptr) {
dat_status =
DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_IA);
goto bail;
@@ -317,44 +306,34 @@ u32 dapl_ep_create(DAT_IA_HANDLE ia_hand
* modified by dat_ep_modify() is not strictly
* required when the EP is created
*/
- if (pz_handle != DAT_HANDLE_NULL &&
- DAPL_BAD_HANDLE(pz_handle, DAPL_MAGIC_PZ)) {
- dat_status =
- DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_PZ);
- goto bail;
- }
/* If connect handle is !NULL verify handle is good */
- if (connect_evd_handle != DAT_HANDLE_NULL &&
- (DAPL_BAD_HANDLE(connect_evd_handle, DAPL_MAGIC_EVD) ||
- !(((struct dapl_evd *)connect_evd_handle)->
- evd_flags & DAT_EVD_CONNECTION_FLAG))) {
+ if (connect_evd != NULL &&
+ !(((struct dapl_evd *)connect_evd)->
+ evd_flags & DAT_EVD_CONNECTION_FLAG)) {
dat_status =
DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EVD_CONN);
goto bail;
}
/* If recv_evd is !NULL, verify handle is good and flags are valid */
- if (recv_evd_handle != DAT_HANDLE_NULL &&
- (DAPL_BAD_HANDLE(recv_evd_handle, DAPL_MAGIC_EVD) ||
- !(((struct dapl_evd *)recv_evd_handle)->evd_flags & DAT_EVD_DTO_FLAG))) {
+ if (recv_evd != NULL &&
+ !(((struct dapl_evd *)recv_evd)->evd_flags & DAT_EVD_DTO_FLAG)) {
dat_status =
DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EVD_RECV);
goto bail;
}
/* If req_evd is !NULL, verify handle is good and flags are valid */
- if (request_evd_handle != DAT_HANDLE_NULL &&
- (DAPL_BAD_HANDLE(request_evd_handle, DAPL_MAGIC_EVD) ||
- !(((struct dapl_evd *)request_evd_handle)->
- evd_flags & DAT_EVD_DTO_FLAG))) {
+ if (request_evd != NULL &&
+ !(((struct dapl_evd *)request_evd)->evd_flags & DAT_EVD_DTO_FLAG)) {
dat_status =
DAT_ERROR(DAT_INVALID_HANDLE,
DAT_INVALID_HANDLE_EVD_REQUEST);
goto bail;
}
- if (ep_handle == NULL) {
+ if (ep == NULL) {
dat_status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG7);
goto bail;
}
@@ -370,12 +349,12 @@ u32 dapl_ep_create(DAT_IA_HANDLE ia_hand
* the respective queue.
*/
if (ep_attr != NULL &&
- ((recv_evd_handle == DAT_HANDLE_NULL && ep_attr->max_recv_dtos != 0)
- || (recv_evd_handle != DAT_HANDLE_NULL
+ ((recv_evd == NULL && ep_attr->max_recv_dtos != 0)
+ || (recv_evd != NULL
&& ep_attr->max_recv_dtos == 0)
- || (request_evd_handle == DAT_HANDLE_NULL
+ || (request_evd == NULL
&& ep_attr->max_request_dtos != 0)
- || (request_evd_handle != DAT_HANDLE_NULL
+ || (request_evd != NULL
&& ep_attr->max_request_dtos == 0)
|| ep_attr->max_recv_iov == 0 || ep_attr->max_request_iov == 0
|| (DAT_SUCCESS !=
@@ -413,25 +392,25 @@ u32 dapl_ep_create(DAT_IA_HANDLE ia_hand
/*
* Fill in the EP
*/
- ep_ptr->param.ia_handle = ia_handle;
+ ep_ptr->param.ia = ia;
ep_ptr->param.ep_state = DAT_EP_STATE_UNCONNECTED;
ep_ptr->param.local_ia_address_ptr =
(struct sockaddr *)&ia_ptr->hca_ptr->hca_address;
/* Set the remote address pointer to the end of the EP struct */
ep_ptr->param.remote_ia_address_ptr = (struct sockaddr *) (ep_ptr + 1);
- ep_ptr->param.pz_handle = pz_handle;
- ep_ptr->param.recv_evd_handle = recv_evd_handle;
- ep_ptr->param.request_evd_handle = request_evd_handle;
- ep_ptr->param.connect_evd_handle = connect_evd_handle;
+ ep_ptr->param.pz = pz;
+ ep_ptr->param.recv_evd = recv_evd;
+ ep_ptr->param.request_evd = request_evd;
+ ep_ptr->param.connect_evd = connect_evd;
/*
* Make sure we handle the NULL DTO EVDs
*/
- if (recv_evd_handle == DAT_HANDLE_NULL && ep_attr == NULL)
+ if (recv_evd == NULL && ep_attr == NULL)
ep_ptr->param.ep_attr.max_recv_dtos = 0;
- if (request_evd_handle == DAT_HANDLE_NULL && ep_attr == NULL)
+ if (request_evd == NULL && ep_attr == NULL)
ep_ptr->param.ep_attr.max_request_dtos = 0;
/*
@@ -440,9 +419,9 @@ u32 dapl_ep_create(DAT_IA_HANDLE ia_hand
* As much as possible we try to keep QP creation out of the
* connect path to avoid resource errors in strange places.
*/
- if (pz_handle != DAT_HANDLE_NULL) {
+ if (pz != NULL) {
/* Take a reference on the PZ handle */
- atomic_inc(&((struct dapl_pz *)pz_handle)->pz_ref_count);
+ atomic_inc(&((struct dapl_pz *)pz)->pz_ref_count);
/*
* Get a QP from the IB provider
@@ -450,7 +429,7 @@ u32 dapl_ep_create(DAT_IA_HANDLE ia_hand
dat_status = dapl_ib_qp_alloc(ia_ptr, ep_ptr, ep_ptr);
if (dat_status != DAT_SUCCESS) {
- atomic_dec(&((struct dapl_pz *)pz_handle)->pz_ref_count);
+ atomic_dec(&((struct dapl_pz *)pz)->pz_ref_count);
dapl_ep_dealloc(ep_ptr);
goto bail;
}
@@ -460,36 +439,36 @@ u32 dapl_ep_create(DAT_IA_HANDLE ia_hand
/*
* Update ref counts. See the spec where the endpoint marks
* a data object as 'in use'
- * pz_handle: dat_pz_free
- * evd_handles:
+ * pz: dat_pz_free
+ * evds:
*
* N.B. This should really be done by a util routine.
*/
- atomic_inc(&((struct dapl_evd *)connect_evd_handle)->evd_ref_count);
+ atomic_inc(&((struct dapl_evd *)connect_evd)->evd_ref_count);
/* Optional handles */
- if (recv_evd_handle != DAT_HANDLE_NULL)
- atomic_inc(&((struct dapl_evd *)recv_evd_handle)->
+ if (recv_evd != NULL)
+ atomic_inc(&((struct dapl_evd *)recv_evd)->
evd_ref_count);
- if (request_evd_handle != DAT_HANDLE_NULL)
- atomic_inc(&((struct dapl_evd *)request_evd_handle)->
+ if (request_evd != NULL)
+ atomic_inc(&((struct dapl_evd *)request_evd)->
evd_ref_count);
/* Link it onto the IA */
dapl_ia_link_ep(ia_ptr, ep_ptr);
- *ep_handle = ep_ptr;
+ *ep = (struct dat_ep *)ep_ptr;
bail:
return dat_status;
}
-u32 dapl_ep_create_with_srq(DAT_IA_HANDLE ia_handle, DAT_PZ_HANDLE pz_handle,
- DAT_EVD_HANDLE recv_evd_handle,
- DAT_EVD_HANDLE request_evd_handle,
- DAT_EVD_HANDLE connect_evd_handle,
- DAT_SRQ_HANDLE srq_handle,
+u32 dapl_ep_create_with_srq(struct dat_ia *ia, struct dat_pz *pz,
+ struct dat_evd *recv_evd,
+ struct dat_evd *request_evd,
+ struct dat_evd *connect_evd,
+ struct dat_srq *srq,
const struct dat_ep_attr *ep_attr,
- DAT_EP_HANDLE *ep_handle)
+ struct dat_ep **ep)
{
struct dapl_ia *ia_ptr;
struct dapl_ep *ep_ptr;
@@ -498,18 +477,18 @@ u32 dapl_ep_create_with_srq(DAT_IA_HANDL
dapl_dbg_log(DAPL_DBG_TYPE_API,
"dapl_ep_create_with_srq (%p, %p, %p, %p, %p, %p, %p %p)\n",
- ia_handle,
- pz_handle,
- recv_evd_handle,
- request_evd_handle,
- connect_evd_handle, srq_handle, ep_attr, ep_handle);
+ ia,
+ pz,
+ recv_evd,
+ request_evd,
+ connect_evd, srq, ep_attr, ep);
- ia_ptr = (struct dapl_ia *)ia_handle;
+ ia_ptr = (struct dapl_ia *)ia;
/*
* Verify parameters
*/
- if (DAPL_BAD_HANDLE(ia_ptr, DAPL_MAGIC_IA)) {
+ if (!ia_ptr) {
dat_status =
DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_IA);
goto bail;
@@ -521,35 +500,27 @@ u32 dapl_ep_create_with_srq(DAT_IA_HANDL
* modified by dat_ep_modify() is not strictly
* required when the EP is created
*/
- if (pz_handle != NULL && DAPL_BAD_HANDLE(pz_handle, DAPL_MAGIC_PZ)) {
- dat_status =
- DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_PZ);
- goto bail;
- }
/* If connect handle is !NULL verify handle is good */
- if (connect_evd_handle != DAT_HANDLE_NULL &&
- (DAPL_BAD_HANDLE(connect_evd_handle, DAPL_MAGIC_EVD) ||
- !(((struct dapl_evd *)connect_evd_handle)->
- evd_flags & DAT_EVD_CONNECTION_FLAG))) {
+ if (connect_evd != NULL &&
+ !(((struct dapl_evd *)connect_evd)->
+ evd_flags & DAT_EVD_CONNECTION_FLAG)) {
dat_status =
DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EVD_CONN);
goto bail;
}
/* If recv_evd is !NULL, verify handle is good and flags are valid */
- if (recv_evd_handle != DAT_HANDLE_NULL &&
- (DAPL_BAD_HANDLE(recv_evd_handle, DAPL_MAGIC_EVD) ||
- !(((struct dapl_evd *)recv_evd_handle)->evd_flags & DAT_EVD_DTO_FLAG))) {
+ if (recv_evd != NULL &&
+ !(((struct dapl_evd *)recv_evd)->evd_flags & DAT_EVD_DTO_FLAG)) {
dat_status =
DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EVD_RECV);
goto bail;
}
/* If req_evd is !NULL, verify handle is good and flags are valid */
- if (request_evd_handle != DAT_HANDLE_NULL &&
- (DAPL_BAD_HANDLE(request_evd_handle, DAPL_MAGIC_EVD) ||
- !(((struct dapl_evd *)request_evd_handle)->
- evd_flags & DAT_EVD_DTO_FLAG))) {
+ if (request_evd != NULL &&
+ !(((struct dapl_evd *)request_evd)->
+ evd_flags & DAT_EVD_DTO_FLAG)) {
dat_status =
DAT_ERROR(DAT_INVALID_HANDLE,
DAT_INVALID_HANDLE_EVD_REQUEST);
@@ -560,13 +531,13 @@ u32 dapl_ep_create_with_srq(DAT_IA_HANDL
* Verify the SRQ handle. It is an error to invoke this call with
* a NULL handle
*/
- if (DAPL_BAD_HANDLE(srq_handle, DAPL_MAGIC_SRQ)) {
+ if (!srq) {
dat_status =
DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_SRQ);
goto bail;
}
- if (ep_handle == NULL) {
+ if (ep == NULL) {
dat_status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG7);
goto bail;
}
@@ -582,12 +553,12 @@ u32 dapl_ep_create_with_srq(DAT_IA_HANDL
* the respective queue.
*/
if (ep_attr != NULL &&
- ((recv_evd_handle == DAT_HANDLE_NULL && ep_attr->max_recv_dtos != 0)
- || (recv_evd_handle != DAT_HANDLE_NULL
+ ((recv_evd == NULL && ep_attr->max_recv_dtos != 0)
+ || (recv_evd != NULL
&& ep_attr->max_recv_dtos == 0)
- || (request_evd_handle == DAT_HANDLE_NULL
+ || (request_evd == NULL
&& ep_attr->max_request_dtos != 0)
- || (request_evd_handle != DAT_HANDLE_NULL
+ || (request_evd != NULL
&& ep_attr->max_request_dtos == 0)
|| ep_attr->max_recv_iov == 0 || ep_attr->max_request_iov == 0
|| (DAT_SUCCESS !=
@@ -636,26 +607,26 @@ u32 dapl_ep_create_with_srq(DAT_IA_HANDL
/*
* Fill in the EP
*/
- ep_ptr->param.ia_handle = ia_handle;
+ ep_ptr->param.ia = ia;
ep_ptr->param.ep_state = DAT_EP_STATE_UNCONNECTED;
ep_ptr->param.local_ia_address_ptr =
(struct sockaddr *)&ia_ptr->hca_ptr->hca_address;
/* Set the remote address pointer to the end of the EP struct */
ep_ptr->param.remote_ia_address_ptr = (struct sockaddr *) (ep_ptr + 1);
- ep_ptr->param.pz_handle = pz_handle;
- ep_ptr->param.recv_evd_handle = recv_evd_handle;
- ep_ptr->param.request_evd_handle = request_evd_handle;
- ep_ptr->param.connect_evd_handle = connect_evd_handle;
+ ep_ptr->param.pz = pz;
+ ep_ptr->param.recv_evd = recv_evd;
+ ep_ptr->param.request_evd = request_evd;
+ ep_ptr->param.connect_evd = connect_evd;
/*
* Make sure we handle the NULL DTO EVDs
*/
- if (recv_evd_handle == DAT_HANDLE_NULL && ep_attr == NULL) {
+ if (recv_evd == NULL && ep_attr == NULL) {
ep_ptr->param.ep_attr.max_recv_dtos = 0;
}
- if (request_evd_handle == DAT_HANDLE_NULL && ep_attr == NULL) {
+ if (request_evd == NULL && ep_attr == NULL) {
ep_ptr->param.ep_attr.max_request_dtos = 0;
}
@@ -665,9 +636,9 @@ u32 dapl_ep_create_with_srq(DAT_IA_HANDL
* As much as possible we try to keep QP creation out of the
* connect path to avoid resource errors in strange places.
*/
- if (pz_handle != DAT_HANDLE_NULL) {
+ if (pz != NULL) {
/* Take a reference on the PZ handle */
- atomic_inc(&((struct dapl_pz *)pz_handle)->pz_ref_count);
+ atomic_inc(&((struct dapl_pz *)pz)->pz_ref_count);
/*
* Get a QP from the IB provider
@@ -675,7 +646,7 @@ u32 dapl_ep_create_with_srq(DAT_IA_HANDL
dat_status = dapl_ib_qp_alloc(ia_ptr, ep_ptr, ep_ptr);
if (dat_status != DAT_SUCCESS) {
- atomic_dec(&((struct dapl_pz *)pz_handle)->pz_ref_count);
+ atomic_dec(&((struct dapl_pz *)pz)->pz_ref_count);
dapl_ep_dealloc(ep_ptr);
goto bail;
}
@@ -685,24 +656,24 @@ u32 dapl_ep_create_with_srq(DAT_IA_HANDL
/*
* Update ref counts. See the spec where the endpoint marks
* a data object as 'in use'
- * pz_handle: dat_pz_free,
- * evd_handles:
+ * pz: dat_pz_free,
+ * evds:
*
* N.B. This should really be done by a util routine.
*/
- atomic_inc(&((struct dapl_evd *)connect_evd_handle)->evd_ref_count);
+ atomic_inc(&((struct dapl_evd *)connect_evd)->evd_ref_count);
/* Optional handles */
- if (recv_evd_handle != DAT_HANDLE_NULL)
- atomic_inc(&((struct dapl_evd *)recv_evd_handle)->
+ if (recv_evd != NULL)
+ atomic_inc(&((struct dapl_evd *)recv_evd)->
evd_ref_count);
- if (request_evd_handle != DAT_HANDLE_NULL)
- atomic_inc(&((struct dapl_evd *)request_evd_handle)->
+ if (request_evd != NULL)
+ atomic_inc(&((struct dapl_evd *)request_evd)->
evd_ref_count);
/* Link it onto the IA */
dapl_ia_link_ep(ia_ptr, ep_ptr);
- *ep_handle = ep_ptr;
+ *ep = ep_ptr;
#endif /* notdef */
@@ -710,7 +681,7 @@ bail:
return dat_status;
}
-u32 dapl_ep_free(DAT_EP_HANDLE ep_handle)
+u32 dapl_ep_free(struct dat_ep *ep)
{
struct dapl_ep *ep_ptr;
struct dapl_ia *ia_ptr;
@@ -718,15 +689,15 @@ u32 dapl_ep_free(DAT_EP_HANDLE ep_handle
enum ib_qp_state save_qp_state;
u32 dat_status = DAT_SUCCESS;
- dapl_dbg_log(DAPL_DBG_TYPE_API, "dapl_ep_free (%p)\n", ep_handle);
+ dapl_dbg_log(DAPL_DBG_TYPE_API, "dapl_ep_free (%p)\n", ep);
- ep_ptr = (struct dapl_ep *)ep_handle;
+ ep_ptr = (struct dapl_ep *)ep;
param = &ep_ptr->param;
/*
* Verify parameter & state
*/
- if (DAPL_BAD_HANDLE(ep_ptr, DAPL_MAGIC_EP)) {
+ if (!ep_ptr) {
dat_status =
DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EP);
goto bail;
@@ -744,7 +715,7 @@ u32 dapl_ep_free(DAT_EP_HANDLE ep_handle
goto bail;
}
- ia_ptr = ep_ptr->header.owner_ia;
+ ia_ptr = ep_ptr->common.owner_ia;
/* If we are connected, issue a disconnect. If we are in the
* disconnect_pending state, disconnect with the ABRUPT flag
@@ -754,14 +725,15 @@ u32 dapl_ep_free(DAT_EP_HANDLE ep_handle
/*
* Invoke ep_disconnect to clean up outstanding connections
*/
- (void)dapl_ep_disconnect(ep_ptr, DAT_CLOSE_ABRUPT_FLAG);
+ (void)dapl_ep_disconnect((struct dat_ep *)ep_ptr,
+ DAT_CLOSE_ABRUPT_FLAG);
dapl_os_assert(ep_ptr->param.ep_state == DAT_EP_STATE_DISCONNECTED ||
ep_ptr->param.ep_state == DAT_EP_STATE_UNCONNECTED);
/*
* Do verification of parameters and the state change atomically.
*/
- spin_lock_irqsave(&ep_ptr->header.lock, ep_ptr->header.flags);
+ spin_lock_irqsave(&ep_ptr->common.lock, ep_ptr->common.flags);
/* Remove the EP from the IA */
dapl_ia_unlink_ep(ia_ptr, ep_ptr);
@@ -771,24 +743,24 @@ u32 dapl_ep_free(DAT_EP_HANDLE ep_handle
* to set handles to NULL. Set handles to NULL so this routine
* is idempotent.
*/
- if (param->pz_handle != NULL) {
- atomic_dec(&((struct dapl_pz *)param->pz_handle)->pz_ref_count);
- param->pz_handle = NULL;
+ if (param->pz != NULL) {
+ atomic_dec(&((struct dapl_pz *)param->pz)->pz_ref_count);
+ param->pz = NULL;
}
- if (param->recv_evd_handle != NULL) {
- atomic_dec(&((struct dapl_evd *)param->recv_evd_handle)->
+ if (param->recv_evd != NULL) {
+ atomic_dec(&((struct dapl_evd *)param->recv_evd)->
evd_ref_count);
- param->recv_evd_handle = NULL;
+ param->recv_evd = NULL;
}
- if (param->request_evd_handle != NULL) {
- atomic_dec(&((struct dapl_evd *)param->request_evd_handle)->
+ if (param->request_evd != NULL) {
+ atomic_dec(&((struct dapl_evd *)param->request_evd)->
evd_ref_count);
- param->request_evd_handle = NULL;
+ param->request_evd = NULL;
}
- if (param->connect_evd_handle != NULL) {
- atomic_dec(&((struct dapl_evd *)param->connect_evd_handle)->
+ if (param->connect_evd != NULL) {
+ atomic_dec(&((struct dapl_evd *)param->connect_evd)->
evd_ref_count);
- param->connect_evd_handle = NULL;
+ param->connect_evd = NULL;
}
/*
@@ -804,7 +776,7 @@ u32 dapl_ep_free(DAT_EP_HANDLE ep_handle
*/
save_qp_state = ep_ptr->qp_state;
ep_ptr->qp_state = DAPL_QP_STATE_UNATTACHED;
- spin_unlock_irqrestore(&ep_ptr->header.lock, ep_ptr->header.flags);
+ spin_unlock_irqrestore(&ep_ptr->common.lock, ep_ptr->common.flags);
/* Free the QP. If the EP has never been used, the QP is invalid */
if (save_qp_state != DAPL_QP_STATE_UNATTACHED) {
@@ -828,7 +800,7 @@ bail:
}
-u32 dapl_ep_connect(DAT_EP_HANDLE ep_handle,
+u32 dapl_ep_connect(struct dat_ep *ep,
struct sockaddr *remote_ia_address,
DAT_CONN_QUAL remote_conn_qual, unsigned long timeout,
int private_data_size, const void *private_data,
@@ -839,7 +811,7 @@ u32 dapl_ep_connect(DAT_EP_HANDLE ep_han
dapl_dbg_log(DAPL_DBG_TYPE_API | DAPL_DBG_TYPE_CM,
"dapl_ep_connect(%p, {%u.%u.%u.%u}, %X, %d, %d, %p, %x, %x)\n",
- ep_handle,
+ ep,
remote_ia_address->sa_data[2],
remote_ia_address->sa_data[3],
remote_ia_address->sa_data[4],
@@ -847,19 +819,19 @@ u32 dapl_ep_connect(DAT_EP_HANDLE ep_han
remote_conn_qual, timeout, private_data_size, private_data,
qos, connect_flags);
- ep_ptr = (struct dapl_ep *)ep_handle;
+ ep_ptr = (struct dapl_ep *)ep;
/*
* Verify parameter & state. The connection handle must be good
* at this point.
*/
- if (DAPL_BAD_HANDLE(ep_ptr, DAPL_MAGIC_EP)) {
+ if (!ep_ptr) {
dat_status =
DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EP);
goto bail;
}
- if (DAPL_BAD_HANDLE(ep_ptr->param.connect_evd_handle, DAPL_MAGIC_EVD)) {
+ if (!ep_ptr->param.connect_evd) {
dat_status =
DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EVD_CONN);
goto bail;
@@ -889,9 +861,7 @@ u32 dapl_ep_connect(DAT_EP_HANDLE ep_han
* * Assign the QP and release the lock.
*/
if (ep_ptr->qp_state == DAPL_QP_STATE_UNATTACHED) {
- if (ep_ptr->param.pz_handle == NULL
- || DAPL_BAD_HANDLE(ep_ptr->param.pz_handle, DAPL_MAGIC_PZ))
- {
+ if (ep_ptr->param.pz == NULL) {
dat_status =
DAT_ERROR(DAT_INVALID_STATE,
DAT_INVALID_STATE_EP_NOTREADY);
@@ -899,7 +869,7 @@ u32 dapl_ep_connect(DAT_EP_HANDLE ep_han
}
alloc_ep = *ep_ptr;
- dat_status = dapl_ib_qp_alloc(ep_ptr->header.owner_ia,
+ dat_status = dapl_ib_qp_alloc(ep_ptr->common.owner_ia,
&alloc_ep, ep_ptr);
if (dat_status != DAT_SUCCESS) {
dat_status =
@@ -908,15 +878,15 @@ u32 dapl_ep_connect(DAT_EP_HANDLE ep_han
goto bail;
}
- spin_lock_irqsave(&ep_ptr->header.lock, ep_ptr->header.flags);
+ spin_lock_irqsave(&ep_ptr->common.lock, ep_ptr->common.flags);
/*
* PZ shouldn't have changed since we're only racing with
* dapl_cr_accept()
*/
if (ep_ptr->qp_state != DAPL_QP_STATE_UNATTACHED) {
/* Bail, cleaning up. */
- spin_unlock_irqrestore(&ep_ptr->header.lock,
- ep_ptr->header.flags);
+ spin_unlock_irqrestore(&ep_ptr->common.lock,
+ ep_ptr->common.flags);
dat_status = dapl_ib_qp_free(&alloc_ep);
if (dat_status != DAT_SUCCESS) {
dapl_dbg_log(DAPL_DBG_TYPE_WARN,
@@ -932,42 +902,30 @@ u32 dapl_ep_connect(DAT_EP_HANDLE ep_han
ep_ptr->qp = alloc_ep.qp;
ep_ptr->qp_state = alloc_ep.qp_state;
- spin_unlock_irqrestore(&ep_ptr->header.lock,
- ep_ptr->header.flags);
+ spin_unlock_irqrestore(&ep_ptr->common.lock,
+ ep_ptr->common.flags);
}
/*
* We do state checks and transitions under lock.
* The only code we're racing against is dapl_cr_accept.
*/
- spin_lock_irqsave(&ep_ptr->header.lock, ep_ptr->header.flags);
+ spin_lock_irqsave(&ep_ptr->common.lock, ep_ptr->common.flags);
/*
* Verify the attributes of the EP handle before we connect it. Test
* all of the handles to make sure they are currently valid.
* Specifically:
- * pz_handle required
- * recv_evd_handle optional, but must be valid
- * request_evd_handle optional, but must be valid
- * connect_evd_handle required
- */
- if (ep_ptr->param.pz_handle == NULL
- || DAPL_BAD_HANDLE(ep_ptr->param.pz_handle, DAPL_MAGIC_PZ)
- /* test connect handle */
- || ep_ptr->param.connect_evd_handle == NULL
- || DAPL_BAD_HANDLE(ep_ptr->param.connect_evd_handle, DAPL_MAGIC_EVD)
- || !(((struct dapl_evd *)ep_ptr->param.connect_evd_handle)->
- evd_flags & DAT_EVD_CONNECTION_FLAG)
- /* test optional completion handles */
- || (ep_ptr->param.recv_evd_handle != DAT_HANDLE_NULL &&
- (DAPL_BAD_HANDLE
- (ep_ptr->param.recv_evd_handle, DAPL_MAGIC_EVD)))
- || (ep_ptr->param.request_evd_handle != DAT_HANDLE_NULL
- &&
- (DAPL_BAD_HANDLE
- (ep_ptr->param.request_evd_handle, DAPL_MAGIC_EVD)))) {
- spin_unlock_irqrestore(&ep_ptr->header.lock,
- ep_ptr->header.flags);
+ * pz required
+ * recv_evd optional, but must be valid
+ * request_evd optional, but must be valid
+ * connect_evd required
+ */
+ if (ep_ptr->param.pz == NULL || ep_ptr->param.connect_evd == NULL
+ || !(((struct dapl_evd *)ep_ptr->param.connect_evd)->
+ evd_flags & DAT_EVD_CONNECTION_FLAG)) {
+ spin_unlock_irqrestore(&ep_ptr->common.lock,
+ ep_ptr->common.flags);
dat_status =
DAT_ERROR(DAT_INVALID_STATE, DAT_INVALID_STATE_EP_NOTREADY);
goto bail;
@@ -977,12 +935,12 @@ u32 dapl_ep_connect(DAT_EP_HANDLE ep_han
* we need to attach one now.
*/
if (ep_ptr->qp_state == DAPL_QP_STATE_UNATTACHED) {
- dat_status = dapl_ib_qp_alloc(ep_ptr->header.owner_ia,
+ dat_status = dapl_ib_qp_alloc(ep_ptr->common.owner_ia,
ep_ptr, ep_ptr);
if (dat_status != DAT_SUCCESS) {
- spin_unlock_irqrestore(&ep_ptr->header.lock,
- ep_ptr->header.flags);
+ spin_unlock_irqrestore(&ep_ptr->common.lock,
+ ep_ptr->common.flags);
dat_status =
DAT_ERROR(DAT_INSUFFICIENT_RESOURCES,
DAT_RESOURCE_TEP);
@@ -991,8 +949,8 @@ u32 dapl_ep_connect(DAT_EP_HANDLE ep_han
}
if (ep_ptr->param.ep_state != DAT_EP_STATE_UNCONNECTED) {
- spin_unlock_irqrestore(&ep_ptr->header.lock,
- ep_ptr->header.flags);
+ spin_unlock_irqrestore(&ep_ptr->common.lock,
+ ep_ptr->common.flags);
dat_status =
DAT_ERROR(DAT_INVALID_STATE, dapl_ep_state_subtype(ep_ptr));
goto bail;
@@ -1003,8 +961,8 @@ u32 dapl_ep_connect(DAT_EP_HANDLE ep_han
/*
* At this point we only support one QOS level
*/
- spin_unlock_irqrestore(&ep_ptr->header.lock,
- ep_ptr->header.flags);
+ spin_unlock_irqrestore(&ep_ptr->common.lock,
+ ep_ptr->common.flags);
dat_status = DAT_ERROR(DAT_MODEL_NOT_SUPPORTED, 0);
goto bail;
}
@@ -1018,7 +976,7 @@ u32 dapl_ep_connect(DAT_EP_HANDLE ep_han
* At this point we're committed, and done with the endpoint
* except for the connect, so we can drop the lock.
*/
- spin_unlock_irqrestore(&ep_ptr->header.lock, ep_ptr->header.flags);
+ spin_unlock_irqrestore(&ep_ptr->common.lock, ep_ptr->common.flags);
/* Copy the connection qualifiers */
memcpy(ep_ptr->param.remote_ia_address_ptr, remote_ia_address,
@@ -1026,7 +984,7 @@ u32 dapl_ep_connect(DAT_EP_HANDLE ep_han
ep_ptr->param.remote_port_qual = remote_conn_qual;
memcpy(ep_ptr->private_data,private_data,private_data_size);
- dat_status = dapl_ib_connect(ep_ptr, remote_ia_address,
+ dat_status = dapl_ib_connect((struct dat_ep *)ep_ptr, remote_ia_address,
remote_conn_qual, timeout,
private_data_size, ep_ptr->private_data);
@@ -1043,10 +1001,10 @@ u32 dapl_ep_connect(DAT_EP_HANDLE ep_han
if (dat_status == DAT_ERROR(DAT_INTERNAL_ERROR, 1)) {
dapl_evd_post_connection_event((struct dapl_evd *)
ep_ptr->param.
- connect_evd_handle,
+ connect_evd,
DAT_CONNECTION_EVENT_UNREACHABLE,
- (DAT_HANDLE) ep_ptr, 0,
- NULL);
+ (struct dat_ep *)ep_ptr,
+ 0, NULL);
dat_status = DAT_SUCCESS;
}
}
@@ -1058,7 +1016,7 @@ bail:
return dat_status;
}
-u32 dapl_ep_dup_connect(DAT_EP_HANDLE ep_handle, DAT_EP_HANDLE ep_dup_handle,
+u32 dapl_ep_dup_connect(struct dat_ep *ep, struct dat_ep *ep_dup,
unsigned long timeout, int private_data_size,
const void *private_data, enum dat_qos qos)
{
@@ -1067,13 +1025,13 @@ u32 dapl_ep_dup_connect(DAT_EP_HANDLE ep
DAT_CONN_QUAL remote_conn_qual;
u32 dat_status;
- ep_dup_ptr = (struct dapl_ep *)ep_dup_handle;
+ ep_dup_ptr = (struct dapl_ep *)ep_dup;
/*
* Verify the dup handle, which must be connected. All other
* parameters will be verified by dapl_ep_connect
*/
- if (DAPL_BAD_HANDLE(ep_dup_handle, DAPL_MAGIC_EP)) {
+ if (!ep_dup) {
dat_status =
DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EP);
goto bail;
@@ -1089,10 +1047,10 @@ u32 dapl_ep_dup_connect(DAT_EP_HANDLE ep
* there is a problem. Do this under a lock and pull out
* the connection parameters for atomicity.
*/
- spin_lock_irqsave(&ep_dup_ptr->header.lock, ep_dup_ptr->header.flags);
+ spin_lock_irqsave(&ep_dup_ptr->common.lock, ep_dup_ptr->common.flags);
if (ep_dup_ptr->param.ep_state != DAT_EP_STATE_CONNECTED) {
- spin_unlock_irqrestore(&ep_dup_ptr->header.lock,
- ep_dup_ptr->header.flags);
+ spin_unlock_irqrestore(&ep_dup_ptr->common.lock,
+ ep_dup_ptr->common.flags);
dat_status =
DAT_ERROR(DAT_INVALID_STATE,
dapl_ep_state_subtype(ep_dup_ptr));
@@ -1100,10 +1058,10 @@ u32 dapl_ep_dup_connect(DAT_EP_HANDLE ep
}
remote_ia_address_ptr = ep_dup_ptr->param.remote_ia_address_ptr;
remote_conn_qual = ep_dup_ptr->param.remote_port_qual;
- spin_unlock_irqrestore(&ep_dup_ptr->header.lock,
- ep_dup_ptr->header.flags);
+ spin_unlock_irqrestore(&ep_dup_ptr->common.lock,
+ ep_dup_ptr->common.flags);
- dat_status = dapl_ep_connect(ep_handle,
+ dat_status = dapl_ep_connect(ep,
remote_ia_address_ptr,
remote_conn_qual,
timeout,
@@ -1114,7 +1072,7 @@ bail:
return dat_status;
}
-u32 dapl_ep_disconnect(DAT_EP_HANDLE ep_handle,
+u32 dapl_ep_disconnect(struct dat_ep *ep,
enum dat_close_flags disconnect_flags)
{
struct dapl_ep *ep_ptr;
@@ -1124,14 +1082,14 @@ u32 dapl_ep_disconnect(DAT_EP_HANDLE ep_
dapl_dbg_log(DAPL_DBG_TYPE_API | DAPL_DBG_TYPE_CM,
"dapl_ep_disconnect (%p, %x)\n",
- ep_handle, disconnect_flags);
+ ep, disconnect_flags);
- ep_ptr = (struct dapl_ep *)ep_handle;
+ ep_ptr = (struct dapl_ep *)ep;
/*
* Verify parameter & state
*/
- if (DAPL_BAD_HANDLE(ep_ptr, DAPL_MAGIC_EP)) {
+ if (!ep_ptr) {
dat_status =
DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EP);
goto bail;
@@ -1141,12 +1099,12 @@ u32 dapl_ep_disconnect(DAT_EP_HANDLE ep_
* Do the verification of parameters and the state change
* atomically.
*/
- spin_lock_irqsave(&ep_ptr->header.lock, ep_ptr->header.flags);
+ spin_lock_irqsave(&ep_ptr->common.lock, ep_ptr->common.flags);
/* Disconnecting a disconnected EP is a no-op. */
if (ep_ptr->param.ep_state == DAT_EP_STATE_DISCONNECTED) {
- spin_unlock_irqrestore(&ep_ptr->header.lock,
- ep_ptr->header.flags);
+ spin_unlock_irqrestore(&ep_ptr->common.lock,
+ ep_ptr->common.flags);
dat_status = DAT_SUCCESS;
goto bail;
}
@@ -1160,8 +1118,8 @@ u32 dapl_ep_disconnect(DAT_EP_HANDLE ep_
ep_ptr->param.ep_state != DAT_EP_STATE_ACTIVE_CONNECTION_PENDING &&
ep_ptr->param.ep_state != DAT_EP_STATE_COMPLETION_PENDING &&
ep_ptr->param.ep_state != DAT_EP_STATE_DISCONNECT_PENDING) {
- spin_unlock_irqrestore(&ep_ptr->header.lock,
- ep_ptr->header.flags);
+ spin_unlock_irqrestore(&ep_ptr->common.lock,
+ ep_ptr->common.flags);
dat_status =
DAT_ERROR(DAT_INVALID_STATE, dapl_ep_state_subtype(ep_ptr));
goto bail;
@@ -1173,8 +1131,8 @@ u32 dapl_ep_disconnect(DAT_EP_HANDLE ep_
* If in state DISCONNECT_PENDING then this must be an
* ABRUPT disconnect
*/
- spin_unlock_irqrestore(&ep_ptr->header.lock,
- ep_ptr->header.flags);
+ spin_unlock_irqrestore(&ep_ptr->common.lock,
+ ep_ptr->common.flags);
dat_status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG2);
goto bail;
}
@@ -1187,18 +1145,19 @@ u32 dapl_ep_disconnect(DAT_EP_HANDLE ep_
*/
ep_ptr->param.ep_state = DAT_EP_STATE_DISCONNECTED;
- spin_unlock_irqrestore(&ep_ptr->header.lock,
- ep_ptr->header.flags);
+ spin_unlock_irqrestore(&ep_ptr->common.lock,
+ ep_ptr->common.flags);
/* disconnect and make sure we get no callbacks */
(void)dapl_ib_disconnect(ep_ptr, DAT_CLOSE_ABRUPT_FLAG);
/* clean up connection state */
dapl_sp_remove_ep(ep_ptr);
- evd_ptr = (struct dapl_evd *)ep_ptr->param.connect_evd_handle;
+ evd_ptr = (struct dapl_evd *)ep_ptr->param.connect_evd;
dapl_evd_post_connection_event(evd_ptr,
DAT_CONNECTION_EVENT_DISCONNECTED,
- (DAT_HANDLE) ep_ptr, 0, NULL);
+ (struct dat_ep *)ep_ptr, 0,
+ NULL);
dat_status = DAT_SUCCESS;
goto bail;
}
@@ -1216,14 +1175,14 @@ u32 dapl_ep_disconnect(DAT_EP_HANDLE ep_
if (ep_ptr->param.ep_state == DAT_EP_STATE_CONNECTED) {
ep_ptr->param.ep_state = DAT_EP_STATE_DISCONNECT_PENDING;
}
- spin_unlock_irqrestore(&ep_ptr->header.lock, ep_ptr->header.flags);
+ spin_unlock_irqrestore(&ep_ptr->common.lock, ep_ptr->common.flags);
dat_status = dapl_ib_disconnect(ep_ptr, disconnect_flags);
/*
* Reacquire the lock and make sure we didn't get a callback
* that cleaned up.
*/
- spin_lock_irqsave(&ep_ptr->header.lock, ep_ptr->header.flags);
+ spin_lock_irqsave(&ep_ptr->common.lock, ep_ptr->common.flags);
if (disconnect_flags == DAT_CLOSE_ABRUPT_FLAG &&
ep_ptr->param.ep_state == DAT_EP_STATE_DISCONNECT_PENDING) {
/*
@@ -1234,8 +1193,8 @@ u32 dapl_ep_disconnect(DAT_EP_HANDLE ep_
* on the way out.
*/
cr_ptr = ep_ptr->cr_ptr;
- spin_unlock_irqrestore(&ep_ptr->header.lock,
- ep_ptr->header.flags);
+ spin_unlock_irqrestore(&ep_ptr->common.lock,
+ ep_ptr->common.flags);
if (cr_ptr != NULL) {
dapl_dbg_log(DAPL_DBG_TYPE_API | DAPL_DBG_TYPE_CM,
@@ -1246,13 +1205,13 @@ u32 dapl_ep_disconnect(DAT_EP_HANDLE ep_
DAT_CONNECTION_EVENT_DISCONNECTED,
NULL, cr_ptr->sp_ptr);
} else {
- dapl_evd_connection_callback(ep_ptr->cm_handle,
+ dapl_evd_connection_callback(ep_ptr->cm,
DAT_CONNECTION_EVENT_DISCONNECTED,
NULL, ep_ptr);
}
} else
- spin_unlock_irqrestore(&ep_ptr->header.lock,
- ep_ptr->header.flags);
+ spin_unlock_irqrestore(&ep_ptr->common.lock,
+ ep_ptr->common.flags);
bail:
dapl_dbg_log(DAPL_DBG_TYPE_RTN | DAPL_DBG_TYPE_CM,
@@ -1261,7 +1220,7 @@ u32 dapl_ep_disconnect(DAT_EP_HANDLE ep_
return dat_status;
}
-u32 dapl_ep_get_status(DAT_EP_HANDLE ep_handle, enum dat_ep_state *ep_state,
+u32 dapl_ep_get_status(struct dat_ep *ep, enum dat_ep_state *ep_state,
boolean_t *in_dto_idle, boolean_t *out_dto_idle)
{
struct dapl_ep *ep_ptr;
@@ -1269,14 +1228,14 @@ u32 dapl_ep_get_status(DAT_EP_HANDLE ep_
dapl_dbg_log(DAPL_DBG_TYPE_API,
"dapl_ep_get_status (%p, %p, %p, %p)\n",
- ep_handle, ep_state, in_dto_idle, out_dto_idle);
+ ep, ep_state, in_dto_idle, out_dto_idle);
- ep_ptr = (struct dapl_ep *)ep_handle;
+ ep_ptr = (struct dapl_ep *)ep;
/*
* Verify parameter & state
*/
- if (DAPL_BAD_HANDLE(ep_ptr, DAPL_MAGIC_EP)) {
+ if (!ep_ptr) {
dat_status =
DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EP);
goto bail;
@@ -1304,15 +1263,15 @@ u32 dapl_ep_get_status(DAT_EP_HANDLE ep_
}
static inline u32
-dapl_ep_modify_validate_parameters(DAT_EP_HANDLE ep_handle,
+dapl_ep_modify_validate_parameters(struct dat_ep *ep,
enum dat_ep_param_mask mask,
const struct dat_ep_param *ep_param,
struct dapl_ia **ia_ptr,
struct dapl_ep **ep_ptr,
struct dat_ep_attr *ep_attr_ptr)
{
- struct dapl_ia *ia;
- struct dapl_ep *ep;
+ struct dapl_ia *dapl_ia;
+ struct dapl_ep *dapl_ep;
struct dat_ep_attr ep_attr;
struct dat_ep_attr ep_attr_limit;
struct dat_ep_attr ep_attr_request;
@@ -1321,14 +1280,14 @@ dapl_ep_modify_validate_parameters(DAT_E
*ia_ptr = NULL;
*ep_ptr = NULL;
- if (DAPL_BAD_HANDLE(ep_handle, DAPL_MAGIC_EP)) {
+ if (!ep) {
dat_status =
DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EP);
goto bail;
}
- ep = (struct dapl_ep *)ep_handle;
- ia = ep->header.owner_ia;
+ dapl_ep = (struct dapl_ep *)ep;
+ dapl_ia = dapl_ep->common.owner_ia;
/*
* Verify parameters valid in current EP state
@@ -1348,10 +1307,10 @@ dapl_ep_modify_validate_parameters(DAT_E
* TENTATIVE_CONNECTION_PENDING (psp PROVIDER allocated EP)
*/
if ((mask & DAT_EP_FIELD_PZ_HANDLE) &&
- (ep->param.ep_state != DAT_EP_STATE_UNCONNECTED &&
- ep->param.ep_state != DAT_EP_STATE_TENTATIVE_CONNECTION_PENDING)) {
- dat_status =
- DAT_ERROR(DAT_INVALID_STATE, dapl_ep_state_subtype(ep));
+ (dapl_ep->param.ep_state != DAT_EP_STATE_UNCONNECTED &&
+ dapl_ep->param.ep_state != DAT_EP_STATE_TENTATIVE_CONNECTION_PENDING)) {
+ dat_status = DAT_ERROR(DAT_INVALID_STATE,
+ dapl_ep_state_subtype(dapl_ep));
goto bail;
}
@@ -1367,41 +1326,21 @@ dapl_ep_modify_validate_parameters(DAT_E
DAT_EP_FIELD_EP_ATTR_MAX_REQUEST_DTOS |
DAT_EP_FIELD_EP_ATTR_MAX_RECV_IOV |
DAT_EP_FIELD_EP_ATTR_MAX_REQUEST_IOV)) &&
- (ep->param.ep_state != DAT_EP_STATE_UNCONNECTED &&
- ep->param.ep_state != DAT_EP_STATE_RESERVED &&
- ep->param.ep_state != DAT_EP_STATE_TENTATIVE_CONNECTION_PENDING)) {
- dat_status =
- DAT_ERROR(DAT_INVALID_STATE, dapl_ep_state_subtype(ep));
+ (dapl_ep->param.ep_state != DAT_EP_STATE_UNCONNECTED &&
+ dapl_ep->param.ep_state != DAT_EP_STATE_RESERVED &&
+ dapl_ep->param.ep_state != DAT_EP_STATE_TENTATIVE_CONNECTION_PENDING)) {
+ dat_status = DAT_ERROR(DAT_INVALID_STATE,
+ dapl_ep_state_subtype(dapl_ep));
goto bail;
}
/*
* Validate handles being modified
*/
- if (mask & DAT_EP_FIELD_PZ_HANDLE) {
- if (ep_param->pz_handle != NULL &&
- DAPL_BAD_HANDLE(ep_param->pz_handle, DAPL_MAGIC_PZ)) {
- dat_status =
- DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG3);
- goto bail;
- }
- }
-
if (mask & DAT_EP_FIELD_RECV_EVD_HANDLE) {
- if (ep_param->recv_evd_handle != NULL &&
- (DAPL_BAD_HANDLE(ep_param->recv_evd_handle, DAPL_MAGIC_EVD)
- || !((struct dapl_evd *)ep_param->recv_evd_handle)->
- evd_flags & DAT_EVD_DTO_FLAG)) {
- dat_status =
- DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG3);
- goto bail;
- }
- }
-
- if (mask & DAT_EP_FIELD_REQUEST_EVD_HANDLE) {
- if (ep_param->request_evd_handle != NULL &&
- DAPL_BAD_HANDLE(ep_param->request_evd_handle,
- DAPL_MAGIC_EVD)) {
+ if (ep_param->recv_evd != NULL &&
+ !((struct dapl_evd *)ep_param->recv_evd)->
+ evd_flags & DAT_EVD_DTO_FLAG) {
dat_status =
DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG3);
goto bail;
@@ -1409,10 +1348,8 @@ dapl_ep_modify_validate_parameters(DAT_E
}
if (mask & DAT_EP_FIELD_CONNECT_EVD_HANDLE) {
- if (ep_param->connect_evd_handle != NULL &&
- DAPL_BAD_HANDLE(ep_param->connect_evd_handle,
- DAPL_MAGIC_EVD)
- && !(((struct dapl_evd *)ep_param->connect_evd_handle)->
+ if (ep_param->connect_evd != NULL &&
+ !(((struct dapl_evd *)ep_param->connect_evd)->
evd_flags & DAT_EVD_CONNECTION_FLAG)) {
dat_status =
DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG3);
@@ -1423,8 +1360,8 @@ dapl_ep_modify_validate_parameters(DAT_E
/*
* Validate the attributes against the HCA limits
*/
- ep_attr = ep->param.ep_attr;
- ep_attr_limit = ia->hca_ptr->ep_attr;
+ ep_attr = dapl_ep->param.ep_attr;
+ ep_attr_limit = dapl_ia->hca_ptr->ep_attr;
ep_attr_request = ep_param->ep_attr;
if (mask & DAT_EP_FIELD_EP_ATTR_MAX_MESSAGE_SIZE) {
@@ -1471,7 +1408,7 @@ dapl_ep_modify_validate_parameters(DAT_E
if (mask & DAT_EP_FIELD_EP_ATTR_MAX_RECV_DTOS) {
if (ep_attr_request.max_recv_dtos > ep_attr_limit.max_recv_dtos
- || (ep_param->recv_evd_handle == DAT_HANDLE_NULL
+ || (ep_param->recv_evd == NULL
&& (ep_attr_request.max_recv_dtos > 0))) {
dat_status =
DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG3);
@@ -1484,7 +1421,7 @@ dapl_ep_modify_validate_parameters(DAT_E
if (mask & DAT_EP_FIELD_EP_ATTR_MAX_REQUEST_DTOS) {
if (ep_attr_request.max_request_dtos >
ep_attr_limit.max_request_dtos
- || (ep_param->request_evd_handle == DAT_HANDLE_NULL
+ || (ep_param->request_evd == NULL
&& (ep_attr_request.max_request_dtos > 0))) {
dat_status =
DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG3);
@@ -1541,15 +1478,15 @@ dapl_ep_modify_validate_parameters(DAT_E
}
}
- *ia_ptr = ia;
- *ep_ptr = ep;
+ *ia_ptr = dapl_ia;
+ *ep_ptr = dapl_ep;
*ep_attr_ptr = ep_attr;
bail:
return dat_status;
}
-u32 dapl_ep_modify(DAT_EP_HANDLE ep_handle, enum dat_ep_param_mask mask,
+u32 dapl_ep_modify(struct dat_ep *ep, enum dat_ep_param_mask mask,
const struct dat_ep_param *ep_param)
{
struct dapl_ia *ia;
@@ -1575,7 +1512,7 @@ u32 dapl_ep_modify(DAT_EP_HANDLE ep_hand
boolean_t rqst_iov_used = FALSE;
boolean_t recv_iov_used = FALSE;
- dat_status = dapl_ep_modify_validate_parameters(ep_handle,
+ dat_status = dapl_ep_modify_validate_parameters(ep,
mask,
ep_param,
&ia, &ep1, &ep_attr1);
@@ -1589,16 +1526,16 @@ u32 dapl_ep_modify(DAT_EP_HANDLE ep_hand
alloc_ep = *ep1;
alloc_ep.param.ep_attr = ep_attr1;
if (mask & DAT_EP_FIELD_PZ_HANDLE)
- alloc_ep.param.pz_handle = ep_param->pz_handle;
+ alloc_ep.param.pz = ep_param->pz;
if (mask & DAT_EP_FIELD_RECV_EVD_HANDLE)
- alloc_ep.param.recv_evd_handle = ep_param->recv_evd_handle;
+ alloc_ep.param.recv_evd = ep_param->recv_evd;
if (mask & DAT_EP_FIELD_REQUEST_EVD_HANDLE)
- alloc_ep.param.request_evd_handle = ep_param->request_evd_handle;
+ alloc_ep.param.request_evd = ep_param->request_evd;
if (mask & DAT_EP_FIELD_CONNECT_EVD_HANDLE)
- alloc_ep.param.connect_evd_handle = ep_param->connect_evd_handle;
+ alloc_ep.param.connect_evd = ep_param->connect_evd;
/*
* Allocate everything that might be needed.
@@ -1651,18 +1588,18 @@ u32 dapl_ep_modify(DAT_EP_HANDLE ep_hand
* There's a lot of work done here, but there should be no
* allocation or blocking.
*/
- spin_lock_irqsave(&ep1->header.lock, ep1->header.flags);
+ spin_lock_irqsave(&ep1->common.lock, ep1->common.flags);
/*
* Revalidate parameters; make sure that races haven't
* changed anything important.
*/
- dat_status = dapl_ep_modify_validate_parameters(ep_handle,
+ dat_status = dapl_ep_modify_validate_parameters(ep,
mask,
ep_param,
&ia, &ep2, &ep_attr2);
if (DAT_SUCCESS != dat_status) {
- spin_unlock_irqrestore(&ep2->header.lock, ep2->header.flags);
+ spin_unlock_irqrestore(&ep2->common.lock, ep2->common.flags);
goto bail;
}
@@ -1691,10 +1628,10 @@ u32 dapl_ep_modify(DAT_EP_HANDLE ep_hand
* is stuff changed by dapl_cr_accept, and neither PZ nor EVD is in that
* list.
*/
- new_ep.param.pz_handle = alloc_ep.param.pz_handle;
- new_ep.param.recv_evd_handle = alloc_ep.param.recv_evd_handle;
- new_ep.param.request_evd_handle = alloc_ep.param.request_evd_handle;
- new_ep.param.connect_evd_handle = alloc_ep.param.connect_evd_handle;
+ new_ep.param.pz = alloc_ep.param.pz;
+ new_ep.param.recv_evd = alloc_ep.param.recv_evd;
+ new_ep.param.request_evd = alloc_ep.param.request_evd;
+ new_ep.param.connect_evd = alloc_ep.param.connect_evd;
/* Deal with each of the allocation fields. */
if (mask & DAT_EP_FIELD_EP_ATTR_MAX_RECV_DTOS
@@ -1756,50 +1693,50 @@ u32 dapl_ep_modify(DAT_EP_HANDLE ep_hand
if (DAPL_QP_STATE_UNATTACHED != new_ep.qp_state) {
dat_status = dapl_ib_qp_modify(ia, ep2, &ep_attr2);
if (dat_status != DAT_SUCCESS) {
- spin_unlock_irqrestore(&ep2->header.lock,
- ep2->header.flags);
+ spin_unlock_irqrestore(&ep2->common.lock,
+ ep2->common.flags);
goto bail;
}
}
*ep2 = new_ep;
- spin_unlock_irqrestore(&ep2->header.lock, ep2->header.flags);
+ spin_unlock_irqrestore(&ep2->common.lock, ep2->common.flags);
/*
* Modify reference counts, incrementing new ones
* and then decrementing old ones (so if they're the same
* the refcount never drops to zero).
*/
- tmp_pz = (struct dapl_pz *)new_ep.param.pz_handle;
+ tmp_pz = (struct dapl_pz *)new_ep.param.pz;
if (tmp_pz)
atomic_inc(&tmp_pz->pz_ref_count);
- tmp_evd = (struct dapl_evd *)new_ep.param.recv_evd_handle;
+ tmp_evd = (struct dapl_evd *)new_ep.param.recv_evd;
if (tmp_evd)
atomic_inc(&tmp_evd->evd_ref_count);
- tmp_evd = (struct dapl_evd *)new_ep.param.request_evd_handle;
+ tmp_evd = (struct dapl_evd *)new_ep.param.request_evd;
if (tmp_evd)
atomic_inc(&tmp_evd->evd_ref_count);
- tmp_evd = (struct dapl_evd *)new_ep.param.connect_evd_handle;
+ tmp_evd = (struct dapl_evd *)new_ep.param.connect_evd;
if (tmp_evd)
atomic_inc(&tmp_evd->evd_ref_count);
/* decreament the old reference counts */
- tmp_pz = (struct dapl_pz *)copy_of_old_ep.param.pz_handle;
+ tmp_pz = (struct dapl_pz *)copy_of_old_ep.param.pz;
if (tmp_pz)
atomic_dec(&tmp_pz->pz_ref_count);
- tmp_evd = (struct dapl_evd *)copy_of_old_ep.param.recv_evd_handle;
+ tmp_evd = (struct dapl_evd *)copy_of_old_ep.param.recv_evd;
if (tmp_evd)
atomic_dec(&tmp_evd->evd_ref_count);
- tmp_evd = (struct dapl_evd *)copy_of_old_ep.param.request_evd_handle;
+ tmp_evd = (struct dapl_evd *)copy_of_old_ep.param.request_evd;
if (tmp_evd)
atomic_dec(&tmp_evd->evd_ref_count);
- tmp_evd = (struct dapl_evd *)copy_of_old_ep.param.connect_evd_handle;
+ tmp_evd = (struct dapl_evd *)copy_of_old_ep.param.connect_evd;
if (tmp_evd)
atomic_dec(&tmp_evd->evd_ref_count);
@@ -1847,7 +1784,7 @@ bail:
return dat_status;
}
-u32 dapl_ep_post_rdma_read(DAT_EP_HANDLE ep_handle, int num_segments,
+u32 dapl_ep_post_rdma_read(struct dat_ep *ep, int num_segments,
struct dat_lmr_triplet *local_iov,
DAT_DTO_COOKIE user_cookie,
const struct dat_rmr_triplet *remote_iov,
@@ -1858,12 +1795,12 @@ u32 dapl_ep_post_rdma_read(DAT_EP_HANDLE
dapl_dbg_log(DAPL_DBG_TYPE_API,
"dapl_ep_post_rdma_read (%p, %d, %p, %p, %p, %x)\n",
- ep_handle,
+ ep,
num_segments,
local_iov,
user_cookie.as_64, remote_iov, completion_flags);
- dat_status = dapl_ep_post_send_req(ep_handle,
+ dat_status = dapl_ep_post_send_req(ep,
num_segments,
local_iov,
user_cookie,
@@ -1878,7 +1815,7 @@ u32 dapl_ep_post_rdma_read(DAT_EP_HANDLE
return dat_status;
}
-u32 dapl_ep_post_rdma_write(DAT_EP_HANDLE ep_handle, int num_segments,
+u32 dapl_ep_post_rdma_write(struct dat_ep *ep, int num_segments,
struct dat_lmr_triplet *local_iov,
DAT_DTO_COOKIE user_cookie,
const struct dat_rmr_triplet *remote_iov,
@@ -1888,12 +1825,12 @@ u32 dapl_ep_post_rdma_write(DAT_EP_HANDL
dapl_dbg_log(DAPL_DBG_TYPE_API,
"dapl_ep_post_rdma_write (%p, %d, %p, %P, %p, %x)\n",
- ep_handle,
+ ep,
num_segments,
local_iov,
user_cookie.as_64, remote_iov, completion_flags);
- dat_status = dapl_ep_post_send_req(ep_handle,
+ dat_status = dapl_ep_post_send_req(ep,
num_segments,
local_iov,
user_cookie,
@@ -1908,7 +1845,7 @@ u32 dapl_ep_post_rdma_write(DAT_EP_HANDL
return dat_status;
}
-u32 dapl_ep_post_recv(DAT_EP_HANDLE ep_handle, int num_segments,
+u32 dapl_ep_post_recv(struct dat_ep *ep, int num_segments,
struct dat_lmr_triplet *local_iov,
DAT_DTO_COOKIE user_cookie,
enum dat_completion_flags completion_flags)
@@ -1919,15 +1856,15 @@ u32 dapl_ep_post_recv(DAT_EP_HANDLE ep_h
dapl_dbg_log(DAPL_DBG_TYPE_API,
"dapl_ep_post_recv (%p, %d, %p, %P, %x)\n",
- ep_handle, num_segments, local_iov, user_cookie.as_64,
+ ep, num_segments, local_iov, user_cookie.as_64,
completion_flags);
- if (DAPL_BAD_HANDLE(ep_handle, DAPL_MAGIC_EP)) {
+ if (!ep) {
status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EP);
goto bail;
}
- ep_ptr = (struct dapl_ep *) ep_handle;
+ ep_ptr = (struct dapl_ep *) ep;
/*
* Synchronization ok since this buffer is only used for receive
@@ -1957,7 +1894,7 @@ bail:
return status;
}
-u32 dapl_ep_post_send(DAT_EP_HANDLE ep_handle, int num_segments,
+u32 dapl_ep_post_send(struct dat_ep *ep, int num_segments,
struct dat_lmr_triplet *local_iov,
DAT_DTO_COOKIE user_cookie,
enum dat_completion_flags completion_flags)
@@ -1967,11 +1904,11 @@ u32 dapl_ep_post_send(DAT_EP_HANDLE ep_h
dapl_dbg_log(DAPL_DBG_TYPE_API,
"dapl_ep_post_send (%p, %d, %p, %P, %x)\n",
- ep_handle,
+ ep,
num_segments,
local_iov, user_cookie.as_64, completion_flags);
- dat_status = dapl_ep_post_send_req(ep_handle,
+ dat_status = dapl_ep_post_send_req(ep,
num_segments,
local_iov,
user_cookie,
@@ -1985,21 +1922,21 @@ u32 dapl_ep_post_send(DAT_EP_HANDLE ep_h
return dat_status;
}
-u32 dapl_ep_query(DAT_EP_HANDLE ep_handle, struct dat_ep_param *ep_param)
+u32 dapl_ep_query(struct dat_ep *ep, struct dat_ep_param *ep_param)
{
struct dapl_ep *ep_ptr;
u32 status = DAT_SUCCESS;
dapl_dbg_log(DAPL_DBG_TYPE_API,
"dapl_ep_query (%p, %p)\n",
- ep_handle, ep_param);
+ ep, ep_param);
- ep_ptr = (struct dapl_ep *)ep_handle;
+ ep_ptr = (struct dapl_ep *)ep;
/*
* Verify parameter & state
*/
- if (DAPL_BAD_HANDLE(ep_ptr, DAPL_MAGIC_EP)) {
+ if (!ep_ptr) {
status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EP);
goto bail;
}
@@ -2015,12 +1952,10 @@ u32 dapl_ep_query(DAT_EP_HANDLE ep_handl
* N.B. Just slam all values into the user structure, there
* is nothing to be gained by checking for each bit.
*/
- if (ep_ptr->param.ep_state == DAT_EP_STATE_CONNECTED) {
+ if (ep_ptr->param.ep_state == DAT_EP_STATE_CONNECTED)
/* obtain the remote IP address */
- status =
- dapl_ib_cm_remote_addr((DAT_HANDLE) ep_handle,
- &ep_ptr->remote_ia_address);
- }
+ status = dapl_ib_cm_remote_addr(ep, &ep_ptr->remote_ia_address);
+
ep_ptr->param.remote_ia_address_ptr =
(struct sockaddr *)&ep_ptr->remote_ia_address;
*ep_param = ep_ptr->param;
@@ -2029,21 +1964,21 @@ bail:
return status;
}
-u32 dapl_ep_recv_query(DAT_EP_HANDLE ep_handle, int *nbufs_allocate,
+u32 dapl_ep_recv_query(struct dat_ep *ep, int *nbufs_allocate,
int *bufs_alloc_span)
{
struct dapl_ep *ep_ptr;
u32 dat_status = DAT_SUCCESS;
dapl_dbg_log(DAPL_DBG_TYPE_API, "dapl_ep_recv_query (%p, %p, %p)\n",
- ep_handle, nbufs_allocate, bufs_alloc_span);
+ ep, nbufs_allocate, bufs_alloc_span);
- ep_ptr = (struct dapl_ep *)ep_handle;
+ ep_ptr = (struct dapl_ep *)ep;
/*
* Verify parameter & state
*/
- if (DAPL_BAD_HANDLE(ep_ptr, DAPL_MAGIC_EP)) {
+ if (!ep_ptr) {
dat_status =
DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EP);
goto bail;
@@ -2056,17 +1991,17 @@ bail:
}
-u32 dapl_ep_reset(DAT_EP_HANDLE ep_handle)
+u32 dapl_ep_reset(struct dat_ep *ep)
{
struct dapl_ep *ep_ptr;
u32 dat_status = DAT_SUCCESS;
- ep_ptr = (struct dapl_ep *)ep_handle;
+ ep_ptr = (struct dapl_ep *)ep;
/*
* Verify parameter & state
*/
- if (DAPL_BAD_HANDLE(ep_ptr, DAPL_MAGIC_EP)) {
+ if (!ep_ptr) {
dat_status =
DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EP);
goto bail;
@@ -2088,7 +2023,7 @@ bail:
return dat_status;
}
-u32 dapl_ep_set_watermark(DAT_EP_HANDLE ep_handle,
+u32 dapl_ep_set_watermark(struct dat_ep *ep,
int soft_high_watermark,
int hard_high_watermark)
{
@@ -2096,14 +2031,14 @@ u32 dapl_ep_set_watermark(DAT_EP_HANDLE
u32 dat_status = DAT_SUCCESS;
dapl_dbg_log(DAPL_DBG_TYPE_API, "dapl_ep_set_watermark (%p, %d, %d)\n",
- ep_handle, soft_high_watermark, hard_high_watermark);
+ ep, soft_high_watermark, hard_high_watermark);
- ep_ptr = (struct dapl_ep *)ep_handle;
+ ep_ptr = (struct dapl_ep *)ep;
/*
* Verify parameter & state
*/
- if (DAPL_BAD_HANDLE(ep_ptr, DAPL_MAGIC_EP)) {
+ if (!ep_ptr) {
dat_status =
DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EP);
goto bail;
Index: linux-kernel/dat-provider/dapl_rsp.c
===================================================================
--- linux-kernel/dat-provider/dapl_rsp.c (revision 2564)
+++ linux-kernel/dat-provider/dapl_rsp.c (working copy)
@@ -44,13 +44,13 @@
* event
*
* Input:
- * ia_handle
+ * ia
* conn_qual
- * ep_handle
- * evd_handle
+ * ep
+ * evd
*
* Output:
- * rsp_handle
+ * rsp
*
* Returns:
* DAT_SUCCESS
@@ -59,9 +59,9 @@
* DAT_INVALID_STATE
* DAT_CONN_QUAL_IN_USE
*/
-u32 dapl_rsp_create(DAT_IA_HANDLE ia_handle, DAT_CONN_QUAL conn_qual,
- DAT_EP_HANDLE ep_handle, DAT_EVD_HANDLE evd_handle,
- DAT_RSP_HANDLE *rsp_handle)
+u32 dapl_rsp_create(struct dat_ia *ia, DAT_CONN_QUAL conn_qual,
+ struct dat_ep *ep, struct dat_evd *evd,
+ struct dat_sp **rsp)
{
struct dapl_ia *ia_ptr;
struct dapl_sp *sp_ptr;
@@ -70,39 +70,39 @@ u32 dapl_rsp_create(DAT_IA_HANDLE ia_han
boolean_t sp_found;
u32 status = DAT_SUCCESS;
- ia_ptr = (struct dapl_ia *)ia_handle;
+ ia_ptr = (struct dapl_ia *)ia;
dapl_dbg_log(DAPL_DBG_TYPE_CM,
">>> dapl_rsp_free conn_qual: %x EP: %p\n",
- conn_qual, ep_handle);
+ conn_qual, ep);
- if (DAPL_BAD_HANDLE(ia_ptr, DAPL_MAGIC_IA)) {
+ if (!ia_ptr) {
status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_IA);
goto bail;
}
- if (DAPL_BAD_HANDLE(ep_handle, DAPL_MAGIC_EP)) {
+ if (!ep) {
status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_EP);
goto bail;
}
- if (DAPL_BAD_HANDLE(evd_handle, DAPL_MAGIC_EVD)) {
+ if (!evd) {
status = DAT_ERROR(DAT_INVALID_HANDLE,
DAT_INVALID_HANDLE_EVD_CR);
goto bail;
}
- if (rsp_handle == NULL) {
+ if (rsp == NULL) {
status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG5);
goto bail;
}
- ep_ptr = (struct dapl_ep *)ep_handle;
+ ep_ptr = (struct dapl_ep *)ep;
if (ep_ptr->param.ep_state != DAT_EP_STATE_UNCONNECTED) {
status = DAT_ERROR(DAT_INVALID_STATE,
dapl_ep_state_subtype(ep_ptr));
goto bail;
}
- evd_ptr = (struct dapl_evd *)evd_handle;
+ evd_ptr = (struct dapl_evd *)evd;
if (!(evd_ptr->evd_flags & DAT_EVD_CR_FLAG)) {
status = DAT_ERROR(DAT_INVALID_HANDLE,
DAT_INVALID_HANDLE_EVD_CR);
@@ -126,11 +126,11 @@ u32 dapl_rsp_create(DAT_IA_HANDLE ia_han
/*
* Fill out the RSP args
*/
- sp_ptr->ia_handle = ia_handle;
+ sp_ptr->ia = ia;
sp_ptr->conn_qual = conn_qual;
- sp_ptr->evd_handle = evd_handle;
+ sp_ptr->evd = evd;
sp_ptr->psp_flags = 0;
- sp_ptr->ep_handle = ep_handle;
+ sp_ptr->ep = ep;
/*
* Take a reference on the EVD handle
@@ -162,7 +162,7 @@ u32 dapl_rsp_create(DAT_IA_HANDLE ia_han
* the state to FREE, so we know the call failed.
*/
atomic_dec(&evd_ptr->evd_ref_count);
- sp_ptr->evd_handle = NULL;
+ sp_ptr->evd = NULL;
sp_ptr->state = DAPL_SP_STATE_FREE;
dapl_ia_unlink_sp(ia_ptr, sp_ptr);
dapl_sp_dealloc(sp_ptr);
@@ -178,7 +178,7 @@ u32 dapl_rsp_create(DAT_IA_HANDLE ia_han
/*
* Return handle to the user
*/
- *rsp_handle = (DAT_RSP_HANDLE)sp_ptr;
+ *rsp = (struct dat_sp *)sp_ptr;
bail:
return status;
@@ -190,7 +190,7 @@ bail:
* Destroy a specific instance of a Reserved Service Point.
*
* Input:
- * rsp_handle
+ * rsp
*
* Output:
* none
@@ -199,50 +199,49 @@ bail:
* DAT_SUCCESS
* DAT_INVALID_HANDLE
*/
-u32 dapl_rsp_free(DAT_RSP_HANDLE rsp_handle)
+u32 dapl_rsp_free(struct dat_sp *rsp)
{
struct dapl_ia *ia_ptr;
struct dapl_sp *sp_ptr;
struct dapl_ep *ep_ptr;
u32 status = DAT_SUCCESS;
- sp_ptr = (struct dapl_sp *)rsp_handle;
+ sp_ptr = (struct dapl_sp *)rsp;
/*
* Verify handle
*/
- dapl_dbg_log(DAPL_DBG_TYPE_CM, ">>> dapl_rsp_free %p\n", rsp_handle);
- if (DAPL_BAD_HANDLE(sp_ptr, DAPL_MAGIC_RSP)) {
+ dapl_dbg_log(DAPL_DBG_TYPE_CM, ">>> dapl_rsp_free %p\n", rsp);
+ if (!sp_ptr) {
status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_RSP);
goto bail;
}
- /* ia_ptr = (struct dapl_ia *)sp_ptr->header.owner_ia; */
- ia_ptr = sp_ptr->header.owner_ia;
+ ia_ptr = sp_ptr->common.owner_ia;
/*
* Remove the connection listener if there are no connections. If
* we defer removing the sp it becomes something of a zombie
* container until disconnection, after which it will be cleaned up.
*/
- spin_lock_irqsave(&sp_ptr->header.lock, sp_ptr->header.flags);
+ spin_lock_irqsave(&sp_ptr->common.lock, sp_ptr->common.flags);
/*
* Make sure we don't leave a dangling EP. If the state is still
* RESERVED then the RSP still owns it.
*/
- ep_ptr = (struct dapl_ep *)sp_ptr->ep_handle;
+ ep_ptr = (struct dapl_ep *)sp_ptr->ep;
if (ep_ptr != NULL && ep_ptr->param.ep_state == DAT_EP_STATE_RESERVED)
ep_ptr->param.ep_state = DAT_EP_STATE_UNCONNECTED;
- sp_ptr->ep_handle = NULL;
+ sp_ptr->ep = NULL;
/*
* Release reference on EVD. If an error was encountered in a previous
- * free the evd_handle will be NULL
+ * free the evd will be NULL
*/
- if (sp_ptr->evd_handle) {
- atomic_dec(&((struct dapl_evd *)sp_ptr->evd_handle)->
+ if (sp_ptr->evd) {
+ atomic_dec(&((struct dapl_evd *)sp_ptr->evd)->
evd_ref_count);
- sp_ptr->evd_handle = NULL;
+ sp_ptr->evd = NULL;
}
/*
@@ -258,8 +257,8 @@ u32 dapl_rsp_free(DAT_RSP_HANDLE rsp_han
/* This RSP has never been used. Clean it up */
sp_ptr->listening = FALSE;
sp_ptr->state = DAPL_SP_STATE_FREE;
- spin_unlock_irqrestore(&sp_ptr->header.lock,
- sp_ptr->header.flags);
+ spin_unlock_irqrestore(&sp_ptr->common.lock,
+ sp_ptr->common.flags);
status = dapl_ib_remove_conn_listener(ia_ptr, sp_ptr);
if (status != DAT_SUCCESS) {
@@ -275,20 +274,20 @@ u32 dapl_rsp_free(DAT_RSP_HANDLE rsp_han
* ServiceID again, which will reactivate it.
*/
sp_ptr->state = DAPL_SP_STATE_RSP_PENDING;
- spin_unlock_irqrestore(&sp_ptr->header.lock,
- sp_ptr->header.flags);
+ spin_unlock_irqrestore(&sp_ptr->common.lock,
+ sp_ptr->common.flags);
}
bail:
return status;
}
-u32 dapl_rsp_query(DAT_RSP_HANDLE rsp_handle, struct dat_rsp_param *rsp_param)
+u32 dapl_rsp_query(struct dat_sp *rsp, struct dat_rsp_param *rsp_param)
{
struct dapl_sp *sp_ptr;
u32 status;
- if (DAPL_BAD_HANDLE(rsp_handle, DAPL_MAGIC_RSP)) {
+ if (!rsp) {
status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_RSP);
goto bail;
}
@@ -298,15 +297,15 @@ u32 dapl_rsp_query(DAT_RSP_HANDLE rsp_ha
goto bail;
}
- sp_ptr = (struct dapl_sp *)rsp_handle;
+ sp_ptr = (struct dapl_sp *)rsp;
/*
* Fill in the RSP params
*/
- rsp_param->ia_handle = sp_ptr->ia_handle;
+ rsp_param->ia = sp_ptr->ia;
rsp_param->conn_qual = sp_ptr->conn_qual;
- rsp_param->evd_handle = sp_ptr->evd_handle;
- rsp_param->ep_handle = sp_ptr->ep_handle;
+ rsp_param->evd = sp_ptr->evd;
+ rsp_param->ep = sp_ptr->ep;
status = DAT_SUCCESS;
Index: linux-kernel/dat-provider/dapl_set_consumer_context.c
===================================================================
--- linux-kernel/dat-provider/dapl_set_consumer_context.c (revision 2564)
+++ linux-kernel/dat-provider/dapl_set_consumer_context.c (working copy)
@@ -1,74 +0,0 @@
-/*
- * 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
- * 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
- * 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
- * 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.
- */
-
-/*
- * $Id$
- */
-
-#include "dapl.h"
-
-/*
- * dapl_set_consumer_context
- *
- * Set a consumer context in the provided dat_handle
- *
- * Input:
- * dat_handle
- * context
- *
- * Output:
- * none
- *
- * Returns:
- * DAT_SUCCESS
- * DAT_INVALID_HANDLE
- */
-u32 dapl_set_consumer_context(DAT_HANDLE dat_handle, union dat_context context)
-{
- u32 dat_status = DAT_SUCCESS;
- struct dapl_header *header;
-
- header = (struct dapl_header *)dat_handle;
- if (((header) == NULL) ||
- ((unsigned long)(header) & 3) ||
- (header->magic != DAPL_MAGIC_IA &&
- header->magic != DAPL_MAGIC_EVD &&
- header->magic != DAPL_MAGIC_EP &&
- header->magic != DAPL_MAGIC_LMR &&
- header->magic != DAPL_MAGIC_RMR &&
- header->magic != DAPL_MAGIC_PZ &&
- header->magic != DAPL_MAGIC_PSP &&
- header->magic != DAPL_MAGIC_RSP &&
- header->magic != DAPL_MAGIC_CR)) {
- dat_status = DAT_ERROR(DAT_INVALID_HANDLE, 0);
- goto bail;
- }
- header->user_context = context;
-
- bail:
- return dat_status;
-}
Index: linux-kernel/dat-provider/dapl_ia_open.c
===================================================================
--- linux-kernel/dat-provider/dapl_ia_open.c (revision 2564)
+++ linux-kernel/dat-provider/dapl_ia_open.c (working copy)
@@ -45,18 +45,18 @@
* and calls this function.
*/
u32 dapl_ia_open(const char *name, int async_evd_qlen,
- DAT_EVD_HANDLE *async_evd_handle_ptr,
- DAT_IA_HANDLE *ia_handle_ptr)
+ struct dat_evd **async_evd_ptr,
+ struct dat_ia **ia_ptr)
{
u32 dat_status = DAT_SUCCESS;
struct dat_provider *provider;
struct dapl_hca *hca_ptr = NULL;
- struct dapl_ia *ia_ptr = NULL;
- struct dapl_evd *evd_ptr;
+ struct dapl_ia *ia = NULL;
+ struct dapl_evd *evd;
dapl_dbg_log(DAPL_DBG_TYPE_API,
"dapl_ia_open (%s, %d, %p, %p)\n",
- name, async_evd_qlen, async_evd_handle_ptr, ia_handle_ptr);
+ name, async_evd_qlen, async_evd_ptr, ia_ptr);
dat_status = dapl_provider_list_search(name, &provider);
if (DAT_SUCCESS != dat_status) {
@@ -64,25 +64,25 @@ u32 dapl_ia_open(const char *name, int a
goto bail;
}
- /* ia_handle_ptr and async_evd_handle_ptr cannot be NULL */
- if (ia_handle_ptr == NULL) {
+ /* ia_ptr and async_evd_ptr cannot be NULL */
+ if (ia_ptr == NULL) {
dat_status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG4);
goto bail;
}
- if (async_evd_handle_ptr == NULL) {
+ if (async_evd_ptr == NULL) {
dat_status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG3);
goto bail;
}
/* initialize the caller's param */
- *ia_handle_ptr = DAT_HANDLE_NULL;
+ *ia_ptr = NULL;
hca_ptr = (struct dapl_hca *)provider->extension;
atomic_inc(&hca_ptr->handle_ref_count);
/* Allocate and initialize ia structure */
- ia_ptr = dapl_ia_alloc(provider, hca_ptr);
- if (!ia_ptr) {
+ ia = dapl_ia_alloc(provider, hca_ptr);
+ if (!ia) {
atomic_dec(&hca_ptr->handle_ref_count);
dat_status =
DAT_ERROR(DAT_INSUFFICIENT_RESOURCES, DAT_RESOURCE_MEMORY);
@@ -93,17 +93,16 @@ u32 dapl_ia_open(const char *name, int a
* use the one passed in (if non-NULL) or create one
*/
- evd_ptr = (struct dapl_evd *)*async_evd_handle_ptr;
- if (evd_ptr) {
- if (DAPL_BAD_HANDLE(evd_ptr, DAPL_MAGIC_EVD) ||
- !(evd_ptr->evd_flags & DAT_EVD_ASYNC_FLAG)) {
+ evd = (struct dapl_evd *)*async_evd_ptr;
+ if (evd) {
+ if (!(evd->evd_flags & DAT_EVD_ASYNC_FLAG)) {
dat_status =
DAT_ERROR(DAT_INVALID_HANDLE,
DAT_INVALID_HANDLE_EVD_ASYNC);
goto bail;
}
- if (evd_ptr->header.owner_ia->hca_ptr->ib_hca_handle !=
+ if (evd->common.owner_ia->hca_ptr->ib_hca_handle !=
hca_ptr->ib_hca_handle) {
dat_status =
DAT_ERROR(DAT_INVALID_HANDLE,
@@ -111,8 +110,8 @@ u32 dapl_ia_open(const char *name, int a
goto bail;
}
- ia_ptr->cleanup_async_error_evd = FALSE;
- ia_ptr->async_error_evd = evd_ptr;
+ ia->cleanup_async_error_evd = FALSE;
+ ia->async_error_evd = evd;
} else {
/* Verify we have >0 length, and let the provider check the size */
if (async_evd_qlen <= 0) {
@@ -120,32 +119,33 @@ u32 dapl_ia_open(const char *name, int a
DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG2);
goto bail;
}
- dat_status = dapl_evd_internal_create(ia_ptr, async_evd_qlen,
+ dat_status = dapl_evd_internal_create(ia,
+ async_evd_qlen,
DAT_UPCALL_DISABLE, NULL,
DAT_EVD_ASYNC_FLAG,
- &evd_ptr);
+ &evd);
if (dat_status != DAT_SUCCESS)
goto bail;
- atomic_inc(&evd_ptr->evd_ref_count);
+ atomic_inc(&evd->evd_ref_count);
/* Register the handlers associated with the async EVD. */
- dat_status = dapl_ia_setup_callbacks(ia_ptr, evd_ptr);
+ dat_status = dapl_ia_setup_callbacks(ia, evd);
/* Assign the EVD so it gets cleaned up */
- ia_ptr->cleanup_async_error_evd = TRUE;
- ia_ptr->async_error_evd = evd_ptr;
+ ia->cleanup_async_error_evd = TRUE;
+ ia->async_error_evd = evd;
if (dat_status != DAT_SUCCESS)
goto bail;
}
dat_status = DAT_SUCCESS;
- *ia_handle_ptr = ia_ptr;
- *async_evd_handle_ptr = evd_ptr;
+ *ia_ptr = (struct dat_ia *)ia;
+ *async_evd_ptr = (struct dat_evd *)evd;
- bail:
- if (dat_status != DAT_SUCCESS) {
- if (ia_ptr)
- dapl_ia_close(ia_ptr, DAT_CLOSE_ABRUPT_FLAG);
- }
+bail:
+ if (dat_status != DAT_SUCCESS)
+ if (ia)
+ dapl_ia_close((struct dat_ia *)ia,
+ DAT_CLOSE_ABRUPT_FLAG);
dapl_dbg_log(DAPL_DBG_TYPE_RTN,
"dapl_ia_open () returns 0x%x\n", dat_status);
Index: linux-kernel/dat-provider/dapl_mr_util.c
===================================================================
--- linux-kernel/dat-provider/dapl_mr_util.c (revision 2564)
+++ linux-kernel/dat-provider/dapl_mr_util.c (working copy)
@@ -59,7 +59,7 @@ u64 dapl_mr_get_address(DAT_REGION_DESCR
case DAT_MEM_TYPE_VIRTUAL:
return (u64) (unsigned long) desc.for_va;
case DAT_MEM_TYPE_LMR:
- lmr = (struct dapl_lmr *)desc.for_lmr_handle;
+ lmr = (struct dapl_lmr *)desc.for_lmr;
/* Since this function is recoursive we cannot inline it */
return dapl_mr_get_address(lmr->param.region_desc,
Index: linux-kernel/dat-provider/dapl_evd.c
===================================================================
--- linux-kernel/dat-provider/dapl_evd.c (revision 2564)
+++ linux-kernel/dat-provider/dapl_evd.c (working copy)
@@ -51,7 +51,7 @@ static void dapl_evd_upcall_trigger(stru
}
for (;;) {
- status = dapl_evd_dequeue((DAT_EVD_HANDLE)evd, &event);
+ status = dapl_evd_dequeue((struct dat_evd *)evd, &event);
if (DAT_SUCCESS != status)
return;
@@ -157,17 +157,12 @@ struct dapl_evd *dapl_evd_alloc(struct d
/* zero the structure */
memset(evd, 0, sizeof *evd);
- /*
- * initialize the header
- */
- evd->header.provider = ia->header.provider;
- evd->header.magic = DAPL_MAGIC_EVD;
- evd->header.handle_type = DAT_HANDLE_TYPE_EVD;
- evd->header.owner_ia = ia;
- evd->header.user_context.as_64 = 0;
- evd->header.user_context.as_ptr = NULL;
- dapl_llist_init_entry(&evd->header.ia_list_entry);
- spin_lock_init(&evd->header.lock);
+ evd->evd.provider = ia->ia.provider;
+ evd->common.owner_ia = ia;
+ evd->common.user_context.as_64 = 0;
+ evd->common.user_context.as_ptr = NULL;
+ dapl_llist_init_entry(&evd->common.ia_list_entry);
+ spin_lock_init(&evd->common.lock);
/*
* Initialize the body
@@ -249,7 +244,6 @@ static u32 dapl_evd_dealloc(struct dapl_
u32 status = DAT_SUCCESS;
struct dapl_ia *ia;
- dapl_os_assert(evd->header.magic == DAPL_MAGIC_EVD);
dapl_os_assert(atomic_read(&evd->evd_ref_count) == 0);
/*
@@ -257,7 +251,7 @@ static u32 dapl_evd_dealloc(struct dapl_
* up from it.
*/
if (evd->cq != NULL) {
- ia = evd->header.owner_ia;
+ ia = evd->common.owner_ia;
status = dapl_ib_cq_free(evd);
if (status != DAT_SUCCESS) {
@@ -265,12 +259,6 @@ static u32 dapl_evd_dealloc(struct dapl_
}
}
- /*
- * We should now be safe to invalidate the EVD; reset the
- * magic to prevent reuse.
- */
- evd->header.magic = DAPL_MAGIC_INVALID;
-
/* If the ring buffer allocation failed, then the dapl_rbuf_destroy */
/* function will detect that the ring buffer's internal data (ex. base */
/* pointer) are invalid and will handle the situation appropriately */
@@ -314,14 +302,14 @@ static struct dat_event *dapl_evd_get_ev
struct dat_event *event;
if (evd->evd_producer_locking_needed) {
- spin_lock_irqsave(&evd->header.lock, evd->header.flags);
+ spin_lock_irqsave(&evd->common.lock, evd->common.flags);
}
event = (struct dat_event *) dapl_rbuf_remove(&evd->free_event_queue);
/* Release the lock if it was taken and the call failed. */
if (!event && evd->evd_producer_locking_needed)
- spin_unlock_irqrestore(&evd->header.lock, evd->header.flags);
+ spin_unlock_irqrestore(&evd->common.lock, evd->common.flags);
return event;
}
@@ -348,8 +336,8 @@ static void dapl_evd_post_event(struct d
dapl_os_assert(evd->evd_state == DAPL_EVD_STATE_OPEN);
if (evd->evd_producer_locking_needed)
- spin_unlock_irqrestore(&evd->header.lock,
- evd->header.flags);
+ spin_unlock_irqrestore(&evd->common.lock,
+ evd->common.flags);
dapl_evd_upcall_trigger(evd);
}
@@ -363,12 +351,12 @@ static void dapl_evd_format_overflow_eve
{
struct dapl_ia *ia;
- ia = evd->header.owner_ia;
+ ia = evd->common.owner_ia;
- event->evd_handle = (DAT_EVD_HANDLE) evd;
+ event->evd = (struct dat_evd *)evd;
event->event_number = DAT_ASYNC_ERROR_EVD_OVERFLOW;
event->event_data.asynch_error_event_data.dat_handle =
- (DAT_HANDLE) ia;
+ (struct dat_ia *)ia;
}
/*
@@ -409,9 +397,9 @@ static struct dat_event *dapl_evd_get_an
event = dapl_evd_get_event(evd);
if (!event)
dapl_evd_post_overflow_event(
- evd->header.owner_ia->async_error_evd, evd);
+ evd->common.owner_ia->async_error_evd, evd);
else {
- event->evd_handle = (DAT_EVD_HANDLE) evd;
+ event->evd = (struct dat_evd *)evd;
event->event_number = evno;
}
@@ -419,10 +407,10 @@ static struct dat_event *dapl_evd_get_an
}
u32 dapl_evd_post_cr_arrival_event(struct dapl_evd *evd,
- DAT_SP_HANDLE sp_handle,
+ struct dat_sp *sp,
struct sockaddr *ia_address,
DAT_CONN_QUAL conn_qual,
- DAT_CR_HANDLE cr_handle)
+ struct dat_cr *cr)
{
struct dat_event *event;
event = dapl_evd_get_and_init_event(evd, DAT_CONNECTION_REQUEST_EVENT);
@@ -436,11 +424,11 @@ u32 dapl_evd_post_cr_arrival_event(struc
return DAT_ERROR(DAT_INSUFFICIENT_RESOURCES,
DAT_RESOURCE_MEMORY);
- event->event_data.cr_arrival_event_data.sp_handle = sp_handle;
+ event->event_data.cr_arrival_event_data.sp = sp;
event->event_data.cr_arrival_event_data.local_ia_address_ptr =
ia_address;
event->event_data.cr_arrival_event_data.conn_qual = conn_qual;
- event->event_data.cr_arrival_event_data.cr_handle = cr_handle;
+ event->event_data.cr_arrival_event_data.cr = cr;
dapl_evd_post_event(evd, event);
@@ -449,7 +437,7 @@ u32 dapl_evd_post_cr_arrival_event(struc
u32 dapl_evd_post_connection_event(struct dapl_evd *evd,
enum dat_event_number event_number,
- DAT_EP_HANDLE ep_handle,
+ struct dat_ep *ep,
int private_data_size,
void *private_data)
{
@@ -466,7 +454,7 @@ u32 dapl_evd_post_connection_event(struc
DAT_RESOURCE_MEMORY);
}
- event->event_data.connect_event_data.ep_handle = ep_handle;
+ event->event_data.connect_event_data.ep = ep;
event->event_data.connect_event_data.private_data_size =
private_data_size;
event->event_data.connect_event_data.private_data = private_data;
@@ -492,7 +480,7 @@ static u32 dapl_evd_post_async_error_eve
return DAT_ERROR(DAT_INSUFFICIENT_RESOURCES,
DAT_RESOURCE_MEMORY);
- event->event_data.asynch_error_event_data.dat_handle = (DAT_HANDLE) ia;
+ event->event_data.asynch_error_event_data.dat_handle = ia;
dapl_evd_post_event(evd, event);
@@ -539,12 +527,8 @@ static void dapl_evd_wc_to_event(struct
ep = cookie->ep;
dapl_os_assert(NULL != ep);
- if (ep->header.magic != DAPL_MAGIC_EP) {
- /* ep may have been freed, just return */
- return;
- }
- event->evd_handle = (DAT_EVD_HANDLE) evd;
+ event->evd = (struct dat_evd *)evd;
switch (cookie->type) {
case DAPL_COOKIE_TYPE_DTO:
@@ -563,7 +547,7 @@ static void dapl_evd_wc_to_event(struct
}
event->event_number = DAT_DTO_COMPLETION_EVENT;
- event_data->ep_handle = cookie->ep;
+ event_data->ep = (struct dat_ep *)cookie->ep;
event_data->user_cookie = cookie->val.dto.cookie;
event_data->status = dto_status;
@@ -606,7 +590,7 @@ static void dapl_evd_wc_to_event(struct
event->event_number = DAT_RMR_BIND_COMPLETION_EVENT;
event_data = &event->event_data.rmr_completion_event_data;
- event_data->rmr_handle = cookie->val.rmr.rmr;
+ event_data->rmr = (struct dat_rmr *)cookie->val.rmr.rmr;
event_data->user_cookie = cookie->val.rmr.cookie;
if (dto_status == DAT_DTO_SUCCESS) {
@@ -654,7 +638,7 @@ void dapl_evd_qp_async_error_callback(st
u32 status;
ep = (struct dapl_ep *)context;
- async_evd = (struct dapl_evd *)ep->header.owner_ia->async_error_evd;
+ async_evd = (struct dapl_evd *)ep->common.owner_ia->async_error_evd;
dapl_dbg_log(DAPL_DBG_TYPE_CALLBACK | DAPL_DBG_TYPE_EXCEPTION,
"dapl_evd_qp_async_error_callback: "
@@ -679,7 +663,7 @@ void dapl_evd_qp_async_error_callback(st
* we are not interested in.
*/
(void)dapl_evd_post_async_error_event(async_evd, async_event,
- async_evd->header.owner_ia);
+ async_evd->common.owner_ia);
}
dapl_dbg_log(DAPL_DBG_TYPE_CALLBACK | DAPL_DBG_TYPE_EXCEPTION,
"dapl_evd_qp_async_error_callback () returns\n");
@@ -698,11 +682,11 @@ void dapl_evd_cq_async_error_callback(st
if (!evd)
dapl_os_panic("NULL == context\n");
- async_evd = evd->header.owner_ia->async_error_evd;
+ async_evd = evd->common.owner_ia->async_error_evd;
status = dapl_evd_post_async_error_event(async_evd,
DAT_ASYNC_ERROR_EVD_OVERFLOW,
- async_evd->header.owner_ia);
+ async_evd->common.owner_ia);
if (status != DAT_SUCCESS) {
dapl_os_panic("async EVD overflow\n");
@@ -738,7 +722,7 @@ void dapl_evd_un_async_error_callback(st
*/
dapl_evd_post_async_error_event(async_evd,
async_event,
- async_evd->header.owner_ia);
+ async_evd->common.owner_ia);
}
dapl_dbg_log(DAPL_DBG_TYPE_CALLBACK | DAPL_DBG_TYPE_EXCEPTION,
"dapl_evd_un_async_error_callback () returns\n");
@@ -764,14 +748,14 @@ void dapl_evd_connection_callback(struct
"ep: %p\n",
cm_handle, event, ep);
- evd = (struct dapl_evd *)ep->param.connect_evd_handle;
+ evd = (struct dapl_evd *)ep->param.connect_evd;
private_data_size = 0;
/*
* All operations effect the EP, so lock it once and unlock
* when necessary
*/
- spin_lock_irqsave(&ep->header.lock, ep->header.flags);
+ spin_lock_irqsave(&ep->common.lock, ep->common.flags);
switch (event) {
case DAT_CONNECTION_EVENT_ESTABLISHED:
@@ -784,13 +768,13 @@ void dapl_evd_connection_callback(struct
/* If someone pulled the plug on the connection, just
* exit
*/
- spin_unlock_irqrestore(&ep->header.lock,
- ep->header.flags);
+ spin_unlock_irqrestore(&ep->common.lock,
+ ep->common.flags);
status = DAT_SUCCESS;
break;
}
ep->param.ep_state = DAT_EP_STATE_CONNECTED;
- ep->cm_handle = cm_handle;
+ ep->cm = cm_handle;
if (private_data == NULL) {
private_data_size = 0;
} else {
@@ -798,7 +782,7 @@ void dapl_evd_connection_callback(struct
memcpy(ep->private_data, private_data,
private_data_size);
}
- spin_unlock_irqrestore(&ep->header.lock, ep->header.flags);
+ spin_unlock_irqrestore(&ep->common.lock, ep->common.flags);
break;
}
@@ -811,8 +795,8 @@ void dapl_evd_connection_callback(struct
*/
ep->param.ep_state = DAT_EP_STATE_DISCONNECTED;
dapl_ib_disconnect_clean(ep, TRUE);
- spin_unlock_irqrestore(&ep->header.lock,
- ep->header.flags);
+ spin_unlock_irqrestore(&ep->common.lock,
+ ep->common.flags);
break;
}
@@ -820,7 +804,7 @@ void dapl_evd_connection_callback(struct
{
ep->param.ep_state = DAT_EP_STATE_DISCONNECTED;
dapl_ib_disconnect_clean(ep, TRUE);
- spin_unlock_irqrestore(&ep->header.lock, ep->header.flags);
+ spin_unlock_irqrestore(&ep->common.lock, ep->common.flags);
break;
}
@@ -828,7 +812,7 @@ void dapl_evd_connection_callback(struct
{
ep->param.ep_state = DAT_EP_STATE_DISCONNECTED;
dapl_ib_disconnect_clean(ep, TRUE);
- spin_unlock_irqrestore(&ep->header.lock, ep->header.flags);
+ spin_unlock_irqrestore(&ep->common.lock, ep->common.flags);
break;
}
@@ -836,7 +820,7 @@ void dapl_evd_connection_callback(struct
{
ep->param.ep_state = DAT_EP_STATE_DISCONNECTED;
dapl_ib_disconnect_clean(ep, TRUE);
- spin_unlock_irqrestore(&ep->header.lock, ep->header.flags);
+ spin_unlock_irqrestore(&ep->common.lock, ep->common.flags);
break;
}
@@ -844,14 +828,14 @@ void dapl_evd_connection_callback(struct
{
ep->param.ep_state = DAT_EP_STATE_DISCONNECTED;
dapl_ib_disconnect_clean(ep, FALSE);
- spin_unlock_irqrestore(&ep->header.lock, ep->header.flags);
+ spin_unlock_irqrestore(&ep->common.lock, ep->common.flags);
break;
}
case DAT_CONNECTION_REQUEST_EVENT:
default:
{
- spin_unlock_irqrestore(&ep->header.lock, ep->header.flags);
+ spin_unlock_irqrestore(&ep->common.lock, ep->common.flags);
evd = NULL;
dapl_os_assert(0); /* shouldn't happen */
@@ -865,7 +849,7 @@ void dapl_evd_connection_callback(struct
*/
if (evd != NULL) {
status = dapl_evd_post_connection_event(evd, event,
- (DAT_HANDLE) ep,
+ (struct dat_ep *)ep,
private_data_size, /* 0 except on CONNECT */
ep->private_data);
@@ -877,10 +861,10 @@ void dapl_evd_connection_callback(struct
* expect a callback on an ABRUPT disconnect.
*/
dapl_ib_disconnect(ep, DAT_CLOSE_ABRUPT_FLAG);
- spin_lock_irqsave(&ep->header.lock, ep->header.flags);
+ spin_lock_irqsave(&ep->common.lock, ep->common.flags);
ep->param.ep_state = DAT_EP_STATE_DISCONNECTED;
- spin_unlock_irqrestore(&ep->header.lock,
- ep->header.flags);
+ spin_unlock_irqrestore(&ep->common.lock,
+ ep->common.flags);
}
}
@@ -901,7 +885,6 @@ void dapl_evd_dto_callback(struct ib_cq
evd = (struct dapl_evd *)user_context;
dapl_os_assert(evd->cq == cq);
- dapl_os_assert(evd->header.magic == DAPL_MAGIC_EVD);
/* Read once. */
state = *(volatile DAPL_EVD_STATE *)&evd->evd_state;
@@ -927,9 +910,9 @@ void dapl_evd_dto_callback(struct ib_cq
status = dapl_ib_completion_notify(evd);
if (DAT_SUCCESS != status)
(void)dapl_evd_post_async_error_event(
- evd->header.owner_ia->async_error_evd,
+ evd->common.owner_ia->async_error_evd,
DAT_ASYNC_ERROR_PROVIDER_INTERNAL_ERROR,
- evd->header.owner_ia);
+ evd->common.owner_ia);
dapl_evd_upcall_trigger(evd);
}
@@ -1008,10 +991,10 @@ bail:
return status;
}
-u32 dapl_evd_kcreate(DAT_IA_HANDLE ia_handle, int min_qlen,
+u32 dapl_evd_kcreate(struct dat_ia *ia_handle, int min_qlen,
enum dat_upcall_policy upcall_policy,
const struct dat_upcall_object *upcall,
- enum dat_evd_flags flags, DAT_EVD_HANDLE *evd_handle)
+ enum dat_evd_flags flags, struct dat_evd **evd_handle)
{
struct dapl_ia *ia;
struct dapl_evd *evd;
@@ -1025,7 +1008,7 @@ u32 dapl_evd_kcreate(DAT_IA_HANDLE ia_ha
evd = NULL;
*evd_handle = NULL;
- if (DAPL_BAD_HANDLE(ia_handle, DAPL_MAGIC_IA)) {
+ if (!ia_handle) {
status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_IA);
goto bail;
}
@@ -1053,17 +1036,17 @@ u32 dapl_evd_kcreate(DAT_IA_HANDLE ia_ha
if (status != DAT_SUCCESS)
goto bail;
- *evd_handle = (DAT_EVD_HANDLE) evd;
+ *evd_handle = (struct dat_evd *)evd;
bail:
if (status != DAT_SUCCESS)
if (evd)
- dapl_evd_free(evd);
+ dapl_evd_free((struct dat_evd *)evd);
return status;
}
-u32 dapl_evd_free(DAT_EVD_HANDLE evd_handle)
+u32 dapl_evd_free(struct dat_evd *evd_handle)
{
struct dapl_evd *evd;
u32 status = DAT_SUCCESS;
@@ -1072,7 +1055,7 @@ u32 dapl_evd_free(DAT_EVD_HANDLE evd_han
evd = (struct dapl_evd *)evd_handle;
- if (DAPL_BAD_HANDLE(evd_handle, DAPL_MAGIC_EVD)) {
+ if (!evd_handle) {
status = DAT_ERROR(DAT_INVALID_HANDLE, 0);
goto bail;
}
@@ -1083,11 +1066,11 @@ u32 dapl_evd_free(DAT_EVD_HANDLE evd_han
goto bail;
}
- dapl_ia_unlink_evd(evd->header.owner_ia, evd);
+ dapl_ia_unlink_evd(evd->common.owner_ia, evd);
status = dapl_evd_dealloc(evd);
if (status != DAT_SUCCESS) {
- dapl_ia_link_evd(evd->header.owner_ia, evd);
+ dapl_ia_link_evd(evd->common.owner_ia, evd);
}
bail:
@@ -1097,7 +1080,7 @@ bail:
return status;
}
-u32 dapl_evd_kquery(DAT_EVD_HANDLE evd_handle, struct dat_evd_param *evd_param)
+u32 dapl_evd_kquery(struct dat_evd *evd_handle, struct dat_evd_param *evd_param)
{
struct dapl_evd *evd;
u32 status = DAT_SUCCESS;
@@ -1108,11 +1091,11 @@ u32 dapl_evd_kquery(DAT_EVD_HANDLE evd_h
}
/* Note: the spec. allows for events to be directed to a NULL EVD */
- /* with handle of type DAT_HANDLE_NULL. See 6.3.1 */
- if (DAT_HANDLE_NULL == evd_handle) {
+ /* with handle of type NULL. See 6.3.1 */
+ if (NULL == evd_handle) {
memset(evd_param, 0, sizeof *evd_param);
} else {
- if (DAPL_BAD_HANDLE(evd_handle, DAPL_MAGIC_EVD)) {
+ if (!evd_handle) {
status = DAT_ERROR(DAT_INVALID_HANDLE, 0);
goto bail;
}
@@ -1128,7 +1111,7 @@ u32 dapl_evd_kquery(DAT_EVD_HANDLE evd_h
* about reading the state variable atomically when we add
* in waitable/unwaitable.
*/
- evd_param->ia_handle = evd->header.owner_ia;
+ evd_param->ia = (struct dat_ia *)evd->common.owner_ia;
evd_param->evd_qlen = evd->qlen;
evd_param->evd_flags = evd->evd_flags;
evd_param->upcall_policy = evd->upcall_policy;
@@ -1139,7 +1122,7 @@ bail:
return status;
}
-u32 dapl_evd_modify_upcall(DAT_EVD_HANDLE evd_handle,
+u32 dapl_evd_modify_upcall(struct dat_evd *evd_handle,
enum dat_upcall_policy upcall_policy,
const struct dat_upcall_object *upcall)
{
@@ -1150,7 +1133,7 @@ u32 dapl_evd_modify_upcall(DAT_EVD_HANDL
evd = (struct dapl_evd *)evd_handle;
- if (DAPL_BAD_HANDLE(evd_handle, DAPL_MAGIC_EVD)) {
+ if (!evd_handle) {
status = DAT_ERROR(DAT_INVALID_HANDLE, 0);
goto bail;
}
@@ -1162,14 +1145,14 @@ bail:
return status;
}
-u32 dapl_evd_post_se(DAT_EVD_HANDLE evd_handle, const struct dat_event *event)
+u32 dapl_evd_post_se(struct dat_evd *evd_handle, const struct dat_event *event)
{
struct dapl_evd *evd;
u32 status = DAT_SUCCESS;
evd = (struct dapl_evd *)evd_handle;
- if (DAPL_BAD_HANDLE(evd_handle, DAPL_MAGIC_EVD)) {
+ if (!evd_handle) {
status = DAT_ERROR(DAT_INVALID_HANDLE, 0);
goto bail;
}
@@ -1196,7 +1179,7 @@ u32 dapl_evd_post_se(DAT_EVD_HANDLE evd_
return status;
}
-u32 dapl_evd_dequeue(DAT_EVD_HANDLE evd_handle, struct dat_event *event)
+u32 dapl_evd_dequeue(struct dat_evd *evd_handle, struct dat_event *event)
{
struct dapl_evd *evd;
struct dat_event *local_event;
@@ -1207,7 +1190,7 @@ u32 dapl_evd_dequeue(DAT_EVD_HANDLE evd_
evd = (struct dapl_evd *)evd_handle;
- if (DAPL_BAD_HANDLE(evd_handle, DAPL_MAGIC_EVD)) {
+ if (!evd_handle) {
status = DAT_ERROR(DAT_INVALID_HANDLE, 0);
goto bail;
}
@@ -1222,7 +1205,7 @@ u32 dapl_evd_dequeue(DAT_EVD_HANDLE evd_
* restricts us from having multiple threads in CQ poll, and the
* DAT API allows multiple threads in dat_evd_dequeue()
*/
- spin_lock_irqsave(&evd->header.lock, evd->header.flags);
+ spin_lock_irqsave(&evd->common.lock, evd->common.flags);
/*
* Make sure there are no other waiters and the evd is active.
@@ -1230,7 +1213,7 @@ u32 dapl_evd_dequeue(DAT_EVD_HANDLE evd_
*/
if (evd->evd_state != DAPL_EVD_STATE_OPEN ||
evd->catastrophic_overflow) {
- spin_unlock_irqrestore(&evd->header.lock, evd->header.flags);
+ spin_unlock_irqrestore(&evd->common.lock, evd->common.flags);
status = DAT_ERROR(DAT_INVALID_STATE, 0);
goto bail;
}
@@ -1249,7 +1232,7 @@ u32 dapl_evd_dequeue(DAT_EVD_HANDLE evd_
status = DAT_ERROR(DAT_QUEUE_EMPTY, 0);
}
- spin_unlock_irqrestore(&evd->header.lock, evd->header.flags);
+ spin_unlock_irqrestore(&evd->common.lock, evd->common.flags);
bail:
dapl_dbg_log(DAPL_DBG_TYPE_RTN,
"dapl_evd_dequeue () returns 0x%x\n", status);
@@ -1257,7 +1240,7 @@ u32 dapl_evd_dequeue(DAT_EVD_HANDLE evd_
return status;
}
-u32 dapl_evd_resize(DAT_EVD_HANDLE evd_handle, int evd_qlen)
+u32 dapl_evd_resize(struct dat_evd *evd_handle, int evd_qlen)
{
struct dapl_ia *ia;
struct dapl_evd *evd;
@@ -1267,13 +1250,13 @@ u32 dapl_evd_resize(DAT_EVD_HANDLE evd_h
dapl_dbg_log(DAPL_DBG_TYPE_API, "dapl_evd_resize (%p, %d)\n",
evd_handle, evd_qlen);
- if (DAPL_BAD_HANDLE(evd_handle, DAPL_MAGIC_EVD)) {
+ if (!evd_handle) {
status = DAT_ERROR(DAT_INVALID_HANDLE, 0);
goto bail;
}
evd = (struct dapl_evd *)evd_handle;
- ia = evd->header.owner_ia;
+ ia = evd->common.owner_ia;
if (evd_qlen == evd->qlen) {
status = DAT_SUCCESS;
@@ -1285,7 +1268,7 @@ u32 dapl_evd_resize(DAT_EVD_HANDLE evd_h
goto bail;
}
- spin_lock_irqsave(&evd->header.lock, evd->header.flags);
+ spin_lock_irqsave(&evd->common.lock, evd->common.flags);
pend_cnt = dapl_rbuf_count(&evd->pending_event_queue);
if (pend_cnt > evd_qlen) {
@@ -1302,6 +1285,6 @@ u32 dapl_evd_resize(DAT_EVD_HANDLE evd_h
goto bail;
bail:
- spin_unlock_irqrestore(&evd->header.lock, evd->header.flags);
+ spin_unlock_irqrestore(&evd->common.lock, evd->common.flags);
return status;
}
Index: linux-kernel/dat-provider/dapl_ia_query.c
===================================================================
--- linux-kernel/dat-provider/dapl_ia_query.c (revision 2564)
+++ linux-kernel/dat-provider/dapl_ia_query.c (working copy)
@@ -38,12 +38,12 @@
* Provide the consumer with Interface Adapter and Provider parameters.
*
* Input:
- * ia_handle
+ * ia
* ia_mask
* provider_mask
*
* Output:
- * async_evd_handle
+ * async_evd
* ia_parameters
* provider_parameters
*
@@ -51,7 +51,7 @@
* DAT_SUCCESS
* DAT_INVALID_PARAMETER
*/
-u32 dapl_ia_query(DAT_IA_HANDLE ia_handle, DAT_EVD_HANDLE *async_evd_handle,
+u32 dapl_ia_query(struct dat_ia *ia, struct dat_evd **async_evd,
struct dat_ia_attr *ia_attr,
struct dat_provider_attr *provider_attr)
{
@@ -66,21 +66,21 @@ u32 dapl_ia_query(DAT_IA_HANDLE ia_handl
dapl_dbg_log(DAPL_DBG_TYPE_API,
"dapl_ia_query (%p, %p, %p, %p)\n",
- ia_handle,
- async_evd_handle,
+ ia,
+ async_evd,
ia_attr,
provider_attr);
- ia_ptr = (struct dapl_ia *)ia_handle;
+ ia_ptr = (struct dapl_ia *)ia;
- if (DAPL_BAD_HANDLE(ia_ptr, DAPL_MAGIC_IA)) {
+ if (!ia_ptr) {
dat_status =
DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_IA);
goto bail;
}
- if (NULL != async_evd_handle) {
- *async_evd_handle = ia_ptr->async_error_evd;
+ if (NULL != async_evd) {
+ *async_evd = (struct dat_evd *)ia_ptr->async_error_evd;
}
if (NULL != ia_attr)
@@ -88,7 +88,7 @@ u32 dapl_ia_query(DAT_IA_HANDLE ia_handl
if (NULL != provider_attr) {
strncpy(provider_attr->provider_name,
- ia_ptr->header.provider->device_name,
+ ia_ptr->ia.provider->device_name,
DAT_NAME_MAX_LENGTH);
provider_attr->provider_version_major = DAPL_PROVIDER_MAJOR;
provider_attr->provider_version_minor = DAPL_PROVIDER_MINOR;
Index: linux-kernel/dat-provider/dapl_sp_util.c
===================================================================
--- linux-kernel/dat-provider/dapl_sp_util.c (revision 2564)
+++ linux-kernel/dat-provider/dapl_sp_util.c (working copy)
@@ -65,22 +65,16 @@ struct dapl_sp *dapl_sp_alloc(struct dap
/* zero the structure */
memset(sp_ptr, 0, sizeof *sp_ptr);
- /*
- * initialize the header
- */
- sp_ptr->header.provider = ia_ptr->header.provider;
- if (is_psp) {
- sp_ptr->header.magic = DAPL_MAGIC_PSP;
- sp_ptr->header.handle_type = DAT_HANDLE_TYPE_PSP;
- } else {
- sp_ptr->header.magic = DAPL_MAGIC_RSP;
- sp_ptr->header.handle_type = DAT_HANDLE_TYPE_RSP;
- }
- sp_ptr->header.owner_ia = ia_ptr;
- sp_ptr->header.user_context.as_64 = 0;
- sp_ptr->header.user_context.as_ptr = NULL;
- dapl_llist_init_entry(&sp_ptr->header.ia_list_entry);
- spin_lock_init(&sp_ptr->header.lock);
+ sp_ptr->sp.provider = ia_ptr->ia.provider;
+ if (is_psp)
+ sp_ptr->sp.type = DAT_SP_TYPE_PSP;
+ else
+ sp_ptr->sp.type = DAT_SP_TYPE_RSP;
+ sp_ptr->common.owner_ia = ia_ptr;
+ sp_ptr->common.user_context.as_64 = 0;
+ sp_ptr->common.user_context.as_ptr = NULL;
+ dapl_llist_init_entry(&sp_ptr->common.ia_list_entry);
+ spin_lock_init(&sp_ptr->common.lock);
/*
* Initialize the Body (set to NULL above)
@@ -107,12 +101,8 @@ struct dapl_sp *dapl_sp_alloc(struct dap
*/
void dapl_sp_dealloc(struct dapl_sp *sp_ptr)
{
- dapl_os_assert(sp_ptr->header.magic == DAPL_MAGIC_PSP ||
- sp_ptr->header.magic == DAPL_MAGIC_RSP);
dapl_os_assert(dapl_llist_is_empty(&sp_ptr->cr_list_head));
- sp_ptr->header.magic = DAPL_MAGIC_INVALID; /* reset magic to prevent reuse */
-
kfree(sp_ptr);
}
@@ -134,11 +124,11 @@ void dapl_sp_dealloc(struct dapl_sp *sp_
*/
void dapl_sp_link_cr(struct dapl_sp *sp_ptr, struct dapl_cr *cr_ptr)
{
- spin_lock_irqsave(&sp_ptr->header.lock, sp_ptr->header.flags);
+ spin_lock_irqsave(&sp_ptr->common.lock, sp_ptr->common.flags);
dapl_llist_add_tail(&sp_ptr->cr_list_head,
- &cr_ptr->header.ia_list_entry, cr_ptr);
+ &cr_ptr->common.ia_list_entry, cr_ptr);
sp_ptr->cr_list_count++;
- spin_unlock_irqrestore(&sp_ptr->header.lock, sp_ptr->header.flags);
+ spin_unlock_irqrestore(&sp_ptr->common.lock, sp_ptr->common.flags);
}
/*
@@ -174,7 +164,7 @@ struct dapl_cr *dapl_sp_search_cr(struct
if (cr_ptr->ib_cm_handle == ib_cm_handle)
return cr_ptr;
- cr_ptr = cr_ptr->header.ia_list_entry.flink->data;
+ cr_ptr = cr_ptr->common.ia_list_entry.flink->data;
} while ((void *)cr_ptr != (void *)sp_ptr->cr_list_head->data);
return NULL;
@@ -208,7 +198,7 @@ void dapl_sp_remove_cr(struct dapl_sp *s
}
dapl_llist_remove_entry(&sp_ptr->cr_list_head,
- &cr_ptr->header.ia_list_entry);
+ &cr_ptr->common.ia_list_entry);
sp_ptr->cr_list_count--;
}
@@ -238,13 +228,13 @@ void dapl_sp_remove_ep(struct dapl_ep *e
if (cr_ptr != NULL) {
sp_ptr = cr_ptr->sp_ptr;
- spin_lock_irqsave(&sp_ptr->header.lock, sp_ptr->header.flags);
+ spin_lock_irqsave(&sp_ptr->common.lock, sp_ptr->common.flags);
/* Remove the CR from the queue */
dapl_sp_remove_cr(sp_ptr, cr_ptr);
- spin_unlock_irqrestore(&sp_ptr->header.lock,
- sp_ptr->header.flags);
+ spin_unlock_irqrestore(&sp_ptr->common.lock,
+ sp_ptr->common.flags);
/* free memory outside of the lock */
dapl_cr_free(cr_ptr);
Index: linux-kernel/dat-provider/dapl_evd.h
===================================================================
--- linux-kernel/dat-provider/dapl_evd.h (revision 2564)
+++ linux-kernel/dat-provider/dapl_evd.h (working copy)
@@ -60,14 +60,14 @@ extern void dapl_evd_un_async_error_call
*/
extern u32 dapl_evd_post_cr_arrival_event(struct dapl_evd *evd,
- DAT_SP_HANDLE sp_handle,
+ struct dat_sp *sp_handle,
struct sockaddr *ia_address,
DAT_CONN_QUAL conn_qual,
- DAT_CR_HANDLE cr_handle);
+ struct dat_cr *cr_handle);
extern u32 dapl_evd_post_connection_event(struct dapl_evd *evd,
enum dat_event_number event_number,
- DAT_EP_HANDLE ep_handle,
+ struct dat_ep *ep_handle,
int private_data_size,
void *private_data);
Index: linux-kernel/dat-provider/dapl.h
===================================================================
--- linux-kernel/dat-provider/dapl.h (revision 2564)
+++ linux-kernel/dat-provider/dapl.h (working copy)
@@ -46,23 +46,6 @@
* *
*********************************************************************/
-typedef enum dapl_magic {
- /* magic number values for verification & debug */
- DAPL_MAGIC_IA = 0xCafeF00d,
- DAPL_MAGIC_EVD = 0xFeedFace,
- DAPL_MAGIC_EP = 0xDeadBabe,
- DAPL_MAGIC_LMR = 0xBeefCafe,
- DAPL_MAGIC_RMR = 0xABadCafe,
- DAPL_MAGIC_PZ = 0xDeafBeef,
- DAPL_MAGIC_PSP = 0xBeadeD0c,
- DAPL_MAGIC_RSP = 0xFab4Feed,
- DAPL_MAGIC_SRQ = 0xC001Babe,
- DAPL_MAGIC_CR = 0xBe12Cee1,
- DAPL_MAGIC_CR_DESTROYED = 0xB12bDead,
- DAPL_MAGIC_CNO = 0xDeadF00d,
- DAPL_MAGIC_INVALID = 0xFFFFFFFF
-} DAPL_MAGIC;
-
typedef enum dapl_evd_state {
DAPL_EVD_STATE_OPEN,
DAPL_EVD_STATE_DEAD = 0xDEAD
@@ -92,23 +75,6 @@ typedef enum dapl_evd_completion {
/*********************************************************************
* *
- * Macros *
- * *
- *********************************************************************/
-
-/*
- * Simple macro to verify a handle is bad. Conditions:
- * - pointer is NULL
- * - pointer is not word aligned
- * - pointer's magic number is wrong
- */
-#define DAPL_BAD_HANDLE(h, magicNum) ( \
- ((h) == NULL) || \
- ((unsigned long)(h) & 3) || \
- (((struct dapl_header *)(h))->magic != (magicNum)))
-
-/*********************************************************************
- * *
* Typedefs *
* *
*********************************************************************/
@@ -170,11 +136,8 @@ struct dapl_hca {
struct dat_ep_attr ep_attr;
};
-/* DAPL Objects always have the following header */
-struct dapl_header {
- struct dat_provider *provider; /* required by DAT - must be first */
- DAPL_MAGIC magic; /* magic number for verification */
- enum dat_handle_type handle_type;
+/* DAPL Objects always have the following items */
+struct dapl_common {
struct dapl_ia *owner_ia;
struct dapl_llist_entry ia_list_entry;
union dat_context user_context; /* user context - opaque to DAPL */
@@ -182,9 +145,9 @@ struct dapl_header {
unsigned long flags; /* saved lock flag values */
};
-/* struct dapl_ia maps to DAT_IA_HANDLE */
struct dapl_ia {
- struct dapl_header header; /* WARNING: must be first */
+ struct dat_ia ia;
+ struct dapl_common common;
struct dapl_hca *hca_ptr;
struct dapl_evd *async_error_evd;
boolean_t cleanup_async_error_evd;
@@ -200,9 +163,9 @@ struct dapl_ia {
struct dapl_llist_entry *srq_list_head; /* SRQ queue */
};
-/* struct dapl_evd maps to DAT_EVD_HANDLE */
struct dapl_evd {
- struct dapl_header header; /* WARNING: must be first */
+ struct dat_evd evd;
+ struct dapl_common common;
DAPL_EVD_STATE evd_state;
enum dat_evd_flags evd_flags;
@@ -230,9 +193,9 @@ struct dapl_evd {
struct dat_upcall_object upcall;
};
-/* struct dapl_ep maps to DAT_EP_HANDLE */
struct dapl_ep {
- struct dapl_header header;
+ struct dat_ep ep;
+ struct dapl_common common;
/* What the DAT Consumer asked for */
struct dat_ep_param param;
@@ -241,7 +204,7 @@ struct dapl_ep {
enum ib_qp_state qp_state;
/* communications manager handle */
- struct dapl_cm_id *cm_handle;
+ struct dapl_cm_id *cm;
/* store the remote IA address here, reference from the param
* struct which only has a pointer, no storage
*/
@@ -267,33 +230,33 @@ struct dapl_ep {
int send_iov_num;
};
-/* struct dapl_srq maps to DAT_SRQ_HANDLE */
struct dapl_srq {
- struct dapl_header header; /* WARNING: must be first */
+ struct dat_srq srq;
+ struct dapl_common common;
struct dat_srq_param param;
atomic_t srq_ref_count;
struct dapl_cookie_buffer recv_buffer;
atomic_t recv_count;
};
-/* struct dapl_pz maps to DAT_PZ_HANDLE */
struct dapl_pz {
- struct dapl_header header; /* WARNING: must be first */
+ struct dat_pz pz;
+ struct dapl_common common;
struct ib_pd *pd;
atomic_t pz_ref_count;
};
-/* struct dapl_lmr maps to DAT_LMR_HANDLE */
struct dapl_lmr {
- struct dapl_header header; /* WARNING: must be first */
+ struct dat_lmr lmr;
+ struct dapl_common common;
struct dat_lmr_param param;
struct ib_mr *mr;
atomic_t lmr_ref_count;
};
-/* struct dapl_rmr maps to DAT_RMR_HANDLE */
struct dapl_rmr {
- struct dapl_header header; /* WARNING: must be first */
+ struct dat_rmr rmr;
+ struct dapl_common common;
struct dat_rmr_param param;
struct dapl_ep *ep;
struct dapl_pz *pz;
@@ -310,17 +273,17 @@ typedef enum dapl_sp_state {
DAPL_SP_STATE_RSP_PENDING
} DAPL_SP_STATE;
-/* struct dapl_sp maps to DAT_PSP_HANDLE and DAT_RSP_HANDLE */
struct dapl_sp {
- struct dapl_header header; /* WARNING: must be first */
+ struct dat_sp sp;
+ struct dapl_common common;
DAPL_SP_STATE state; /* type and queue of the SP */
/* PSP/RSP PARAM fields */
- DAT_IA_HANDLE ia_handle;
+ struct dat_ia *ia;
DAT_CONN_QUAL conn_qual;
- DAT_EVD_HANDLE evd_handle;
+ struct dat_evd *evd;
enum dat_psp_flags psp_flags;
- DAT_EP_HANDLE ep_handle;
+ struct dat_ep *ep;
/* maintenance fields */
boolean_t listening; /* PSP is registered & active */
@@ -329,9 +292,9 @@ struct dapl_sp {
int cr_list_count; /* count of CRs on queue */
};
-/* struct dapl_cr maps to DAT_CR_HANDLE */
struct dapl_cr {
- struct dapl_header header;
+ struct dat_cr cr;
+ struct dapl_common common;
/* for convenience the data is kept as a struct dat_cr_param.
* however, the "local_endpoint" field is always NULL
* so this wastes a pointer. This is probably ok to
@@ -396,91 +359,88 @@ struct dapl_cookie {
*/
extern u32 dapl_ia_open(const char *name, int async_evd_qlen,
- DAT_EVD_HANDLE *async_evd_handle_ptr,
- DAT_IA_HANDLE *ia_handle_ptr);
+ struct dat_evd **async_evd_ptr,
+ struct dat_ia **ia_ptr);
-extern u32 dapl_ia_close(DAT_IA_HANDLE, enum dat_close_flags);
+extern u32 dapl_ia_close(struct dat_ia *, enum dat_close_flags);
-extern u32 dapl_ia_query(DAT_IA_HANDLE, DAT_EVD_HANDLE *, struct dat_ia_attr *,
+extern u32 dapl_ia_query(struct dat_ia *, struct dat_evd **, struct dat_ia_attr *,
struct dat_provider_attr *);
/* helper functions */
-extern u32 dapl_set_consumer_context(DAT_HANDLE handle,
+extern u32 dapl_set_consumer_context(void *handle,
union dat_context context);
-extern u32 dapl_get_consumer_context(DAT_HANDLE handle,
+extern u32 dapl_get_consumer_context(void *handle,
union dat_context *context);
-extern u32 dapl_get_handle_type(DAT_HANDLE handle,
- enum dat_handle_type *type);
-
/* CR Functions */
-extern u32 dapl_cr_query(DAT_CR_HANDLE, struct dat_cr_param *);
+extern u32 dapl_cr_query(struct dat_cr *, struct dat_cr_param *);
-extern u32 dapl_cr_accept(DAT_CR_HANDLE cr_handle, DAT_EP_HANDLE ep_handle,
+extern u32 dapl_cr_accept(struct dat_cr *cr, struct dat_ep *ep,
int private_data_size,
const void *private_data);
-extern u32 dapl_cr_reject(DAT_CR_HANDLE cr_handle);
+extern u32 dapl_cr_reject(struct dat_cr *cr);
-extern u32 dapl_cr_handoff(DAT_CR_HANDLE cr_handle, DAT_CONN_QUAL handoff);
+extern u32 dapl_cr_handoff(struct dat_cr *cr, DAT_CONN_QUAL handoff);
/* EVD Functions */
-extern u32 dapl_ia_memtype_hint(DAT_IA_HANDLE ia_handle,
+extern u32 dapl_ia_memtype_hint(struct dat_ia *ia,
enum dat_mem_type mem_type,
u64 length,
enum dat_mem_optimize_flags mem_optimization,
u64 *suggested_length,
u64 *suggested_alignment);
-extern u32 dapl_evd_kcreate(DAT_IA_HANDLE ia_handle, int evd_min_qlen,
+extern u32 dapl_evd_kcreate(struct dat_ia *ia, int evd_min_qlen,
enum dat_upcall_policy upcall_policy,
const struct dat_upcall_object * upcall,
enum dat_evd_flags evd_flags,
- DAT_EVD_HANDLE * evd_handle);
+ struct dat_evd ** evd);
-extern u32 dapl_evd_kquery(DAT_EVD_HANDLE evd_handle,
+extern u32 dapl_evd_kquery(struct dat_evd *evd,
struct dat_evd_param *evd_args);
-extern u32 dapl_evd_modify_upcall(DAT_EVD_HANDLE evd_handle,
+extern u32 dapl_evd_modify_upcall(struct dat_evd *evd,
enum dat_upcall_policy upcall_policy,
const struct dat_upcall_object * upcall);
-extern u32 dapl_evd_enable(DAT_EVD_HANDLE evd_handle);
+extern u32 dapl_evd_enable(struct dat_evd *evd);
-extern u32 dapl_evd_disable(DAT_EVD_HANDLE evd_handle);
+extern u32 dapl_evd_disable(struct dat_evd *evd);
-extern u32 dapl_evd_resize(DAT_EVD_HANDLE evd_handle, int evd_qlen);
+extern u32 dapl_evd_resize(struct dat_evd *evd, int evd_qlen);
-extern u32 dapl_evd_post_se(DAT_EVD_HANDLE evd_handle,
+extern u32 dapl_evd_post_se(struct dat_evd *evd,
const struct dat_event *event);
-extern u32 dapl_evd_dequeue(DAT_EVD_HANDLE evd_handle, struct dat_event *event);
+extern u32 dapl_evd_dequeue(struct dat_evd *evd, struct dat_event *event);
-extern u32 dapl_evd_free(DAT_EVD_HANDLE evd_handle);
+extern u32 dapl_evd_free(struct dat_evd *evd);
-extern u32 dapl_evd_set_unwaitable(DAT_EVD_HANDLE evd_handle);
+extern u32 dapl_evd_set_unwaitable(struct dat_evd *evd);
-extern u32 dapl_evd_clear_unwaitable(DAT_EVD_HANDLE evd_handle);
+extern u32 dapl_evd_clear_unwaitable(struct dat_evd *evd);
/* EP functions */
-extern u32 dapl_ep_create(DAT_IA_HANDLE ia_handle, DAT_PZ_HANDLE pz_handle,
- DAT_EVD_HANDLE in_dto_completion_evd_handle,
- DAT_EVD_HANDLE out_dto_completion_evd_handle,
- DAT_EVD_HANDLE connect_evd_handle,
+extern u32 dapl_ep_create(struct dat_ia *ia, struct dat_pz *pz,
+ struct dat_evd *in_dto_completion_evd,
+ struct dat_evd *out_dto_completion_evd,
+ struct dat_evd *connect_evd,
const struct dat_ep_attr *ep_parameters,
- DAT_EP_HANDLE *ep_handle);
+ struct dat_ep **ep);
-extern u32 dapl_ep_query(DAT_EP_HANDLE, struct dat_ep_param *);
+extern u32 dapl_ep_query(struct dat_ep *, struct dat_ep_param *);
-extern u32 dapl_ep_modify(DAT_EP_HANDLE ep_handle,
+extern u32 dapl_ep_modify(struct dat_ep *ep,
enum dat_ep_param_mask ep_args_mask,
const struct dat_ep_param *ep_args);
-extern u32 dapl_ep_connect(DAT_EP_HANDLE ep_handle,
+extern u32 dapl_ep_connect(struct dat_ep *ep,
struct sockaddr *remote_ia_address,
DAT_CONN_QUAL remote_conn_qual,
unsigned long timeout,
@@ -489,161 +449,161 @@ extern u32 dapl_ep_connect(DAT_EP_HANDLE
enum dat_qos quality_of_service,
enum dat_connect_flags connect_flags);
-extern u32 dapl_ep_dup_connect(DAT_EP_HANDLE ep_handle,
- DAT_EP_HANDLE ep_dup_handle,
+extern u32 dapl_ep_dup_connect(struct dat_ep *ep,
+ struct dat_ep *ep_dup,
unsigned long timeout,
int private_data_size,
const void *private_data,
enum dat_qos quality_of_service);
-extern u32 dapl_ep_disconnect(DAT_EP_HANDLE ep_handle,
+extern u32 dapl_ep_disconnect(struct dat_ep *ep,
enum dat_close_flags close_flags);
-extern u32 dapl_ep_post_send(DAT_EP_HANDLE ep_handle, int num_segments,
+extern u32 dapl_ep_post_send(struct dat_ep *ep, int num_segments,
struct dat_lmr_triplet *local_iov,
DAT_DTO_COOKIE user_cookie,
enum dat_completion_flags completion_flags);
-extern u32 dapl_ep_post_recv(DAT_EP_HANDLE ep_handle, int num_segments,
+extern u32 dapl_ep_post_recv(struct dat_ep *ep, int num_segments,
struct dat_lmr_triplet *local_iov,
DAT_DTO_COOKIE user_cookie,
enum dat_completion_flags completion_flags);
-extern u32 dapl_ep_post_rdma_read(DAT_EP_HANDLE ep_handle,
+extern u32 dapl_ep_post_rdma_read(struct dat_ep *ep,
int num_segments,
struct dat_lmr_triplet *local_iov,
DAT_DTO_COOKIE user_cookie,
const struct dat_rmr_triplet *remote_iov,
enum dat_completion_flags completion_flags);
-extern u32 dapl_ep_post_rdma_write(DAT_EP_HANDLE ep_handle,
+extern u32 dapl_ep_post_rdma_write(struct dat_ep *ep,
int num_segments,
struct dat_lmr_triplet *local_iov,
DAT_DTO_COOKIE user_cookie,
const struct dat_rmr_triplet *remote_iov,
enum dat_completion_flags completion_flags);
-extern u32 dapl_ep_get_status(DAT_EP_HANDLE ep_handle,
+extern u32 dapl_ep_get_status(struct dat_ep *ep,
enum dat_ep_state *ep_state,
boolean_t *in_dto_idle, boolean_t *out_dto_idle);
-extern u32 dapl_ep_free(DAT_EP_HANDLE ep_handle);
+extern u32 dapl_ep_free(struct dat_ep *ep);
-extern u32 dapl_ep_reset(DAT_EP_HANDLE ep_handle);
+extern u32 dapl_ep_reset(struct dat_ep *ep);
-extern u32 dapl_ep_create_with_srq(DAT_IA_HANDLE ia_handle,
- DAT_PZ_HANDLE pz_handle,
- DAT_EVD_HANDLE recv_evd_handle,
- DAT_EVD_HANDLE request_evd_handle,
- DAT_EVD_HANDLE connect_evd_handle,
- DAT_SRQ_HANDLE srq_handle,
+extern u32 dapl_ep_create_with_srq(struct dat_ia *ia,
+ struct dat_pz *pz,
+ struct dat_evd *recv_evd,
+ struct dat_evd *request_evd,
+ struct dat_evd *connect_evd,
+ struct dat_srq *srq_handle,
const struct dat_ep_attr *ep_attributes,
- DAT_EP_HANDLE *ep_handle);
+ struct dat_ep **ep);
-extern u32 dapl_ep_recv_query(DAT_EP_HANDLE ep_handle,
+extern u32 dapl_ep_recv_query(struct dat_ep *ep,
int *nbufs_allocated,
int *bufs_alloc_span);
-extern u32 dapl_ep_set_watermark(DAT_EP_HANDLE ep_handle,
+extern u32 dapl_ep_set_watermark(struct dat_ep *ep,
int soft_high_watermark,
int hard_high_watermark);
/* LMR functions */
-extern u32 dapl_lmr_kcreate(DAT_IA_HANDLE ia_handle, enum dat_mem_type mem_type,
+extern u32 dapl_lmr_kcreate(struct dat_ia *ia, enum dat_mem_type mem_type,
DAT_REGION_DESCRIPTION region_description,
- u64 length, DAT_PZ_HANDLE pz_handle,
+ u64 length, struct dat_pz *pz,
enum dat_mem_priv_flags privileges,
enum dat_mem_optimize_flags optimization,
- DAT_LMR_HANDLE *lmr_handle,
+ struct dat_lmr **lmr,
DAT_LMR_CONTEXT *lmr_context,
DAT_RMR_CONTEXT *rmr_context,
u64 *registered_length,
u64 *registered_address);
-extern u32 dapl_lmr_query(DAT_LMR_HANDLE, struct dat_lmr_param *);
+extern u32 dapl_lmr_query(struct dat_lmr *, struct dat_lmr_param *);
-extern u32 dapl_lmr_free(DAT_LMR_HANDLE);
+extern u32 dapl_lmr_free(struct dat_lmr *);
-extern u32 dapl_lmr_sync_rdma_read(DAT_IA_HANDLE ia_handle,
+extern u32 dapl_lmr_sync_rdma_read(struct dat_ia *ia,
const struct dat_lmr_triplet *local_segments,
u64 num_segments);
-extern u32 dapl_lmr_sync_rdma_write(DAT_IA_HANDLE ia_handle,
+extern u32 dapl_lmr_sync_rdma_write(struct dat_ia *ia,
const struct dat_lmr_triplet *local_segments,
u64 num_segments);
/* RMR Functions */
-extern u32 dapl_rmr_create(DAT_PZ_HANDLE pz_handle, DAT_RMR_HANDLE *rmr_handle);
+extern u32 dapl_rmr_create(struct dat_pz *pz, struct dat_rmr **rmr);
-extern u32 dapl_rmr_query(DAT_RMR_HANDLE rmr_handle,
+extern u32 dapl_rmr_query(struct dat_rmr *rmr,
struct dat_rmr_param *rmr_args);
-extern u32 dapl_rmr_bind(DAT_RMR_HANDLE rmr_handle,
+extern u32 dapl_rmr_bind(struct dat_rmr *rmr,
const struct dat_lmr_triplet *lmr_triplet,
enum dat_mem_priv_flags mem_priv,
- DAT_EP_HANDLE ep_handle,
+ struct dat_ep *ep,
DAT_RMR_COOKIE user_cookie,
enum dat_completion_flags completion_flags,
DAT_RMR_CONTEXT *context);
-extern u32 dapl_rmr_free(DAT_RMR_HANDLE);
+extern u32 dapl_rmr_free(struct dat_rmr *rmr);
/* PSP Functions */
-extern u32 dapl_psp_create(DAT_IA_HANDLE ia_handle, DAT_CONN_QUAL conn_qual,
- DAT_EVD_HANDLE evd_handle,
+extern u32 dapl_psp_create(struct dat_ia *ia, DAT_CONN_QUAL conn_qual,
+ struct dat_evd *evd,
enum dat_psp_flags psp_flags,
- DAT_PSP_HANDLE *psp_handle);
+ struct dat_sp **psp);
-extern u32 dapl_psp_create_any(DAT_IA_HANDLE ia_handle,
+extern u32 dapl_psp_create_any(struct dat_ia *ia,
DAT_CONN_QUAL *conn_qual,
- DAT_EVD_HANDLE evd_handle,
+ struct dat_evd *evd,
enum dat_psp_flags psp_flags,
- DAT_PSP_HANDLE *psp_handle);
+ struct dat_sp **psp);
-extern u32 dapl_psp_query(DAT_PSP_HANDLE, struct dat_psp_param *);
+extern u32 dapl_psp_query(struct dat_sp *, struct dat_psp_param *);
-extern u32 dapl_psp_free(DAT_PSP_HANDLE psp_handle);
+extern u32 dapl_psp_free(struct dat_sp *psp);
/* RSP Functions */
-extern u32 dapl_rsp_create(DAT_IA_HANDLE ia_handle, DAT_CONN_QUAL conn_qual,
- DAT_EP_HANDLE ep_handle, DAT_EVD_HANDLE evd_handle,
- DAT_RSP_HANDLE *rsp_handle);
+extern u32 dapl_rsp_create(struct dat_ia *ia, DAT_CONN_QUAL conn_qual,
+ struct dat_ep *ep, struct dat_evd *evd,
+ struct dat_sp **rsp);
-extern u32 dapl_rsp_query(DAT_RSP_HANDLE, struct dat_rsp_param *);
+extern u32 dapl_rsp_query(struct dat_sp *, struct dat_rsp_param *);
-extern u32 dapl_rsp_free(DAT_RSP_HANDLE rsp_handle);
+extern u32 dapl_rsp_free(struct dat_sp *rsp);
/* PZ Functions */
-extern u32 dapl_pz_create(DAT_IA_HANDLE ia_handle, DAT_PZ_HANDLE *pz_handle);
+extern u32 dapl_pz_create(struct dat_ia *ia, struct dat_pz **pz);
-extern u32 dapl_pz_query(DAT_PZ_HANDLE pz_handle, struct dat_pz_param *pz_args);
+extern u32 dapl_pz_query(struct dat_pz *pz, struct dat_pz_param *pz_args);
-extern u32 dapl_pz_free(DAT_PZ_HANDLE pz_handle);
+extern u32 dapl_pz_free(struct dat_pz *pz);
/* SRQ functions */
-extern u32 dapl_srq_create(DAT_IA_HANDLE ia_handle, DAT_PZ_HANDLE pz_handle,
+extern u32 dapl_srq_create(struct dat_ia *ia, struct dat_pz *pz,
struct dat_srq_attr *srq_attr,
- DAT_SRQ_HANDLE *srq_handle);
+ struct dat_srq **srq);
-extern u32 dapl_srq_free(DAT_SRQ_HANDLE srq_handle);
+extern u32 dapl_srq_free(struct dat_srq *srq);
-extern u32 dapl_srq_post_recv(DAT_SRQ_HANDLE srq_handle, int num_segments,
+extern u32 dapl_srq_post_recv(struct dat_srq *srq, int num_segments,
struct dat_lmr_triplet *local_iov,
DAT_DTO_COOKIE user_cookie);
-extern u32 dapl_srq_query(DAT_SRQ_HANDLE srq_handle,
+extern u32 dapl_srq_query(struct dat_srq *srq,
struct dat_srq_param *srq_param);
-extern u32 dapl_srq_resize(DAT_SRQ_HANDLE srq_handle,
+extern u32 dapl_srq_resize(struct dat_srq *srq,
int srq_max_recv_dto);
-extern u32 dapl_srq_set_lw(DAT_SRQ_HANDLE srq_handle, int low_watermark);
+extern u32 dapl_srq_set_lw(struct dat_srq *srq, int low_watermark);
/*
* DAPL internal utility function prototypes
Index: linux-kernel/dat-provider/dapl_ia_util.c
===================================================================
--- linux-kernel/dat-provider/dapl_ia_util.c (revision 2564)
+++ linux-kernel/dat-provider/dapl_ia_util.c (working copy)
@@ -65,17 +65,12 @@ struct dapl_ia *dapl_ia_alloc(struct dat
/* zero the structure */
memset(ia_ptr, 0, sizeof *ia_ptr);
- /*
- * initialize the header
- */
- ia_ptr->header.provider = provider;
- ia_ptr->header.magic = DAPL_MAGIC_IA;
- ia_ptr->header.handle_type = DAT_HANDLE_TYPE_IA;
- ia_ptr->header.owner_ia = ia_ptr;
- ia_ptr->header.user_context.as_64 = 0;
- ia_ptr->header.user_context.as_ptr = NULL;
- dapl_llist_init_entry(&ia_ptr->header.ia_list_entry);
- spin_lock_init(&ia_ptr->header.lock);
+ ia_ptr->ia.provider = provider;
+ ia_ptr->common.owner_ia = ia_ptr;
+ ia_ptr->common.user_context.as_64 = 0;
+ ia_ptr->common.user_context.as_ptr = NULL;
+ dapl_llist_init_entry(&ia_ptr->common.ia_list_entry);
+ spin_lock_init(&ia_ptr->common.lock);
/*
* initialize the body
@@ -127,9 +122,9 @@ u32 dapl_ia_abrupt_close(struct dapl_ia
? NULL : dapl_llist_peek_head(&ia_ptr->rmr_list_head));
while (rmr_ptr != NULL) {
next_rmr_ptr = dapl_llist_next_entry(&ia_ptr->rmr_list_head,
- &rmr_ptr->header.
+ &rmr_ptr->common.
ia_list_entry);
- dat_status = dapl_rmr_free(rmr_ptr);
+ dat_status = dapl_rmr_free((struct dat_rmr *)rmr_ptr);
if (dat_status != DAT_SUCCESS)
dapl_dbg_log(DAPL_DBG_TYPE_WARN,
"ia_close(ABRUPT): rmr_free(%p) returns %x\n",
@@ -141,9 +136,9 @@ u32 dapl_ia_abrupt_close(struct dapl_ia
? NULL : dapl_llist_peek_head(&ia_ptr->rsp_list_head));
while (sp_ptr != NULL) {
next_sp_ptr = dapl_llist_next_entry(&ia_ptr->rsp_list_head,
- &sp_ptr->header.
+ &sp_ptr->common.
ia_list_entry);
- dat_status = dapl_rsp_free(sp_ptr);
+ dat_status = dapl_rsp_free((struct dat_sp *)sp_ptr);
if (dat_status != DAT_SUCCESS)
dapl_dbg_log(DAPL_DBG_TYPE_WARN,
"ia_close(ABRUPT): rsp_free(%p) returns %x\n",
@@ -155,7 +150,7 @@ u32 dapl_ia_abrupt_close(struct dapl_ia
? NULL : dapl_llist_peek_head(&ia_ptr->ep_list_head));
while (ep_ptr != NULL) {
next_ep_ptr = dapl_llist_next_entry(&ia_ptr->ep_list_head,
- &ep_ptr->header.
+ &ep_ptr->common.
ia_list_entry);
/*
* Issue a disconnect if the EP needs it
@@ -163,21 +158,19 @@ u32 dapl_ia_abrupt_close(struct dapl_ia
if (ep_ptr->param.ep_state == DAT_EP_STATE_CONNECTED ||
ep_ptr->param.ep_state == DAT_EP_STATE_DISCONNECTED ||
ep_ptr->param.ep_state ==
- DAT_EP_STATE_ACTIVE_CONNECTION_PENDING
- || ep_ptr->param.ep_state == DAT_EP_STATE_COMPLETION_PENDING
- || ep_ptr->param.ep_state ==
- DAT_EP_STATE_DISCONNECT_PENDING) {
- dat_status =
- dapl_ep_disconnect(ep_ptr, DAT_CLOSE_ABRUPT_FLAG);
+ DAT_EP_STATE_ACTIVE_CONNECTION_PENDING ||
+ ep_ptr->param.ep_state == DAT_EP_STATE_COMPLETION_PENDING || ep_ptr->param.ep_state == DAT_EP_STATE_DISCONNECT_PENDING) {
+ dat_status = dapl_ep_disconnect((struct dat_ep *)ep_ptr,
+ DAT_CLOSE_ABRUPT_FLAG);
if (dat_status != DAT_SUCCESS)
dapl_dbg_log(DAPL_DBG_TYPE_WARN,
"ia_close(ABRUPT): ep_disconnect(%p) returns %x\n",
ep_ptr, dat_status);
}
/* force the EP into error state to force flush all posted DTOs. */
- (void) dapl_modify_qp_state_to_error(ep_ptr->qp);
+ (void)dapl_modify_qp_state_to_error(ep_ptr->qp);
- dat_status = dapl_ep_free(ep_ptr);
+ dat_status = dapl_ep_free((struct dat_ep *)ep_ptr);
if (dat_status != DAT_SUCCESS)
dapl_dbg_log(DAPL_DBG_TYPE_WARN,
"ia_close(ABRUPT): ep_free(%p) returns %x\n",
@@ -189,9 +182,9 @@ u32 dapl_ia_abrupt_close(struct dapl_ia
? NULL : dapl_llist_peek_head(&ia_ptr->lmr_list_head));
while (lmr_ptr != NULL) {
next_lmr_ptr = dapl_llist_next_entry(&ia_ptr->lmr_list_head,
- &lmr_ptr->header.
+ &lmr_ptr->common.
ia_list_entry);
- dat_status = dapl_lmr_free(lmr_ptr);
+ dat_status = dapl_lmr_free((struct dat_lmr *)lmr_ptr);
if (dat_status != DAT_SUCCESS)
dapl_dbg_log(DAPL_DBG_TYPE_WARN,
"ia_close(ABRUPT): lmr_free(%p) returns %x\n",
@@ -213,7 +206,7 @@ u32 dapl_ia_abrupt_close(struct dapl_ia
dat_status);
next_sp_ptr = dapl_llist_next_entry(&ia_ptr->psp_list_head,
- &sp_ptr->header.
+ &sp_ptr->common.
ia_list_entry);
/* Remove CR's from this PSP and clean them up */
@@ -222,18 +215,19 @@ u32 dapl_ia_abrupt_close(struct dapl_ia
while (cr_ptr != NULL) {
next_cr_ptr = dapl_llist_next_entry(
&sp_ptr->cr_list_head,
- &cr_ptr->header.ia_list_entry);
+ &cr_ptr->common.ia_list_entry);
/* Remove the CR from the queue & cleanup */
- spin_lock_irqsave(&sp_ptr->header.lock, sp_ptr->header.flags);
+ spin_lock_irqsave(&sp_ptr->common.lock,
+ sp_ptr->common.flags);
dapl_sp_remove_cr(sp_ptr, cr_ptr);
- spin_unlock_irqrestore(&sp_ptr->header.lock,
- sp_ptr->header.flags);
+ spin_unlock_irqrestore(&sp_ptr->common.lock,
+ sp_ptr->common.flags);
dapl_cr_free(cr_ptr);
cr_ptr = next_cr_ptr;
}
- dat_status = dapl_psp_free(sp_ptr);
+ dat_status = dapl_psp_free((struct dat_sp *)sp_ptr);
if (dat_status != DAT_SUCCESS)
dapl_dbg_log(DAPL_DBG_TYPE_WARN,
"ia_close(ABRUPT): psp_free(%p) returns %x\n",
@@ -246,9 +240,9 @@ u32 dapl_ia_abrupt_close(struct dapl_ia
? NULL : dapl_llist_peek_head(&ia_ptr->pz_list_head));
while (pz_ptr != NULL) {
next_pz_ptr = dapl_llist_next_entry(&ia_ptr->pz_list_head,
- &pz_ptr->header.
+ &pz_ptr->common.
ia_list_entry);
- dat_status = dapl_pz_free(pz_ptr);
+ dat_status = dapl_pz_free((struct dat_pz *)pz_ptr);
if (dat_status != DAT_SUCCESS)
dapl_dbg_log(DAPL_DBG_TYPE_WARN,
"ia_close(ABRUPT): pz_free(%p) returns %x\n",
@@ -266,11 +260,11 @@ u32 dapl_ia_abrupt_close(struct dapl_ia
? NULL : dapl_llist_peek_head(&ia_ptr->evd_list_head));
while (evd_ptr != NULL) {
next_evd_ptr = dapl_llist_next_entry(&ia_ptr->evd_list_head,
- &evd_ptr->header.
+ &evd_ptr->common.
ia_list_entry);
if (evd_ptr != ia_ptr->async_error_evd) {
/* it isn't the async EVD; delete it. */
- dat_status = dapl_evd_free(evd_ptr);
+ dat_status = dapl_evd_free((struct dat_evd *)evd_ptr);
if (dat_status != DAT_SUCCESS)
dapl_dbg_log(DAPL_DBG_TYPE_WARN,
"ia_close(ABRUPT): evd_free(%p) returns %x\n",
@@ -289,7 +283,7 @@ u32 dapl_ia_abrupt_close(struct dapl_ia
dat_status = dapl_ia_teardown_callbacks(ia_ptr);
atomic_dec(&ia_ptr->async_error_evd->evd_ref_count);
- dat_status = dapl_evd_free(ia_ptr->async_error_evd);
+ dat_status = dapl_evd_free((struct dat_evd *)ia_ptr->async_error_evd);
if (DAT_SUCCESS != dat_status)
dapl_dbg_log(DAPL_DBG_TYPE_WARN,
@@ -404,7 +398,7 @@ u32 dapl_ia_graceful_close(struct dapl_i
if (DAT_SUCCESS != cur_dat_status)
dat_status = cur_dat_status;
atomic_dec(&ia_ptr->async_error_evd->evd_ref_count);
- cur_dat_status = dapl_evd_free(ia_ptr->async_error_evd);
+ cur_dat_status = dapl_evd_free((struct dat_evd *)ia_ptr->async_error_evd);
if (DAT_SUCCESS != cur_dat_status)
dat_status = cur_dat_status;
@@ -424,8 +418,6 @@ bail:
*/
void dapl_ia_free(struct dapl_ia *ia_ptr)
{
- dapl_os_assert(ia_ptr->header.magic == DAPL_MAGIC_IA);
-
dapl_os_assert(ia_ptr->async_error_evd == NULL);
dapl_os_assert(dapl_llist_is_empty(&ia_ptr->lmr_list_head));
dapl_os_assert(dapl_llist_is_empty(&ia_ptr->rmr_list_head));
@@ -434,12 +426,8 @@ void dapl_ia_free(struct dapl_ia *ia_ptr
dapl_os_assert(dapl_llist_is_empty(&ia_ptr->psp_list_head));
dapl_os_assert(dapl_llist_is_empty(&ia_ptr->rsp_list_head));
- /*
- * deinitialize the header
- */
dapl_hca_unlink_ia(ia_ptr->hca_ptr, ia_ptr);
- ia_ptr->header.magic = DAPL_MAGIC_INVALID; /* reset magic to prevent reuse */
- /* no need to destroy ia_ptr->header.lock */
+ /* no need to destroy ia_ptr->common.lock */
kfree(ia_ptr);
}
@@ -449,10 +437,10 @@ void dapl_ia_free(struct dapl_ia *ia_ptr
*/
void dapl_ia_link_ep(struct dapl_ia *ia_ptr, struct dapl_ep *ep_ptr)
{
- spin_lock_irqsave(&ia_ptr->header.lock, ia_ptr->header.flags);
+ spin_lock_irqsave(&ia_ptr->common.lock, ia_ptr->common.flags);
dapl_llist_add_head(&ia_ptr->ep_list_head,
- &ep_ptr->header.ia_list_entry, ep_ptr);
- spin_unlock_irqrestore(&ia_ptr->header.lock, ia_ptr->header.flags);
+ &ep_ptr->common.ia_list_entry, ep_ptr);
+ spin_unlock_irqrestore(&ia_ptr->common.lock, ia_ptr->common.flags);
}
/*
@@ -460,10 +448,10 @@ void dapl_ia_link_ep(struct dapl_ia *ia_
*/
void dapl_ia_unlink_ep(struct dapl_ia *ia_ptr, struct dapl_ep *ep_ptr)
{
- spin_lock_irqsave(&ia_ptr->header.lock, ia_ptr->header.flags);
+ spin_lock_irqsave(&ia_ptr->common.lock, ia_ptr->common.flags);
dapl_llist_remove_entry(&ia_ptr->ep_list_head,
- &ep_ptr->header.ia_list_entry);
- spin_unlock_irqrestore(&ia_ptr->header.lock, ia_ptr->header.flags);
+ &ep_ptr->common.ia_list_entry);
+ spin_unlock_irqrestore(&ia_ptr->common.lock, ia_ptr->common.flags);
}
/*
@@ -471,10 +459,10 @@ void dapl_ia_unlink_ep(struct dapl_ia *i
*/
void dapl_ia_link_srq(struct dapl_ia *ia_ptr, struct dapl_srq *srq_ptr)
{
- spin_lock_irqsave(&ia_ptr->header.lock, ia_ptr->header.flags);
+ spin_lock_irqsave(&ia_ptr->common.lock, ia_ptr->common.flags);
dapl_llist_add_head(&ia_ptr->srq_list_head,
- &srq_ptr->header.ia_list_entry, srq_ptr);
- spin_unlock_irqrestore(&ia_ptr->header.lock, ia_ptr->header.flags);
+ &srq_ptr->common.ia_list_entry, srq_ptr);
+ spin_unlock_irqrestore(&ia_ptr->common.lock, ia_ptr->common.flags);
}
/*
@@ -482,10 +470,10 @@ void dapl_ia_link_srq(struct dapl_ia *ia
*/
void dapl_ia_unlink_srq(struct dapl_ia *ia_ptr, struct dapl_srq *srq_ptr)
{
- spin_lock_irqsave(&ia_ptr->header.lock, ia_ptr->header.flags);
+ spin_lock_irqsave(&ia_ptr->common.lock, ia_ptr->common.flags);
dapl_llist_remove_entry(&ia_ptr->srq_list_head,
- &srq_ptr->header.ia_list_entry);
- spin_unlock_irqrestore(&ia_ptr->header.lock, ia_ptr->header.flags);
+ &srq_ptr->common.ia_list_entry);
+ spin_unlock_irqrestore(&ia_ptr->common.lock, ia_ptr->common.flags);
}
/*
@@ -493,10 +481,10 @@ void dapl_ia_unlink_srq(struct dapl_ia *
*/
void dapl_ia_link_lmr(struct dapl_ia *ia_ptr, struct dapl_lmr *lmr_ptr)
{
- spin_lock_irqsave(&ia_ptr->header.lock, ia_ptr->header.flags);
+ spin_lock_irqsave(&ia_ptr->common.lock, ia_ptr->common.flags);
dapl_llist_add_head(&ia_ptr->lmr_list_head,
- &lmr_ptr->header.ia_list_entry, lmr_ptr);
- spin_unlock_irqrestore(&ia_ptr->header.lock, ia_ptr->header.flags);
+ &lmr_ptr->common.ia_list_entry, lmr_ptr);
+ spin_unlock_irqrestore(&ia_ptr->common.lock, ia_ptr->common.flags);
}
/*
@@ -504,10 +492,10 @@ void dapl_ia_link_lmr(struct dapl_ia *ia
*/
void dapl_ia_unlink_lmr(struct dapl_ia *ia_ptr, struct dapl_lmr *lmr_ptr)
{
- spin_lock_irqsave(&ia_ptr->header.lock, ia_ptr->header.flags);
+ spin_lock_irqsave(&ia_ptr->common.lock, ia_ptr->common.flags);
dapl_llist_remove_entry(&ia_ptr->lmr_list_head,
- &lmr_ptr->header.ia_list_entry);
- spin_unlock_irqrestore(&ia_ptr->header.lock, ia_ptr->header.flags);
+ &lmr_ptr->common.ia_list_entry);
+ spin_unlock_irqrestore(&ia_ptr->common.lock, ia_ptr->common.flags);
}
/*
@@ -515,10 +503,10 @@ void dapl_ia_unlink_lmr(struct dapl_ia *
*/
void dapl_ia_link_rmr(struct dapl_ia *ia_ptr, struct dapl_rmr *rmr_ptr)
{
- spin_lock_irqsave(&ia_ptr->header.lock, ia_ptr->header.flags);
+ spin_lock_irqsave(&ia_ptr->common.lock, ia_ptr->common.flags);
dapl_llist_add_head(&ia_ptr->rmr_list_head,
- &rmr_ptr->header.ia_list_entry, rmr_ptr);
- spin_unlock_irqrestore(&ia_ptr->header.lock, ia_ptr->header.flags);
+ &rmr_ptr->common.ia_list_entry, rmr_ptr);
+ spin_unlock_irqrestore(&ia_ptr->common.lock, ia_ptr->common.flags);
}
/*
@@ -526,10 +514,10 @@ void dapl_ia_link_rmr(struct dapl_ia *ia
*/
void dapl_ia_unlink_rmr(struct dapl_ia *ia_ptr, struct dapl_rmr *rmr_ptr)
{
- spin_lock_irqsave(&ia_ptr->header.lock, ia_ptr->header.flags);
+ spin_lock_irqsave(&ia_ptr->common.lock, ia_ptr->common.flags);
dapl_llist_remove_entry(&ia_ptr->rmr_list_head,
- &rmr_ptr->header.ia_list_entry);
- spin_unlock_irqrestore(&ia_ptr->header.lock, ia_ptr->header.flags);
+ &rmr_ptr->common.ia_list_entry);
+ spin_unlock_irqrestore(&ia_ptr->common.lock, ia_ptr->common.flags);
}
/*
@@ -537,10 +525,10 @@ void dapl_ia_unlink_rmr(struct dapl_ia *
*/
void dapl_ia_link_pz(struct dapl_ia *ia_ptr, struct dapl_pz *pz_ptr)
{
- spin_lock_irqsave(&ia_ptr->header.lock, ia_ptr->header.flags);
+ spin_lock_irqsave(&ia_ptr->common.lock, ia_ptr->common.flags);
dapl_llist_add_head(&ia_ptr->pz_list_head,
- &pz_ptr->header.ia_list_entry, pz_ptr);
- spin_unlock_irqrestore(&ia_ptr->header.lock, ia_ptr->header.flags);
+ &pz_ptr->common.ia_list_entry, pz_ptr);
+ spin_unlock_irqrestore(&ia_ptr->common.lock, ia_ptr->common.flags);
}
/*
@@ -548,10 +536,10 @@ void dapl_ia_link_pz(struct dapl_ia *ia_
*/
void dapl_ia_unlink_pz(struct dapl_ia *ia_ptr, struct dapl_pz *pz_ptr)
{
- spin_lock_irqsave(&ia_ptr->header.lock, ia_ptr->header.flags);
+ spin_lock_irqsave(&ia_ptr->common.lock, ia_ptr->common.flags);
dapl_llist_remove_entry(&ia_ptr->pz_list_head,
- &pz_ptr->header.ia_list_entry);
- spin_unlock_irqrestore(&ia_ptr->header.lock, ia_ptr->header.flags);
+ &pz_ptr->common.ia_list_entry);
+ spin_unlock_irqrestore(&ia_ptr->common.lock, ia_ptr->common.flags);
}
/*
@@ -559,10 +547,10 @@ void dapl_ia_unlink_pz(struct dapl_ia *i
*/
void dapl_ia_link_evd(struct dapl_ia *ia_ptr, struct dapl_evd *evd_ptr)
{
- spin_lock_irqsave(&ia_ptr->header.lock, ia_ptr->header.flags);
+ spin_lock_irqsave(&ia_ptr->common.lock, ia_ptr->common.flags);
dapl_llist_add_head(&ia_ptr->evd_list_head,
- &evd_ptr->header.ia_list_entry, evd_ptr);
- spin_unlock_irqrestore(&ia_ptr->header.lock, ia_ptr->header.flags);
+ &evd_ptr->common.ia_list_entry, evd_ptr);
+ spin_unlock_irqrestore(&ia_ptr->common.lock, ia_ptr->common.flags);
}
/*
@@ -570,10 +558,10 @@ void dapl_ia_link_evd(struct dapl_ia *ia
*/
void dapl_ia_unlink_evd(struct dapl_ia *ia_ptr, struct dapl_evd *evd_ptr)
{
- spin_lock_irqsave(&ia_ptr->header.lock, ia_ptr->header.flags);
+ spin_lock_irqsave(&ia_ptr->common.lock, ia_ptr->common.flags);
dapl_llist_remove_entry(&ia_ptr->evd_list_head,
- &evd_ptr->header.ia_list_entry);
- spin_unlock_irqrestore(&ia_ptr->header.lock, ia_ptr->header.flags);
+ &evd_ptr->common.ia_list_entry);
+ spin_unlock_irqrestore(&ia_ptr->common.lock, ia_ptr->common.flags);
}
/*
@@ -581,10 +569,10 @@ void dapl_ia_unlink_evd(struct dapl_ia *
*/
void dapl_ia_link_psp(struct dapl_ia *ia_ptr, struct dapl_sp *sp_ptr)
{
- spin_lock_irqsave(&ia_ptr->header.lock, ia_ptr->header.flags);
+ spin_lock_irqsave(&ia_ptr->common.lock, ia_ptr->common.flags);
dapl_llist_add_head(&ia_ptr->psp_list_head,
- &sp_ptr->header.ia_list_entry, sp_ptr);
- spin_unlock_irqrestore(&ia_ptr->header.lock, ia_ptr->header.flags);
+ &sp_ptr->common.ia_list_entry, sp_ptr);
+ spin_unlock_irqrestore(&ia_ptr->common.lock, ia_ptr->common.flags);
}
/*
@@ -594,17 +582,17 @@ void dapl_ia_unlink_sp(struct dapl_ia *i
{
struct dapl_llist_entry **list_head;
- if (sp_ptr->header.handle_type == DAT_HANDLE_TYPE_PSP) {
+ if (sp_ptr->sp.type == DAT_SP_TYPE_PSP) {
list_head = &ia_ptr->psp_list_head;
} else {
- dapl_os_assert(sp_ptr->header.handle_type ==
- DAT_HANDLE_TYPE_RSP);
+ dapl_os_assert(sp_ptr->sp.type ==
+ DAT_SP_TYPE_RSP);
list_head = &ia_ptr->rsp_list_head;
}
- spin_lock_irqsave(&ia_ptr->header.lock, ia_ptr->header.flags);
- dapl_llist_remove_entry(list_head, &sp_ptr->header.ia_list_entry);
- spin_unlock_irqrestore(&ia_ptr->header.lock, ia_ptr->header.flags);
+ spin_lock_irqsave(&ia_ptr->common.lock, ia_ptr->common.flags);
+ dapl_llist_remove_entry(list_head, &sp_ptr->common.ia_list_entry);
+ spin_unlock_irqrestore(&ia_ptr->common.lock, ia_ptr->common.flags);
}
/*
@@ -634,7 +622,7 @@ struct dapl_sp *dapl_ia_sp_search(struct
else
list_head = &ia_ptr->rsp_list_head;
- spin_lock_irqsave(&ia_ptr->header.lock, ia_ptr->header.flags);
+ spin_lock_irqsave(&ia_ptr->common.lock, ia_ptr->common.flags);
sp_ptr = (dapl_llist_is_empty(list_head) ? NULL :
dapl_llist_peek_head(list_head));
@@ -644,10 +632,10 @@ struct dapl_sp *dapl_ia_sp_search(struct
break;
sp_ptr = dapl_llist_next_entry(list_head,
- &sp_ptr->header.ia_list_entry);
+ &sp_ptr->common.ia_list_entry);
}
- spin_unlock_irqrestore(&ia_ptr->header.lock, ia_ptr->header.flags);
+ spin_unlock_irqrestore(&ia_ptr->common.lock, ia_ptr->common.flags);
return sp_ptr;
}
@@ -670,10 +658,10 @@ struct dapl_sp *dapl_ia_sp_search(struct
*/
void dapl_ia_link_rsp(struct dapl_ia *ia_ptr, struct dapl_sp *sp_ptr)
{
- spin_lock_irqsave(&ia_ptr->header.lock, ia_ptr->header.flags);
+ spin_lock_irqsave(&ia_ptr->common.lock, ia_ptr->common.flags);
dapl_llist_add_head(&ia_ptr->rsp_list_head,
- &sp_ptr->header.ia_list_entry, sp_ptr);
- spin_unlock_irqrestore(&ia_ptr->header.lock, ia_ptr->header.flags);
+ &sp_ptr->common.ia_list_entry, sp_ptr);
+ spin_unlock_irqrestore(&ia_ptr->common.lock, ia_ptr->common.flags);
}
u32 dapl_ia_setup_callbacks(struct dapl_ia *ia_ptr,
Index: linux-kernel/dat-provider/dapl_cr_query.c
===================================================================
--- linux-kernel/dat-provider/dapl_cr_query.c (revision 2564)
+++ linux-kernel/dat-provider/dapl_cr_query.c (working copy)
@@ -34,16 +34,16 @@
#include "dapl.h"
#include "dapl_openib_util.h"
-u32 dapl_cr_query(DAT_CR_HANDLE cr_handle, struct dat_cr_param *cr_param)
+u32 dapl_cr_query(struct dat_cr *cr, struct dat_cr_param *cr_param)
{
struct dapl_cr *cr_ptr;
u32 status;
dapl_dbg_log(DAPL_DBG_TYPE_API,
"dapl_cr_query (%p, %x, %p)\n",
- cr_handle, cr_param);
+ cr, cr_param);
- if (DAPL_BAD_HANDLE(cr_handle, DAPL_MAGIC_CR)) {
+ if (cr == NULL) {
status = DAT_ERROR(DAT_INVALID_HANDLE, DAT_INVALID_HANDLE_CR);
goto bail;
}
@@ -53,10 +53,10 @@ u32 dapl_cr_query(DAT_CR_HANDLE cr_handl
goto bail;
}
- cr_ptr = (struct dapl_cr *)cr_handle;
+ cr_ptr = (struct dapl_cr *)cr;
/* obtain the remote IP address */
- (void) dapl_ib_cm_remote_addr((DAT_HANDLE) cr_handle,
+ (void) dapl_ib_cm_remote_addr((void *) cr,
&cr_ptr->remote_ia_address);
/* since the arguments are easily accessible, ignore the mask */
Index: linux-kernel/dat-provider/dapl_provider.c
===================================================================
--- linux-kernel/dat-provider/dapl_provider.c (revision 2564)
+++ linux-kernel/dat-provider/dapl_provider.c (working copy)
@@ -71,9 +71,8 @@ static struct dat_provider g_dapl_provid
.ia_close_func = &dapl_ia_close,
.ia_memtype_hint_func = &dapl_ia_memtype_hint,
- .set_consumer_context_func = &dapl_set_consumer_context,
- .get_consumer_context_func = &dapl_get_consumer_context,
- .get_handle_type_func = &dapl_get_handle_type,
+ .set_consumer_context_func = NULL,
+ .get_consumer_context_func = NULL,
.cr_query_func = &dapl_cr_query,
.cr_accept_func = &dapl_cr_accept,
Index: linux-kernel/dat-provider/dapl_openib_cm.c
===================================================================
--- linux-kernel/dat-provider/dapl_openib_cm.c (revision 2564)
+++ linux-kernel/dat-provider/dapl_openib_cm.c (working copy)
@@ -70,7 +70,7 @@ static void dapl_destroy_cm_id(struct da
conn, conn->cm_id);
ib_destroy_cm_id(conn->cm_id);
if (conn->ep)
- conn->ep->cm_handle = NULL;
+ conn->ep->cm = NULL;
kfree(conn);
}
}
@@ -172,7 +172,7 @@ static int dapl_cm_active_cb_handler(str
spin_unlock_irqrestore(&conn->lock, flags);
if (ret) {
if (conn->ep)
- conn->ep->cm_handle = NULL;
+ conn->ep->cm = NULL;
kfree(conn);
}
return ret;
@@ -285,7 +285,7 @@ static int dapl_cm_passive_cb_handler(st
spin_unlock_irqrestore(&conn->lock, flags);
if (ret) {
if (conn->ep)
- conn->ep->cm_handle = NULL;
+ conn->ep->cm = NULL;
kfree(conn);
}
return ret;
@@ -413,7 +413,7 @@ error:
* Initiate a connection with the passive listener on another node
*
* Input:
- * ep_handle
+ * ep
* remote_ia_address
* remote_conn_qual
* private_data_size size of private data and structure
@@ -428,7 +428,7 @@ error:
* DAT_INVALID_PARAMETER
*
*/
-u32 dapl_ib_connect(DAT_EP_HANDLE ep_handle,
+u32 dapl_ib_connect(struct dat_ep *ep,
struct sockaddr *remote_ia_address,
DAT_CONN_QUAL remote_conn_qual, unsigned long timeout,
int private_data_size, void *private_data)
@@ -438,7 +438,7 @@ u32 dapl_ib_connect(DAT_EP_HANDLE ep_han
struct dapl_cm_id *conn;
int status;
- ep_ptr = (struct dapl_ep *)ep_handle;
+ ep_ptr = (struct dapl_ep *)ep;
if (ep_ptr->qp == NULL) {
printk(KERN_ERR "dapl_ib_connect: qp handle invalid\n");
return DAT_INTERNAL_ERROR;
@@ -460,9 +460,9 @@ u32 dapl_ib_connect(DAT_EP_HANDLE ep_han
kfree(conn);
return DAT_INTERNAL_ERROR;
}
- conn->ep->cm_handle = conn;
+ conn->ep->cm = conn;
- ia_ptr = conn->ep->header.owner_ia;
+ ia_ptr = conn->ep->common.owner_ia;
/* Setup QP/CM parameters */
memset(&conn->param, 0, sizeof conn->param);
@@ -507,7 +507,7 @@ u32 dapl_ib_connect(DAT_EP_HANDLE ep_han
* Disconnect an EP
*
* Input:
- * ep_handle
+ * ep
* close_flags
*
* Output:
@@ -521,7 +521,7 @@ u32 dapl_ib_connect(DAT_EP_HANDLE ep_han
*/
u32 dapl_ib_disconnect(struct dapl_ep *ep_ptr, enum dat_close_flags close_flags)
{
- struct dapl_cm_id *conn = ep_ptr->cm_handle;
+ struct dapl_cm_id *conn = ep_ptr->cm;
int status;
dapl_dbg_log(DAPL_DBG_TYPE_CM,
@@ -537,7 +537,7 @@ u32 dapl_ib_disconnect(struct dapl_ep *e
status = ib_send_cm_dreq(conn->cm_id, NULL, 0);
if (status)
printk(KERN_ERR "dapl_ib_disconnect: CM ID 0x%p "
- "status %d\n", ep_ptr->cm_handle, status);
+ "status %d\n", ep_ptr->cm, status);
}
return DAT_SUCCESS;
@@ -607,14 +607,14 @@ void dapl_ib_reinit_ep(struct dapl_ep *e
dapl_dbg_log(DAPL_DBG_TYPE_CM,
" >>> dapl_ib_reinit_ep: EP %p\n", ep_ptr);
- ia_ptr = ep_ptr->header.owner_ia;
+ ia_ptr = ep_ptr->common.owner_ia;
/*
* What if QP is connected? Do we need to destroy the cm_id
* here as well, send a DREQ, REJ? What cm_id state are we in?
* we may not care if we just destroy the cm_id
- * ib_destroy_cm_id(ep_ptr->cm_handle);
- * supporting this call may require setting the cm_handle to
+ * ib_destroy_cm_id(ep_ptr->cm);
+ * supporting this call may require setting the cm to
* something like NULL wherever it is destroyed
*/
@@ -685,7 +685,7 @@ u32 dapl_ib_setup_conn_listener(struct d
* Have the CM remove a connection listener.
*
* Input:
- * ia_handle IA handle
+ * ia IA handle
* ServiceID IB Channel Service ID
*
* Output:
@@ -719,7 +719,7 @@ u32 dapl_ib_remove_conn_listener(struct
* Perform necessary steps to reject a connection
*
* Input:
- * cm_handle
+ * cm
*
* Output:
* none
@@ -730,24 +730,24 @@ u32 dapl_ib_remove_conn_listener(struct
* DAT_INVALID_PARAMETER
*
*/
-u32 dapl_ib_reject_connection(struct dapl_cm_id *cm_handle)
+u32 dapl_ib_reject_connection(struct dapl_cm_id *cm)
{
int status;
- if (cm_handle == NULL) {
+ if (cm == NULL) {
dapl_dbg_log(DAPL_DBG_TYPE_ERR,
"dapl_ib_reject_connection: invalid cm handle\n");
return DAT_SUCCESS;
}
- status = ib_send_cm_rej(cm_handle->cm_id, IB_CM_REJ_CONSUMER_DEFINED,
+ status = ib_send_cm_rej(cm->cm_id, IB_CM_REJ_CONSUMER_DEFINED,
NULL, 0, NULL, 0);
if (status) {
dapl_dbg_log(DAPL_DBG_TYPE_ERR, " dapl_ib_reject_connection: "
"ib_send_cm_rej failed: %d\n", status);
return DAT_ERROR(DAT_INSUFFICIENT_RESOURCES, 0);
}
- dapl_destroy_cm_id(cm_handle);
+ dapl_destroy_cm_id(cm);
return DAT_SUCCESS;
}
@@ -757,8 +757,8 @@ u32 dapl_ib_reject_connection(struct dap
* Perform necessary steps to accept a connection
*
* Input:
- * cr_handle
- * ep_handle
+ * cr
+ * ep
* private_data_size
* private_data
*
@@ -771,7 +771,7 @@ u32 dapl_ib_reject_connection(struct dap
* DAT_INVALID_PARAMETER
*
*/
-u32 dapl_ib_accept_connection(DAT_CR_HANDLE cr_handle, DAT_EP_HANDLE ep_handle,
+u32 dapl_ib_accept_connection(struct dat_cr *cr, struct dat_ep *ep,
int private_data_size,
const void *prd_ptr)
{
@@ -783,9 +783,9 @@ u32 dapl_ib_accept_connection(DAT_CR_HAN
struct ib_cm_rep_param passive_params;
struct dapl_cm_id *conn;
- cr_ptr = (struct dapl_cr *)cr_handle;
- ep_ptr = (struct dapl_ep *)ep_handle;
- ia_ptr = ep_ptr->header.owner_ia;
+ cr_ptr = (struct dapl_cr *)cr;
+ ep_ptr = (struct dapl_ep *)ep;
+ ia_ptr = ep_ptr->common.owner_ia;
conn = cr_ptr->ib_cm_handle;
/* Obtain size of private data structure & contents */
@@ -810,8 +810,8 @@ u32 dapl_ib_accept_connection(DAT_CR_HAN
}
}
- cr_ptr->param.local_ep_handle = ep_handle;
- ep_ptr->cm_handle = conn;
+ cr_ptr->param.local_ep = ep;
+ ep_ptr->cm = conn;
conn->ep = ep_ptr;
memset(&passive_params, 0, sizeof passive_params);
@@ -851,7 +851,7 @@ reject:
/*
* ib_cm_get_remote_gid
*/
-static int ib_cm_get_remote_gid(struct dapl_cm_id *cm_handle, u8 *remote_gid)
+static int ib_cm_get_remote_gid(struct dapl_cm_id *cm, u8 *remote_gid)
{
return DAT_INTERNAL_ERROR; /* for now!!! */
}
@@ -862,7 +862,7 @@ static int ib_cm_get_remote_gid(struct d
* Obtain the remote IP address given a connection
*
* Input:
- * cr_handle
+ * cr
* private data structure handle (only if not using ATS)
*
* Output:
@@ -874,7 +874,7 @@ static int ib_cm_get_remote_gid(struct d
* DAT_INVALID_PARAMETER
*
*/
-u32 dapl_ib_cm_remote_addr(DAT_HANDLE dat_handle,
+u32 dapl_ib_cm_remote_addr(void *dat_handle,
struct sockaddr_in6 *remote_ia_address)
{
struct dapl_ia *ia_ptr;
@@ -883,7 +883,7 @@ u32 dapl_ib_cm_remote_addr(DAT_HANDLE da
struct dapl_cr *cr_ptr = (struct dapl_cr *)dat_handle;
- ia_ptr = (struct dapl_ia *)cr_ptr->sp_ptr->ia_handle;
+ ia_ptr = (struct dapl_ia *)cr_ptr->sp_ptr->ia;
rc = ib_cm_get_remote_gid(cr_ptr->ib_cm_handle, (u8 *) & remote_gid);
if (rc < 0)
Index: linux-kernel/patches/alt_dat_provider_makefile
===================================================================
--- linux-kernel/patches/alt_dat_provider_makefile (revision 2564)
+++ linux-kernel/patches/alt_dat_provider_makefile (working copy)
@@ -21,8 +21,6 @@ PROVIDER_MODULES := \
dapl_cr_util \
dapl_ep \
dapl_evd \
- dapl_get_consumer_context \
- dapl_get_handle_type \
dapl_hash \
dapl_hca_util \
dapl_ia_close \
@@ -39,7 +37,6 @@ PROVIDER_MODULES := \
dapl_ring_buffer_util \
dapl_rmr \
dapl_rsp \
- dapl_set_consumer_context \
dapl_sp_util \
dapl_srq \
dapl_util
Index: linux-kernel/dat/api.c
===================================================================
--- linux-kernel/dat/api.c (revision 2564)
+++ linux-kernel/dat/api.c (working copy)
@@ -350,7 +350,7 @@ static u32 dat_strerror_minor(u32 value,
}
u32 dat_ia_openv(const char *name, int async_event_qlen,
- DAT_EVD_HANDLE *async_event_handle, DAT_IA_HANDLE *ia_handle,
+ struct dat_evd **async_event_handle, struct dat_ia **ia,
u32 dat_major, u32 dat_minor, boolean_t thread_safety)
{
DAT_IA_OPEN_FUNC ia_open_func;
@@ -387,13 +387,12 @@ u32 dat_ia_openv(const char *name, int a
return status;
}
- return ia_open_func(name, async_event_qlen, async_event_handle,
- ia_handle);
+ return ia_open_func(name, async_event_qlen, async_event_handle, ia);
}
EXPORT_SYMBOL(dat_ia_openv);
-u32 dat_ia_close(DAT_IA_HANDLE ia_handle, enum dat_close_flags flags)
+u32 dat_ia_close(struct dat_ia *ia, enum dat_close_flags flags)
{
struct dat_provider *provider;
struct dat_provider_attr provider_attr;
@@ -401,17 +400,16 @@ u32 dat_ia_close(DAT_IA_HANDLE ia_handle
const char *ia_name;
dat_dbg_print(DAT_DBG_TYPE_CONSUMER_API,
- "%s(ia:%x, flags:%x)\n", __func__, ia_handle, flags);
+ "%s(ia:%x, flags:%x)\n", __func__, ia, flags);
- provider = DAT_HANDLE_TO_PROVIDER(ia_handle);
+ provider = DAT_HANDLE_TO_PROVIDER(ia);
ia_name = provider->device_name;
- if (DAT_SUCCESS != (status = dat_ia_query(ia_handle, NULL, NULL,
+ if (DAT_SUCCESS != (status = dat_ia_query(ia, NULL, NULL,
&provider_attr)))
dat_dbg_print(DAT_DBG_TYPE_CONSUMER_API,
"dat_ia_query for IA %s failed\n", ia_name);
- else if (DAT_SUCCESS != (status = provider->ia_close_func(ia_handle,
- flags)))
+ else if (DAT_SUCCESS != (status = provider->ia_close_func(ia, flags)))
dat_dbg_print(DAT_DBG_TYPE_CONSUMER_API,
"close function for IA %s failed\n", ia_name);
else {
Index: linux-kernel/dat/dat.h
===================================================================
--- linux-kernel/dat/dat.h (revision 2564)
+++ linux-kernel/dat/dat.h (working copy)
@@ -333,20 +333,6 @@ enum dat_return_subtype {
#define DAT_GET_TYPE(status) ((u32)(status) & DAT_TYPE_MASK)
#define DAT_GET_SUBTYPE(status) ((u32)(status) & DAT_SUBTYPE_MASK)
-/* dat handle types */
-enum dat_handle_type {
- DAT_HANDLE_TYPE_CR,
- DAT_HANDLE_TYPE_EP,
- DAT_HANDLE_TYPE_EVD,
- DAT_HANDLE_TYPE_IA,
- DAT_HANDLE_TYPE_LMR,
- DAT_HANDLE_TYPE_PSP,
- DAT_HANDLE_TYPE_PZ,
- DAT_HANDLE_TYPE_RMR,
- DAT_HANDLE_TYPE_RSP,
- DAT_HANDLE_TYPE_SRQ
-};
-
#define DAT_NAME_MAX_LENGTH 256
struct dat_named_attr {
@@ -385,21 +371,6 @@ enum dat_completion_flags {
#define DAT_TIMEOUT_MAX ULONG_MAX
-/* dat handles */
-typedef void *DAT_HANDLE;
-typedef DAT_HANDLE DAT_CR_HANDLE;
-typedef DAT_HANDLE DAT_EP_HANDLE;
-typedef DAT_HANDLE DAT_EVD_HANDLE;
-typedef DAT_HANDLE DAT_IA_HANDLE;
-typedef DAT_HANDLE DAT_LMR_HANDLE;
-typedef DAT_HANDLE DAT_PSP_HANDLE;
-typedef DAT_HANDLE DAT_PZ_HANDLE;
-typedef DAT_HANDLE DAT_RMR_HANDLE;
-typedef DAT_HANDLE DAT_RSP_HANDLE;
-typedef DAT_HANDLE DAT_SRQ_HANDLE;
-
-#define DAT_HANDLE_NULL ((DAT_HANDLE)NULL)
-
typedef u64 DAT_CONN_QUAL;
typedef u64 DAT_PORT_QUAL;
@@ -541,8 +512,8 @@ enum dat_mem_priv_flags {
/* RMR Arguments */
struct dat_rmr_param {
- DAT_IA_HANDLE ia_handle;
- DAT_PZ_HANDLE pz_handle;
+ struct dat_ia *ia;
+ struct dat_pz *pz;
struct dat_lmr_triplet lmr_triplet;
enum dat_mem_priv_flags mem_priv;
DAT_RMR_CONTEXT rmr_context;
@@ -588,17 +559,17 @@ enum dat_ep_state {
};
struct dat_ep_param {
- DAT_IA_HANDLE ia_handle;
+ struct dat_ia *ia;
enum dat_ep_state ep_state;
struct sockaddr *local_ia_address_ptr;
DAT_PORT_QUAL local_port_qual;
struct sockaddr *remote_ia_address_ptr;
DAT_PORT_QUAL remote_port_qual;
- DAT_PZ_HANDLE pz_handle;
- DAT_EVD_HANDLE recv_evd_handle;
- DAT_EVD_HANDLE request_evd_handle;
- DAT_EVD_HANDLE connect_evd_handle;
- DAT_SRQ_HANDLE srq_handle;
+ struct dat_pz *pz;
+ struct dat_evd *recv_evd;
+ struct dat_evd *request_evd;
+ struct dat_evd *connect_evd;
+ struct dat_srq *srq;
struct dat_ep_attr ep_attr;
};
@@ -654,9 +625,9 @@ struct dat_srq_attr {
};
struct dat_srq_param {
- DAT_IA_HANDLE ia_handle;
+ struct dat_ia *ia;
enum dat_srq_state srq_state;
- DAT_PZ_HANDLE pz_handle;
+ struct dat_pz *pz;
int max_recv_dtos;
int max_recv_iov;
int low_watermark;
@@ -667,25 +638,25 @@ struct dat_srq_param {
/* PZ Parameters */
struct dat_pz_param {
- DAT_IA_HANDLE ia_handle;
+ struct dat_ia *ia;
};
/* PSP Parameters */
struct dat_psp_param {
- DAT_IA_HANDLE ia_handle;
+ struct dat_ia *ia;
DAT_CONN_QUAL conn_qual;
- DAT_EVD_HANDLE evd_handle;
+ struct dat_evd *evd;
enum dat_psp_flags psp_flags;
};
/* RSP Parameters */
struct dat_rsp_param {
- DAT_IA_HANDLE ia_handle;
+ struct dat_ia *ia;
DAT_CONN_QUAL conn_qual;
- DAT_EVD_HANDLE evd_handle;
- DAT_EP_HANDLE ep_handle;
+ struct dat_evd *evd;
+ struct dat_ep *ep;
};
/* Connection Request Parameters.
@@ -712,11 +683,11 @@ struct dat_cr_param {
/* The local Endpoint provided by the Service Point for the requested
* connection. It is the only Endpoint that can accept a Connection
- * Request on this Service Point. The value DAT_HANDLE_NULL
+ * Request on this Service Point. The value NULL
* represents that there is no associated local Endpoint for the
* requested connection.
*/
- DAT_EP_HANDLE local_ep_handle;
+ struct dat_ep *local_ep;
};
/************************** Events ******************************/
@@ -753,7 +724,7 @@ enum dat_dto_completion_status {
/* DTO completion event data */
/* transfered_length is not defined if status is not DAT_SUCCESS */
struct dat_dto_completion_event_data {
- DAT_EP_HANDLE ep_handle;
+ struct dat_ep *ep;
DAT_DTO_COOKIE user_cookie;
enum dat_dto_completion_status status;
u64 transfered_length;
@@ -761,25 +732,20 @@ struct dat_dto_completion_event_data {
/* RMR bind completion event data */
struct dat_rmr_bind_completion_event_data {
- DAT_RMR_HANDLE rmr_handle;
+ struct dat_rmr *rmr;
DAT_RMR_COOKIE user_cookie;
enum dat_dto_completion_status status;
};
-typedef union dat_sp_handle {
- DAT_RSP_HANDLE rsp_handle;
- DAT_PSP_HANDLE psp_handle;
-} DAT_SP_HANDLE;
-
/* Connection Request Arrival event data */
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
- * DAT_HANDLE_NULL because the reserved Service Point is
+ * NULL because the reserved Service Point is
* automatically destroyed upon generating this event. Can be PSP
* or RSP.
*/
- DAT_SP_HANDLE sp_handle;
+ struct dat_sp *sp;
/* Address of the IA on which the Connection Request arrived. */
struct sockaddr *local_ia_address_ptr;
@@ -791,30 +757,30 @@ struct dat_cr_arrival_event_data {
/* The Connection Request instance created by a Provider for the
* arrived Connection Request. Consumers can find out private_data
- * passed by a remote Consumer from cr_handle. It is up to a Consumer
+ * passed by a remote Consumer from cr. It is up to a Consumer
* to dat_cr_accept or dat_cr_reject of the Connection Request.
*/
- DAT_CR_HANDLE cr_handle;
+ struct dat_cr *cr;
};
/* Connection event data */
struct dat_connection_event_data {
- DAT_EP_HANDLE ep_handle;
+ struct dat_ep *ep;
int private_data_size;
void *private_data;
};
/* Async Error event data */
-/* For unaffiliated asynchronous event dat_handle is ia_handle. For
- * Endpoint affiliated asynchronous event dat_handle is ep_handle. For
- * EVD affiliated asynchronous event dat_handle is evd_handle. For SRQ
+/* For unaffiliated asynchronous event dat_handle is ia. For
+ * Endpoint affiliated asynchronous event dat_handle is ep. For
+ * EVD affiliated asynchronous event dat_handle is evd. For SRQ
* affiliated asynchronous event dat_handle is srq_handle. For Memory
- * affiliated asynchronous event dat_handle is either lmr_handle,
- * rmr_handle or pz_handle.
+ * affiliated asynchronous event dat_handle is either lmr,
+ * rmr_handle or pz.
*/
struct dat_asynch_error_event_data {
- DAT_HANDLE dat_handle; /* either IA, EP, EVD, SRQ, */
+ void *dat_handle; /* either IA, EP, EVD, SRQ, */
/* LMR, RMR, or PZ handle */
int reason; /* object specific */
};
@@ -894,7 +860,7 @@ typedef union dat_event_data {
struct dat_event {
enum dat_event_number event_number;
- DAT_EVD_HANDLE evd_handle;
+ struct dat_evd *evd;
DAT_EVENT_DATA event_data;
};
@@ -934,7 +900,7 @@ struct dat_provider_info {
};
struct dat_evd_param {
- DAT_IA_HANDLE ia_handle;
+ struct dat_ia *ia;
int evd_qlen;
enum dat_upcall_policy upcall_policy;
struct dat_upcall_object upcall;
@@ -960,7 +926,7 @@ enum dat_mem_optimize_flags {
typedef union dat_region_description {
void *for_va;
- DAT_LMR_HANDLE for_lmr_handle;
+ struct dat_lmr *for_lmr;
void *for_pointer; /* For kdapl only */
void *for_array; /* For kdapl only */
u64 for_pa; /* For kdapl only */
@@ -968,11 +934,11 @@ typedef union dat_region_description {
/* LMR Arguments */
struct dat_lmr_param {
- DAT_IA_HANDLE ia_handle;
+ struct dat_ia *ia;
enum dat_mem_type mem_type;
DAT_REGION_DESCRIPTION region_desc;
u64 length;
- DAT_PZ_HANDLE pz_handle;
+ struct dat_pz *pz;
enum dat_mem_priv_flags mem_priv;
DAT_LMR_CONTEXT lmr_context;
DAT_RMR_CONTEXT rmr_context;
@@ -1083,178 +1049,176 @@ struct dat_provider_attr {
*
****************************************************************/
-typedef u32 (*DAT_IA_OPEN_FUNC)(const char *, int, DAT_EVD_HANDLE *,
- DAT_IA_HANDLE *);
+typedef u32 (*DAT_IA_OPEN_FUNC)(const char *, int, struct dat_evd **,
+ struct dat_ia **);
-typedef u32 (*DAT_IA_OPENV_FUNC)(const char *, int, DAT_EVD_HANDLE *,
- DAT_IA_HANDLE *, u32, u32, boolean_t);
+typedef u32 (*DAT_IA_OPENV_FUNC)(const char *, int, struct dat_evd **,
+ struct dat_ia **, u32, u32, boolean_t);
-typedef u32 (*DAT_IA_CLOSE_FUNC)(DAT_IA_HANDLE, enum dat_close_flags);
+typedef u32 (*DAT_IA_CLOSE_FUNC)(struct dat_ia *, enum dat_close_flags);
-typedef u32 (*DAT_IA_QUERY_FUNC)(DAT_IA_HANDLE, DAT_EVD_HANDLE *,
+typedef u32 (*DAT_IA_QUERY_FUNC)(struct dat_ia *, struct dat_evd **,
struct dat_ia_attr *,
struct dat_provider_attr *);
-typedef u32 (*DAT_SET_CONSUMER_CONTEXT_FUNC)(DAT_HANDLE, union dat_context);
-
-typedef u32 (*DAT_GET_CONSUMER_CONTEXT_FUNC)(DAT_HANDLE, union dat_context *);
+typedef u32 (*DAT_SET_CONSUMER_CONTEXT_FUNC)(void *, union dat_context);
-typedef u32 (*DAT_GET_HANDLE_TYPE_FUNC)(DAT_HANDLE, enum dat_handle_type *);
+typedef u32 (*DAT_GET_CONSUMER_CONTEXT_FUNC)(void *, union dat_context *);
-typedef u32 (*DAT_CR_QUERY_FUNC)(DAT_CR_HANDLE, struct dat_cr_param *);
+typedef u32 (*DAT_CR_QUERY_FUNC)(struct dat_cr *, struct dat_cr_param *);
-typedef u32 (*DAT_CR_ACCEPT_FUNC)(DAT_CR_HANDLE, DAT_EP_HANDLE, int,
+typedef u32 (*DAT_CR_ACCEPT_FUNC)(struct dat_cr *, struct dat_ep *, int,
const void*);
-typedef u32 (*DAT_CR_REJECT_FUNC)(DAT_CR_HANDLE);
+typedef u32 (*DAT_CR_REJECT_FUNC)(struct dat_cr *);
-typedef u32 (*DAT_CR_HANDOFF_FUNC)(DAT_CR_HANDLE, DAT_CONN_QUAL);
+typedef u32 (*DAT_CR_HANDOFF_FUNC)(struct dat_cr *, DAT_CONN_QUAL);
-typedef u32 (*DAT_EVD_RESIZE_FUNC)(DAT_EVD_HANDLE, int);
+typedef u32 (*DAT_EVD_RESIZE_FUNC)(struct dat_evd *, int);
-typedef u32 (*DAT_EVD_POST_SE_FUNC)(DAT_EVD_HANDLE, const struct dat_event *);
+typedef u32 (*DAT_EVD_POST_SE_FUNC)(struct dat_evd *, const struct dat_event *);
-typedef u32 (*DAT_EVD_DEQUEUE_FUNC)(DAT_EVD_HANDLE, struct dat_event *);
+typedef u32 (*DAT_EVD_DEQUEUE_FUNC)(struct dat_evd *, struct dat_event *);
-typedef u32 (*DAT_EVD_FREE_FUNC)(DAT_EVD_HANDLE);
+typedef u32 (*DAT_EVD_FREE_FUNC)(struct dat_evd *);
-typedef u32 (*DAT_EVD_QUERY_FUNC)(DAT_EVD_HANDLE, struct dat_evd_param *);
+typedef u32 (*DAT_EVD_QUERY_FUNC)(struct dat_evd *, struct dat_evd_param *);
-typedef u32 (*DAT_EP_CREATE_FUNC)(DAT_IA_HANDLE, DAT_PZ_HANDLE, DAT_EVD_HANDLE,
- DAT_EVD_HANDLE, DAT_EVD_HANDLE,
- const struct dat_ep_attr *, DAT_EP_HANDLE *);
+typedef u32 (*DAT_EP_CREATE_FUNC)(struct dat_ia *, struct dat_pz *, struct dat_evd *,
+ struct dat_evd *, struct dat_evd *,
+ const struct dat_ep_attr *, struct dat_ep **);
-typedef u32 (*DAT_EP_CREATE_WITH_SRQ_FUNC)(DAT_IA_HANDLE, DAT_PZ_HANDLE,
- DAT_EVD_HANDLE, DAT_EVD_HANDLE,
- DAT_EVD_HANDLE, DAT_SRQ_HANDLE,
+typedef u32 (*DAT_EP_CREATE_WITH_SRQ_FUNC)(struct dat_ia *, struct dat_pz *,
+ struct dat_evd *, struct dat_evd *,
+ struct dat_evd *, struct dat_srq *,
const struct dat_ep_attr *,
- DAT_EP_HANDLE *);
+ struct dat_ep **);
-typedef u32 (*DAT_EP_QUERY_FUNC)(DAT_EP_HANDLE, struct dat_ep_param *);
+typedef u32 (*DAT_EP_QUERY_FUNC)(struct dat_ep *, struct dat_ep_param *);
-typedef u32 (*DAT_EP_MODIFY_FUNC)(DAT_EP_HANDLE, enum dat_ep_param_mask,
+typedef u32 (*DAT_EP_MODIFY_FUNC)(struct dat_ep *, enum dat_ep_param_mask,
const struct dat_ep_param *);
-typedef u32 (*DAT_EP_CONNECT_FUNC)(DAT_EP_HANDLE, struct sockaddr *,
+typedef u32 (*DAT_EP_CONNECT_FUNC)(struct dat_ep *, struct sockaddr *,
DAT_CONN_QUAL, unsigned long timeout, int,
const void *, enum dat_qos,
enum dat_connect_flags);
-typedef u32 (*DAT_EP_DUP_CONNECT_FUNC)(DAT_EP_HANDLE, DAT_EP_HANDLE,
+typedef u32 (*DAT_EP_DUP_CONNECT_FUNC)(struct dat_ep *, struct dat_ep *,
unsigned long timeout, int, const void *,
enum dat_qos);
-typedef u32 (*DAT_EP_DISCONNECT_FUNC)(DAT_EP_HANDLE, enum dat_close_flags);
+typedef u32 (*DAT_EP_DISCONNECT_FUNC)(struct dat_ep *, enum dat_close_flags);
-typedef u32 (*DAT_EP_POST_SEND_FUNC)(DAT_EP_HANDLE, int,
+typedef u32 (*DAT_EP_POST_SEND_FUNC)(struct dat_ep *, int,
struct dat_lmr_triplet *, DAT_DTO_COOKIE,
enum dat_completion_flags);
-typedef u32 (*DAT_EP_POST_RECV_FUNC)(DAT_EP_HANDLE, int,
+typedef u32 (*DAT_EP_POST_RECV_FUNC)(struct dat_ep *, int,
struct dat_lmr_triplet *, DAT_DTO_COOKIE,
enum dat_completion_flags);
-typedef u32 (*DAT_EP_POST_RDMA_READ_FUNC)(DAT_EP_HANDLE, int,
+typedef u32 (*DAT_EP_POST_RDMA_READ_FUNC)(struct dat_ep *, int,
struct dat_lmr_triplet *,
DAT_DTO_COOKIE,
const struct dat_rmr_triplet *,
enum dat_completion_flags);
-typedef u32 (*DAT_EP_POST_RDMA_WRITE_FUNC)(DAT_EP_HANDLE, int,
+typedef u32 (*DAT_EP_POST_RDMA_WRITE_FUNC)(struct dat_ep *, int,
struct dat_lmr_triplet *,
DAT_DTO_COOKIE,
const struct dat_rmr_triplet *,
enum dat_completion_flags);
-typedef u32 (*DAT_EP_GET_STATUS_FUNC)(DAT_EP_HANDLE, enum dat_ep_state *,
+typedef u32 (*DAT_EP_GET_STATUS_FUNC)(struct dat_ep *, enum dat_ep_state *,
boolean_t *, boolean_t *);
-typedef u32 (*DAT_EP_FREE_FUNC)(DAT_EP_HANDLE);
+typedef u32 (*DAT_EP_FREE_FUNC)(struct dat_ep *);
-typedef u32 (*DAT_EP_RESET_FUNC)(DAT_EP_HANDLE);
+typedef u32 (*DAT_EP_RESET_FUNC)(struct dat_ep *);
-typedef u32 (*DAT_EP_RECV_QUERY_FUNC)(DAT_EP_HANDLE, int *, int *);
+typedef u32 (*DAT_EP_RECV_QUERY_FUNC)(struct dat_ep *, int *, int *);
-typedef u32 (*DAT_EP_SET_WATERMARK_FUNC)(DAT_EP_HANDLE, int, int);
+typedef u32 (*DAT_EP_SET_WATERMARK_FUNC)(struct dat_ep *, int, int);
-typedef u32 (*DAT_LMR_FREE_FUNC)(DAT_LMR_HANDLE);
+typedef u32 (*DAT_LMR_FREE_FUNC)(struct dat_lmr *);
-typedef u32 (*DAT_LMR_QUERY_FUNC)(DAT_LMR_HANDLE, struct dat_lmr_param *);
+typedef u32 (*DAT_LMR_QUERY_FUNC)(struct dat_lmr *, struct dat_lmr_param *);
-typedef u32 (*DAT_LMR_SYNC_RDMA_READ_FUNC)(DAT_IA_HANDLE,
+typedef u32 (*DAT_LMR_SYNC_RDMA_READ_FUNC)(struct dat_ia *,
const struct dat_lmr_triplet *,
u64);
-typedef u32 (*DAT_LMR_SYNC_RDMA_WRITE_FUNC)(DAT_IA_HANDLE,
+typedef u32 (*DAT_LMR_SYNC_RDMA_WRITE_FUNC)(struct dat_ia *,
const struct dat_lmr_triplet *,
u64);
-typedef u32 (*DAT_RMR_CREATE_FUNC)(DAT_PZ_HANDLE, DAT_RMR_HANDLE *);
+typedef u32 (*DAT_RMR_CREATE_FUNC)(struct dat_pz *, struct dat_rmr * *);
-typedef u32 (*DAT_RMR_QUERY_FUNC)(DAT_RMR_HANDLE, struct dat_rmr_param *);
+typedef u32 (*DAT_RMR_QUERY_FUNC)(struct dat_rmr *, struct dat_rmr_param *);
-typedef u32 (*DAT_RMR_BIND_FUNC)(DAT_RMR_HANDLE, const struct dat_lmr_triplet *,
- enum dat_mem_priv_flags, DAT_EP_HANDLE,
+typedef u32 (*DAT_RMR_BIND_FUNC)(struct dat_rmr *, const struct dat_lmr_triplet *,
+ enum dat_mem_priv_flags, struct dat_ep *,
DAT_RMR_COOKIE, enum dat_completion_flags,
DAT_RMR_CONTEXT *);
-typedef u32 (*DAT_RMR_FREE_FUNC)(DAT_RMR_HANDLE);
+typedef u32 (*DAT_RMR_FREE_FUNC)(struct dat_rmr *);
-typedef u32 (*DAT_PSP_CREATE_FUNC)(DAT_IA_HANDLE, DAT_CONN_QUAL, DAT_EVD_HANDLE,
- enum dat_psp_flags, DAT_PSP_HANDLE *);
+typedef u32 (*DAT_PSP_CREATE_FUNC)(struct dat_ia *, DAT_CONN_QUAL, struct dat_evd *,
+ enum dat_psp_flags, struct dat_sp **);
-typedef u32 (*DAT_PSP_CREATE_ANY_FUNC)(DAT_IA_HANDLE, DAT_CONN_QUAL *,
- DAT_EVD_HANDLE, enum dat_psp_flags,
- DAT_PSP_HANDLE *);
+typedef u32 (*DAT_PSP_CREATE_ANY_FUNC)(struct dat_ia *, DAT_CONN_QUAL *,
+ struct dat_evd *, enum dat_psp_flags,
+ struct dat_sp **);
-typedef u32 (*DAT_PSP_QUERY_FUNC)(DAT_PSP_HANDLE, struct dat_psp_param *);
+typedef u32 (*DAT_PSP_QUERY_FUNC)(struct dat_sp *, struct dat_psp_param *);
-typedef u32 (*DAT_PSP_FREE_FUNC)(DAT_PSP_HANDLE);
+typedef u32 (*DAT_PSP_FREE_FUNC)(struct dat_sp *);
-typedef u32 (*DAT_RSP_CREATE_FUNC)(DAT_IA_HANDLE, DAT_CONN_QUAL, DAT_EP_HANDLE,
- DAT_EVD_HANDLE, DAT_RSP_HANDLE *);
+typedef u32 (*DAT_RSP_CREATE_FUNC)(struct dat_ia *, DAT_CONN_QUAL, struct dat_ep *,
+ struct dat_evd *, struct dat_sp **);
-typedef u32 (*DAT_RSP_QUERY_FUNC)(DAT_RSP_HANDLE, struct dat_rsp_param *);
+typedef u32 (*DAT_RSP_QUERY_FUNC)(struct dat_sp *, struct dat_rsp_param *);
-typedef u32 (*DAT_RSP_FREE_FUNC)(DAT_RSP_HANDLE);
+typedef u32 (*DAT_RSP_FREE_FUNC)(struct dat_sp *);
-typedef u32 (*DAT_PZ_CREATE_FUNC)(DAT_IA_HANDLE, DAT_PZ_HANDLE *);
+typedef u32 (*DAT_PZ_CREATE_FUNC)(struct dat_ia *, struct dat_pz **);
-typedef u32 (*DAT_PZ_QUERY_FUNC)(DAT_PZ_HANDLE, struct dat_pz_param *);
+typedef u32 (*DAT_PZ_QUERY_FUNC)(struct dat_pz *, struct dat_pz_param *);
-typedef u32 (*DAT_PZ_FREE_FUNC)(DAT_PZ_HANDLE);
+typedef u32 (*DAT_PZ_FREE_FUNC)(struct dat_pz *);
-typedef u32 (*DAT_SRQ_CREATE_FUNC)(DAT_IA_HANDLE, DAT_PZ_HANDLE,
- struct dat_srq_attr *, DAT_SRQ_HANDLE *);
+typedef u32 (*DAT_SRQ_CREATE_FUNC)(struct dat_ia *, struct dat_pz *,
+ struct dat_srq_attr *, struct dat_srq **);
-typedef u32 (*DAT_SRQ_SET_LW_FUNC)(DAT_SRQ_HANDLE, int);
+typedef u32 (*DAT_SRQ_SET_LW_FUNC)(struct dat_srq *, int);
-typedef u32 (*DAT_SRQ_FREE_FUNC)(DAT_SRQ_HANDLE);
+typedef u32 (*DAT_SRQ_FREE_FUNC)(struct dat_srq *);
-typedef u32 (*DAT_SRQ_QUERY_FUNC)(DAT_SRQ_HANDLE, struct dat_srq_param *);
+typedef u32 (*DAT_SRQ_QUERY_FUNC)(struct dat_srq *, struct dat_srq_param *);
-typedef u32 (*DAT_SRQ_RESIZE_FUNC)(DAT_SRQ_HANDLE, int);
+typedef u32 (*DAT_SRQ_RESIZE_FUNC)(struct dat_srq *, int);
-typedef u32 (*DAT_SRQ_POST_RECV_FUNC)(DAT_SRQ_HANDLE, int,
+typedef u32 (*DAT_SRQ_POST_RECV_FUNC)(struct dat_srq *, int,
struct dat_lmr_triplet *, DAT_DTO_COOKIE);
-typedef u32 (*DAT_LMR_KCREATE_FUNC)(DAT_IA_HANDLE, enum dat_mem_type,
+typedef u32 (*DAT_LMR_KCREATE_FUNC)(struct dat_ia *, enum dat_mem_type,
DAT_REGION_DESCRIPTION, u64,
- DAT_PZ_HANDLE, enum dat_mem_priv_flags,
+ struct dat_pz *, enum dat_mem_priv_flags,
enum dat_mem_optimize_flags,
- DAT_LMR_HANDLE *,
+ struct dat_lmr **,
DAT_LMR_CONTEXT *, DAT_RMR_CONTEXT *,
u64 *, u64 *);
-typedef u32 (*DAT_IA_MEMTYPE_HINT_FUNC)(DAT_IA_HANDLE, enum dat_mem_type, u64,
+typedef u32 (*DAT_IA_MEMTYPE_HINT_FUNC)(struct dat_ia *, enum dat_mem_type, u64,
enum dat_mem_optimize_flags, u64 *,
u64 *);
-typedef u32 (*DAT_EVD_KCREATE_FUNC) (DAT_IA_HANDLE, int, enum dat_upcall_policy,
+typedef u32 (*DAT_EVD_KCREATE_FUNC) (struct dat_ia *, int, enum dat_upcall_policy,
const struct dat_upcall_object *,
- enum dat_evd_flags, DAT_EVD_HANDLE *);
+ enum dat_evd_flags, struct dat_evd **);
-typedef u32 (*DAT_EVD_MODIFY_UPCALL_FUNC)(DAT_EVD_HANDLE,
+typedef u32 (*DAT_EVD_MODIFY_UPCALL_FUNC)(struct dat_evd *,
enum dat_upcall_policy,
const struct dat_upcall_object *);
@@ -1269,7 +1233,6 @@ struct dat_provider {
DAT_SET_CONSUMER_CONTEXT_FUNC set_consumer_context_func;
DAT_GET_CONSUMER_CONTEXT_FUNC get_consumer_context_func;
- DAT_GET_HANDLE_TYPE_FUNC get_handle_type_func;
DAT_CR_QUERY_FUNC cr_query_func;
DAT_CR_ACCEPT_FUNC cr_accept_func;
@@ -1338,6 +1301,52 @@ struct dat_provider {
DAT_SRQ_SET_LW_FUNC srq_set_lw_func;
};
+struct dat_ep {
+ struct dat_provider *provider;
+};
+
+struct dat_ia {
+ struct dat_provider *provider;
+};
+
+struct dat_evd {
+ struct dat_provider *provider;
+};
+
+struct dat_cno {
+ struct dat_provider *provider;
+};
+
+struct dat_srq {
+ struct dat_provider *provider;
+};
+
+struct dat_pz {
+ struct dat_provider *provider;
+};
+
+struct dat_lmr {
+ struct dat_provider *provider;
+};
+
+struct dat_rmr {
+ struct dat_provider *provider;
+};
+
+enum dat_sp_type {
+ DAT_SP_TYPE_RSP,
+ DAT_SP_TYPE_PSP
+};
+
+struct dat_sp {
+ struct dat_provider *provider;
+ enum dat_sp_type type;
+};
+
+struct dat_cr {
+ struct dat_provider *provider;
+};
+
/***************************************************************
*
* FUNCTION PROTOTYPES
@@ -1359,8 +1368,8 @@ extern u32 dat_registry_remove_provider(
* DAT registry functions for consumers
*/
extern u32 dat_ia_openv(const char *name, int async_event_qlen,
- DAT_EVD_HANDLE *async_event_handle,
- DAT_IA_HANDLE *ia_handle, u32 dat_major, u32 dat_minor,
+ struct dat_evd **async_event_handle,
+ struct dat_ia **ia, u32 dat_major, u32 dat_minor,
boolean_t thread_safety);
#define dat_ia_open(name, qlen, async_evd, ia) \
@@ -1368,7 +1377,7 @@ extern u32 dat_ia_openv(const char *name
DAT_VERSION_MAJOR, DAT_VERSION_MINOR, \
DAT_THREADSAFE)
-extern u32 dat_ia_close(DAT_IA_HANDLE, enum dat_close_flags);
+extern u32 dat_ia_close(struct dat_ia *, enum dat_close_flags);
extern u32 dat_strerror(u32, const char **, const char **);
@@ -1383,27 +1392,21 @@ extern u32 dat_registry_list_providers(i
#define DAT_CALL_PROVIDER_FUNC(func, handle, ...) \
DAT_HANDLE_TO_PROVIDER(handle)->func(handle, ##__VA_ARGS__)
-static inline u32 dat_set_consumer_context(DAT_HANDLE handle,
+static inline u32 dat_set_consumer_context(void *handle,
union dat_context context)
{
return DAT_CALL_PROVIDER_FUNC(set_consumer_context_func, handle,
context);
}
-static inline u32 dat_get_consumer_context(DAT_HANDLE handle,
+static inline u32 dat_get_consumer_context(void *handle,
union dat_context *context)
{
return DAT_CALL_PROVIDER_FUNC(get_consumer_context_func, handle,
context);
}
-static inline u32 dat_get_handle_type(DAT_HANDLE handle,
- enum dat_handle_type *type)
-{
- return DAT_CALL_PROVIDER_FUNC(get_handle_type_func, handle, type);
-}
-
-static inline u32 dat_ia_memtype_hint(DAT_IA_HANDLE ia,
+static inline u32 dat_ia_memtype_hint(struct dat_ia *ia,
enum dat_mem_type mem_type,
u64 length,
enum dat_mem_optimize_flags mem_optimize,
@@ -1415,7 +1418,7 @@ static inline u32 dat_ia_memtype_hint(DA
preferred_alignment);
}
-static inline u32 dat_ia_query(DAT_IA_HANDLE ia, DAT_EVD_HANDLE *async_evd,
+static inline u32 dat_ia_query(struct dat_ia *ia, struct dat_evd **async_evd,
struct dat_ia_attr *ia_attr,
struct dat_provider_attr *provider_attr)
{
@@ -1423,49 +1426,49 @@ static inline u32 dat_ia_query(DAT_IA_HA
ia_query_func, ia, async_evd, ia_attr, provider_attr);
}
-static inline u32 dat_cr_accept(DAT_CR_HANDLE cr, DAT_EP_HANDLE ep,
+static inline u32 dat_cr_accept(struct dat_cr *cr, struct dat_ep *ep,
int private_data_size, const void *private_data)
{
return DAT_CALL_PROVIDER_FUNC(
cr_accept_func, cr, ep, private_data_size, private_data);
}
-static inline u32 dat_cr_handoff(DAT_CR_HANDLE cr, DAT_CONN_QUAL handoff)
+static inline u32 dat_cr_handoff(struct dat_cr *cr, DAT_CONN_QUAL handoff)
{
return DAT_CALL_PROVIDER_FUNC(cr_handoff_func, cr, handoff);
}
-static inline u32 dat_cr_query(DAT_CR_HANDLE cr, struct dat_cr_param *param)
+static inline u32 dat_cr_query(struct dat_cr *cr, struct dat_cr_param *param)
{
return DAT_CALL_PROVIDER_FUNC(cr_query_func, cr, param);
}
-static inline u32 dat_cr_reject(DAT_CR_HANDLE cr)
+static inline u32 dat_cr_reject(struct dat_cr *cr)
{
return DAT_CALL_PROVIDER_FUNC(cr_reject_func, cr);
}
-static inline u32 dat_evd_dequeue(DAT_EVD_HANDLE evd, struct dat_event *event)
+static inline u32 dat_evd_dequeue(struct dat_evd *evd, struct dat_event *event)
{
return DAT_CALL_PROVIDER_FUNC(evd_dequeue_func, evd, event);
}
-static inline u32 dat_evd_free(DAT_EVD_HANDLE evd)
+static inline u32 dat_evd_free(struct dat_evd *evd)
{
return DAT_CALL_PROVIDER_FUNC(evd_free_func, evd);
}
-static inline u32 dat_evd_kcreate(DAT_IA_HANDLE ia, int qlen,
+static inline u32 dat_evd_kcreate(struct dat_ia *ia, int qlen,
enum dat_upcall_policy policy,
const struct dat_upcall_object *upcall,
enum dat_evd_flags flags,
- DAT_EVD_HANDLE * evd)
+ struct dat_evd ** evd)
{
return DAT_CALL_PROVIDER_FUNC(evd_kcreate_func, ia, qlen, policy,
upcall, flags, evd);
}
-static inline u32 dat_evd_modify_upcall(DAT_EVD_HANDLE evd,
+static inline u32 dat_evd_modify_upcall(struct dat_evd *evd,
enum dat_upcall_policy policy,
const struct dat_upcall_object *upcall)
{
@@ -1473,23 +1476,23 @@ static inline u32 dat_evd_modify_upcall(
upcall);
}
-static inline u32 dat_evd_post_se(DAT_EVD_HANDLE evd,
+static inline u32 dat_evd_post_se(struct dat_evd *evd,
const struct dat_event *event)
{
return DAT_CALL_PROVIDER_FUNC(evd_post_se_func, evd, event);
}
-static inline u32 dat_evd_query(DAT_EVD_HANDLE evd, struct dat_evd_param *param)
+static inline u32 dat_evd_query(struct dat_evd *evd, struct dat_evd_param *param)
{
return DAT_CALL_PROVIDER_FUNC(evd_query_func, evd, param);
}
-static inline u32 dat_evd_resize(DAT_EVD_HANDLE evd, int qlen)
+static inline u32 dat_evd_resize(struct dat_evd *evd, int qlen)
{
return DAT_CALL_PROVIDER_FUNC(evd_resize_func, evd, qlen);
}
-static inline u32 dat_ep_connect(DAT_EP_HANDLE ep, struct sockaddr *ia_addr,
+static inline u32 dat_ep_connect(struct dat_ep *ep, struct sockaddr *ia_addr,
DAT_CONN_QUAL conn_qual, unsigned long timeout,
int private_data_size,
const void *private_data, enum dat_qos qos,
@@ -1500,36 +1503,36 @@ static inline u32 dat_ep_connect(DAT_EP_
qos, flags);
}
-static inline u32 dat_ep_create(DAT_IA_HANDLE ia, DAT_PZ_HANDLE pz,
- DAT_EVD_HANDLE in_evd, DAT_EVD_HANDLE out_evd,
- DAT_EVD_HANDLE connect_evd,
+static inline u32 dat_ep_create(struct dat_ia *ia, struct dat_pz *pz,
+ struct dat_evd *in_evd, struct dat_evd *out_evd,
+ struct dat_evd *connect_evd,
const struct dat_ep_attr *attr,
- DAT_EP_HANDLE *ep)
+ struct dat_ep **ep)
{
return DAT_CALL_PROVIDER_FUNC(ep_create_func, ia, pz, in_evd, out_evd,
connect_evd, attr, ep);
}
-static inline u32 dat_ep_create_with_srq(DAT_IA_HANDLE ia, DAT_PZ_HANDLE pz,
- DAT_EVD_HANDLE in_evd,
- DAT_EVD_HANDLE out_evd,
- DAT_EVD_HANDLE connect_evd,
- DAT_SRQ_HANDLE srq,
+static inline u32 dat_ep_create_with_srq(struct dat_ia *ia, struct dat_pz *pz,
+ struct dat_evd *in_evd,
+ struct dat_evd *out_evd,
+ struct dat_evd *connect_evd,
+ struct dat_srq *srq,
const struct dat_ep_attr *attr,
- DAT_EP_HANDLE *ep)
+ struct dat_ep **ep)
{
return DAT_CALL_PROVIDER_FUNC(ep_create_with_srq_func, ia, pz, in_evd,
out_evd, connect_evd, srq, attr, ep);
}
-static inline u32 dat_ep_disconnect(DAT_EP_HANDLE ep,
+static inline u32 dat_ep_disconnect(struct dat_ep *ep,
enum dat_close_flags flags)
{
return DAT_CALL_PROVIDER_FUNC(ep_disconnect_func, ep, flags);
}
-static inline u32 dat_ep_dup_connect(DAT_EP_HANDLE ep, DAT_EP_HANDLE dup_ep,
+static inline u32 dat_ep_dup_connect(struct dat_ep *ep, struct dat_ep *dup_ep,
unsigned long timeout,
int private_data_size,
const void *private_data, enum dat_qos qos)
@@ -1538,25 +1541,25 @@ static inline u32 dat_ep_dup_connect(DAT
private_data_size, private_data, qos);
}
-static inline u32 dat_ep_free(DAT_EP_HANDLE ep)
+static inline u32 dat_ep_free(struct dat_ep *ep)
{
return DAT_CALL_PROVIDER_FUNC(ep_free_func, ep);
}
-static inline u32 dat_ep_get_status(DAT_EP_HANDLE ep, enum dat_ep_state *state,
+static inline u32 dat_ep_get_status(struct dat_ep *ep, enum dat_ep_state *state,
boolean_t *recv_idle, boolean_t *req_idle)
{
return DAT_CALL_PROVIDER_FUNC(ep_get_status_func, ep, state, recv_idle,
req_idle);
}
-static inline u32 dat_ep_modify(DAT_EP_HANDLE ep, enum dat_ep_param_mask mask,
+static inline u32 dat_ep_modify(struct dat_ep *ep, enum dat_ep_param_mask mask,
const struct dat_ep_param *param)
{
return DAT_CALL_PROVIDER_FUNC(ep_modify_func, ep, mask, param);
}
-static inline u32 dat_ep_post_rdma_read(DAT_EP_HANDLE ep, int size,
+static inline u32 dat_ep_post_rdma_read(struct dat_ep *ep, int size,
struct dat_lmr_triplet *local_iov,
DAT_DTO_COOKIE cookie,
const struct dat_rmr_triplet *remote_iov,
@@ -1566,7 +1569,7 @@ static inline u32 dat_ep_post_rdma_read(
local_iov, cookie, remote_iov, flags);
}
-static inline u32 dat_ep_post_rdma_write(DAT_EP_HANDLE ep, int size,
+static inline u32 dat_ep_post_rdma_write(struct dat_ep *ep, int size,
struct dat_lmr_triplet *local_iov,
DAT_DTO_COOKIE cookie,
const struct dat_rmr_triplet *remote_iov,
@@ -1576,7 +1579,7 @@ static inline u32 dat_ep_post_rdma_write
local_iov, cookie, remote_iov, flags);
}
-static inline u32 dat_ep_post_recv(DAT_EP_HANDLE ep, int size,
+static inline u32 dat_ep_post_recv(struct dat_ep *ep, int size,
struct dat_lmr_triplet *local_iov,
DAT_DTO_COOKIE cookie,
enum dat_completion_flags flags)
@@ -1585,7 +1588,7 @@ static inline u32 dat_ep_post_recv(DAT_E
cookie, flags);
}
-static inline u32 dat_ep_post_send(DAT_EP_HANDLE ep,
+static inline u32 dat_ep_post_send(struct dat_ep *ep,
int size,
struct dat_lmr_triplet *local_iov,
DAT_DTO_COOKIE cookie,
@@ -1595,24 +1598,24 @@ static inline u32 dat_ep_post_send(DAT_E
ep_post_send_func, ep, size, local_iov, cookie, flags);
}
-static inline u32 dat_ep_query(DAT_EP_HANDLE ep, struct dat_ep_param *param)
+static inline u32 dat_ep_query(struct dat_ep *ep, struct dat_ep_param *param)
{
return DAT_CALL_PROVIDER_FUNC(ep_query_func, ep, param);
}
-static inline u32 dat_ep_recv_query(DAT_EP_HANDLE ep, int *bufs_alloc,
+static inline u32 dat_ep_recv_query(struct dat_ep *ep, int *bufs_alloc,
int *bufs_avail)
{
return DAT_CALL_PROVIDER_FUNC(ep_recv_query_func, ep, bufs_alloc,
bufs_avail);
}
-static inline u32 dat_ep_reset(DAT_EP_HANDLE ep)
+static inline u32 dat_ep_reset(struct dat_ep *ep)
{
return DAT_CALL_PROVIDER_FUNC(ep_reset_func, ep);
}
-static inline u32 dat_ep_set_watermark(DAT_EP_HANDLE ep,
+static inline u32 dat_ep_set_watermark(struct dat_ep *ep,
int soft_high_watermark,
int hard_high_watermark)
{
@@ -1620,17 +1623,17 @@ static inline u32 dat_ep_set_watermark(D
soft_high_watermark, hard_high_watermark);
}
-static inline u32 dat_lmr_query(DAT_LMR_HANDLE lmr, struct dat_lmr_param *param)
+static inline u32 dat_lmr_query(struct dat_lmr *lmr, struct dat_lmr_param *param)
{
return DAT_CALL_PROVIDER_FUNC(lmr_query_func, lmr, param);
}
-static inline u32 dat_lmr_free(DAT_LMR_HANDLE lmr)
+static inline u32 dat_lmr_free(struct dat_lmr *lmr)
{
return DAT_CALL_PROVIDER_FUNC(lmr_free_func, lmr);
}
-static inline u32 dat_lmr_sync_rdma_read(DAT_IA_HANDLE ia,
+static inline u32 dat_lmr_sync_rdma_read(struct dat_ia *ia,
const struct dat_lmr_triplet *iovs,
u64 num_iovs)
{
@@ -1638,7 +1641,7 @@ static inline u32 dat_lmr_sync_rdma_read
num_iovs);
}
-static inline u32 dat_lmr_sync_rdma_write(DAT_IA_HANDLE ia,
+static inline u32 dat_lmr_sync_rdma_write(struct dat_ia *ia,
const struct dat_lmr_triplet *iovs,
u64 num_iovs)
{
@@ -1646,20 +1649,20 @@ static inline u32 dat_lmr_sync_rdma_writ
num_iovs);
}
-static inline u32 dat_rmr_create(DAT_PZ_HANDLE pz, DAT_RMR_HANDLE *rmr)
+static inline u32 dat_rmr_create(struct dat_pz *pz, struct dat_rmr * *rmr)
{
return DAT_CALL_PROVIDER_FUNC(rmr_create_func, pz, rmr);
}
-static inline u32 dat_rmr_query(DAT_RMR_HANDLE rmr, struct dat_rmr_param *param)
+static inline u32 dat_rmr_query(struct dat_rmr * rmr, struct dat_rmr_param *param)
{
return DAT_CALL_PROVIDER_FUNC(rmr_query_func, rmr, param);
}
-static inline u32 dat_rmr_bind(DAT_RMR_HANDLE rmr,
+static inline u32 dat_rmr_bind(struct dat_rmr * rmr,
const struct dat_lmr_triplet *iov,
enum dat_mem_priv_flags mem_flags,
- DAT_EP_HANDLE ep, DAT_RMR_COOKIE cookie,
+ struct dat_ep *ep, DAT_RMR_COOKIE cookie,
enum dat_completion_flags comp_flags,
DAT_RMR_CONTEXT *context)
{
@@ -1667,84 +1670,84 @@ static inline u32 dat_rmr_bind(DAT_RMR_H
cookie, comp_flags, context);
}
-static inline u32 dat_rmr_free(DAT_RMR_HANDLE rmr)
+static inline u32 dat_rmr_free(struct dat_rmr * rmr)
{
return DAT_CALL_PROVIDER_FUNC(rmr_free_func, rmr);
}
-static inline u32 dat_psp_create(DAT_IA_HANDLE ia, DAT_CONN_QUAL conn_qual,
- DAT_EVD_HANDLE evd, enum dat_psp_flags flags,
- DAT_PSP_HANDLE *psp)
+static inline u32 dat_psp_create(struct dat_ia *ia, DAT_CONN_QUAL conn_qual,
+ struct dat_evd *evd, enum dat_psp_flags flags,
+ struct dat_sp **psp)
{
return DAT_CALL_PROVIDER_FUNC(psp_create_func, ia, conn_qual, evd,
flags, psp);
}
-static inline u32 dat_psp_create_any(DAT_IA_HANDLE ia, DAT_CONN_QUAL *conn_qual,
- DAT_EVD_HANDLE evd,
+static inline u32 dat_psp_create_any(struct dat_ia *ia, DAT_CONN_QUAL *conn_qual,
+ struct dat_evd *evd,
enum dat_psp_flags flags,
- DAT_PSP_HANDLE *psp)
+ struct dat_sp **psp)
{
return DAT_CALL_PROVIDER_FUNC(psp_create_any_func, ia, conn_qual, evd,
flags, psp);
}
-static inline u32 dat_psp_query(DAT_PSP_HANDLE psp, struct dat_psp_param *param)
+static inline u32 dat_psp_query(struct dat_sp *psp, struct dat_psp_param *param)
{
return DAT_CALL_PROVIDER_FUNC(psp_query_func, psp, param);
}
-static inline u32 dat_psp_free(DAT_PSP_HANDLE psp)
+static inline u32 dat_psp_free(struct dat_sp *psp)
{
return DAT_CALL_PROVIDER_FUNC(psp_free_func, psp);
}
-static inline u32 dat_rsp_create(DAT_IA_HANDLE ia, DAT_CONN_QUAL conn_qual,
- DAT_EP_HANDLE ep, DAT_EVD_HANDLE evd,
- DAT_RSP_HANDLE *rsp)
+static inline u32 dat_rsp_create(struct dat_ia *ia, DAT_CONN_QUAL conn_qual,
+ struct dat_ep *ep, struct dat_evd *evd,
+ struct dat_sp **rsp)
{
return DAT_CALL_PROVIDER_FUNC(rsp_create_func, ia, conn_qual, ep, evd,
rsp);
}
-static inline u32 dat_rsp_query(DAT_RSP_HANDLE rsp, struct dat_rsp_param *param)
+static inline u32 dat_rsp_query(struct dat_sp *rsp, struct dat_rsp_param *param)
{
return DAT_CALL_PROVIDER_FUNC(rsp_query_func, rsp, param);
}
-static inline u32 dat_rsp_free(DAT_RSP_HANDLE rsp)
+static inline u32 dat_rsp_free(struct dat_sp *rsp)
{
return DAT_CALL_PROVIDER_FUNC(rsp_free_func, rsp);
}
-static inline u32 dat_pz_create(DAT_IA_HANDLE ia, DAT_PZ_HANDLE *pz)
+static inline u32 dat_pz_create(struct dat_ia *ia, struct dat_pz **pz)
{
return DAT_CALL_PROVIDER_FUNC(pz_create_func, ia, pz);
}
-static inline u32 dat_pz_query(DAT_PZ_HANDLE pz, struct dat_pz_param *param)
+static inline u32 dat_pz_query(struct dat_pz *pz, struct dat_pz_param *param)
{
return DAT_CALL_PROVIDER_FUNC(pz_query_func, pz, param);
}
-static inline u32 dat_pz_free(DAT_PZ_HANDLE pz)
+static inline u32 dat_pz_free(struct dat_pz *pz)
{
return DAT_CALL_PROVIDER_FUNC(pz_free_func, pz);
}
-static inline u32 dat_srq_create(DAT_IA_HANDLE ia, DAT_PZ_HANDLE pz,
+static inline u32 dat_srq_create(struct dat_ia *ia, struct dat_pz *pz,
struct dat_srq_attr *attr,
- DAT_SRQ_HANDLE *srq)
+ struct dat_srq **srq)
{
return DAT_CALL_PROVIDER_FUNC(srq_create_func, ia, pz, attr, srq);
}
-static inline u32 dat_srq_free(DAT_SRQ_HANDLE srq)
+static inline u32 dat_srq_free(struct dat_srq *srq)
{
return DAT_CALL_PROVIDER_FUNC(srq_free_func, srq);
}
-static inline u32 dat_srq_post_recv(DAT_SRQ_HANDLE srq, int num_iovs,
+static inline u32 dat_srq_post_recv(struct dat_srq *srq, int num_iovs,
struct dat_lmr_triplet *iovs,
DAT_DTO_COOKIE cookie)
{
@@ -1752,34 +1755,34 @@ static inline u32 dat_srq_post_recv(DAT_
cookie);
}
-static inline u32 dat_srq_query(DAT_SRQ_HANDLE srq, struct dat_srq_param *param)
+static inline u32 dat_srq_query(struct dat_srq *srq, struct dat_srq_param *param)
{
return DAT_CALL_PROVIDER_FUNC(srq_query_func, srq, param);
}
-static inline u32 dat_srq_resize(DAT_SRQ_HANDLE srq, int max_recv_dtos)
+static inline u32 dat_srq_resize(struct dat_srq *srq, int max_recv_dtos)
{
return DAT_CALL_PROVIDER_FUNC(srq_resize_func, srq, max_recv_dtos);
}
-static inline u32 dat_srq_set_lw(DAT_SRQ_HANDLE srq, int low_watermark)
+static inline u32 dat_srq_set_lw(struct dat_srq *srq, int low_watermark)
{
return DAT_CALL_PROVIDER_FUNC(srq_set_lw_func, srq, low_watermark);
}
-static inline u32 dat_lmr_kcreate(DAT_IA_HANDLE ia, enum dat_mem_type type,
+static inline u32 dat_lmr_kcreate(struct dat_ia *ia, enum dat_mem_type type,
DAT_REGION_DESCRIPTION region, u64 len,
- DAT_PZ_HANDLE pz,
+ struct dat_pz *pz,
enum dat_mem_priv_flags privileges,
enum dat_mem_optimize_flags optimization,
- DAT_LMR_HANDLE *lmr_handle,
+ struct dat_lmr **lmr,
DAT_LMR_CONTEXT *lmr_context,
DAT_RMR_CONTEXT *rmr_context,
u64 *registered_length,
u64 *registered_address)
{
return DAT_CALL_PROVIDER_FUNC(lmr_kcreate_func, ia, type, region, len,
- pz, privileges, optimization, lmr_handle,
+ pz, privileges, optimization, lmr,
lmr_context, rmr_context,
registered_length, registered_address);
}
More information about the general
mailing list