diff options
author | Michael Brown | 2012-08-29 23:11:58 +0200 |
---|---|---|
committer | Michael Brown | 2012-08-31 22:22:57 +0200 |
commit | f747fac3e1dad31378579326d8e9dce0df85c214 (patch) | |
tree | 68393b4686b7d28737b16b26c6f49c4d2db431d0 /src/net/infiniband | |
parent | [iobuf] Allow allocation of I/O buffers with a specified alignment offset (diff) | |
download | ipxe-f747fac3e1dad31378579326d8e9dce0df85c214.tar.gz ipxe-f747fac3e1dad31378579326d8e9dce0df85c214.tar.xz ipxe-f747fac3e1dad31378579326d8e9dce0df85c214.zip |
[infiniband] Allow queue pairs to have a custom allocator for receive iobufs
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/net/infiniband')
-rw-r--r-- | src/net/infiniband/ib_cmrc.c | 8 | ||||
-rw-r--r-- | src/net/infiniband/ib_mi.c | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/net/infiniband/ib_cmrc.c b/src/net/infiniband/ib_cmrc.c index 369e2e90..dd623ddb 100644 --- a/src/net/infiniband/ib_cmrc.c +++ b/src/net/infiniband/ib_cmrc.c @@ -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; diff --git a/src/net/infiniband/ib_mi.c b/src/net/infiniband/ib_mi.c index ced2eea1..31fe71a4 100644 --- a/src/net/infiniband/ib_mi.c +++ b/src/net/infiniband/ib_mi.c @@ -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; |