diff options
| author | Michael Brown | 2017-03-22 09:47:46 +0100 |
|---|---|---|
| committer | Michael Brown | 2017-03-22 10:18:02 +0100 |
| commit | 39ef530088859ccbbcf29bf6af2cf9f0307dc476 (patch) | |
| tree | 1f90063aa65d6fa2065bdb7f430aebf70623856e /src/drivers/infiniband/flexboot_nodnic.c | |
| parent | [build] Avoid confusing sparse in single-argument DBG() macros (diff) | |
| download | ipxe-39ef530088859ccbbcf29bf6af2cf9f0307dc476.tar.gz ipxe-39ef530088859ccbbcf29bf6af2cf9f0307dc476.tar.xz ipxe-39ef530088859ccbbcf29bf6af2cf9f0307dc476.zip | |
[infiniband] Return status code from ib_create_cq() and ib_create_qp()
Any underlying errors arising during ib_create_cq() or ib_create_qp()
are lost since the functions simply return NULL on error. This makes
debugging harder, since a debug-enabled build is required to discover
the root cause of the error.
Fix by returning a status code from these functions, thereby allowing
any underlying errors to be propagated.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers/infiniband/flexboot_nodnic.c')
| -rw-r--r-- | src/drivers/infiniband/flexboot_nodnic.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/drivers/infiniband/flexboot_nodnic.c b/src/drivers/infiniband/flexboot_nodnic.c index 1ee10f54b..2108e78fc 100644 --- a/src/drivers/infiniband/flexboot_nodnic.c +++ b/src/drivers/infiniband/flexboot_nodnic.c @@ -860,6 +860,7 @@ static int flexboot_nodnic_eth_open ( struct net_device *netdev ) { mlx_uint64 cq_size = 0; mlx_uint32 qpn = 0; nodnic_port_state state = nodnic_port_state_down; + int rc; if ( port->port_priv.port_state & NODNIC_PORT_OPENED ) { DBGC ( flexboot_nodnic, "%s: port %d is already opened\n", @@ -877,11 +878,11 @@ static int flexboot_nodnic_eth_open ( struct net_device *netdev ) { } INIT_LIST_HEAD ( &dummy_cq->work_queues ); - port->eth_qp = ib_create_qp ( ibdev, IB_QPT_ETH, - FLEXBOOT_NODNIC_ETH_NUM_SEND_WQES, dummy_cq, - FLEXBOOT_NODNIC_ETH_NUM_RECV_WQES, dummy_cq, - &flexboot_nodnic_eth_qp_op, netdev->name ); - if ( !port->eth_qp ) { + if ( ( rc = ib_create_qp ( ibdev, IB_QPT_ETH, + FLEXBOOT_NODNIC_ETH_NUM_SEND_WQES, dummy_cq, + FLEXBOOT_NODNIC_ETH_NUM_RECV_WQES, dummy_cq, + &flexboot_nodnic_eth_qp_op, netdev->name, + &port->eth_qp ) ) != 0 ) { DBGC ( flexboot_nodnic, "flexboot_nodnic %p port %d could not create queue pair\n", flexboot_nodnic, ibdev->port ); status = MLX_OUT_OF_RESOURCES; @@ -894,9 +895,8 @@ static int flexboot_nodnic_eth_open ( struct net_device *netdev ) { MLX_FATAL_CHECK_STATUS(status, get_cq_size_err, "nodnic_port_get_cq_size failed"); - port->eth_cq = ib_create_cq ( ibdev, cq_size, - &flexboot_nodnic_eth_cq_op ); - if ( !port->eth_cq ) { + if ( ( rc = ib_create_cq ( ibdev, cq_size, &flexboot_nodnic_eth_cq_op, + &port->eth_cq ) ) != 0 ) { DBGC ( flexboot_nodnic, "flexboot_nodnic %p port %d could not create completion queue\n", flexboot_nodnic, ibdev->port ); |
