@@ -219,27 +219,24 @@ void uct_dc_iface_set_quota(uct_dc_iface_t *iface, uct_dc_iface_config_t *config
219219 ucs_min (iface -> super .config .tx_qp_len , config -> quota );
220220}
221221
222- static ucs_status_t uct_dc_iface_init_version (uct_dc_iface_t * iface ,
223- uct_md_h md )
222+ static void uct_dc_iface_init_version (uct_dc_iface_t * iface , uct_md_h md )
224223{
225224 uct_ib_device_t * dev ;
226225 unsigned ver ;
227226
228227 dev = & ucs_derived_of (md , uct_ib_md_t )-> dev ;
229228 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 ;
230232
231233 if (ver & UCT_IB_DEVICE_FLAG_DC_V2 ) {
232234 iface -> version_flag = UCT_DC_IFACE_ADDR_DC_V2 ;
233- return UCS_OK ;
234235 }
235236
236237 if (ver & UCT_IB_DEVICE_FLAG_DC_V1 ) {
237238 iface -> version_flag = UCT_DC_IFACE_ADDR_DC_V1 ;
238- return UCS_OK ;
239239 }
240-
241- iface -> version_flag = 0 ;
242- return UCS_ERR_UNSUPPORTED ;
243240}
244241
245242UCS_CLASS_INIT_FUNC (uct_dc_iface_t , uct_dc_iface_ops_t * ops , uct_md_h md ,
@@ -265,10 +262,7 @@ UCS_CLASS_INIT_FUNC(uct_dc_iface_t, uct_dc_iface_ops_t *ops, uct_md_h md,
265262 return UCS_ERR_INVALID_PARAM ;
266263 }
267264
268- status = uct_dc_iface_init_version (self , md );
269- if (status != UCS_OK ) {
270- return status ;
271- }
265+ uct_dc_iface_init_version (self , md );
272266
273267 self -> tx .ndci = config -> ndci ;
274268 self -> tx .policy = config -> tx_policy ;
@@ -361,7 +355,7 @@ int uct_dc_iface_is_reachable(const uct_iface_h tl_iface,
361355
362356 ucs_assert_always (iface_addr != NULL );
363357
364- return (addr -> flags & iface -> version_flag ) &&
358+ return (( addr -> flags & UCT_DC_IFACE_ADDR_DC_VERS ) == iface -> version_flag ) &&
365359 (UCT_DC_IFACE_ADDR_TM_ENABLED (addr ) ==
366360 UCT_RC_IFACE_TM_ENABLED (& iface -> super )) &&
367361 uct_ib_iface_is_reachable (tl_iface , dev_addr , iface_addr );
0 commit comments