1
1

Stop an ugly infinite loop caused by continual re-opening of the opal if framework.

Этот коммит содержится в:
Ralph Castain 2015-03-24 17:49:17 -07:00
родитель dfb7e00ef5
Коммит 9dbc69df0f
3 изменённых файлов: 22 добавлений и 9 удалений

Просмотреть файл

@ -1,5 +1,6 @@
/*
* Copyright (c) 2010-2013 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -27,6 +28,8 @@ static int opal_if_base_open (mca_base_open_flag_t flags);
static int opal_if_base_close(void);
static void opal_if_construct(opal_if_t *obj);
static bool frameopen = false;
/* instance the opal_if_t object */
OBJ_CLASS_INSTANCE(opal_if_t, opal_list_item_t, opal_if_construct, NULL);
@ -55,6 +58,11 @@ static int opal_if_base_register (mca_base_register_flag_t flags)
static int opal_if_base_open (mca_base_open_flag_t flags)
{
if (frameopen) {
return OPAL_SUCCESS;
}
frameopen = true;
/* setup the global list */
OBJ_CONSTRUCT(&opal_if_list, opal_list_t);
@ -66,6 +74,10 @@ static int opal_if_base_close(void)
{
opal_list_item_t *item;
if (!frameopen) {
return OPAL_SUCCESS;
}
while (NULL != (item = opal_list_remove_first(&opal_if_list))) {
OBJ_RELEASE(item);
}

Просмотреть файл

@ -4,6 +4,7 @@
* Copyright (c) 2013 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2015 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -19,6 +20,7 @@
#include "opal/constants.h"
#include "opal/util/output.h"
#include "opal/mca/if/if.h"
#include "opal/mca/if/base/base.h"
static int if_posix_open(void);
@ -148,6 +150,7 @@ static int if_posix_open(void)
} while (ifc_len < MAX_IFCONF_SIZE);
if (!successful_locate) {
opal_output(0, "opal_ifinit: unable to find network interfaces.");
close(sd);
return OPAL_ERR_FATAL;
}
@ -221,6 +224,9 @@ static int if_posix_open(void)
/* every new address gets its own internal if_index */
intf->if_index = opal_list_get_size(&opal_if_list)+1;
opal_output_verbose(1, opal_if_base_framework.framework_output,
"found interface %s", intf->if_name);
/* assign the kernel index to distinguish different NICs */
#ifndef SIOCGIFINDEX
intf->if_kernel_index = intf->if_index;

Просмотреть файл

@ -12,7 +12,7 @@
* Copyright (c) 2008-2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2010-2013 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2013-2014 Intel, Inc. All rights reserved
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -69,11 +69,6 @@ opal_finalize_util(void)
}
/* close interfaces code. */
if (opal_if_base_framework.framework_refcnt > 1) {
/* opal if may have been opened many times -- FIXME */
opal_if_base_framework.framework_refcnt = 1;
}
(void) mca_base_framework_close(&opal_if_base_framework);
(void) mca_base_framework_close(&opal_event_base_framework);