From c8fb76b9a9aa026b67f20ed9b8c8eac3b654172c Mon Sep 17 00:00:00 2001 From: Ivan Kochin Date: Thu, 30 Nov 2023 13:37:54 +0200 Subject: [PATCH] UCP/WIREUP: Consider local distance during slow lanes dropping --- src/ucp/wireup/select.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/ucp/wireup/select.c b/src/ucp/wireup/select.c index a8f2e906750..8dcdaff4d66 100644 --- a/src/ucp/wireup/select.c +++ b/src/ucp/wireup/select.c @@ -1461,12 +1461,18 @@ static double ucp_wireup_get_lane_bw(ucp_worker_h worker, const ucp_wireup_select_info_t *sinfo, const ucp_unpacked_address_t *address) { - ucp_context_h context = worker->context; - const uct_iface_attr_t *iface_attr; + ucp_worker_iface_t *wiface = ucp_worker_iface(worker, sinfo->rsc_index); double bw_local, bw_remote; - iface_attr = ucp_worker_iface_get_attr(worker, sinfo->rsc_index); - bw_local = ucp_tl_iface_bandwidth(context, &iface_attr->bandwidth); + if (address->dst_version < 17) { + bw_local = ucp_tl_iface_bandwidth(worker->context, + &wiface->attr.bandwidth); + } else { + /* Compare BW including local distance to prevent EP reconfiguration + * since remote distance is included to remote_addr*/ + bw_local = ucp_wireup_iface_bw_distance(wiface); + } + bw_remote = address->address_list[sinfo->addr_index].iface_attr.bandwidth; if (address->addr_version == UCP_OBJECT_VERSION_V2) {