|
69 | 69 | static void finalize_one_channel(opal_btl_usnic_module_t *module, |
70 | 70 | struct opal_btl_usnic_channel_t *channel); |
71 | 71 |
|
| 72 | +static int channel_addr2str(opal_btl_usnic_module_t *module, int channel, |
| 73 | + char *str, size_t len_param) |
| 74 | +{ |
| 75 | + size_t len; |
| 76 | + |
| 77 | + len = len_param; |
| 78 | + fi_av_straddr(module->av, module->mod_channels[channel].info->src_addr, |
| 79 | + str, &len); |
| 80 | + if (len > len_param) { |
| 81 | + opal_show_help("help-mpi-btl-usnic.txt", |
| 82 | + "libfabric API failed", |
| 83 | + true, |
| 84 | + opal_process_info.nodename, |
| 85 | + module->linux_device_name, |
| 86 | + "fi_av_straddr", __FILE__, __LINE__, |
| 87 | + FI_ENODATA, |
| 88 | + "Failed to convert address to string: buffer too short"); |
| 89 | + |
| 90 | + return OPAL_ERR_OUT_OF_RESOURCE; |
| 91 | + } |
| 92 | + |
| 93 | + return OPAL_SUCCESS; |
| 94 | +} |
| 95 | + |
72 | 96 |
|
73 | 97 | /* |
74 | 98 | * Loop over a block of procs sent to us in add_procs and see if we |
@@ -159,12 +183,29 @@ static int add_procs_block_create_endpoints(opal_btl_usnic_module_t *module, |
159 | 183 | modex->ipv4_addr, |
160 | 184 | modex->netmask); |
161 | 185 |
|
| 186 | + char local_pri_addr[64] = {0}; |
| 187 | + rc = channel_addr2str(module, USNIC_PRIORITY_CHANNEL, |
| 188 | + local_pri_addr, sizeof(local_pri_addr)); |
| 189 | + if (OPAL_SUCCESS != rc) { |
| 190 | + OBJ_RELEASE(usnic_proc); |
| 191 | + continue; |
| 192 | + } |
| 193 | + |
| 194 | + char local_data_addr[64] = {0}; |
| 195 | + rc = channel_addr2str(module, USNIC_DATA_CHANNEL, |
| 196 | + local_data_addr, sizeof(local_data_addr)); |
| 197 | + if (OPAL_SUCCESS != rc) { |
| 198 | + OBJ_RELEASE(usnic_proc); |
| 199 | + continue; |
| 200 | + } |
| 201 | + |
162 | 202 | opal_output_verbose(5, USNIC_OUT, |
163 | | - "btl:usnic:add_procs:%s: new usnic peer endpoint: %s, proirity port %d, data port %d", |
| 203 | + "btl:usnic:add_procs:%s: new usnic peer endpoint: pri=%s:%d, data=%s:%d (local: pri=%s, data=%s)", |
164 | 204 | module->linux_device_name, |
165 | | - str, |
166 | | - modex->ports[USNIC_PRIORITY_CHANNEL], |
167 | | - modex->ports[USNIC_DATA_CHANNEL]); |
| 205 | + str, modex->ports[USNIC_PRIORITY_CHANNEL], |
| 206 | + str, modex->ports[USNIC_DATA_CHANNEL], |
| 207 | + local_pri_addr, |
| 208 | + local_data_addr); |
168 | 209 |
|
169 | 210 | endpoints[i] = usnic_endpoint; |
170 | 211 | ++num_created; |
@@ -1633,6 +1674,21 @@ static int create_ep(opal_btl_usnic_module_t* module, |
1633 | 1674 | assert(0 != sin->sin_port); |
1634 | 1675 | } |
1635 | 1676 |
|
| 1677 | + char *str; |
| 1678 | + if (USNIC_PRIORITY_CHANNEL == channel->chan_index) { |
| 1679 | + str = "priority"; |
| 1680 | + } else if (USNIC_DATA_CHANNEL == channel->chan_index) { |
| 1681 | + str = "data"; |
| 1682 | + } else { |
| 1683 | + str = "UNKNOWN"; |
| 1684 | + } |
| 1685 | + opal_output_verbose(15, USNIC_OUT, |
| 1686 | + "btl:usnic:create_ep:%s: new usnic local endpoint channel %s: %s:%d", |
| 1687 | + module->fabric_info->fabric_attr->name, |
| 1688 | + str, |
| 1689 | + inet_ntoa(sin->sin_addr), |
| 1690 | + ntohs(sin->sin_port)); |
| 1691 | + |
1636 | 1692 | /* actual sizes */ |
1637 | 1693 | channel->chan_rd_num = channel->info->rx_attr->size; |
1638 | 1694 | channel->chan_sd_num = channel->info->tx_attr->size; |
|
0 commit comments