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.
|
* University of Stuttgart. All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* 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) 2008 Sun Microsystems, Inc. All rights reserved.
|
||||||
* Copyright (c) 2009 Oak Ridge National Laboratory
|
* Copyright (c) 2009 Oak Ridge National Laboratory
|
||||||
* Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights
|
* 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;
|
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;
|
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);
|
memset (kindexes, 0, sizeof(int) * if_count);
|
||||||
|
|
||||||
/* assign the corresponding kernel indexes for all opal_list indexes
|
/* assign the corresponding kernel indexes for all opal_list
|
||||||
* (loop over all addresses)
|
* indexes (loop over all addresses)
|
||||||
*/
|
*/
|
||||||
for(if_index = opal_ifbegin(); if_index >= 0; if_index = opal_ifnext(if_index)){
|
for(if_index = opal_ifbegin(); if_index >= 0; if_index = opal_ifnext(if_index)){
|
||||||
int index = opal_ifindextokindex (if_index);
|
int index = opal_ifindextokindex (if_index);
|
||||||
@ -867,8 +868,8 @@ static int mca_btl_tcp_component_exchange(void)
|
|||||||
index = opal_ifnext(index)) {
|
index = opal_ifnext(index)) {
|
||||||
struct sockaddr_storage my_ss;
|
struct sockaddr_storage my_ss;
|
||||||
|
|
||||||
/* look if the address belongs to this (enabled) NIC.
|
/* Look if the module's address belongs to this
|
||||||
* If not, go to next address
|
* kernel IP interface. If not, go to next address.
|
||||||
*/
|
*/
|
||||||
if (opal_ifindextokindex (index) !=
|
if (opal_ifindextokindex (index) !=
|
||||||
mca_btl_tcp_component.tcp_btls[i]->tcp_ifkindex) {
|
mca_btl_tcp_component.tcp_btls[i]->tcp_ifkindex) {
|
||||||
|
@ -527,19 +527,18 @@ int mca_btl_tcp_proc_insert( mca_btl_tcp_proc_t* btl_proc,
|
|||||||
NULL != peer_interfaces[j]->ipv4_address) {
|
NULL != peer_interfaces[j]->ipv4_address) {
|
||||||
|
|
||||||
/* check for loopback */
|
/* check for loopback */
|
||||||
if ((opal_net_islocalhost((struct sockaddr *)local_interfaces[i]->ipv4_address)
|
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 *)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_net_islocalhost((struct sockaddr *)local_interfaces[i]->ipv4_address)
|
(opal_net_islocalhost((struct sockaddr *)local_interfaces[i]->ipv4_address) &&
|
||||||
&& !opal_ifislocal(proc_hostname))) {
|
!opal_ifislocal(proc_hostname))) {
|
||||||
|
|
||||||
/* No connection is possible on these interfaces */
|
/* No connection is possible on these interfaces */
|
||||||
|
|
||||||
/* check for RFC1918 */
|
/* check for RFC1918 */
|
||||||
} else if(opal_net_addr_isipv4public((struct sockaddr*) local_interfaces[i]->ipv4_address)
|
} else if(opal_net_addr_isipv4public((struct sockaddr*) local_interfaces[i]->ipv4_address) &&
|
||||||
&& opal_net_addr_isipv4public((struct sockaddr*)
|
opal_net_addr_isipv4public((struct sockaddr*) peer_interfaces[j]->ipv4_address)) {
|
||||||
peer_interfaces[j]->ipv4_address)) {
|
|
||||||
if(opal_net_samenetwork((struct sockaddr*) local_interfaces[i]->ipv4_address,
|
if(opal_net_samenetwork((struct sockaddr*) local_interfaces[i]->ipv4_address,
|
||||||
(struct sockaddr*) peer_interfaces[j]->ipv4_address,
|
(struct sockaddr*) peer_interfaces[j]->ipv4_address,
|
||||||
local_interfaces[i]->ipv4_netmask)) {
|
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) {
|
NULL != peer_interfaces[j]->ipv6_address) {
|
||||||
|
|
||||||
/* check for loopback */
|
/* check for loopback */
|
||||||
if ((opal_net_islocalhost((struct sockaddr *)local_interfaces[i]->ipv6_address)
|
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 *)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_net_islocalhost((struct sockaddr *)local_interfaces[i]->ipv6_address)
|
(opal_net_islocalhost((struct sockaddr *)local_interfaces[i]->ipv6_address) &&
|
||||||
&& !opal_ifislocal(proc_hostname))) {
|
!opal_ifislocal(proc_hostname))) {
|
||||||
|
|
||||||
/* No connection is possible on these interfaces */
|
/* No connection is possible on these interfaces */
|
||||||
|
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user