Starting to introduce an Infiniband device abstraction

This commit is contained in:
Michael Brown
2007-09-14 20:29:44 +01:00
parent 75fbc96f75
commit 9d08b7c692
2 changed files with 201 additions and 0 deletions

View File

@@ -61,6 +61,69 @@ struct ibhdr {
uint16_t reserved;
} __attribute__ (( packed ));
/** An Infiniband Work Queue */
struct ib_work_queue {
/** Number of work queue entries */
unsigned int num_wqes;
/** Posted index
*
* This is the index of the most recently posted entry.
*/
unsigned int posted;
/** Driver-private data
*
* Typically used to hold the address of the work queue.
*/
void *priv;
/** I/O buffers assigned to work queue */
struct io_buffer *iobuf[0];
};
/** An Infiniband Queue Pair */
struct ib_queue_pair {
/** Queue Pair Number */
uint32_t qpn;
/** Send queue */
struct ib_work_queue send;
/** Receive queue */
struct ib_work_queue recv;
};
/** An Infiniband Address Vector */
struct ib_address_vector {
};
/**
* Infiniband device operations
*
* These represent a subset of the Infiniband Verbs.
*/
struct ib_device_operations {
/** Post Send work queue entry
*
* @v ibdev Infiniband device
* @v iobuf I/O buffer
* @v av Address vector
* @v qp Queue pair
* @ret rc Return status code
*
* If this method returns success, the I/O buffer remains
* owned by the queue pair. If this method returns failure,
* the I/O buffer is immediately released; the failure is
* interpreted as "failure to enqueue buffer".
*/
int ( * post_send ) ( struct ib_device *ibdev,
struct io_buffer *iobuf,
struct ib_address_vector *av,
struct ib_queue_pair *qp );
};
extern struct ll_protocol infiniband_protocol;
extern const char * ib_ntoa ( const void *ll_addr );