[infiniband] Allow queue pairs to have a custom allocator for receive iobufs

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2012-08-29 22:11:58 +01:00
parent 96be171be5
commit f747fac3e1
6 changed files with 48 additions and 10 deletions

View File

@@ -257,6 +257,11 @@ static struct ib_completion_queue_operations ib_cmrc_completion_ops = {
.complete_recv = ib_cmrc_complete_recv,
};
/** Infiniband CMRC queue pair operations */
static struct ib_queue_pair_operations ib_cmrc_queue_pair_ops = {
.alloc_iob = alloc_iob,
};
/**
* Send data via CMRC
*
@@ -410,7 +415,8 @@ int ib_cmrc_open ( struct interface *xfer, struct ib_device *ibdev,
/* Create queue pair */
cmrc->qp = 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 );
if ( ! cmrc->qp ) {
DBGC ( cmrc, "CMRC %p could not create queue pair\n", cmrc );
rc = -ENOMEM;

View File

@@ -164,6 +164,11 @@ static struct ib_completion_queue_operations ib_mi_completion_ops = {
.complete_recv = ib_mi_complete_recv,
};
/** Management interface queue pair operations */
static struct ib_queue_pair_operations ib_mi_queue_pair_ops = {
.alloc_iob = alloc_iob,
};
/**
* Transmit MAD
*
@@ -353,7 +358,8 @@ struct ib_mad_interface * ib_create_mi ( struct ib_device *ibdev,
/* Create queue pair */
mi->qp = 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 );
if ( ! mi->qp ) {
DBGC ( mi, "MI %p could not allocate queue pair\n", mi );
goto err_create_qp;