|
22 | 22 |
|
23 | 23 | #define UCT_TCP_IFACE_NETDEV_DIR "/sys/class/net" |
24 | 24 |
|
| 25 | +const char *uct_tcp_reachability_modes[] = { |
| 26 | + [UCT_TCP_REACHABILITY_MODE_ROUTE] = "route", |
| 27 | + [UCT_TCP_REACHABILITY_MODE_ALL] = "all", |
| 28 | + [UCT_TCP_REACHABILITY_MODE_LAST] = NULL |
| 29 | +}; |
| 30 | + |
25 | 31 | extern ucs_class_t UCS_CLASS_DECL_NAME(uct_tcp_iface_t); |
26 | 32 |
|
27 | 33 | static ucs_config_field_t uct_tcp_iface_config_table[] = { |
@@ -118,6 +124,12 @@ static ucs_config_field_t uct_tcp_iface_config_table[] = { |
118 | 124 | ucs_offsetof(uct_tcp_iface_config_t, ep_bind_src_addr), |
119 | 125 | UCS_CONFIG_TYPE_TERNARY}, |
120 | 126 |
|
| 127 | + {"REACHABILITY_MODE", "route", |
| 128 | + "The mode used for performing the reachability check\n" |
| 129 | + " - route - all routable addresses are assumed as reachable\n" |
| 130 | + " - all - all addresses are assumed as reachable, without any check", |
| 131 | + ucs_offsetof(uct_tcp_iface_config_t, reachability_mode), UCS_CONFIG_TYPE_ENUM(uct_tcp_reachability_modes)}, |
| 132 | + |
121 | 133 | {NULL} |
122 | 134 | }; |
123 | 135 |
|
@@ -241,12 +253,15 @@ uct_tcp_iface_is_reachable_v2(const uct_iface_h tl_iface, |
241 | 253 | } |
242 | 254 | } |
243 | 255 |
|
244 | | - if ((params->field_mask & UCT_IFACE_IS_REACHABLE_FIELD_SCOPE) && |
245 | | - (params->scope == UCT_IFACE_REACHABILITY_SCOPE_DEVICE)) { |
| 256 | + if (((params->field_mask & UCT_IFACE_IS_REACHABLE_FIELD_SCOPE) && |
| 257 | + (params->scope == UCT_IFACE_REACHABILITY_SCOPE_DEVICE)) || |
| 258 | + (iface->config.reachability_mode == UCT_TCP_REACHABILITY_MODE_ALL)) { |
246 | 259 | return uct_iface_scope_is_reachable(tl_iface, params); |
247 | 260 | } |
248 | 261 |
|
249 | 262 | /* Check if the remote address is routable */ |
| 263 | + ucs_assert(iface->config.reachability_mode == |
| 264 | + UCT_TCP_REACHABILITY_MODE_ROUTE); |
250 | 265 | status = ucs_ifname_to_index(iface->if_name, &ndev_index); |
251 | 266 | if (status != UCS_OK) { |
252 | 267 | uct_iface_fill_info_str_buf( |
@@ -763,6 +778,7 @@ static UCS_CLASS_INIT_FUNC(uct_tcp_iface_t, uct_md_h md, uct_worker_h worker, |
763 | 778 | self->config.keepalive.cnt = config->keepalive.cnt; |
764 | 779 | self->config.keepalive.intvl = config->keepalive.intvl; |
765 | 780 | self->config.ep_bind_src_addr = config->ep_bind_src_addr; |
| 781 | + self->config.reachability_mode = config->reachability_mode; |
766 | 782 | self->port_range.first = config->port_range.first; |
767 | 783 | self->port_range.last = config->port_range.last; |
768 | 784 |
|
|
0 commit comments