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