@@ -954,11 +954,12 @@ usnic_do_resends(
954954 opal_btl_usnic_send_segment_t * sseg ;
955955 opal_btl_usnic_endpoint_t * endpoint ;
956956 struct opal_btl_usnic_channel_t * data_channel ;
957- int ret ;
957+ int ret , count ;
958958
959959 data_channel = & module -> mod_channels [USNIC_DATA_CHANNEL ];
960960
961- while ((get_send_credits (data_channel ) > 1 ) &&
961+ count = mca_btl_usnic_component .max_resends_per_iteration ;
962+ while (count > 0 && (get_send_credits (data_channel ) > 1 ) &&
962963 !opal_list_is_empty (& module -> pending_resend_segs )) {
963964
964965 /*
@@ -999,6 +1000,8 @@ usnic_do_resends(
9991000 if (OPAL_UNLIKELY (OPAL_SUCCESS != ret )) {
10001001 opal_btl_usnic_util_abort ("hotel checkin failed\n" , __FILE__ , __LINE__ );
10011002 }
1003+
1004+ -- count ;
10021005 }
10031006}
10041007
@@ -1226,7 +1229,7 @@ opal_btl_usnic_module_progress_sends(
12261229
12271230 /* Is it time to send ACK? */
12281231 if (endpoint -> endpoint_acktime == 0 ||
1229- endpoint -> endpoint_acktime <= get_nsec ()) {
1232+ endpoint -> endpoint_acktime <= get_ticks ()) {
12301233 if (OPAL_LIKELY (opal_btl_usnic_ack_send (module , endpoint ) == OPAL_SUCCESS )) {
12311234 opal_btl_usnic_remove_from_endpoints_needing_ack (endpoint );
12321235 } else {
@@ -2344,14 +2347,14 @@ static void init_freelists(opal_btl_usnic_module_t *module)
23442347 uint32_t segsize ;
23452348
23462349 segsize = (module -> local_modex .max_msg_size +
2347- opal_cache_line_size - 1 ) &
2350+ mca_btl_usnic_component .prefix_send_offset +
2351+ opal_cache_line_size - 1 ) &
23482352 ~(opal_cache_line_size - 1 );
23492353
23502354 /* Send frags freelists */
23512355 OBJ_CONSTRUCT (& module -> small_send_frags , opal_free_list_t );
23522356 rc = usnic_compat_free_list_init (& module -> small_send_frags ,
2353- sizeof (opal_btl_usnic_small_send_frag_t ) +
2354- mca_btl_usnic_component .prefix_send_offset ,
2357+ sizeof (opal_btl_usnic_small_send_frag_t ),
23552358 opal_cache_line_size ,
23562359 OBJ_CLASS (opal_btl_usnic_small_send_frag_t ),
23572360 segsize ,
@@ -2368,8 +2371,7 @@ static void init_freelists(opal_btl_usnic_module_t *module)
23682371
23692372 OBJ_CONSTRUCT (& module -> large_send_frags , opal_free_list_t );
23702373 rc = usnic_compat_free_list_init (& module -> large_send_frags ,
2371- sizeof (opal_btl_usnic_large_send_frag_t ) +
2372- mca_btl_usnic_component .prefix_send_offset ,
2374+ sizeof (opal_btl_usnic_large_send_frag_t ),
23732375 opal_cache_line_size ,
23742376 OBJ_CLASS (opal_btl_usnic_large_send_frag_t ),
23752377 0 , /* payload size */
@@ -2386,8 +2388,7 @@ static void init_freelists(opal_btl_usnic_module_t *module)
23862388
23872389 OBJ_CONSTRUCT (& module -> put_dest_frags , opal_free_list_t );
23882390 rc = usnic_compat_free_list_init (& module -> put_dest_frags ,
2389- sizeof (opal_btl_usnic_put_dest_frag_t ) +
2390- mca_btl_usnic_component .prefix_send_offset ,
2391+ sizeof (opal_btl_usnic_put_dest_frag_t ),
23912392 opal_cache_line_size ,
23922393 OBJ_CLASS (opal_btl_usnic_put_dest_frag_t ),
23932394 0 , /* payload size */
@@ -2405,8 +2406,7 @@ static void init_freelists(opal_btl_usnic_module_t *module)
24052406 /* list of segments to use for sending */
24062407 OBJ_CONSTRUCT (& module -> chunk_segs , opal_free_list_t );
24072408 rc = usnic_compat_free_list_init (& module -> chunk_segs ,
2408- sizeof (opal_btl_usnic_chunk_segment_t ) +
2409- mca_btl_usnic_component .prefix_send_offset ,
2409+ sizeof (opal_btl_usnic_chunk_segment_t ),
24102410 opal_cache_line_size ,
24112411 OBJ_CLASS (opal_btl_usnic_chunk_segment_t ),
24122412 segsize ,
@@ -2424,11 +2424,11 @@ static void init_freelists(opal_btl_usnic_module_t *module)
24242424 /* ACK segments freelist */
24252425 uint32_t ack_segment_len ;
24262426 ack_segment_len = (sizeof (opal_btl_usnic_btl_header_t ) +
2427+ mca_btl_usnic_component .prefix_send_offset +
24272428 opal_cache_line_size - 1 ) & ~(opal_cache_line_size - 1 );
24282429 OBJ_CONSTRUCT (& module -> ack_segs , opal_free_list_t );
24292430 rc = usnic_compat_free_list_init (& module -> ack_segs ,
2430- sizeof (opal_btl_usnic_ack_segment_t ) +
2431- mca_btl_usnic_component .prefix_send_offset ,
2431+ sizeof (opal_btl_usnic_ack_segment_t ),
24322432 opal_cache_line_size ,
24332433 OBJ_CLASS (opal_btl_usnic_ack_segment_t ),
24342434 ack_segment_len ,
0 commit comments