|
12 | 12 | * All rights reserved.
|
13 | 13 | * Copyright (c) 2006 Sandia National Laboratories. All rights
|
14 | 14 | * reserved.
|
15 |
| - * Copyright (c) 2009-2016 Cisco Systems, Inc. All rights reserved. |
| 15 | + * Copyright (c) 2009-2017 Cisco Systems, Inc. All rights reserved. |
16 | 16 | * Copyright (c) 2014-2016 Los Alamos National Security, LLC. All rights
|
17 | 17 | * reserved.
|
18 | 18 | * Copyright (c) 2014 Intel, Inc. All rights reserved
|
@@ -1611,6 +1611,31 @@ static int create_ep(opal_btl_usnic_module_t* module,
|
1611 | 1611 | return OPAL_ERR_OUT_OF_RESOURCE;
|
1612 | 1612 | }
|
1613 | 1613 |
|
| 1614 | + /* Check to ensure that the RX/TX queue lengths are at least as |
| 1615 | + long as we asked for */ |
| 1616 | + if ((int) channel->info->rx_attr->size < channel->chan_rd_num) { |
| 1617 | + rc = FI_ETOOSMALL; |
| 1618 | + opal_show_help("help-mpi-btl-usnic.txt", |
| 1619 | + "internal error during init", |
| 1620 | + true, |
| 1621 | + opal_process_info.nodename, |
| 1622 | + module->linux_device_name, |
| 1623 | + "endpoint RX queue length is too short", __FILE__, __LINE__, |
| 1624 | + rc, fi_strerror(rc)); |
| 1625 | + return OPAL_ERR_OUT_OF_RESOURCE; |
| 1626 | + } |
| 1627 | + if ((int) channel->info->tx_attr->size < channel->chan_sd_num) { |
| 1628 | + rc = FI_ETOOSMALL; |
| 1629 | + opal_show_help("help-mpi-btl-usnic.txt", |
| 1630 | + "internal error during init", |
| 1631 | + true, |
| 1632 | + opal_process_info.nodename, |
| 1633 | + module->linux_device_name, |
| 1634 | + "endpoint TX queue length is too short", __FILE__, __LINE__, |
| 1635 | + rc, fi_strerror(rc)); |
| 1636 | + return OPAL_ERR_OUT_OF_RESOURCE; |
| 1637 | + } |
| 1638 | + |
1614 | 1639 | /* attach CQ to EP */
|
1615 | 1640 | rc = fi_ep_bind(channel->ep, &channel->cq->fid, FI_SEND);
|
1616 | 1641 | if (0 != rc) {
|
@@ -1783,6 +1808,20 @@ static int init_one_channel(opal_btl_usnic_module_t *module,
|
1783 | 1808 | goto error;
|
1784 | 1809 | }
|
1785 | 1810 |
|
| 1811 | + /* Ensure that we got a CQ that is at least as long as we asked |
| 1812 | + for */ |
| 1813 | + if ((int) cq_attr.size < cq_num) { |
| 1814 | + rc = FI_ETOOSMALL; |
| 1815 | + opal_show_help("help-mpi-btl-usnic.txt", |
| 1816 | + "internal error during init", |
| 1817 | + true, |
| 1818 | + opal_process_info.nodename, |
| 1819 | + module->linux_device_name, |
| 1820 | + "created CQ is too small", __FILE__, __LINE__, |
| 1821 | + rc, fi_strerror(rc)); |
| 1822 | + goto error; |
| 1823 | + } |
| 1824 | + |
1786 | 1825 | /* Set up the endpoint for this channel */
|
1787 | 1826 | rc = create_ep(module, channel);
|
1788 | 1827 | if (OPAL_SUCCESS != rc) {
|
|
0 commit comments