@@ -963,11 +963,12 @@ usnic_do_resends(
963963 opal_btl_usnic_send_segment_t * sseg ;
964964 opal_btl_usnic_endpoint_t * endpoint ;
965965 struct opal_btl_usnic_channel_t * data_channel ;
966- int ret ;
966+ int ret , count ;
967967
968968 data_channel = & module -> mod_channels [USNIC_DATA_CHANNEL ];
969969
970- while ((get_send_credits (data_channel ) > 1 ) &&
970+ count = mca_btl_usnic_component .max_resends_per_iteration ;
971+ while (count > 0 && (get_send_credits (data_channel ) > 1 ) &&
971972 !opal_list_is_empty (& module -> pending_resend_segs )) {
972973
973974 /*
@@ -1009,6 +1010,8 @@ usnic_do_resends(
10091010 BTL_ERROR (("hotel checkin failed\n" ));
10101011 abort (); /* should not be possible */
10111012 }
1013+
1014+ -- count ;
10121015 }
10131016}
10141017
@@ -1236,7 +1239,7 @@ opal_btl_usnic_module_progress_sends(
12361239
12371240 /* Is it time to send ACK? */
12381241 if (endpoint -> endpoint_acktime == 0 ||
1239- endpoint -> endpoint_acktime <= get_nsec ()) {
1242+ endpoint -> endpoint_acktime <= get_ticks ()) {
12401243 if (OPAL_LIKELY (opal_btl_usnic_ack_send (module , endpoint ) == OPAL_SUCCESS )) {
12411244 opal_btl_usnic_remove_from_endpoints_needing_ack (endpoint );
12421245 } else {
@@ -2366,14 +2369,14 @@ static void init_freelists(opal_btl_usnic_module_t *module)
23662369 uint32_t segsize ;
23672370
23682371 segsize = (module -> local_modex .max_msg_size +
2369- opal_cache_line_size - 1 ) &
2372+ mca_btl_usnic_component .prefix_send_offset +
2373+ opal_cache_line_size - 1 ) &
23702374 ~(opal_cache_line_size - 1 );
23712375
23722376 /* Send frags freelists */
23732377 OBJ_CONSTRUCT (& module -> small_send_frags , opal_free_list_t );
23742378 rc = usnic_compat_free_list_init (& module -> small_send_frags ,
2375- sizeof (opal_btl_usnic_small_send_frag_t ) +
2376- mca_btl_usnic_component .prefix_send_offset ,
2379+ sizeof (opal_btl_usnic_small_send_frag_t ),
23772380 opal_cache_line_size ,
23782381 OBJ_CLASS (opal_btl_usnic_small_send_frag_t ),
23792382 segsize ,
@@ -2390,8 +2393,7 @@ static void init_freelists(opal_btl_usnic_module_t *module)
23902393
23912394 OBJ_CONSTRUCT (& module -> large_send_frags , opal_free_list_t );
23922395 rc = usnic_compat_free_list_init (& module -> large_send_frags ,
2393- sizeof (opal_btl_usnic_large_send_frag_t ) +
2394- mca_btl_usnic_component .prefix_send_offset ,
2396+ sizeof (opal_btl_usnic_large_send_frag_t ),
23952397 opal_cache_line_size ,
23962398 OBJ_CLASS (opal_btl_usnic_large_send_frag_t ),
23972399 0 , /* payload size */
@@ -2408,8 +2410,7 @@ static void init_freelists(opal_btl_usnic_module_t *module)
24082410
24092411 OBJ_CONSTRUCT (& module -> put_dest_frags , opal_free_list_t );
24102412 rc = usnic_compat_free_list_init (& module -> put_dest_frags ,
2411- sizeof (opal_btl_usnic_put_dest_frag_t ) +
2412- mca_btl_usnic_component .prefix_send_offset ,
2413+ sizeof (opal_btl_usnic_put_dest_frag_t ),
24132414 opal_cache_line_size ,
24142415 OBJ_CLASS (opal_btl_usnic_put_dest_frag_t ),
24152416 0 , /* payload size */
@@ -2427,8 +2428,7 @@ static void init_freelists(opal_btl_usnic_module_t *module)
24272428 /* list of segments to use for sending */
24282429 OBJ_CONSTRUCT (& module -> chunk_segs , opal_free_list_t );
24292430 rc = usnic_compat_free_list_init (& module -> chunk_segs ,
2430- sizeof (opal_btl_usnic_chunk_segment_t ) +
2431- mca_btl_usnic_component .prefix_send_offset ,
2431+ sizeof (opal_btl_usnic_chunk_segment_t ),
24322432 opal_cache_line_size ,
24332433 OBJ_CLASS (opal_btl_usnic_chunk_segment_t ),
24342434 segsize ,
@@ -2446,11 +2446,11 @@ static void init_freelists(opal_btl_usnic_module_t *module)
24462446 /* ACK segments freelist */
24472447 uint32_t ack_segment_len ;
24482448 ack_segment_len = (sizeof (opal_btl_usnic_btl_header_t ) +
2449+ mca_btl_usnic_component .prefix_send_offset +
24492450 opal_cache_line_size - 1 ) & ~(opal_cache_line_size - 1 );
24502451 OBJ_CONSTRUCT (& module -> ack_segs , opal_free_list_t );
24512452 rc = usnic_compat_free_list_init (& module -> ack_segs ,
2452- sizeof (opal_btl_usnic_ack_segment_t ) +
2453- mca_btl_usnic_component .prefix_send_offset ,
2453+ sizeof (opal_btl_usnic_ack_segment_t ),
24542454 opal_cache_line_size ,
24552455 OBJ_CLASS (opal_btl_usnic_ack_segment_t ),
24562456 ack_segment_len ,
0 commit comments