Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit c755229

Browse files
author
rhc54
committed
Merge pull request #948 from jsquyres/pr/v1.10/moar-usnic-updates
v1.10: More usnic updates
2 parents 0f2de88 + 564aede commit c755229

File tree

4 files changed

+31
-11
lines changed

4 files changed

+31
-11
lines changed

ompi/mca/btl/usnic/btl_usnic_endpoint.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ typedef struct opal_btl_usnic_modex_t {
6969
uint32_t ipv4_addr;
7070
/* Stored in host order */
7171
uint32_t ports[USNIC_NUM_CHANNELS];
72+
/* Stored in network order */
7273
uint32_t netmask;
7374
/* Stored in host order */
7475
uint32_t connectivity_udp_port;

ompi/mca/btl/usnic/btl_usnic_module.c

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,18 @@ static int add_procs_block_create_endpoints(opal_btl_usnic_module_t *module,
9898

9999
/* Do not create loopback usnic connections */
100100
if (opal_proc == my_proc) {
101+
opal_output_verbose(75, USNIC_OUT,
102+
"btl:usnic:add_procs:%s: not connecting to self",
103+
module->fabric_info->fabric_attr->name);
101104
continue;
102105
}
103106

104107
/* usNIC does not support loopback to the same machine */
105108
if (OPAL_PROC_ON_LOCAL_NODE(opal_proc->proc_flags)) {
109+
opal_output_verbose(75, USNIC_OUT,
110+
"btl:usnic:add_procs:%s: not connecting to %s on same server",
111+
module->fabric_info->fabric_attr->name,
112+
usnic_compat_proc_name_print(&opal_proc->proc_name));
106113
continue;
107114
}
108115

@@ -115,6 +122,11 @@ static int add_procs_block_create_endpoints(opal_btl_usnic_module_t *module,
115122
if (OPAL_ERR_UNREACH == rc) {
116123
/* If the peer doesn't have usnic modex info, then we just
117124
skip it */
125+
opal_output_verbose(75, USNIC_OUT,
126+
"btl:usnic:add_procs:%s: peer %s on %s does not have usnic modex info; skipping",
127+
module->fabric_info->fabric_attr->name,
128+
usnic_compat_proc_name_print(&opal_proc->proc_name),
129+
opal_get_proc_hostname(opal_proc));
118130
continue;
119131
} else if (OPAL_SUCCESS != rc) {
120132
return OPAL_ERR_OUT_OF_RESOURCE;
@@ -127,8 +139,10 @@ static int add_procs_block_create_endpoints(opal_btl_usnic_module_t *module,
127139
&usnic_endpoint);
128140
if (OPAL_SUCCESS != rc) {
129141
opal_output_verbose(5, USNIC_OUT,
130-
"btl:usnic:%s: unable to create endpoint for module=%p proc=%p\n",
131-
__func__, (void *)module, (void *)usnic_proc);
142+
"btl:usnic:add_procs:%s: unable to create endpoint to peer %s on %s",
143+
module->fabric_info->fabric_attr->name,
144+
usnic_compat_proc_name_print(&opal_proc->proc_name),
145+
opal_get_proc_hostname(opal_proc));
132146
OBJ_RELEASE(usnic_proc);
133147
continue;
134148
}
@@ -144,7 +158,8 @@ static int add_procs_block_create_endpoints(opal_btl_usnic_module_t *module,
144158
modex->netmask);
145159

146160
opal_output_verbose(5, USNIC_OUT,
147-
"btl:usnic: new usnic peer endpoint: %s, proirity port %d, data port %d",
161+
"btl:usnic:add_procs:%s: new usnic peer endpoint: %s, proirity port %d, data port %d",
162+
module->fabric_info->fabric_attr->name,
148163
str,
149164
modex->ports[USNIC_PRIORITY_CHANNEL],
150165
modex->ports[USNIC_DATA_CHANNEL]);
@@ -1895,6 +1910,7 @@ static void init_queue_lengths(opal_btl_usnic_module_t *module)
18951910
} else {
18961911
module->cq_num = mca_btl_usnic_component.cq_num;
18971912
}
1913+
module->av_eq_num = mca_btl_usnic_component.av_eq_num;
18981914

18991915
/*
19001916
* Queue sizes for priority channel scale with # of endpoint. A

ompi/mca/btl/usnic/btl_usnic_util.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,24 +115,27 @@ opal_btl_usnic_dump_hex(void *vaddr, int len)
115115
* using inet_ntop()).
116116
*/
117117
void opal_btl_usnic_snprintf_ipv4_addr(char *out, size_t maxlen,
118-
uint32_t addr, uint32_t netmask)
118+
uint32_t addr_be, uint32_t netmask_be)
119119
{
120120
int prefixlen;
121+
uint32_t netmask = ntohl(netmask_be);
122+
uint32_t addr = ntohl(addr_be);
121123
uint8_t *p = (uint8_t*) &addr;
124+
122125
if (netmask != 0) {
123126
prefixlen = 33 - ffs(netmask);
124127
snprintf(out, maxlen, "%u.%u.%u.%u/%u",
125-
p[0],
126-
p[1],
127-
p[2],
128128
p[3],
129+
p[2],
130+
p[1],
131+
p[0],
129132
prefixlen);
130133
} else {
131134
snprintf(out, maxlen, "%u.%u.%u.%u",
132-
p[0],
133-
p[1],
135+
p[3],
134136
p[2],
135-
p[3]);
137+
p[1],
138+
p[0]);
136139
}
137140
}
138141

ompi/mca/btl/usnic/btl_usnic_util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ void opal_btl_usnic_util_abort(const char *msg, const char *file, int line);
113113
* expected to be in network byte order.
114114
*/
115115
void opal_btl_usnic_snprintf_ipv4_addr(char *out, size_t maxlen,
116-
uint32_t addr, uint32_t netmask);
116+
uint32_t addr_be, uint32_t netmask_be);
117117

118118
void opal_btl_usnic_snprintf_bool_array(char *s, size_t slen, bool a[], size_t alen);
119119

0 commit comments

Comments
 (0)