1
1

Mostly a patch from Vasily/Mellanox to fix multi-port and 32/64 bit

issues with iwarp.c.  These fixes are needed for IBoE / ROCEE /
whateveritscalledtoday.  I added a few minor changes to his base
patch.

This commit was SVN r22717.
Этот коммит содержится в:
Jeff Squyres 2010-02-25 20:57:05 +00:00
родитель f6f6a06dff
Коммит a4a81698c2
4 изменённых файлов: 37 добавлений и 24 удалений

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

@ -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-2009 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2006-2009 Mellanox Technologies. All rights reserved.
* Copyright (c) 2006-2007 Los Alamos National Security, LLC. All rights
* reserved.
@ -633,13 +633,6 @@ int mca_btl_openib_add_procs(
}
#endif
#ifdef OMPI_HAVE_RDMAOE
if(IBV_LINK_LAYER_ETHERNET == openib_btl->ib_port_attr.link_layer &&
OPAL_PROC_ON_LOCAL_NODE(ompi_proc->proc_flags)) {
continue;
}
#endif
if(NULL == (ib_proc = mca_btl_openib_proc_create(ompi_proc))) {
return OMPI_ERR_OUT_OF_RESOURCE;
}

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

@ -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) 2006-2009 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2006-2010 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2006-2009 Mellanox Technologies. All rights reserved.
* Copyright (c) 2006-2007 Los Alamos National Security, LLC. All rights
* reserved.
@ -592,7 +592,7 @@ static int init_one_port(opal_list_t *btl_list, mca_btl_openib_device_t *device,
that member, then we're < OFED v1.2, and it can only be IB. */
#if defined(HAVE_STRUCT_IBV_DEVICE_TRANSPORT_TYPE)
if (IBV_TRANSPORT_IWARP == device->ib_dev->transport_type) {
subnet_id = mca_btl_openib_get_iwarp_subnet_id(device->ib_dev);
subnet_id = mca_btl_openib_get_iwarp_subnet_id(device->ib_dev, port_num);
BTL_VERBOSE(("my iWARP subnet_id is %016" PRIx64, subnet_id));
} else {
memset(&gid, 0, sizeof(gid));
@ -601,7 +601,18 @@ static int init_one_port(opal_list_t *btl_list, mca_btl_openib_device_t *device,
ibv_get_device_name(device->ib_dev), port_num));
return OMPI_ERR_NOT_FOUND;
}
#ifdef OMPI_HAVE_RDMAOE
if (IBV_LINK_LAYER_ETHERNET == ib_port_attr->link_layer) {
subnet_id = mca_btl_openib_get_iwarp_subnet_id(device->ib_dev,
port_num);
} else {
subnet_id = ntoh64(gid.global.subnet_prefix);
}
#else
subnet_id = ntoh64(gid.global.subnet_prefix);
#endif
BTL_VERBOSE(("my IB subnet_id for HCA %s port %d is %016" PRIx64,
ibv_get_device_name(device->ib_dev), port_num, subnet_id));
}
@ -2698,10 +2709,12 @@ btl_openib_component_init(int *num_btl_modules,
initialize them */
i = 0;
while (NULL != (item = opal_list_remove_first(&btl_list))) {
mca_btl_openib_device_t *device;
int qp_index;
ib_selected = (mca_btl_base_selected_module_t*)item;
openib_btl = (mca_btl_openib_module_t*)ib_selected->btl_module;
mca_btl_openib_device_t *device = openib_btl->device;
int qp_index;
device = openib_btl->device;
/* Search for a CPC that can handle this port */
ret = ompi_btl_openib_connect_base_select_for_local_port(openib_btl);

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

@ -1,6 +1,6 @@
/*
* Copyright (c) 2008 Chelsio, Inc. All rights reserved.
* Copyright (c) 2008-2009 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2008-2010 Cisco Systems, Inc. All rights reserved.
*
* Additional copyrights may follow
*
@ -84,7 +84,8 @@ static char *stringify(uint32_t addr)
* precisely specify which addresses are used (e.g., to effect
* specific subnet routing).
*/
uint64_t mca_btl_openib_get_iwarp_subnet_id(struct ibv_device *ib_dev)
uint64_t mca_btl_openib_get_iwarp_subnet_id(struct ibv_device *ib_dev,
uint8_t port)
{
opal_list_item_t *item;
@ -101,7 +102,8 @@ uint64_t mca_btl_openib_get_iwarp_subnet_id(struct ibv_device *ib_dev)
item != opal_list_get_end(myaddrs);
item = opal_list_get_next(item)) {
struct rdma_addr_list *addr = (struct rdma_addr_list *)item;
if (!strcmp(addr->dev_name, ib_dev->name)) {
if (!strcmp(addr->dev_name, ib_dev->name) &&
port == addr->dev_port) {
return addr->subnet;
}
}
@ -180,6 +182,8 @@ static int dev_specified(char *name, int port)
static int ipaddr_specified(struct sockaddr_in *ipaddr, uint32_t netmask)
{
uint32_t all = ~((uint32_t) 0);
if (NULL != mca_btl_openib_component.ipaddr_include) {
char **list;
int i;
@ -210,8 +214,8 @@ static int ipaddr_specified(struct sockaddr_in *ipaddr, uint32_t netmask)
opal_argv_free(temp);
continue;
}
list_subnet = ntohl(ipae.s_addr) & ~(~0 >> atoi(temp[1]));
subnet = ntohl(ipaddr->sin_addr.s_addr) & ~(~0 >> netmask);
list_subnet = ntohl(ipae.s_addr) & ~(all >> atoi(temp[1]));
subnet = ntohl(ipaddr->sin_addr.s_addr) & ~(all >> netmask);
opal_argv_free(temp);
if (subnet == list_subnet) {
@ -252,8 +256,8 @@ static int ipaddr_specified(struct sockaddr_in *ipaddr, uint32_t netmask)
opal_argv_free(temp);
continue;
}
list_subnet = ntohl(ipae.s_addr) & ~(~0 >> atoi(temp[1]));
subnet = ntohl(ipaddr->sin_addr.s_addr) & ~(~0 >> netmask);
list_subnet = ntohl(ipae.s_addr) & ~(all >> atoi(temp[1]));
subnet = ntohl(ipaddr->sin_addr.s_addr) & ~(all >> netmask);
opal_argv_free(temp);
if (subnet == list_subnet) {
@ -272,6 +276,7 @@ static int add_rdma_addr(struct sockaddr *ipaddr, uint32_t netmask)
struct rdma_event_channel *ch;
int rc = OMPI_SUCCESS;
struct rdma_addr_list *myaddr;
uint32_t all = ~((uint32_t) 0);
/* Ensure that this IP address is not in 127.0.0.1/8. If it is,
skip it because we never want loopback addresses to be
@ -349,7 +354,7 @@ static int add_rdma_addr(struct sockaddr *ipaddr, uint32_t netmask)
}
myaddr->addr = sinp->sin_addr.s_addr;
myaddr->subnet = ntohl(myaddr->addr) & ~(~0 >> netmask);
myaddr->subnet = ntohl(myaddr->addr) & ~(all >> netmask);
inet_ntop(sinp->sin_family, &sinp->sin_addr,
myaddr->addr_str, sizeof(myaddr->addr_str));
memcpy(myaddr->dev_name, cm_id->verbs->device->name, IBV_SYSFS_NAME_MAX);
@ -416,7 +421,8 @@ void mca_btl_openib_free_rdma_addr_list(void)
#else
/* !OMPI_HAVE_RDMACM case */
uint64_t mca_btl_openib_get_iwarp_subnet_id(struct ibv_device *ib_dev)
uint64_t mca_btl_openib_get_iwarp_subnet_id(struct ibv_device *ib_dev,
uint8_t port)
{
return 0;
}

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

@ -1,6 +1,6 @@
/*
* Copyright (c) 2008 Chelsio, Inc. All rights reserved.
* Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2008 Chelsio, Inc. All rights reserved.
* Copyright (c) 2008-2010 Cisco Systems, Inc. All rights reserved.
*
* Additional copyrights may follow
*
@ -22,7 +22,8 @@ BEGIN_C_DECLS
* @param ib_dev (IN) IB/iWARP device
* @return Value of the IPv4 Address bitwise-and'ed with the Netmask
*/
extern uint64_t mca_btl_openib_get_iwarp_subnet_id(struct ibv_device *ib_dev);
extern uint64_t mca_btl_openib_get_iwarp_subnet_id(struct ibv_device *ib_dev,
uint8_t port);
/**
* Get the IPv4 address of the specified HCA/RNIC device and physical port.