DAPL_DBG_TYPE g_dapl_dbg_type; /* initialized in dapl_init.c */\r
DAPL_DBG_DEST g_dapl_dbg_dest; /* initialized in dapl_init.c */\r
\r
+static char *_ptr_host_ = NULL;\r
+static char _hostname_[ 128 ];\r
+\r
void dapl_internal_dbg_log ( DAPL_DBG_TYPE type, const char *fmt, ...)\r
{\r
va_list args;\r
\r
+ if ( _ptr_host_ == NULL )\r
+ {\r
+ gethostname(_hostname_, sizeof(_hostname_));\r
+ _ptr_host_ = _hostname_;\r
+ }\r
+\r
if ( type & g_dapl_dbg_type )\r
{\r
va_start (args, fmt);\r
\r
if ( DAPL_DBG_DEST_STDOUT & g_dapl_dbg_dest )\r
{\r
+ fprintf(stdout, "%s:%d: ", _ptr_host_, getpid());\r
dapl_os_vprintf (fmt, args);\r
}\r
\r
"dapl_ep_disconnect (%p, %x)\n",\r
ep_handle,\r
disconnect_flags);\r
+\r
DAPL_CNTR(DCNT_EP_DISCONNECT);\r
\r
ep_ptr = (DAPL_EP *) ep_handle;\r
\r
bail:\r
dapl_dbg_log (DAPL_DBG_TYPE_RTN | DAPL_DBG_TYPE_CM,\r
- "dapl_ep_disconnect (EP %p) returns 0x%x\n",\r
- ep_ptr, dat_status);\r
+ "dapl_ep_disconnect EP %p %s rc %x\n",\r
+ ep_ptr,dapl_get_ep_state_str(ep_ptr->param.ep_state),\r
+ dat_status);\r
\r
return dat_status;\r
}\r
"DAT_EP_STATE_CONNECTED_SINGLE_PATH",\r
"DAT_EP_STATE_CONNECTED_MULTI_PATH"\r
};\r
- return state_str[state];\r
+ return (state > DAT_EP_STATE_CONNECTED_MULTI_PATH ?\r
+ "BAD EP STATE" : state_str[state]);\r
#else\r
static char buf[12];\r
sprintf(buf,"%d",state);\r
{\r
dapl_os_assert (ep_ptr->header.magic == DAPL_MAGIC_EP);\r
\r
- ep_ptr->header.magic = DAPL_MAGIC_INVALID; /* reset magic to prevent reuse */\r
+ /* reset magic to prevent reuse */\r
+ ep_ptr->header.magic = DAPL_MAGIC_INVALID;\r
\r
dapls_cb_free ( &ep_ptr->req_buffer );\r
dapls_cb_free ( &ep_ptr->recv_buffer );\r
DAPL_SP *sp_ptr;\r
DAPL_EVD *evd_ptr;\r
DAT_RETURN dat_status;\r
- static DAT_CONN_QUAL hint_conn_qual = 1000; /* seed value */\r
+ static DAT_CONN_QUAL hint_conn_qual = 1024; /* seed value */\r
DAT_CONN_QUAL lcl_conn_qual;\r
DAT_CONN_QUAL limit_conn_qual;\r
\r
* Invoke provider specific routine to post DTO\r
*/\r
/* XXX Put code here XXX */\r
- /* XXX */ dat_status = DAT_ERROR (DAT_NOT_IMPLEMENTED, DAT_NO_SUBTYPE);\r
+ /* XXX */\r
+ dat_status = DAT_ERROR (DAT_NOT_IMPLEMENTED, DAT_NO_SUBTYPE);\r
\r
if ( dat_status != DAT_SUCCESS )\r
{\r
\r
/*\r
* Connection Disconnect Request callback\r
+ * We received a DREQ, return a DREP (disconnect reply).\r
*/\r
\r
static void \r
\r
ep_ptr = (DAPL_EP * __ptr64) p_cm_dreq_rec->qp_context;\r
\r
- if ( ep_ptr == NULL ||\r
- ep_ptr->header.magic == DAPL_MAGIC_INVALID )\r
+ if ( DAPL_BAD_PTR(ep_ptr) )\r
{\r
- dapl_dbg_log (DAPL_DBG_TYPE_ERR, \r
- "--> DiCDcb: EP %lx invalid or FREED\n", ep_ptr);\r
+ dapl_dbg_log (DAPL_DBG_TYPE_ERR,\r
+ "--> %s: BAD_PTR EP %lx\n", __FUNCTION__, ep_ptr);\r
+ return;\r
+ }\r
+ if ( ep_ptr->header.magic != DAPL_MAGIC_EP )\r
+ {\r
+ if ( ep_ptr->header.magic == DAPL_MAGIC_INVALID )\r
+ return;\r
+\r
+ dapl_dbg_log (DAPL_DBG_TYPE_ERR,\r
+ "--> %s: EP %p BAD_EP_MAGIC %x != wanted %x\n",\r
+ __FUNCTION__, ep_ptr, ep_ptr->header.magic,\r
+ DAPL_MAGIC_EP );\r
return;\r
}\r
+\r
dapl_dbg_log (DAPL_DBG_TYPE_CM, \r
- "--> %s() QP %lx EP %lx state %s sent_discreq %d\n",\r
- __FUNCTION__, ep_ptr->qp_handle, ep_ptr,\r
+ "--> %s() EP %p, %s sent_discreq %s\n",\r
+ __FUNCTION__,ep_ptr,\r
dapl_get_ep_state_str(ep_ptr->param.ep_state),\r
- ep_ptr->sent_discreq );\r
+ (ep_ptr->sent_discreq == DAT_TRUE ? "TRUE":"FALSE"));\r
\r
dapl_os_lock (&ep_ptr->header.lock);\r
if ( ep_ptr->param.ep_state == DAT_EP_STATE_DISCONNECTED\r
/*|| ( ep_ptr->param.ep_state == DAT_EP_STATE_DISCONNECT_PENDING\r
- && ep_ptr->sent_discreq == DAT_FALSE)*/ )\r
+ && ep_ptr->sent_discreq == DAT_TRUE)*/ )\r
{\r
dapl_os_unlock (&ep_ptr->header.lock);\r
- dapl_dbg_log (DAPL_DBG_TYPE_CM, \r
+ dapl_dbg_log (DAPL_DBG_TYPE_ERR/*CM*/, \r
"--> DiCDcb: EP %lx QP %lx already Disconnected\n",\r
ep_ptr, ep_ptr->qp_handle);\r
return;\r
}\r
\r
ep_ptr->param.ep_state = DAT_EP_STATE_DISCONNECT_PENDING;\r
-\r
ep_ptr->recv_discreq = DAT_TRUE;\r
dapl_os_unlock (&ep_ptr->header.lock);\r
\r
- dapl_os_memzero (&cm_drep, sizeof ( ib_cm_drep_t));\r
+ dapl_os_memzero (&cm_drep, sizeof(ib_cm_drep_t));\r
\r
/* Could fail if we received reply from other side, no need to retry */\r
- /* Wait for any transaction in process holding reference */\r
+ /* Wait for any send ops in process holding reference */\r
while ( dapl_os_atomic_read(&ep_ptr->req_count) && bail-- > 0 )\r
{\r
dapl_dbg_log (DAPL_DBG_TYPE_CM, \r
\r
/*\r
* Connection Disconnect Reply callback\r
+ * We sent a DREQ and received a DREP.\r
*/\r
\r
static void \r
\r
ep_ptr = (DAPL_EP * __ptr64) p_cm_drep_rec->qp_context;\r
\r
- if ( !ep_ptr || DAPL_BAD_HANDLE(ep_ptr, DAPL_MAGIC_EP) )\r
+ if (p_cm_drep_rec->cm_status)\r
{\r
- dapl_dbg_log (DAPL_DBG_TYPE_CM,\r
+ dapl_dbg_log (DAPL_DBG_TYPE_CM,\r
+ "--> %s: DREP cm_status(%s) EP=%p\n", __FUNCTION__,\r
+ ib_get_err_str(p_cm_drep_rec->cm_status), ep_ptr); \r
+ }\r
+\r
+ if ( DAPL_BAD_HANDLE(ep_ptr, DAPL_MAGIC_EP) )\r
+ {\r
+ dapl_dbg_log (DAPL_DBG_TYPE_ERR,\r
"--> %s: BAD EP Handle EP=%lx\n", __FUNCTION__,ep_ptr); \r
return;\r
}\r
\r
dapl_dbg_log (DAPL_DBG_TYPE_CM, \r
- "--> DiCDpcb: QP %lx EP %lx state %s cm_hdl %lx\n",\r
- ep_ptr->qp_handle, ep_ptr,\r
- dapl_get_ep_state_str(ep_ptr->param.ep_state),\r
- ep_ptr->cm_handle);\r
+ "--> DiCDpcb: EP %p state %s cm_hdl %p\n",ep_ptr,\r
+ dapl_get_ep_state_str(ep_ptr->param.ep_state),\r
+ ep_ptr->cm_handle);\r
\r
if ( ep_ptr->param.ep_state == DAT_EP_STATE_DISCONNECTED )\r
{\r
}\r
}\r
\r
+/*\r
+ * CM reply callback\r
+ */\r
\r
static void \r
dapli_ib_cm_rep_cb (\r
\r
dapl_os_assert (p_cm_rep_rec != NULL);\r
\r
- dapl_os_memzero (&cm_rtu, sizeof ( ib_cm_rtu_t ));\r
-\r
- dapl_os_assert ( ((DAPL_HEADER * __ptr64)\r
- p_cm_rep_rec->qp_context)->magic == DAPL_MAGIC_EP );\r
- \r
ep_ptr = (DAPL_EP * __ptr64) p_cm_rep_rec->qp_context;\r
+\r
+ if ( DAPL_BAD_HANDLE(ep_ptr, DAPL_MAGIC_EP) )\r
+ {\r
+ dapl_dbg_log (DAPL_DBG_TYPE_ERR, "--> %s: EP %lx invalid or FREED\n",\r
+ __FUNCTION__, ep_ptr);\r
+ return;\r
+ }\r
dapl_dbg_log (DAPL_DBG_TYPE_CM, \r
"--> DiCRpcb: EP = %lx local_max_rdma_read_in %d\n", \r
ep_ptr, p_cm_rep_rec->resp_res);\r
p_ca = (dapl_ibal_ca_t *) \r
ep_ptr->header.owner_ia->hca_ptr->ib_hca_handle;\r
\r
+ dapl_os_memzero (&cm_rtu, sizeof ( ib_cm_rtu_t ));\r
cm_rtu.pfn_cm_apr_cb = dapli_ib_cm_apr_cb;\r
cm_rtu.pfn_cm_dreq_cb = dapli_ib_cm_dreq_cb;\r
cm_rtu.p_rtu_pdata = NULL;\r
\r
ep_ptr = (DAPL_EP * __ptr64) p_cm_rej_rec->qp_context;\r
\r
+ if ( DAPL_BAD_HANDLE(ep_ptr, DAPL_MAGIC_EP) )\r
+ {\r
+ dapl_dbg_log (DAPL_DBG_TYPE_ERR, "--> %s: EP %lx invalid or FREED\n",\r
+ __FUNCTION__, ep_ptr);\r
+ return;\r
+ }\r
+\r
dapl_dbg_log (DAPL_DBG_TYPE_CM, \r
"--> DiCRjcb: EP = %lx QP = %lx rej reason = 0x%x\n", \r
ep_ptr,ep_ptr->qp_handle,CL_NTOH16(p_cm_rej_rec->rej_status));\r
\r
ep_ptr = (DAPL_EP * __ptr64) p_cm_rtu_rec->qp_context;\r
\r
+ if ( DAPL_BAD_HANDLE(ep_ptr, DAPL_MAGIC_EP) )\r
+ {\r
+ dapl_dbg_log (DAPL_DBG_TYPE_ERR, "--> %s: EP %lx invalid or FREED\n",\r
+ __FUNCTION__, ep_ptr);\r
+ return;\r
+ }\r
+\r
dapl_dbg_log (DAPL_DBG_TYPE_CM | DAPL_DBG_TYPE_CALLBACK, \r
"--> DiCRucb: EP %lx QP %lx\n", ep_ptr, ep_ptr->qp_handle); \r
\r
dapls_ib_disconnect ( IN DAPL_EP *ep_ptr,\r
IN DAT_CLOSE_FLAGS disconnect_flags )\r
{\r
- DAPL_IA *ia_ptr;\r
ib_api_status_t ib_status;\r
ib_cm_dreq_t cm_dreq;\r
\r
- //UNUSED_PARAM( disconnect_flags );\r
-\r
dapl_os_assert(ep_ptr);\r
+\r
if ( DAPL_BAD_HANDLE(ep_ptr, DAPL_MAGIC_EP) )\r
{\r
dapl_dbg_log (DAPL_DBG_TYPE_CM,\r
return DAT_SUCCESS;\r
}\r
\r
- dapl_dbg_log (DAPL_DBG_TYPE_CM, "--> %s() DsD: EP %lx QP %lx ep_state %s "\r
- "rx_drq %d tx_drq %d Close %s\n", __FUNCTION__,\r
- ep_ptr, ep_ptr->qp_handle, \r
- dapl_get_ep_state_str (ep_ptr->param.ep_state),\r
- ep_ptr->recv_discreq, ep_ptr->sent_discreq,\r
- (disconnect_flags == DAT_CLOSE_ABRUPT_FLAG\r
- ? "Abrupt":"Graceful"));\r
-\r
- if ( disconnect_flags == DAT_CLOSE_ABRUPT_FLAG ) {\r
- dapl_ep_legacy_post_disconnect(ep_ptr, disconnect_flags);\r
- return DAT_SUCCESS;\r
- }\r
+ dapl_dbg_log (DAPL_DBG_TYPE_CM,\r
+ "--> %s() EP %p %s rx_drq %d tx_drq %d Close %s\n", __FUNCTION__,\r
+ ep_ptr, dapl_get_ep_state_str(ep_ptr->param.ep_state),\r
+ ep_ptr->recv_discreq, ep_ptr->sent_discreq,\r
+ (disconnect_flags == DAT_CLOSE_ABRUPT_FLAG ? "Abrupt":"Graceful"));\r
\r
- if ( ep_ptr->param.ep_state != DAT_EP_STATE_CONNECTED )\r
+ if ( disconnect_flags == DAT_CLOSE_ABRUPT_FLAG )\r
{\r
- dapl_dbg_log (DAPL_DBG_TYPE_CM,\r
- "--> DsD: EP %lx NOT connected state %s\n",\r
- ep_ptr, dapl_get_ep_state_str (ep_ptr->param.ep_state));\r
+ if ( ep_ptr->param.ep_state == DAT_EP_STATE_DISCONNECTED )\r
+ return DAT_SUCCESS;\r
+\r
+ if ( ep_ptr->param.ep_state != DAT_EP_STATE_DISCONNECT_PENDING )\r
+ {\r
+ dapl_dbg_log(DAPL_DBG_TYPE_CM,\r
+ "%s() calling legacy_post_disconnect()\n",__FUNCTION__);\r
+ dapl_ep_legacy_post_disconnect(ep_ptr, disconnect_flags);\r
+ return DAT_SUCCESS;\r
+ }\r
}\r
- ia_ptr = ep_ptr->header.owner_ia;\r
- ib_status = IB_SUCCESS;\r
\r
dapl_os_memzero(&cm_dreq, sizeof(ib_cm_dreq_t));\r
\r
cm_dreq.qp_type = IB_QPT_RELIABLE_CONN;\r
cm_dreq.h_qp = ep_ptr->qp_handle;\r
cm_dreq.pfn_cm_drep_cb = dapli_ib_cm_drep_cb;\r
- \r
+ \r
/* \r
* Currently we do not send any disconnect private data to\r
* the other endpoint because DAT 2.0 does not support it. \r
cm_dreq.p_dreq_pdata = NULL;\r
cm_dreq.flags = IB_FLAGS_SYNC;\r
\r
+ /*\r
+ * still need to send DREQ (disconnect request)?\r
+ */\r
if ( (ep_ptr->recv_discreq == DAT_FALSE)\r
- && (ep_ptr->sent_discreq == DAT_FALSE) )\r
+ && (ep_ptr->sent_discreq == DAT_FALSE)\r
+ && (ep_ptr->qp_state != IB_QPS_RESET) )\r
{\r
- ep_ptr->sent_discreq = DAT_TRUE;\r
-\r
- ib_status = ib_cm_dreq ( &cm_dreq );\r
-\r
- dapl_dbg_log (DAPL_DBG_TYPE_CM,\r
- "--> DsD: EP %lx QP %lx DREQ SENT status %s\n", \r
- ep_ptr, ep_ptr->qp_handle,ib_get_err_str(ib_status));\r
+ ep_ptr->sent_discreq = DAT_TRUE;\r
+ ib_status = ib_cm_dreq ( &cm_dreq );\r
+ /* tolerate INVALID_STATE error as the other side can race ahead and\r
+ * generate a DREQ before we do.\r
+ */\r
+ if (ib_status && (ib_status != IB_INVALID_STATE))\r
+ {\r
+ dapl_dbg_log(DAPL_DBG_TYPE_CM,\r
+ "%s() EP %p Ignored ib_cm_dreq() status %s\n",\r
+ __FUNCTION__,ep_ptr,ib_get_err_str(ib_status));\r
+ }\r
+ if ( ib_status == IB_SUCCESS )\r
+ dapl_dbg_log (DAPL_DBG_TYPE_CM,\r
+ "--> DsD: EP %p DREQ SENT\n", ep_ptr);\r
}\r
-\r
- return dapl_ib_status_convert (ib_status);\r
+ return DAT_SUCCESS;\r
}\r
\r
\r
dapl_dbg_log ( DAPL_DBG_TYPE_ERR,"ib_query_qp(%lx) '%s'\n",\r
qp_handle, ib_get_err_str(ib_status) );\r
}\r
-#if 1\r
else\r
{\r
dapl_dbg_log ( DAPL_DBG_TYPE_CM, "--> QP(%lx) state %s "\r
qpa->init_depth,\r
qpa->access_ctrl );\r
}\r
-#endif\r
}\r
#endif\r
\r
#include <string.h>\r
#include <winsock2.h>\r
#include <Ws2tcpip.h>\r
+#include <process.h>\r
+#define getpid _getpid\r
#include <stdlib.h>\r
#pragma warning ( pop )\r
\r
*/\r
STATIC __inline void dapl_os_sleep_usec (int sleep_time)\r
{\r
- Sleep(sleep_time/1000);\r
+ Sleep(sleep_time/1000); // convert to milliseconds\r
}\r
\r
-STATIC __inline DAPL_OS_TICKS dapl_os_get_ticks (void);\r
-\r
-STATIC __inline int dapl_os_ticks_to_seconds (DAPL_OS_TICKS ticks);\r
-\r
DAT_RETURN dapl_os_get_time (DAPL_OS_TIMEVAL *);\r
/* timer functions */\r
\r
#define dapl_os_vprintf(fmt,args) vprintf(fmt,args)\r
#define dapl_os_syslog(fmt,args) /* XXX Need log routine call */\r
\r
-\r
#endif /* _DAPL_OSD_H_ */\r
\r
/*\r
int\r
dapltest (int argc, char *argv[])\r
{\r
- Params_t *params_ptr;\r
+ Params_t *params_ptr;\r
+ DAT_RETURN rc=DAT_SUCCESS;\r
\r
/* check memory leaking */\r
/*\r
}\r
params_ptr->cpu_mhz = DT_Mdep_GetCpuMhz ();\r
/* call the test-dependent code for invoking the actual test */\r
- DT_Tdep_Execute_Test (params_ptr);\r
+ rc = DT_Tdep_Execute_Test (params_ptr);\r
\r
/* cleanup */\r
\r
* alloc_count); DT_Mdep_LockDestroy(&Alloc_Count_Lock);\r
*/\r
\r
- return ( 0 );\r
+ return ( rc );\r
}\r
\r
\r
#include "dapl_proto.h"\r
#include "dapl_params.h"\r
\r
-void\r
+DAT_RETURN\r
DT_Execute_Test ( Params_t *params_ptr ) ;\r
\r
#endif\r
#include "dapl_transaction_stats.h"\r
#include "dapl_version.h"\r
\r
+#define DAT_ERROR(Type,SubType) ((DAT_RETURN)(DAT_CLASS_ERROR | Type | SubType))\r
+\r
/*\r
* Prototypes\r
*/\r
DAT_EP_HANDLE ep_handle);\r
\r
/* dapl_client.c */\r
-void DT_cs_Client (Params_t * params_ptr,\r
+DAT_RETURN DT_cs_Client (Params_t * params_ptr,\r
char *dapl_name,\r
char *server_name,\r
DAT_UINT32 total_threads);\r
void DT_Performance_Cmd_Endian (Performance_Cmd_t * cmd);\r
\r
/* dapl_performance_client.c */\r
-void DT_Performance_Test_Client ( Params_t *params_ptr,\r
- Per_Test_Data_t * pt_ptr,\r
- DAT_IA_HANDLE * ia_handle,\r
- DAT_IA_ADDRESS_PTR remote);\r
+DAT_RETURN DT_Performance_Test_Client ( Params_t *params_ptr,\r
+ Per_Test_Data_t * pt_ptr,\r
+ DAT_IA_HANDLE * ia_handle,\r
+ DAT_IA_ADDRESS_PTR remote);\r
\r
bool DT_Performance_Test_Client_Connect (\r
- DT_Tdep_Print_Head *phead,\r
- Performance_Test_t * test_ptr);\r
+ DT_Tdep_Print_Head *phead,\r
+ Performance_Test_t * test_ptr);\r
\r
bool DT_Performance_Test_Client_Exchange (\r
- Params_t *params_ptr,\r
- DT_Tdep_Print_Head *phead,\r
- Performance_Test_t *test_ptr);\r
+ Params_t *params_ptr,\r
+ DT_Tdep_Print_Head *phead,\r
+ Performance_Test_t *test_ptr );\r
\r
/* dapl_performance_server.c */\r
void DT_Performance_Test_Server (void * pt_ptr);\r
void DT_Transaction_Cmd_Endian (Transaction_Cmd_t * cmd,\r
bool to_wire);\r
/* dapl_transaction_test.c */\r
-void DT_Transaction_Test_Client (Per_Test_Data_t * pt_ptr,\r
+DAT_RETURN DT_Transaction_Test_Client (Per_Test_Data_t * pt_ptr,\r
DAT_IA_HANDLE ia_handle,\r
DAT_IA_ADDRESS_PTR remote);\r
\r
void DT_Limit_Cmd_Usage (void);\r
\r
/* dapl_limit.c */\r
-void DT_cs_Limit (Params_t *params, Limit_Cmd_t * cmd);\r
+DAT_RETURN DT_cs_Limit (Params_t *params, Limit_Cmd_t * cmd);\r
\r
/* dapl_fft_cmd.c */\r
void DT_FFT_Cmd_Init ( FFT_Cmd_t * cmd);\r
void DT_FFT_Cmd_Usage (void);\r
\r
/* dapl_fft_test.c */\r
-void DT_cs_FFT (Params_t *params, FFT_Cmd_t * cmd);\r
+DAT_RETURN DT_cs_FFT (Params_t *params, FFT_Cmd_t * cmd);\r
\r
/* dapl_fft_hwconn.c */\r
void DT_hwconn_test (Params_t *params_ptr, FFT_Cmd_t *cmd);\r
void\r
DT_Tdep_End ( void ) ;\r
\r
-void\r
+DAT_RETURN\r
DT_Tdep_Execute_Test ( Params_t *params_ptr ) ;\r
\r
DAT_RETURN\r
\r
if "%T%" == "trans" (\r
echo Transaction test - 8192 iterations, 1 thread, SR 4KB buffers\r
- %DT% -T T -s %S% -D %D% -i 8192 -t 1 -w 1 client SR 4096 server SR 4096\r
+ %DT% -T T -s %S% -D %D% -i 8192 -t 1 -w 1 client SR 4096 server SR 4096\r
exit /B\r
)\r
\r
exit /B\r
)\r
\r
+if "%T%" == "EPA" (\r
+ FOR /L %%j IN (2,1,5) DO (\r
+ FOR /L %%i IN (1,1,5) DO (\r
+ echo Multi: Threads[%%j] endpoints[%%i] Send/Recv test - 4096 iterations, 3 8K segs\r
+ %DT% -T T -s %S% -D %D% -i 4096 -t %%j -w %%i client SR 8192 3 server SR 8192 3\r
+ if ERRORLEVEL 1 exit /B \r
+ echo Multi: Threads[%%j] endpoints[%%i] Send/Recv test - 4096 iterations, 3 8K segs\r
+ timeout /T 3\r
+ )\r
+ )\r
+ exit /B \r
+)\r
+\r
+if "%T%" == "EP" (\r
+ echo Multi: Threads[5] endpoints[7] Send/Recv test - 4096 iterations, 3 8K segs\r
+ %DT% -T T -s %S% -D %D% -i 4096 -t 5 -w 7 client SR 8192 3 server SR 8192 3\r
+ echo Multi: Threads[5] endpoints[7] Send/Recv test - 4096 iterations, 3 8K segs\r
+ exit /B \r
+)\r
+\r
if "%T%" == "threads" (\r
echo Multi Threaded[6] Send/Recv test - 4096 iterations, 3 8K segs\r
%DT% -T T -s %S% -D %D% -i 4096 -t 6 -w 1 client SR 8192 3 server SR 8192 3\r
echo %T% testing in %L% Loops\r
REM rdma-write, read, perf\r
FOR /L %%i IN (1,1,%L%) DO (\r
+\r
call %0 %1 trans\r
if ERRORLEVEL 1 exit /B\r
\r
if ERRORLEVEL 1 exit /B\r
\r
call %0 %1 bw\r
+ if ERRORLEVEL 1 exit /B \r
+\r
+ call %0 %1 EP\r
if ERRORLEVEL 1 exit /B\r
+\r
echo %%i %T% loops completed.\r
+ timeout /T 4\r
)\r
exit /B\r
)\r
echo usage: dt-cli hostname [testname [-D]]\r
echo where testname\r
echo stop - request DAPLtest server to exit.\r
-echo conn - simple connection with limited dater transfer\r
+echo conn - simple connection with limited data transfer\r
+echo EP - Multiple EndPoints(7) and Threads(5) Transactions\r
+echo EPA - Increment EndPoints[1..9] while increasing threads[1-8]\r
echo trans - single transaction test\r
echo transm - transaction test: multiple transactions [RW SND, RDMA]\r
echo transt - transaction test: multi-threaded\r
* Client control routine Connect to the server, send the command across.\r
* Then start the client-side of the test - creating threads as needed\r
*/\r
-void\r
+DAT_RETURN\r
DT_cs_Client (Params_t * params_ptr,\r
char *dapl_name,\r
char *server_name,\r
DAT_DTO_COMPLETION_EVENT_DATA dto_stat;\r
DAT_EVENT_NUMBER event_num;\r
unsigned char * buffp;\r
- DAT_RETURN ret;\r
+ DAT_RETURN ret, rc;\r
DT_Tdep_Print_Head *phead;\r
\r
phead = params_ptr->phead;\r
if (!pt_ptr)\r
{\r
DT_Tdep_PT_Printf (phead, "%s: no memory for Per_Test_Data\n", module);\r
- return;\r
+ return DAT_INSUFFICIENT_RESOURCES;\r
}\r
DT_MemListInit (pt_ptr); /* init MemlistLock and memListHead */\r
DT_Thread_Init (pt_ptr); /* init ThreadLock and threadcount */\r
\r
/* Create an EP */\r
ret = dat_ep_create (ia_handle, /* IA */\r
- pz_handle, /* PZ */\r
- recv_evd_hdl, /* recv */\r
- reqt_evd_hdl, /* request */\r
- conn_evd_hdl, /* connect */\r
- (DAT_EP_ATTR *) NULL,\r
- &ep_handle);\r
+ pz_handle, /* PZ */\r
+ recv_evd_hdl, /* recv */\r
+ reqt_evd_hdl, /* request */\r
+ conn_evd_hdl, /* connect */\r
+ (DAT_EP_ATTR *) NULL,\r
+ &ep_handle);\r
if (ret != DAT_SUCCESS)\r
{\r
DT_Tdep_PT_Printf (phead, \r
if (!DT_query (pt_ptr, ia_handle, ep_handle) ||\r
!DT_check_params (pt_ptr, module))\r
{\r
+ ret = DAT_INSUFFICIENT_RESOURCES; \r
goto client_exit;\r
}\r
\r
DT_Tdep_PT_Printf (phead, \r
"%s: no memory for command buffer pool.\n", \r
module);\r
+ ret = DAT_ERROR(DAT_INSUFFICIENT_RESOURCES,DAT_RESOURCE_MEMORY); \r
goto client_exit;\r
}\r
\r
DT_Tdep_PT_Debug (1,(phead, "%s: Posting 1 recv buffer\n", module));\r
retry_repost:\r
if (!DT_post_recv_buffer (phead,\r
- ep_handle,\r
- bpool,\r
- 0,\r
- DT_Bpool_GetBuffSize (bpool, 0)))\r
+ ep_handle,\r
+ bpool,\r
+ 0,\r
+ DT_Bpool_GetBuffSize (bpool, 0)) )\r
{\r
DT_Tdep_PT_Printf (phead,\r
"%s: cannot post Server_Info recv buffer.\n", \r
module);\r
+ ret = DAT_INSUFFICIENT_RESOURCES; \r
goto client_exit;\r
}\r
\r
dat_ep_reset (ep_handle);\r
do\r
{\r
-\r
- ret = DT_Tdep_evd_dequeue ( recv_evd_hdl,\r
- &event);\r
+ rc = DT_Tdep_evd_dequeue ( recv_evd_hdl, &event);\r
drained++;\r
- } while (DAT_GET_TYPE(ret) != DAT_QUEUE_EMPTY);\r
+ } while (DAT_GET_TYPE(rc) != DAT_QUEUE_EMPTY);\r
\r
if (drained > 1 && retry_cnt < MAX_CONN_RETRY)\r
{\r
goto retry;\r
}\r
}\r
+ ret = DAT_INSUFFICIENT_RESOURCES;\r
DT_Tdep_PT_Printf (phead, "%s: bad connection event\n", module);\r
goto client_exit;\r
}\r
sizeof (Client_Info_t));\r
DT_Client_Info_Endian ((Client_Info_t *) buffp);\r
if (!DT_post_send_buffer ( phead,\r
- ep_handle,\r
- bpool,\r
- 1,\r
- DT_Bpool_GetBuffSize (bpool, 1)))\r
+ ep_handle,\r
+ bpool,\r
+ 1,\r
+ DT_Bpool_GetBuffSize (bpool, 1)) )\r
{\r
DT_Tdep_PT_Printf (phead, "%s: cannot send Client_Info\n", module);\r
+ ret = DAT_INSUFFICIENT_RESOURCES; \r
goto client_exit;\r
}\r
/* reap the send and verify it */\r
module));\r
if (!DT_dto_event_wait (phead, reqt_evd_hdl, &dto_stat) ||\r
!DT_dto_check ( phead,\r
- &dto_stat,\r
+ &dto_stat,\r
ep_handle,\r
DT_Bpool_GetBuffSize (bpool, 1),\r
dto_cookie,\r
- "Client_Info_Send"))\r
+ "Client_Info_Send") )\r
{\r
+ ret = DAT_INSUFFICIENT_RESOURCES;\r
goto client_exit;\r
}\r
\r
{\r
Transaction_Cmd = &pt_ptr->Params.u.Transaction_Cmd;\r
memcpy ( (void *)buffp,\r
- (const void *)Transaction_Cmd,\r
- sizeof (Transaction_Cmd_t));\r
+ (const void *)Transaction_Cmd,\r
+ sizeof (Transaction_Cmd_t));\r
DT_Transaction_Cmd_Endian ((Transaction_Cmd_t *)buffp, true);\r
break;\r
}\r
\r
- case QUIT_TEST:\r
- {\r
- Quit_Cmd = &pt_ptr->Params.u.Quit_Cmd;\r
- memcpy ( (void *)buffp,\r
- (const void *)Quit_Cmd,\r
- sizeof (Quit_Cmd_t));\r
- DT_Quit_Cmd_Endian ((Quit_Cmd_t *) buffp, true);\r
- break;\r
- }\r
+ case QUIT_TEST:\r
+ {\r
+ Quit_Cmd = &pt_ptr->Params.u.Quit_Cmd;\r
+ memcpy ( (void *)buffp,\r
+ (const void *)Quit_Cmd,\r
+ sizeof (Quit_Cmd_t));\r
+ DT_Quit_Cmd_Endian ((Quit_Cmd_t *) buffp, true);\r
+ break;\r
+ }\r
\r
case PERFORMANCE_TEST:\r
{\r
default:\r
{\r
DT_Tdep_PT_Printf (phead, "Unknown Test Type\n");\r
+ ret = DAT_INVALID_PARAMETER; \r
goto client_exit;\r
}\r
}\r
\r
/* Send the Command buffer */\r
if (!DT_post_send_buffer ( phead,\r
- ep_handle,\r
- bpool,\r
- 2,\r
- DT_Bpool_GetBuffSize (bpool, 2)))\r
+ ep_handle,\r
+ bpool,\r
+ 2,\r
+ DT_Bpool_GetBuffSize (bpool, 2)) )\r
{\r
DT_Tdep_PT_Printf (phead, "%s: cannot send Command\n", module);\r
+ ret = DAT_INSUFFICIENT_RESOURCES;\r
goto client_exit;\r
}\r
/* reap the send and verify it */\r
module));\r
if (!DT_dto_event_wait (phead, reqt_evd_hdl, &dto_stat) ||\r
!DT_dto_check ( phead,\r
- &dto_stat,\r
+ &dto_stat,\r
ep_handle,\r
DT_Bpool_GetBuffSize (bpool, 2),\r
dto_cookie,\r
- "Client_Cmd_Send"))\r
+ "Client_Cmd_Send") )\r
{\r
+ ret = DAT_INSUFFICIENT_RESOURCES; \r
goto client_exit;\r
}\r
\r
DT_Tdep_PT_Debug (1,(phead, "%s: Waiting for Server_Info\n", module));\r
if (!DT_dto_event_wait (phead, recv_evd_hdl, &dto_stat) ||\r
!DT_dto_check ( phead,\r
- &dto_stat,\r
+ &dto_stat,\r
ep_handle,\r
DT_Bpool_GetBuffSize (bpool, 0),\r
dto_cookie,\r
- "Server_Info_Recv"))\r
+ "Server_Info_Recv") )\r
{\r
+ ret = DAT_INSUFFICIENT_RESOURCES; \r
goto client_exit;\r
}\r
\r
module,\r
pt_ptr->Server_Info.dapltest_version,\r
DAPLTEST_VERSION);\r
+ ret = DAT_MODEL_NOT_SUPPORTED;\r
goto client_exit;\r
}\r
DT_Tdep_PT_Debug (1,(phead, "%s: Version OK!\n", module));\r
{\r
DT_Transaction_Cmd_PT_Print (phead, Transaction_Cmd);\r
}\r
- DT_Transaction_Test_Client (pt_ptr,\r
- ia_handle,\r
- server_netaddr);\r
+ ret = DT_Transaction_Test_Client (pt_ptr,\r
+ ia_handle,\r
+ server_netaddr);\r
break;\r
}\r
\r
- case QUIT_TEST:\r
- {\r
- DT_Quit_Cmd_PT_Print (phead, Quit_Cmd);\r
- break;\r
- }\r
+ case QUIT_TEST:\r
+ {\r
+ DT_Quit_Cmd_PT_Print (phead, Quit_Cmd);\r
+ ret = DAT_SUCCESS;\r
+ break;\r
+ }\r
\r
case PERFORMANCE_TEST:\r
{\r
DT_Performance_Cmd_PT_Print (phead, Performance_Cmd);\r
}\r
\r
- DT_Performance_Test_Client (params_ptr,\r
- pt_ptr,\r
- ia_handle,\r
- server_netaddr);\r
+ ret = DT_Performance_Test_Client (params_ptr,\r
+ pt_ptr,\r
+ ia_handle,\r
+ server_netaddr);\r
break;\r
}\r
}\r
\r
/*********************************************************************\r
* Done - clean up and go home\r
+ * ret == function DAT_RETURN return code\r
*/\r
client_exit:\r
DT_Tdep_PT_Debug (1,(phead, "%s: Cleaning Up ...\n", module));\r
* graceful attempt might fail because we got here due to\r
* some error above, so we may as well try harder.\r
*/\r
- ret = dat_ep_disconnect (ep_handle, DAT_CLOSE_ABRUPT_FLAG);\r
- if (ret != DAT_SUCCESS)\r
+ rc = dat_ep_disconnect (ep_handle, DAT_CLOSE_ABRUPT_FLAG);\r
+ if (rc != DAT_SUCCESS)\r
{\r
DT_Tdep_PT_Printf (phead, \r
"%s: dat_ep_disconnect (abrupt) error: %s\n",\r
module,\r
- DT_RetToString (ret));\r
+ DT_RetToString (rc));\r
}\r
else if (did_connect &&\r
!DT_disco_event_wait (phead, conn_evd_hdl, NULL))\r
*/\r
do\r
{\r
- ret = DT_Tdep_evd_dequeue ( recv_evd_hdl,\r
+ rc = DT_Tdep_evd_dequeue ( recv_evd_hdl,\r
&event);\r
- } while (ret == DAT_SUCCESS);\r
+ } while (rc == DAT_SUCCESS);\r
\r
- ret = dat_ep_free (ep_handle);\r
- if (ret != DAT_SUCCESS)\r
+ rc = dat_ep_free (ep_handle);\r
+ if (rc != DAT_SUCCESS)\r
{\r
DT_Tdep_PT_Printf (phead, \r
"%s: dat_ep_free error: %s\n",\r
module, \r
- DT_RetToString (ret));\r
+ DT_RetToString (rc));\r
/* keep going */\r
}\r
}\r
/* Free the 3 EVDs */\r
if (conn_evd_hdl)\r
{\r
- ret = DT_Tdep_evd_free (conn_evd_hdl);\r
- if (ret != DAT_SUCCESS)\r
+ rc = DT_Tdep_evd_free (conn_evd_hdl);\r
+ if (rc != DAT_SUCCESS)\r
{\r
DT_Tdep_PT_Printf (phead, \r
"%s: dat_evd_free (conn) error: %s\n",\r
module, \r
- DT_RetToString (ret));\r
+ DT_RetToString (rc));\r
/* keep going */\r
}\r
}\r
if (reqt_evd_hdl)\r
{\r
- ret = DT_Tdep_evd_free (reqt_evd_hdl);\r
- if (ret != DAT_SUCCESS)\r
+ rc = DT_Tdep_evd_free (reqt_evd_hdl);\r
+ if (rc != DAT_SUCCESS)\r
{\r
DT_Tdep_PT_Printf (phead, \r
"%s: dat_evd_free (reqt) error: %s\n",\r
module, \r
- DT_RetToString (ret));\r
+ DT_RetToString (rc));\r
/* keep going */\r
}\r
}\r
if (recv_evd_hdl)\r
{\r
- ret = DT_Tdep_evd_free (recv_evd_hdl);\r
- if (ret != DAT_SUCCESS)\r
+ rc = DT_Tdep_evd_free (recv_evd_hdl);\r
+ if (rc != DAT_SUCCESS)\r
{\r
DT_Tdep_PT_Printf (phead, \r
"%s: dat_evd_free (recv) error: %s\n",\r
module, \r
- DT_RetToString (ret));\r
+ DT_RetToString (rc));\r
/* keep going */\r
}\r
}\r
/* Free the PZ */\r
if (pz_handle)\r
{\r
- ret = dat_pz_free (pz_handle);\r
- if (ret != DAT_SUCCESS)\r
+ rc = dat_pz_free (pz_handle);\r
+ if (rc != DAT_SUCCESS)\r
{\r
DT_Tdep_PT_Printf (phead, \r
"%s: dat_pz_free error: %s\n",\r
module, \r
- DT_RetToString (ret));\r
+ DT_RetToString (rc));\r
/* keep going */\r
}\r
}\r
if (ia_handle)\r
{\r
/* dat_ia_close cleans up async evd handle, too */\r
- ret = dat_ia_close (ia_handle, DAT_CLOSE_GRACEFUL_FLAG);\r
- if (ret != DAT_SUCCESS)\r
+ rc = dat_ia_close (ia_handle, DAT_CLOSE_GRACEFUL_FLAG);\r
+ if (rc != DAT_SUCCESS)\r
{\r
DT_Tdep_PT_Printf (phead, \r
"%s: dat_ia_close (graceful) error: %s\n",\r
module, \r
- DT_RetToString (ret));\r
- ret = dat_ia_close (ia_handle, DAT_CLOSE_ABRUPT_FLAG);\r
- if (ret != DAT_SUCCESS)\r
+ DT_RetToString (rc));\r
+ rc = dat_ia_close (ia_handle, DAT_CLOSE_ABRUPT_FLAG);\r
+ if (rc != DAT_SUCCESS)\r
{\r
DT_Tdep_PT_Printf (phead, \r
"%s: dat_ia_close (abrupt) error: %s\n",\r
module, \r
- DT_RetToString (ret));\r
+ DT_RetToString (rc));\r
}\r
/* keep going */\r
}\r
\r
/* Free the Per_Test_Data */\r
DT_Mdep_LockDestroy (&pt_ptr->Thread_counter_lock);\r
- DT_PrintMemList (pt_ptr); /* check if we return all space allocated */\r
+ DT_PrintMemList (pt_ptr); /* check if we return all space allocated */\r
DT_Mdep_LockDestroy (&pt_ptr->MemListLock);\r
DT_Free_Per_Test_Data (pt_ptr);\r
\r
DT_Tdep_PT_Printf (phead, \r
"%s: ========== End of Work -- Client Exiting\n", \r
module);\r
+ return ret;\r
}\r
#include "dapl_quit_cmd.h"\r
#include "dapl_limit_cmd.h"\r
\r
-void\r
+DAT_RETURN\r
DT_Execute_Test (Params_t *params_ptr)\r
{\r
+ DAT_RETURN rc = DAT_SUCCESS;\r
Transaction_Cmd_t *Transaction_Cmd;\r
Quit_Cmd_t *Quit_Cmd;\r
Limit_Cmd_t *Limit_Cmd;\r
case TRANSACTION_TEST:\r
{\r
Transaction_Cmd = ¶ms_ptr->u.Transaction_Cmd;\r
- DT_cs_Client ( params_ptr,\r
- Transaction_Cmd->dapl_name,\r
- Transaction_Cmd->server_name,\r
- Transaction_Cmd->num_threads *\r
- Transaction_Cmd->eps_per_thread);\r
+ rc = DT_cs_Client ( params_ptr,\r
+ Transaction_Cmd->dapl_name,\r
+ Transaction_Cmd->server_name,\r
+ Transaction_Cmd->num_threads *\r
+ Transaction_Cmd->eps_per_thread );\r
break;\r
}\r
case QUIT_TEST:\r
{\r
Quit_Cmd = ¶ms_ptr->u.Quit_Cmd;\r
- DT_cs_Client ( params_ptr,\r
- Quit_Cmd->device_name,\r
- Quit_Cmd->server_name,\r
- 0);\r
+ (void) DT_cs_Client ( params_ptr,\r
+ Quit_Cmd->device_name,\r
+ Quit_Cmd->server_name,\r
+ 0 );\r
break;\r
}\r
case LIMIT_TEST:\r
{\r
Limit_Cmd = ¶ms_ptr->u.Limit_Cmd;\r
- DT_cs_Limit (params_ptr, \r
- Limit_Cmd);\r
+ rc = DT_cs_Limit (params_ptr, Limit_Cmd);\r
break;\r
}\r
case PERFORMANCE_TEST:\r
{\r
Performance_Cmd = ¶ms_ptr->u.Performance_Cmd;\r
- DT_cs_Client ( params_ptr,\r
- Performance_Cmd->dapl_name,\r
- Performance_Cmd->server_name,\r
- 1);\r
+ rc = DT_cs_Client ( params_ptr,\r
+ Performance_Cmd->dapl_name,\r
+ Performance_Cmd->server_name,\r
+ 1 );\r
break;\r
}\r
\r
case FFT_TEST:\r
{\r
FFT_Cmd = ¶ms_ptr->u.FFT_Cmd;\r
- DT_cs_FFT (params_ptr, \r
- FFT_Cmd);\r
+ rc = DT_cs_FFT (params_ptr, FFT_Cmd);\r
break;\r
}\r
}\r
+ return rc;\r
}\r
\r
#include "dapl_proto.h"\r
\r
-void\r
+DAT_RETURN\r
DT_cs_FFT (Params_t *params_ptr, FFT_Cmd_t * cmd)\r
{\r
DT_Tdep_Print_Head *phead;\r
+ DAT_RETURN rc = DAT_SUCCESS;\r
\r
phead = params_ptr->phead;\r
\r
default:\r
{\r
DT_Tdep_PT_Printf (phead, "don't know this test\n");\r
+ rc = DAT_INVALID_PARAMETER;\r
break;\r
}\r
}\r
+ return rc;\r
}\r
\r
/*********************************************************************\r
* Framework to run through all of the limit tests\r
*/\r
-void\r
+DAT_RETURN\r
DT_cs_Limit (Params_t *params, Limit_Cmd_t * cmd)\r
{\r
DT_Tdep_Print_Head *phead;\r
\r
/* More tests TBS ... */\r
\r
- return;\r
+ return DAT_SUCCESS;\r
\r
error:\r
DT_Tdep_PT_Printf (phead, "error occurs, can not continue with limit test\n");\r
DT_Tdep_PT_Printf (phead, "%s\n", star);\r
- return;\r
+ return DAT_INSUFFICIENT_RESOURCES;\r
}\r
\r
#define MAX_CONN_RETRY 8\r
\r
/****************************************************************************/\r
-void\r
+DAT_RETURN\r
DT_Performance_Test_Client (\r
Params_t *params_ptr,\r
Per_Test_Data_t *pt_ptr,\r
Performance_Test_t *test_ptr = NULL;\r
int connected = 1;\r
DT_Tdep_Print_Head *phead;\r
+ DAT_RETURN rc;\r
\r
phead = pt_ptr->Params.phead;\r
\r
#endif\r
\r
DT_Tdep_PT_Debug (1,(phead,"Client: Finished performance test\n"));\r
+\r
+ return (connected ? DAT_SUCCESS : DAT_INSUFFICIENT_RESOURCES);\r
}\r
\r
\r
#define MAX_CONN_RETRY 8\r
\r
/****************************************************************************/\r
-void\r
+DAT_RETURN\r
DT_Transaction_Test_Client (Per_Test_Data_t * pt_ptr,\r
DAT_IA_HANDLE ia_handle,\r
DAT_IA_ADDRESS_PTR remote_ia_addr)\r
Transaction_Cmd_t *cmd = &pt_ptr->Params.u.Transaction_Cmd;\r
unsigned int i;\r
DT_Tdep_Print_Head *phead;\r
+ DAT_RETURN rc = DAT_SUCCESS;\r
\r
phead = pt_ptr->Params.phead;\r
\r
remote_ia_addr))\r
{\r
DT_Tdep_PT_Printf (phead, "Client: Cannot Create Test!\n");\r
+ rc = DAT_INSUFFICIENT_RESOURCES;\r
break;\r
}\r
\r
}\r
\r
DT_print_transaction_stats (phead,\r
- &pt_ptr->Client_Stats,\r
- cmd->num_threads,\r
- cmd->eps_per_thread);\r
+ &pt_ptr->Client_Stats,\r
+ cmd->num_threads,\r
+ cmd->eps_per_thread);\r
+ return rc;\r
}\r
\r
\r
DT_Mdep_LockDestroy (&g_PerfTestLock); /* For kDAPL, this is done in kdapl_module.c */\r
}\r
\r
-void\r
+DAT_RETURN\r
DT_Tdep_Execute_Test (Params_t *params_ptr)\r
{\r
- DT_Execute_Test (params_ptr);\r
+ return DT_Execute_Test (params_ptr);\r
}\r
\r
DAT_RETURN\r