aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers/infiniband/hermon.c
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2017-03-22 10:47:46 +0200
committerMichael Brown <mcb30@ipxe.org>2017-03-22 11:18:02 +0200
commit39ef530088859ccbbcf29bf6af2cf9f0307dc476 (patch)
tree1f90063aa65d6fa2065bdb7f430aebf70623856e /src/drivers/infiniband/hermon.c
parente88e2a29657824963c4fdb948e5ac99dfe6472ee (diff)
downloadipxe-39ef530088859ccbbcf29bf6af2cf9f0307dc476.tar.gz
[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/hermon.c')
-rw-r--r--src/drivers/infiniband/hermon.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/drivers/infiniband/hermon.c b/src/drivers/infiniband/hermon.c
index 2199a9d98..3797d96e8 100644
--- a/src/drivers/infiniband/hermon.c
+++ b/src/drivers/infiniband/hermon.c
@@ -3261,24 +3261,20 @@ static int hermon_eth_open ( struct net_device *netdev ) {
goto err_open;
/* Allocate completion queue */
- port->eth_cq = ib_create_cq ( ibdev, HERMON_ETH_NUM_CQES,
- &hermon_eth_cq_op );
- if ( ! port->eth_cq ) {
+ if ( ( rc = ib_create_cq ( ibdev, HERMON_ETH_NUM_CQES,
+ &hermon_eth_cq_op, &port->eth_cq ) ) != 0 ) {
DBGC ( hermon, "Hermon %p port %d could not create completion "
- "queue\n", hermon, ibdev->port );
- rc = -ENOMEM;
+ "queue: %s\n", hermon, ibdev->port, strerror ( rc ) );
goto err_create_cq;
}
/* Allocate queue pair */
- port->eth_qp = ib_create_qp ( ibdev, IB_QPT_ETH,
- HERMON_ETH_NUM_SEND_WQES, port->eth_cq,
- HERMON_ETH_NUM_RECV_WQES, port->eth_cq,
- &hermon_eth_qp_op, netdev->name );
- if ( ! port->eth_qp ) {
+ if ( ( rc = ib_create_qp ( ibdev, IB_QPT_ETH, HERMON_ETH_NUM_SEND_WQES,
+ port->eth_cq, HERMON_ETH_NUM_RECV_WQES,
+ port->eth_cq, &hermon_eth_qp_op,
+ netdev->name, &port->eth_qp ) ) != 0 ) {
DBGC ( hermon, "Hermon %p port %d could not create queue "
- "pair\n", hermon, ibdev->port );
- rc = -ENOMEM;
+ "pair: %s\n", hermon, ibdev->port, strerror ( rc ) );
goto err_create_qp;
}
ib_qp_set_ownerdata ( port->eth_qp, netdev );