@@ -48,14 +48,6 @@ int ucp_proto_common_init_check_err_handling(
48
48
UCP_ERR_HANDLING_MODE_NONE );
49
49
}
50
50
51
- ucp_rsc_index_t
52
- ucp_proto_common_get_rsc_index (const ucp_proto_init_params_t * params ,
53
- ucp_lane_index_t lane )
54
- {
55
- ucs_assert (lane < UCP_MAX_LANES );
56
- return params -> ep_config_key -> lanes [lane ].rsc_index ;
57
- }
58
-
59
51
static size_t
60
52
ucp_proto_common_get_seg_size (const ucp_proto_common_init_params_t * params ,
61
53
ucp_lane_index_t lane )
@@ -372,6 +364,7 @@ ucp_proto_common_get_lane_perf(const ucp_proto_common_init_params_t *params,
372
364
UCT_PERF_ATTR_FIELD_SEND_POST_OVERHEAD |
373
365
UCT_PERF_ATTR_FIELD_RECV_OVERHEAD |
374
366
UCT_PERF_ATTR_FIELD_BANDWIDTH |
367
+ UCT_PERF_ATTR_FIELD_PATH_BANDWIDTH |
375
368
UCT_PERF_ATTR_FIELD_LATENCY ;
376
369
perf_attr .operation = params -> send_op ;
377
370
@@ -385,6 +378,9 @@ ucp_proto_common_get_lane_perf(const ucp_proto_common_init_params_t *params,
385
378
tl_perf -> recv_overhead = perf_attr .recv_overhead + params -> overhead ;
386
379
tl_perf -> bandwidth = ucp_tl_iface_bandwidth (context ,
387
380
& perf_attr .bandwidth );
381
+ tl_perf -> path_ratio = ucp_tl_iface_bandwidth (context ,
382
+ & perf_attr .path_bandwidth ) /
383
+ tl_perf -> bandwidth ;
388
384
tl_perf -> latency = ucp_tl_iface_latency (context ,
389
385
& perf_attr .latency ) +
390
386
params -> latency ;
@@ -456,41 +452,6 @@ ucp_proto_common_get_lane_perf(const ucp_proto_common_init_params_t *params,
456
452
return status ;
457
453
}
458
454
459
- /*
460
- * TODO: This is a quickfix, needed to select lanes for multi-lane RNDV
461
- * protocol in the order of rma_bw_lanes (RMA_BW lanes sorted by score).
462
- * The proper solution is to have a generic mechanism to sort lanes based on
463
- * the calculated performance, implemented in proto_multi.
464
- * This function should be removed once the proper solution is implemented.
465
- */
466
- static inline ucp_lane_index_t
467
- ucp_proto_common_lanes_iter (const ucp_ep_config_key_t * ep_config_key ,
468
- ucp_lane_map_t lane_map , ucp_lane_type_t lane_type ,
469
- ucp_lane_index_t start , ucp_lane_index_t * lane )
470
- {
471
- if (start >= UCP_MAX_LANES ) {
472
- return UCP_MAX_LANES ;
473
- }
474
-
475
- if (lane_type == UCP_LANE_TYPE_RMA_BW ) {
476
- for (; start < ep_config_key -> num_lanes ; ++ start ) {
477
- * lane = ep_config_key -> rma_bw_lanes [start ];
478
- if ((* lane == UCP_NULL_LANE ) || (lane_map & UCS_BIT (* lane ))) {
479
- break ;
480
- }
481
- }
482
- return start ;
483
- }
484
-
485
- /*
486
- * By default iterate over all lanes in lane_map
487
- * Reset lane_map bits below start position, then find first bit set
488
- */
489
- lane_map &= ~((1ULL << start ) - 1 );
490
- * lane = ucs_ffs64_safe (lane_map );
491
- return * lane ;
492
- }
493
-
494
455
ucp_lane_index_t
495
456
ucp_proto_common_find_lanes (const ucp_proto_init_params_t * params ,
496
457
unsigned flags , ptrdiff_t max_iov_offs ,
@@ -505,7 +466,7 @@ ucp_proto_common_find_lanes(const ucp_proto_init_params_t *params,
505
466
const ucp_rkey_config_key_t * rkey_config_key = params -> rkey_config_key ;
506
467
const ucp_proto_select_param_t * select_param = params -> select_param ;
507
468
const uct_iface_attr_t * iface_attr ;
508
- ucp_lane_index_t lane , num_lanes , i ;
469
+ ucp_lane_index_t lane , num_lanes ;
509
470
const uct_md_attr_v2_t * md_attr ;
510
471
const uct_component_attr_t * cmpt_attr ;
511
472
ucp_rsc_index_t rsc_index ;
@@ -538,12 +499,7 @@ ucp_proto_common_find_lanes(const ucp_proto_init_params_t *params,
538
499
}
539
500
540
501
lane_map = UCS_MASK (ep_config_key -> num_lanes ) & ~exclude_map ;
541
- lane = 0 ;
542
- for (i = ucp_proto_common_lanes_iter (ep_config_key , lane_map , lane_type ,
543
- 0 , & lane );
544
- (i < ep_config_key -> num_lanes ) && (lane != UCP_NULL_LANE );
545
- i = ucp_proto_common_lanes_iter (ep_config_key , lane_map , lane_type ,
546
- i + 1 , & lane )) {
502
+ ucs_for_each_bit (lane , lane_map ) {
547
503
if (num_lanes >= max_lanes ) {
548
504
break ;
549
505
}
0 commit comments