From 39ef530088859ccbbcf29bf6af2cf9f0307dc476 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Wed, 22 Mar 2017 10:47:46 +0200 Subject: [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 --- src/include/ipxe/infiniband.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/include') diff --git a/src/include/ipxe/infiniband.h b/src/include/ipxe/infiniband.h index d7ecd1623..6f4951f17 100644 --- a/src/include/ipxe/infiniband.h +++ b/src/include/ipxe/infiniband.h @@ -493,18 +493,20 @@ struct ib_driver { /** Declare an Infiniband driver */ #define __ib_driver __table_entry ( IB_DRIVERS, 01 ) -extern struct ib_completion_queue * -ib_create_cq ( struct ib_device *ibdev, unsigned int num_cqes, - struct ib_completion_queue_operations *op ); +extern int ib_create_cq ( struct ib_device *ibdev, unsigned int num_cqes, + struct ib_completion_queue_operations *op, + struct ib_completion_queue **new_cq ); extern void ib_destroy_cq ( struct ib_device *ibdev, struct ib_completion_queue *cq ); extern void ib_poll_cq ( struct ib_device *ibdev, struct ib_completion_queue *cq ); -extern struct ib_queue_pair * -ib_create_qp ( struct ib_device *ibdev, enum ib_queue_pair_type type, - unsigned int num_send_wqes, struct ib_completion_queue *send_cq, - unsigned int num_recv_wqes, struct ib_completion_queue *recv_cq, - struct ib_queue_pair_operations *op, const char *name ); +extern int ib_create_qp ( struct ib_device *ibdev, enum ib_queue_pair_type type, + unsigned int num_send_wqes, + struct ib_completion_queue *send_cq, + unsigned int num_recv_wqes, + struct ib_completion_queue *recv_cq, + struct ib_queue_pair_operations *op, + const char *name, struct ib_queue_pair **new_qp ); extern int ib_modify_qp ( struct ib_device *ibdev, struct ib_queue_pair *qp ); extern void ib_destroy_qp ( struct ib_device *ibdev, struct ib_queue_pair *qp ); -- cgit v1.2.3-55-g7522