@@ -226,6 +226,9 @@ static void uct_dc_iface_init_version(uct_dc_iface_t *iface, uct_md_h md)
226226
227227 dev = & ucs_derived_of (md , uct_ib_md_t )-> dev ;
228228 ver = uct_ib_device_spec (dev )-> flags & UCT_IB_DEVICE_FLAG_DC ;
229+ ucs_assert (ver != UCT_IB_DEVICE_FLAG_DC );
230+
231+ iface -> version_flag = 0 ;
229232
230233 if (ver & UCT_IB_DEVICE_FLAG_DC_V2 ) {
231234 iface -> version_flag = UCT_DC_IFACE_ADDR_DC_V2 ;
@@ -234,8 +237,6 @@ static void uct_dc_iface_init_version(uct_dc_iface_t *iface, uct_md_h md)
234237 if (ver & UCT_IB_DEVICE_FLAG_DC_V1 ) {
235238 iface -> version_flag = UCT_DC_IFACE_ADDR_DC_V1 ;
236239 }
237-
238- iface -> version_flag = 0 ;
239240}
240241
241242UCS_CLASS_INIT_FUNC (uct_dc_iface_t , uct_dc_iface_ops_t * ops , uct_md_h md ,
@@ -351,11 +352,10 @@ int uct_dc_iface_is_reachable(const uct_iface_h tl_iface,
351352 uct_dc_iface_t UCS_V_UNUSED * iface = ucs_derived_of (tl_iface ,
352353 uct_dc_iface_t );
353354 uct_dc_iface_addr_t * addr = (uct_dc_iface_addr_t * )iface_addr ;
354- uint8_t dc_ver_mask = UCT_DC_IFACE_ADDR_DC_V1 | UCT_DC_IFACE_ADDR_DC_V2 ;
355355
356356 ucs_assert_always (iface_addr != NULL );
357357
358- return ((addr -> flags & dc_ver_mask ) == ( iface -> version_flag & dc_ver_mask ) ) &&
358+ return ((addr -> flags & UCT_DC_IFACE_ADDR_DC_VERS ) == iface -> version_flag ) &&
359359 (UCT_DC_IFACE_ADDR_TM_ENABLED (addr ) ==
360360 UCT_RC_IFACE_TM_ENABLED (& iface -> super )) &&
361361 uct_ib_iface_is_reachable (tl_iface , dev_addr , iface_addr );
0 commit comments