DAPL: bug fixes
cover DAPL: bug fixes
From: Arlin Davis <[email protected]>
Arlin Davis (4):
ucm: RTU not retransmitted in TIMEWAIT state
dtestx: allow scale up to 1000 EP's
common: dapl_ep_free must serialize CM object destroy
ucm: add time wait override capability for CM services
dapl/common/dapl_ep_free.c | 21 ++++++++------- dapl/openib_common/dapl_ib_common.h | 1 + dapl/openib_ucm/cm.c | 49 +++++++++++++++++------------------ dapl/openib_ucm/dapl_ib_util.h | 1 + dapl/openib_ucm/device.c | 9 +++--- test/dtest/dtestx.c | 21 +++++++++----- 6 files changed, 55 insertions(+), 47 deletions(-)
Signature · 6 lines
1.7.3 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 1/4 ucm: RTU not retransmitted in TIMEWAIT state
In reply to a message not in the archiveFrom: Arlin Davis <[email protected]>
--- dapl/openib_ucm/cm.c | 21 ++++++++++++++++----- 1 files changed, 16 insertions(+), 5 deletions(-)
dapl/openib_ucm/cm.c +16 -5
@@ -231,7 +231,7 @@ static void ucm_check_timers(dp_ib_cm_handle_t cm, int *timer) *timer = cm->hca->ib_trans.cm_timer;if ((time - cm->timer)/1000 > (cm->hca->ib_trans.rtu_time << cm->retries)) { - dapl_log(DAPL_DBG_TYPE_CM_WARN, + dapl_log(DAPL_DBG_TYPE_CM, " CM_TIMEWAIT %d %p [lid, port, cqp, iqp]:" " %x %x %x %x -> %x %x %x %x r_pid %x" " Time(ms) %d > %d\n",
@@ -247,8 +247,17 @@ static void ucm_check_timers(dp_ib_cm_handle_t cm, int *timer) }if (cm->retries >2 ) {dapl_log (DAPL_DBG_TYPE_CM_WARN , -" CM_TIMEWAIT expired (%d ms) for CM %p\n" , - cm, (time - cm->timer)/1000 ); +" CM_TIMEWAIT EXPIRED %d %p [lid, port, cqp, iqp]:" +" %x %x %x %x -> %x %x %x %x r_pid %x" +" Time(ms) %d > %d\n" , + cm->retries+1 , cm, +ntohs (cm->msg.saddr.ib.lid),ntohs (cm->msg.sport), +ntohl (cm->msg.sqpn),ntohl (cm->msg.saddr.ib.qpn), +ntohs (cm->msg.daddr.ib.lid),ntohs (cm->msg.dport), +ntohl (cm->msg.dqpn),ntohl (cm->msg.daddr.ib.qpn), +ntohl (cm->msg.d_id), + (time - cm->timer)/1000 , + cm->hca->ib_trans.rtu_time << cm->retries); cm->ah =NULL ;/* consumer will free AH */ cm->state =DCM_FREE ;dapl_os_unlock (&cm->lock);
@@ -382,8 +391,10 @@ static void ucm_process_recv(ib_hca_transport_t *tp,ucm_connect_rtu (cm, msg);break ;case DCM_CONNECTED :/* active and passive */ +case DCM_TIMEWAIT :/* passive */ /* DREQ, change state and process */ - cm->retries =2 ; +if (cm->state ==DCM_CONNECTED ) + cm->retries =2 ;if (ntohs (msg->op) ==DCM_DREQ ) { cm->state =DCM_DISC_RECV ;dapl_os_unlock (&cm->lock);
@@ -395,7 +406,7 @@ static void ucm_process_recv(ib_hca_transport_t *tp, dapl_log(DAPL_DBG_TYPE_CM_WARN, " RESEND RTU: op %s st %s [lid, port, cqp, iqp]:" " %x %x %x %x -> %x %x %x %x r_pid %x\n", - dapl_cm_op_str(ntohs(cm->msg.op)), + dapl_cm_op_str(ntohs(msg->op)), dapl_cm_state_str(cm->state), ntohs(cm->msg.saddr.ib.lid), ntohs(cm->msg.sport), ntohl(cm->msg.sqpn), ntohl(cm->msg.saddr.ib.qpn),
Signature · 6 lines
1.7.3 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 2/4 dtestx: allow scale up to 1000 EP's
In reply to a message not in the archiveFrom: Arlin Davis <[email protected]>
--- test/dtest/dtestx.c | 21 +++++++++++++-------- 1 files changed, 13 insertions(+), 8 deletions(-)
test/dtest/dtestx.c +13 -8
@@ -143,7 +143,7 @@ int disconnect_ep(void);#define RCV_RDMA_BUF_INDEX 1#define SEND_BUF_INDEX 2#define RECV_BUF_INDEX 3 -#define MAX_EP_COUNT 8 +#define MAX_EP_COUNT 1000#define MAX_AH_COUNT (MAX_EP_COUNT * 2)DAT_VADDR *atomic_buf;
@@ -520,8 +520,8 @@ send_msg(void *data,if (ud_test) {/* * single QP - ep[0] and ah[0] for client and server -* multi QP - ep[i]->ah[i] for client, to 0 -* ep[0]->ah[i] for server, to all +* multi QP - ep[i]->ah[i] for client, i to i +* ep[0]->ah[i] for server, 0 to all */ if (multi_eps) { ah_idx = i;
@@ -704,7 +704,10 @@ void process_conn(int idx) }if (ia_attr.extension_version >=209 ) { -/* Destroy CM resources for AH resolution */ +LOGPRINTF ("%s EP_L[%d]=%p -> cm %p CM_FREE\n" , + ext_event->type ==DAT_IB_UD_PASSIVE_REMOTE_AH ? +"PASSIVE" :"ACTIVE " , ep_l, ep[ep_l], + ext_event->context.as_ptr);dat_ib_ud_cm_free (ep[ep_l], ext_event->context.as_ptr); }
@@ -723,7 +726,7 @@ int connect_ep(char *hostname, struct sockaddr *ser_sa)DAT_DTO_COOKIE cookie;DAT_CONN_QUAL conn_qual;DAT_BOOLEAN in, out; -int i, ii, pdata, ctx; +int i, ii, pdata, ctx, qdepth =REG_MEM_COUNT ;DAT_DTO_COMPLETION_EVENT_DATA *dto_event = &event.event_data.dto_completion_event_data;
@@ -762,8 +765,10 @@ int connect_ep(char *hostname, struct sockaddr *ser_sa) } ep_attr.qos =0 ; ep_attr.recv_completion_flags =0 ; - ep_attr.max_recv_dtos = eps *10 ; - ep_attr.max_request_dtos = eps *10 ; +if (ud_test && !multi_eps) + qdepth = eps *REG_MEM_COUNT ; + ep_attr.max_recv_dtos = qdepth; + ep_attr.max_request_dtos = qdepth; ep_attr.max_recv_iov =1 ; ep_attr.max_request_iov =1 ; ep_attr.request_completion_flags =DAT_COMPLETION_DEFAULT_FLAG ;
@@ -1548,7 +1553,7 @@ int main(int argc, char **argv)switch (rc) {case 'u' : ud_test =1 ; - eps =MAX_EP_COUNT /2 ; + eps =4 ;break ;case 'm' : multi_eps =1 ;
Signature · 6 lines
1.7.3 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 3/4 common: dapl_ep_free must serialize CM object destroy
In reply to a message not in the archiveFrom: Arlin Davis <[email protected]>
CM object could be destroyed from time_wait state from provider in separate thread. Destruction must be serialized with EP lock.
--- dapl/common/dapl_ep_free.c | 21 +++++++++++---------- 1 files changed, 11 insertions(+), 10 deletions(-)
dapl/common/dapl_ep_free.c +11 -10
@@ -66,7 +66,7 @@ DAT_RETURN DAT_API dapl_ep_free(IN DAT_EP_HANDLE ep_handle)DAPL_EP *ep_ptr;DAPL_IA *ia_ptr;DAT_EP_PARAM *param; -dp_ib_cm_handle_t cm_ptr, next_cm_ptr; +dp_ib_cm_handle_t cm_ptr;ib_qp_state_t save_qp_state;DAT_RETURN dat_status =DAT_SUCCESS ;
@@ -110,25 +110,26 @@ DAT_RETURN DAT_API dapl_ep_free(IN DAT_EP_HANDLE ep_handle)*/ (void )dapl_ep_disconnect (ep_ptr,DAT_CLOSE_ABRUPT_FLAG ); +/* +* Do verification of parameters and the state change atomically. +*/ +dapl_os_lock (&ep_ptr->header.lock); +/* Free all CM objects */ cm_ptr = (dapl_llist_is_empty (&ep_ptr->cm_list_head) ?NULL :dapl_llist_peek_head (&ep_ptr->cm_list_head)); +while (cm_ptr !=NULL ) {dapl_log (DAPL_DBG_TYPE_EP ,"dapl_ep_free: Free CM: EP=%p CM=%p\n" , ep_ptr, cm_ptr); - - next_cm_ptr =dapl_llist_next_entry (&ep_ptr->cm_list_head, - &cm_ptr->list_entry); +dapl_os_unlock (&ep_ptr->header.lock);dapls_cm_free (cm_ptr);/* blocking call */ - cm_ptr = next_cm_ptr; +dapl_os_lock (&ep_ptr->header.lock); + cm_ptr = (dapl_llist_is_empty (&ep_ptr->cm_list_head) + ?NULL :dapl_llist_peek_head (&ep_ptr->cm_list_head)); } -/* -* Do verification of parameters and the state change atomically. -*/ -dapl_os_lock (&ep_ptr->header.lock); -#ifdef DAPL_DBG /* check if event pending and warn, don't assert, state is valid */ if (ep_ptr->param.ep_state ==DAT_EP_STATE_DISCONNECT_PENDING ) {
Signature · 6 lines
1.7.3 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 4/4 ucm: add time wait override capability for CM services
In reply to a message not in the archiveFrom: Arlin Davis <[email protected]>
New environment variable DAPL_UCM_WAIT_TIME (ms) to override the default wait_time for CM services. Default setting is 60 seconds.
--- dapl/openib_common/dapl_ib_common.h | 1 + dapl/openib_ucm/cm.c | 52 +++++++++++++--------------------- dapl/openib_ucm/dapl_ib_util.h | 1 + dapl/openib_ucm/device.c | 9 +++--- 4 files changed, 27 insertions(+), 36 deletions(-)
dapl/openib_common/dapl_ib_common.h +1 -0
@@ -225,6 +225,7 @@ typedef uint16_t ib_hca_port_t;#define DCM_RETRY_CNT 10#define DCM_REP_TIME 800/* reply timeout in m_secs */ #define DCM_RTU_TIME 800/* rtu timeout in m_secs */ +#define DCM_WAIT_TIME 60000/* wait timeout in m_secs */ #define DCM_QP_SIZE 500/* uCM tx, rx qp size */ #define DCM_CQ_SIZE 500/* uCM cq size */ #define DCM_TX_BURST 50/* uCM signal, every TX burst msgs posted */
dapl/openib_ucm/cm.c +20 -32
65 lines not on this page · raw message
dapl/openib_ucm/dapl_ib_util.h +1 -0
@@ -101,6 +101,7 @@ typedef struct _ib_hca_transportint cm_timer;int rep_time;int rtu_time; +int wait_time;DAPL_OS_LOCK slock;int s_hd;int s_tl;
dapl/openib_ucm/device.c +5 -4
@@ -504,12 +504,11 @@ static int ucm_service_create(IN DAPL_HCA *hca)int hlen =sizeof (struct ibv_grh );/* hdr included with UD recv */ char *rbuf; -dapl_dbg_log (DAPL_DBG_TYPE_UTIL ," ucm_create: \n" ); -/* setup CM timers and queue sizes */ tp->retries =dapl_os_get_env_val ("DAPL_UCM_RETRY" ,DCM_RETRY_CNT ); tp->rep_time =dapl_os_get_env_val ("DAPL_UCM_REP_TIME" ,DCM_REP_TIME ); tp->rtu_time =dapl_os_get_env_val ("DAPL_UCM_RTU_TIME" ,DCM_RTU_TIME ); + tp->wait_time =dapl_os_get_env_val ("DAPL_UCM_WAIT_TIME" ,DCM_WAIT_TIME ); tp->cm_timer =DAPL_MIN (tp->rep_time,tp->rtu_time); tp->qpe =dapl_os_get_env_val ("DAPL_UCM_QP_SIZE" ,DCM_QP_SIZE ); tp->cqe =dapl_os_get_env_val ("DAPL_UCM_CQ_SIZE" ,DCM_CQ_SIZE );
@@ -519,8 +518,10 @@ static int ucm_service_create(IN DAPL_HCA *hca) goto bail;dapl_log (DAPL_DBG_TYPE_UTIL , -" create_service: pd %p ctx %p handle 0x%x\n" , - tp->pd, tp->pd->context, tp->pd->handle); +" UCM: CM service - pd %p ctx %p " +" Timers(ms): req %d rtu %d wait %d\n" , + tp->pd, tp->pd->context, tp->rep_time, + tp->rtu_time, tp->wait_time); tp->rch =ibv_create_comp_channel (hca->ib_hca_handle);if (!tp->rch)
Signature · 6 lines
1.7.3 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html