[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>
This commit is contained in:
parent
e88e2a2965
commit
39ef530088
|
@ -860,6 +860,7 @@ static int flexboot_nodnic_eth_open ( struct net_device *netdev ) {
|
||||||
mlx_uint64 cq_size = 0;
|
mlx_uint64 cq_size = 0;
|
||||||
mlx_uint32 qpn = 0;
|
mlx_uint32 qpn = 0;
|
||||||
nodnic_port_state state = nodnic_port_state_down;
|
nodnic_port_state state = nodnic_port_state_down;
|
||||||
|
int rc;
|
||||||
|
|
||||||
if ( port->port_priv.port_state & NODNIC_PORT_OPENED ) {
|
if ( port->port_priv.port_state & NODNIC_PORT_OPENED ) {
|
||||||
DBGC ( flexboot_nodnic, "%s: port %d is already opened\n",
|
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 );
|
INIT_LIST_HEAD ( &dummy_cq->work_queues );
|
||||||
|
|
||||||
port->eth_qp = ib_create_qp ( ibdev, IB_QPT_ETH,
|
if ( ( rc = ib_create_qp ( ibdev, IB_QPT_ETH,
|
||||||
FLEXBOOT_NODNIC_ETH_NUM_SEND_WQES, dummy_cq,
|
FLEXBOOT_NODNIC_ETH_NUM_SEND_WQES, dummy_cq,
|
||||||
FLEXBOOT_NODNIC_ETH_NUM_RECV_WQES, dummy_cq,
|
FLEXBOOT_NODNIC_ETH_NUM_RECV_WQES, dummy_cq,
|
||||||
&flexboot_nodnic_eth_qp_op, netdev->name );
|
&flexboot_nodnic_eth_qp_op, netdev->name,
|
||||||
if ( !port->eth_qp ) {
|
&port->eth_qp ) ) != 0 ) {
|
||||||
DBGC ( flexboot_nodnic, "flexboot_nodnic %p port %d could not create queue pair\n",
|
DBGC ( flexboot_nodnic, "flexboot_nodnic %p port %d could not create queue pair\n",
|
||||||
flexboot_nodnic, ibdev->port );
|
flexboot_nodnic, ibdev->port );
|
||||||
status = MLX_OUT_OF_RESOURCES;
|
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,
|
MLX_FATAL_CHECK_STATUS(status, get_cq_size_err,
|
||||||
"nodnic_port_get_cq_size failed");
|
"nodnic_port_get_cq_size failed");
|
||||||
|
|
||||||
port->eth_cq = ib_create_cq ( ibdev, cq_size,
|
if ( ( rc = ib_create_cq ( ibdev, cq_size, &flexboot_nodnic_eth_cq_op,
|
||||||
&flexboot_nodnic_eth_cq_op );
|
&port->eth_cq ) ) != 0 ) {
|
||||||
if ( !port->eth_cq ) {
|
|
||||||
DBGC ( flexboot_nodnic,
|
DBGC ( flexboot_nodnic,
|
||||||
"flexboot_nodnic %p port %d could not create completion queue\n",
|
"flexboot_nodnic %p port %d could not create completion queue\n",
|
||||||
flexboot_nodnic, ibdev->port );
|
flexboot_nodnic, ibdev->port );
|
||||||
|
|
|
@ -3261,24 +3261,20 @@ static int hermon_eth_open ( struct net_device *netdev ) {
|
||||||
goto err_open;
|
goto err_open;
|
||||||
|
|
||||||
/* Allocate completion queue */
|
/* Allocate completion queue */
|
||||||
port->eth_cq = ib_create_cq ( ibdev, HERMON_ETH_NUM_CQES,
|
if ( ( rc = ib_create_cq ( ibdev, HERMON_ETH_NUM_CQES,
|
||||||
&hermon_eth_cq_op );
|
&hermon_eth_cq_op, &port->eth_cq ) ) != 0 ) {
|
||||||
if ( ! port->eth_cq ) {
|
|
||||||
DBGC ( hermon, "Hermon %p port %d could not create completion "
|
DBGC ( hermon, "Hermon %p port %d could not create completion "
|
||||||
"queue\n", hermon, ibdev->port );
|
"queue: %s\n", hermon, ibdev->port, strerror ( rc ) );
|
||||||
rc = -ENOMEM;
|
|
||||||
goto err_create_cq;
|
goto err_create_cq;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Allocate queue pair */
|
/* Allocate queue pair */
|
||||||
port->eth_qp = ib_create_qp ( ibdev, IB_QPT_ETH,
|
if ( ( rc = ib_create_qp ( ibdev, IB_QPT_ETH, HERMON_ETH_NUM_SEND_WQES,
|
||||||
HERMON_ETH_NUM_SEND_WQES, port->eth_cq,
|
port->eth_cq, HERMON_ETH_NUM_RECV_WQES,
|
||||||
HERMON_ETH_NUM_RECV_WQES, port->eth_cq,
|
port->eth_cq, &hermon_eth_qp_op,
|
||||||
&hermon_eth_qp_op, netdev->name );
|
netdev->name, &port->eth_qp ) ) != 0 ) {
|
||||||
if ( ! port->eth_qp ) {
|
|
||||||
DBGC ( hermon, "Hermon %p port %d could not create queue "
|
DBGC ( hermon, "Hermon %p port %d could not create queue "
|
||||||
"pair\n", hermon, ibdev->port );
|
"pair: %s\n", hermon, ibdev->port, strerror ( rc ) );
|
||||||
rc = -ENOMEM;
|
|
||||||
goto err_create_qp;
|
goto err_create_qp;
|
||||||
}
|
}
|
||||||
ib_qp_set_ownerdata ( port->eth_qp, netdev );
|
ib_qp_set_ownerdata ( port->eth_qp, netdev );
|
||||||
|
|
|
@ -538,22 +538,19 @@ static int eoib_open ( struct net_device *netdev ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Allocate completion queue */
|
/* Allocate completion queue */
|
||||||
eoib->cq = ib_create_cq ( ibdev, EOIB_NUM_CQES, &eoib_cq_op );
|
if ( ( rc = ib_create_cq ( ibdev, EOIB_NUM_CQES, &eoib_cq_op,
|
||||||
if ( ! eoib->cq ) {
|
&eoib->cq ) ) != 0 ) {
|
||||||
DBGC ( eoib, "EoIB %s could not allocate completion queue\n",
|
DBGC ( eoib, "EoIB %s could not create completion queue: %s\n",
|
||||||
eoib->name );
|
eoib->name, strerror ( rc ) );
|
||||||
rc = -ENOMEM;
|
|
||||||
goto err_create_cq;
|
goto err_create_cq;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Allocate queue pair */
|
/* Allocate queue pair */
|
||||||
eoib->qp = ib_create_qp ( ibdev, IB_QPT_UD, EOIB_NUM_SEND_WQES,
|
if ( ( rc = ib_create_qp ( ibdev, IB_QPT_UD, EOIB_NUM_SEND_WQES,
|
||||||
eoib->cq, EOIB_NUM_RECV_WQES, eoib->cq,
|
eoib->cq, EOIB_NUM_RECV_WQES, eoib->cq,
|
||||||
&eoib_qp_op, netdev->name );
|
&eoib_qp_op, netdev->name, &eoib->qp ) )!=0){
|
||||||
if ( ! eoib->qp ) {
|
DBGC ( eoib, "EoIB %s could not create queue pair: %s\n",
|
||||||
DBGC ( eoib, "EoIB %s could not allocate queue pair\n",
|
eoib->name, strerror ( rc ) );
|
||||||
eoib->name );
|
|
||||||
rc = -ENOMEM;
|
|
||||||
goto err_create_qp;
|
goto err_create_qp;
|
||||||
}
|
}
|
||||||
ib_qp_set_ownerdata ( eoib->qp, eoib );
|
ib_qp_set_ownerdata ( eoib->qp, eoib );
|
||||||
|
|
|
@ -854,22 +854,20 @@ static int ipoib_open ( struct net_device *netdev ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Allocate completion queue */
|
/* Allocate completion queue */
|
||||||
ipoib->cq = ib_create_cq ( ibdev, IPOIB_NUM_CQES, &ipoib_cq_op );
|
if ( ( rc = ib_create_cq ( ibdev, IPOIB_NUM_CQES, &ipoib_cq_op,
|
||||||
if ( ! ipoib->cq ) {
|
&ipoib->cq ) ) != 0 ) {
|
||||||
DBGC ( ipoib, "IPoIB %p could not allocate completion queue\n",
|
DBGC ( ipoib, "IPoIB %p could not create completion queue: "
|
||||||
ipoib );
|
"%s\n", ipoib, strerror ( rc ) );
|
||||||
rc = -ENOMEM;
|
|
||||||
goto err_create_cq;
|
goto err_create_cq;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Allocate queue pair */
|
/* Allocate queue pair */
|
||||||
ipoib->qp = ib_create_qp ( ibdev, IB_QPT_UD, IPOIB_NUM_SEND_WQES,
|
if ( ( rc = ib_create_qp ( ibdev, IB_QPT_UD, IPOIB_NUM_SEND_WQES,
|
||||||
ipoib->cq, IPOIB_NUM_RECV_WQES, ipoib->cq,
|
ipoib->cq, IPOIB_NUM_RECV_WQES, ipoib->cq,
|
||||||
&ipoib_qp_op, netdev->name );
|
&ipoib_qp_op, netdev->name,
|
||||||
if ( ! ipoib->qp ) {
|
&ipoib->qp ) ) != 0 ) {
|
||||||
DBGC ( ipoib, "IPoIB %p could not allocate queue pair\n",
|
DBGC ( ipoib, "IPoIB %p could not create queue pair: %s\n",
|
||||||
ipoib );
|
ipoib, strerror ( rc ) );
|
||||||
rc = -ENOMEM;
|
|
||||||
goto err_create_qp;
|
goto err_create_qp;
|
||||||
}
|
}
|
||||||
ib_qp_set_ownerdata ( ipoib->qp, ipoib );
|
ib_qp_set_ownerdata ( ipoib->qp, ipoib );
|
||||||
|
|
|
@ -493,18 +493,20 @@ struct ib_driver {
|
||||||
/** Declare an Infiniband driver */
|
/** Declare an Infiniband driver */
|
||||||
#define __ib_driver __table_entry ( IB_DRIVERS, 01 )
|
#define __ib_driver __table_entry ( IB_DRIVERS, 01 )
|
||||||
|
|
||||||
extern struct ib_completion_queue *
|
extern int ib_create_cq ( struct ib_device *ibdev, unsigned int num_cqes,
|
||||||
ib_create_cq ( struct ib_device *ibdev, unsigned int num_cqes,
|
struct ib_completion_queue_operations *op,
|
||||||
struct ib_completion_queue_operations *op );
|
struct ib_completion_queue **new_cq );
|
||||||
extern void ib_destroy_cq ( struct ib_device *ibdev,
|
extern void ib_destroy_cq ( struct ib_device *ibdev,
|
||||||
struct ib_completion_queue *cq );
|
struct ib_completion_queue *cq );
|
||||||
extern void ib_poll_cq ( struct ib_device *ibdev,
|
extern void ib_poll_cq ( struct ib_device *ibdev,
|
||||||
struct ib_completion_queue *cq );
|
struct ib_completion_queue *cq );
|
||||||
extern struct ib_queue_pair *
|
extern int ib_create_qp ( struct ib_device *ibdev, enum ib_queue_pair_type type,
|
||||||
ib_create_qp ( struct ib_device *ibdev, enum ib_queue_pair_type type,
|
unsigned int num_send_wqes,
|
||||||
unsigned int num_send_wqes, struct ib_completion_queue *send_cq,
|
struct ib_completion_queue *send_cq,
|
||||||
unsigned int num_recv_wqes, struct ib_completion_queue *recv_cq,
|
unsigned int num_recv_wqes,
|
||||||
struct ib_queue_pair_operations *op, const char *name );
|
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 int ib_modify_qp ( struct ib_device *ibdev, struct ib_queue_pair *qp );
|
||||||
extern void ib_destroy_qp ( struct ib_device *ibdev,
|
extern void ib_destroy_qp ( struct ib_device *ibdev,
|
||||||
struct ib_queue_pair *qp );
|
struct ib_queue_pair *qp );
|
||||||
|
|
|
@ -92,11 +92,12 @@ struct errortab infiniband_errors[] __errortab = {
|
||||||
* @v ibdev Infiniband device
|
* @v ibdev Infiniband device
|
||||||
* @v num_cqes Number of completion queue entries
|
* @v num_cqes Number of completion queue entries
|
||||||
* @v op Completion queue operations
|
* @v op Completion queue operations
|
||||||
* @ret cq New completion queue
|
* @v new_cq New completion queue to fill in
|
||||||
|
* @ret rc Return status code
|
||||||
*/
|
*/
|
||||||
struct ib_completion_queue *
|
int ib_create_cq ( struct ib_device *ibdev, unsigned int num_cqes,
|
||||||
ib_create_cq ( struct ib_device *ibdev, unsigned int num_cqes,
|
struct ib_completion_queue_operations *op,
|
||||||
struct ib_completion_queue_operations *op ) {
|
struct ib_completion_queue **new_cq ) {
|
||||||
struct ib_completion_queue *cq;
|
struct ib_completion_queue *cq;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
@ -104,8 +105,10 @@ ib_create_cq ( struct ib_device *ibdev, unsigned int num_cqes,
|
||||||
|
|
||||||
/* Allocate and initialise data structure */
|
/* Allocate and initialise data structure */
|
||||||
cq = zalloc ( sizeof ( *cq ) );
|
cq = zalloc ( sizeof ( *cq ) );
|
||||||
if ( ! cq )
|
if ( ! cq ) {
|
||||||
|
rc = -ENOMEM;
|
||||||
goto err_alloc_cq;
|
goto err_alloc_cq;
|
||||||
|
}
|
||||||
cq->ibdev = ibdev;
|
cq->ibdev = ibdev;
|
||||||
list_add_tail ( &cq->list, &ibdev->cqs );
|
list_add_tail ( &cq->list, &ibdev->cqs );
|
||||||
cq->num_cqes = num_cqes;
|
cq->num_cqes = num_cqes;
|
||||||
|
@ -122,14 +125,15 @@ ib_create_cq ( struct ib_device *ibdev, unsigned int num_cqes,
|
||||||
DBGC ( ibdev, "IBDEV %s created %d-entry completion queue %p (%p) "
|
DBGC ( ibdev, "IBDEV %s created %d-entry completion queue %p (%p) "
|
||||||
"with CQN %#lx\n", ibdev->name, num_cqes, cq,
|
"with CQN %#lx\n", ibdev->name, num_cqes, cq,
|
||||||
ib_cq_get_drvdata ( cq ), cq->cqn );
|
ib_cq_get_drvdata ( cq ), cq->cqn );
|
||||||
return cq;
|
*new_cq = cq;
|
||||||
|
return 0;
|
||||||
|
|
||||||
ibdev->op->destroy_cq ( ibdev, cq );
|
ibdev->op->destroy_cq ( ibdev, cq );
|
||||||
err_dev_create_cq:
|
err_dev_create_cq:
|
||||||
list_del ( &cq->list );
|
list_del ( &cq->list );
|
||||||
free ( cq );
|
free ( cq );
|
||||||
err_alloc_cq:
|
err_alloc_cq:
|
||||||
return NULL;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -186,19 +190,19 @@ void ib_poll_cq ( struct ib_device *ibdev,
|
||||||
* @v recv_cq Receive completion queue
|
* @v recv_cq Receive completion queue
|
||||||
* @v op Queue pair operations
|
* @v op Queue pair operations
|
||||||
* @v name Queue pair name
|
* @v name Queue pair name
|
||||||
* @ret qp Queue pair
|
* @v new_qp New queue pair to fill in
|
||||||
|
* @ret rc Return status code
|
||||||
*
|
*
|
||||||
* The queue pair will be left in the INIT state; you must call
|
* The queue pair will be left in the INIT state; you must call
|
||||||
* ib_modify_qp() before it is ready to use for sending and receiving.
|
* ib_modify_qp() before it is ready to use for sending and receiving.
|
||||||
*/
|
*/
|
||||||
struct ib_queue_pair * ib_create_qp ( struct ib_device *ibdev,
|
int ib_create_qp ( struct ib_device *ibdev, enum ib_queue_pair_type type,
|
||||||
enum ib_queue_pair_type type,
|
unsigned int num_send_wqes,
|
||||||
unsigned int num_send_wqes,
|
struct ib_completion_queue *send_cq,
|
||||||
struct ib_completion_queue *send_cq,
|
unsigned int num_recv_wqes,
|
||||||
unsigned int num_recv_wqes,
|
struct ib_completion_queue *recv_cq,
|
||||||
struct ib_completion_queue *recv_cq,
|
struct ib_queue_pair_operations *op, const char *name,
|
||||||
struct ib_queue_pair_operations *op,
|
struct ib_queue_pair **new_qp ) {
|
||||||
const char *name ) {
|
|
||||||
struct ib_queue_pair *qp;
|
struct ib_queue_pair *qp;
|
||||||
size_t total_size;
|
size_t total_size;
|
||||||
int rc;
|
int rc;
|
||||||
|
@ -210,8 +214,10 @@ struct ib_queue_pair * ib_create_qp ( struct ib_device *ibdev,
|
||||||
( num_send_wqes * sizeof ( qp->send.iobufs[0] ) ) +
|
( num_send_wqes * sizeof ( qp->send.iobufs[0] ) ) +
|
||||||
( num_recv_wqes * sizeof ( qp->recv.iobufs[0] ) ) );
|
( num_recv_wqes * sizeof ( qp->recv.iobufs[0] ) ) );
|
||||||
qp = zalloc ( total_size );
|
qp = zalloc ( total_size );
|
||||||
if ( ! qp )
|
if ( ! qp ) {
|
||||||
|
rc = -ENOMEM;
|
||||||
goto err_alloc_qp;
|
goto err_alloc_qp;
|
||||||
|
}
|
||||||
qp->ibdev = ibdev;
|
qp->ibdev = ibdev;
|
||||||
list_add_tail ( &qp->list, &ibdev->qps );
|
list_add_tail ( &qp->list, &ibdev->qps );
|
||||||
qp->type = type;
|
qp->type = type;
|
||||||
|
@ -265,7 +271,8 @@ struct ib_queue_pair * ib_create_qp ( struct ib_device *ibdev,
|
||||||
ibdev->name, qp->qpn, qp->ext_qpn );
|
ibdev->name, qp->qpn, qp->ext_qpn );
|
||||||
}
|
}
|
||||||
|
|
||||||
return qp;
|
*new_qp = qp;
|
||||||
|
return 0;
|
||||||
|
|
||||||
ibdev->op->destroy_qp ( ibdev, qp );
|
ibdev->op->destroy_qp ( ibdev, qp );
|
||||||
err_dev_create_qp:
|
err_dev_create_qp:
|
||||||
|
@ -274,7 +281,7 @@ struct ib_queue_pair * ib_create_qp ( struct ib_device *ibdev,
|
||||||
list_del ( &qp->list );
|
list_del ( &qp->list );
|
||||||
free ( qp );
|
free ( qp );
|
||||||
err_alloc_qp:
|
err_alloc_qp:
|
||||||
return NULL;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -423,23 +423,20 @@ int ib_cmrc_open ( struct interface *xfer, struct ib_device *ibdev,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create completion queue */
|
/* Create completion queue */
|
||||||
cmrc->cq = ib_create_cq ( ibdev, IB_CMRC_NUM_CQES,
|
if ( ( rc = ib_create_cq ( ibdev, IB_CMRC_NUM_CQES,
|
||||||
&ib_cmrc_completion_ops );
|
&ib_cmrc_completion_ops, &cmrc->cq ) ) != 0){
|
||||||
if ( ! cmrc->cq ) {
|
DBGC ( cmrc, "CMRC %s %s could not create completion queue: "
|
||||||
DBGC ( cmrc, "CMRC %s %s could not create completion queue\n",
|
"%s\n", ibdev->name, cmrc->name, strerror ( rc ) );
|
||||||
ibdev->name, cmrc->name );
|
|
||||||
rc = -ENOMEM;
|
|
||||||
goto err_create_cq;
|
goto err_create_cq;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create queue pair */
|
/* Create queue pair */
|
||||||
cmrc->qp = ib_create_qp ( ibdev, IB_QPT_RC, IB_CMRC_NUM_SEND_WQES,
|
if ( ( rc = ib_create_qp ( ibdev, IB_QPT_RC, IB_CMRC_NUM_SEND_WQES,
|
||||||
cmrc->cq, IB_CMRC_NUM_RECV_WQES, cmrc->cq,
|
cmrc->cq, IB_CMRC_NUM_RECV_WQES, cmrc->cq,
|
||||||
&ib_cmrc_queue_pair_ops, name );
|
&ib_cmrc_queue_pair_ops, name,
|
||||||
if ( ! cmrc->qp ) {
|
&cmrc->qp ) ) != 0 ) {
|
||||||
DBGC ( cmrc, "CMRC %s %s could not create queue pair\n",
|
DBGC ( cmrc, "CMRC %s %s could not create queue pair: %s\n",
|
||||||
ibdev->name, cmrc->name );
|
ibdev->name, cmrc->name, strerror ( rc ) );
|
||||||
rc = -ENOMEM;
|
|
||||||
goto err_create_qp;
|
goto err_create_qp;
|
||||||
}
|
}
|
||||||
ib_qp_set_ownerdata ( cmrc->qp, cmrc );
|
ib_qp_set_ownerdata ( cmrc->qp, cmrc );
|
||||||
|
|
|
@ -357,19 +357,20 @@ struct ib_mad_interface * ib_create_mi ( struct ib_device *ibdev,
|
||||||
INIT_LIST_HEAD ( &mi->madx );
|
INIT_LIST_HEAD ( &mi->madx );
|
||||||
|
|
||||||
/* Create completion queue */
|
/* Create completion queue */
|
||||||
mi->cq = ib_create_cq ( ibdev, IB_MI_NUM_CQES, &ib_mi_completion_ops );
|
if ( ( rc = ib_create_cq ( ibdev, IB_MI_NUM_CQES, &ib_mi_completion_ops,
|
||||||
if ( ! mi->cq ) {
|
&mi->cq ) ) != 0 ) {
|
||||||
DBGC ( mi, "MI %p could not allocate completion queue\n", mi );
|
DBGC ( mi, "MI %p could not create completion queue: %s\n",
|
||||||
|
mi, strerror ( rc ) );
|
||||||
goto err_create_cq;
|
goto err_create_cq;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create queue pair */
|
/* Create queue pair */
|
||||||
name = ( ( type == IB_QPT_SMI ) ? "SMI" : "GSI" );
|
name = ( ( type == IB_QPT_SMI ) ? "SMI" : "GSI" );
|
||||||
mi->qp = ib_create_qp ( ibdev, type, IB_MI_NUM_SEND_WQES, mi->cq,
|
if ( ( rc = ib_create_qp ( ibdev, type, IB_MI_NUM_SEND_WQES, mi->cq,
|
||||||
IB_MI_NUM_RECV_WQES, mi->cq,
|
IB_MI_NUM_RECV_WQES, mi->cq,
|
||||||
&ib_mi_queue_pair_ops, name );
|
&ib_mi_queue_pair_ops, name, &mi->qp ) )!=0){
|
||||||
if ( ! mi->qp ) {
|
DBGC ( mi, "MI %p could not create queue pair: %s\n",
|
||||||
DBGC ( mi, "MI %p could not allocate queue pair\n", mi );
|
mi, strerror ( rc ) );
|
||||||
goto err_create_qp;
|
goto err_create_qp;
|
||||||
}
|
}
|
||||||
ib_qp_set_ownerdata ( mi->qp, mi );
|
ib_qp_set_ownerdata ( mi->qp, mi );
|
||||||
|
|
Reference in New Issue