btl tcp: cosmetic changes and updates
No logic changes. Update some stale/incorrect comments, fix some indenting and style.
Этот коммит содержится в:
родитель
d164fe9bc5
Коммит
4b59be4e4c
@ -10,7 +10,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2007-2014 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2007-2015 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
|
||||
* Copyright (c) 2009 Oak Ridge National Laboratory
|
||||
* Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights
|
||||
@ -547,15 +547,16 @@ static int mca_btl_tcp_component_create_instances(void)
|
||||
return OPAL_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
|
||||
/* calculate the number of kernel indexes (number of physical NICs) */
|
||||
/* calculate the number of kernel indexes (number of IP interfaces) */
|
||||
{
|
||||
int j;
|
||||
|
||||
/* initialize array to 0. Assumption: 0 isn't a valid kernel index */
|
||||
/* initialize array to 0. Assumption: 0 isn't a valid kernel
|
||||
index */
|
||||
memset (kindexes, 0, sizeof(int) * if_count);
|
||||
|
||||
/* assign the corresponding kernel indexes for all opal_list indexes
|
||||
* (loop over all addresses)
|
||||
/* assign the corresponding kernel indexes for all opal_list
|
||||
* indexes (loop over all addresses)
|
||||
*/
|
||||
for(if_index = opal_ifbegin(); if_index >= 0; if_index = opal_ifnext(if_index)){
|
||||
int index = opal_ifindextokindex (if_index);
|
||||
@ -867,11 +868,11 @@ static int mca_btl_tcp_component_exchange(void)
|
||||
index = opal_ifnext(index)) {
|
||||
struct sockaddr_storage my_ss;
|
||||
|
||||
/* look if the address belongs to this (enabled) NIC.
|
||||
* If not, go to next address
|
||||
/* Look if the module's address belongs to this
|
||||
* kernel IP interface. If not, go to next address.
|
||||
*/
|
||||
if (opal_ifindextokindex (index) !=
|
||||
mca_btl_tcp_component.tcp_btls[i]->tcp_ifkindex) {
|
||||
mca_btl_tcp_component.tcp_btls[i]->tcp_ifkindex) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -527,19 +527,18 @@ int mca_btl_tcp_proc_insert( mca_btl_tcp_proc_t* btl_proc,
|
||||
NULL != peer_interfaces[j]->ipv4_address) {
|
||||
|
||||
/* check for loopback */
|
||||
if ((opal_net_islocalhost((struct sockaddr *)local_interfaces[i]->ipv4_address)
|
||||
&& !opal_net_islocalhost((struct sockaddr *)peer_interfaces[j]->ipv4_address))
|
||||
|| (opal_net_islocalhost((struct sockaddr *)peer_interfaces[j]->ipv4_address)
|
||||
&& !opal_net_islocalhost((struct sockaddr *)local_interfaces[i]->ipv4_address))
|
||||
|| (opal_net_islocalhost((struct sockaddr *)local_interfaces[i]->ipv4_address)
|
||||
&& !opal_ifislocal(proc_hostname))) {
|
||||
if ((opal_net_islocalhost((struct sockaddr *)local_interfaces[i]->ipv4_address) &&
|
||||
!opal_net_islocalhost((struct sockaddr *)peer_interfaces[j]->ipv4_address)) ||
|
||||
(opal_net_islocalhost((struct sockaddr *)peer_interfaces[j]->ipv4_address) &&
|
||||
!opal_net_islocalhost((struct sockaddr *)local_interfaces[i]->ipv4_address)) ||
|
||||
(opal_net_islocalhost((struct sockaddr *)local_interfaces[i]->ipv4_address) &&
|
||||
!opal_ifislocal(proc_hostname))) {
|
||||
|
||||
/* No connection is possible on these interfaces */
|
||||
|
||||
/* check for RFC1918 */
|
||||
} else if(opal_net_addr_isipv4public((struct sockaddr*) local_interfaces[i]->ipv4_address)
|
||||
&& opal_net_addr_isipv4public((struct sockaddr*)
|
||||
peer_interfaces[j]->ipv4_address)) {
|
||||
} else if(opal_net_addr_isipv4public((struct sockaddr*) local_interfaces[i]->ipv4_address) &&
|
||||
opal_net_addr_isipv4public((struct sockaddr*) peer_interfaces[j]->ipv4_address)) {
|
||||
if(opal_net_samenetwork((struct sockaddr*) local_interfaces[i]->ipv4_address,
|
||||
(struct sockaddr*) peer_interfaces[j]->ipv4_address,
|
||||
local_interfaces[i]->ipv4_netmask)) {
|
||||
@ -569,12 +568,12 @@ int mca_btl_tcp_proc_insert( mca_btl_tcp_proc_t* btl_proc,
|
||||
NULL != peer_interfaces[j]->ipv6_address) {
|
||||
|
||||
/* check for loopback */
|
||||
if ((opal_net_islocalhost((struct sockaddr *)local_interfaces[i]->ipv6_address)
|
||||
&& !opal_net_islocalhost((struct sockaddr *)peer_interfaces[j]->ipv6_address))
|
||||
|| (opal_net_islocalhost((struct sockaddr *)peer_interfaces[j]->ipv6_address)
|
||||
&& !opal_net_islocalhost((struct sockaddr *)local_interfaces[i]->ipv6_address))
|
||||
|| (opal_net_islocalhost((struct sockaddr *)local_interfaces[i]->ipv6_address)
|
||||
&& !opal_ifislocal(proc_hostname))) {
|
||||
if ((opal_net_islocalhost((struct sockaddr *)local_interfaces[i]->ipv6_address) &&
|
||||
!opal_net_islocalhost((struct sockaddr *)peer_interfaces[j]->ipv6_address)) ||
|
||||
(opal_net_islocalhost((struct sockaddr *)peer_interfaces[j]->ipv6_address) &&
|
||||
!opal_net_islocalhost((struct sockaddr *)local_interfaces[i]->ipv6_address)) ||
|
||||
(opal_net_islocalhost((struct sockaddr *)local_interfaces[i]->ipv6_address) &&
|
||||
!opal_ifislocal(proc_hostname))) {
|
||||
|
||||
/* No connection is possible on these interfaces */
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user