From f747fac3e1dad31378579326d8e9dce0df85c214 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Wed, 29 Aug 2012 22:11:58 +0100 Subject: [infiniband] Allow queue pairs to have a custom allocator for receive iobufs Signed-off-by: Michael Brown --- src/include/ipxe/infiniband.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/include') diff --git a/src/include/ipxe/infiniband.h b/src/include/ipxe/infiniband.h index f97a5d4fe..1a64eef6c 100644 --- a/src/include/ipxe/infiniband.h +++ b/src/include/ipxe/infiniband.h @@ -142,6 +142,16 @@ enum ib_queue_pair_type { IB_QPT_ETH, }; +/** Infiniband queue pair operations */ +struct ib_queue_pair_operations { + /** Allocate receive I/O buffer + * + * @v len Maximum receive length + * @ret iobuf I/O buffer (or NULL if out of memory) + */ + struct io_buffer * ( * alloc_iob ) ( size_t len ); +}; + /** An Infiniband Queue Pair */ struct ib_queue_pair { /** Containing Infiniband device */ @@ -169,6 +179,8 @@ struct ib_queue_pair { struct list_head mgids; /** Address vector */ struct ib_address_vector av; + /** Queue pair operations */ + struct ib_queue_pair_operations *op; /** Driver private data */ void *drv_priv; /** Queue owner private data */ @@ -478,8 +490,8 @@ extern void ib_poll_cq ( struct ib_device *ibdev, 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 ); + unsigned int num_recv_wqes, struct ib_completion_queue *recv_cq, + struct ib_queue_pair_operations *op ); 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