1
1

usnic: ensure that queues are long enough

Double check the queue lengths that we get back from libfabric to
ensure that they are at least as long as we need.  They *should* never
be shorter than we need, but let's just check to be sure.

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
Этот коммит содержится в:
Jeff Squyres 2017-01-06 15:10:25 +00:00
родитель 53dc75a89c
Коммит bd5b8ed754

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

@ -12,7 +12,7 @@
* All rights reserved.
* Copyright (c) 2006 Sandia National Laboratories. All rights
* reserved.
* Copyright (c) 2009-2016 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2009-2017 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2014-2016 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved
@ -1611,6 +1611,31 @@ static int create_ep(opal_btl_usnic_module_t* module,
return OPAL_ERR_OUT_OF_RESOURCE;
}
/* Check to ensure that the RX/TX queue lengths are at least as
long as we asked for */
if ((int) channel->info->rx_attr->size < channel->chan_rd_num) {
rc = FI_ETOOSMALL;
opal_show_help("help-mpi-btl-usnic.txt",
"internal error during init",
true,
opal_process_info.nodename,
module->linux_device_name,
"endpoint RX queue length is too short", __FILE__, __LINE__,
rc, fi_strerror(rc));
return OPAL_ERR_OUT_OF_RESOURCE;
}
if ((int) channel->info->tx_attr->size < channel->chan_sd_num) {
rc = FI_ETOOSMALL;
opal_show_help("help-mpi-btl-usnic.txt",
"internal error during init",
true,
opal_process_info.nodename,
module->linux_device_name,
"endpoint TX queue length is too short", __FILE__, __LINE__,
rc, fi_strerror(rc));
return OPAL_ERR_OUT_OF_RESOURCE;
}
/* attach CQ to EP */
rc = fi_ep_bind(channel->ep, &channel->cq->fid, FI_SEND);
if (0 != rc) {
@ -1783,6 +1808,20 @@ static int init_one_channel(opal_btl_usnic_module_t *module,
goto error;
}
/* Ensure that we got a CQ that is at least as long as we asked
for */
if ((int) cq_attr.size < cq_num) {
rc = FI_ETOOSMALL;
opal_show_help("help-mpi-btl-usnic.txt",
"internal error during init",
true,
opal_process_info.nodename,
module->linux_device_name,
"created CQ is too small", __FILE__, __LINE__,
rc, fi_strerror(rc));
goto error;
}
/* Set up the endpoint for this channel */
rc = create_ep(module, channel);
if (OPAL_SUCCESS != rc) {