2626#include <ucs/type/init_once.h>
2727#include <ucs/vfs/base/vfs_cb.h>
2828#include <ucs/vfs/base/vfs_obj.h>
29+ #include <uct/ib/base/ib_device.h>
2930#include <string.h>
3031#include <dlfcn.h>
3132
7273/* Factor to multiply with in order to get infinite latency */
7374#define UCP_CONTEXT_INFINITE_LAT_FACTOR 100
7475
75- #define UCP_MLX_PREFIX "mlx"
76- #define UCP_MLX_DEFAULT_PORT "1"
77-
7876typedef enum ucp_transports_list_search_result {
7977 UCP_TRANSPORTS_LIST_SEARCH_RESULT_PRIMARY = UCS_BIT (0 ),
8078 UCP_TRANSPORTS_LIST_SEARCH_RESULT_AUX_IN_MAIN = UCS_BIT (1 ),
@@ -1080,7 +1078,7 @@ ucp_config_is_tl_name_present(const ucs_config_names_array_t *tl_array,
10801078 tl_cfg_mask ));
10811079}
10821080
1083- /* Return a pointer to the suffix of the device name,
1081+ /* Return a pointer to the suffix of the device name,
10841082 * or the end of the string if no suffix is found. */
10851083static const char * ucp_get_dev_name_suffix (const char * dev_name )
10861084{
@@ -1091,13 +1089,6 @@ static const char *ucp_get_dev_name_suffix(const char *dev_name)
10911089 return colon + 1 ;
10921090}
10931091
1094- static inline int
1095- ucp_is_dev_mlx_default_port (const char * dev_name , const char * dev_name_suffix )
1096- {
1097- return (!strncmp (dev_name , UCP_MLX_PREFIX , strlen (UCP_MLX_PREFIX ))) &&
1098- (!strcmp (dev_name_suffix , UCP_MLX_DEFAULT_PORT ));
1099- }
1100-
11011092static int ucp_is_resource_in_device_list (const uct_tl_resource_desc_t * resource ,
11021093 const ucs_config_names_array_t * devices ,
11031094 uint64_t * dev_cfg_mask ,
@@ -1117,7 +1108,8 @@ static int ucp_is_resource_in_device_list(const uct_tl_resource_desc_t *resource
11171108 if (dev_type == UCT_DEVICE_TYPE_NET ) {
11181109 dev_name_suffix = ucp_get_dev_name_suffix (resource -> dev_name );
11191110
1120- if (ucp_is_dev_mlx_default_port (resource -> dev_name , dev_name_suffix )) {
1111+ if (uct_ib_device_is_mlx_default_port (resource -> dev_name ,
1112+ dev_name_suffix )) {
11211113 ucs_strncpy_zero (dev_name_base , resource -> dev_name ,
11221114 (size_t )(dev_name_suffix - resource -> dev_name ));
11231115
0 commit comments