|
|
@@ -66,6 +66,8 @@ struct ib_work_queue {
|
|
66
|
66
|
struct list_head list;
|
|
67
|
67
|
/** Number of work queue entries */
|
|
68
|
68
|
unsigned int num_wqes;
|
|
|
69
|
+ /** Number of occupied work queue entries */
|
|
|
70
|
+ unsigned int fill;
|
|
69
|
71
|
/** Next work queue entry index
|
|
70
|
72
|
*
|
|
71
|
73
|
* This is the index of the next entry to be filled (i.e. the
|
|
|
@@ -355,70 +357,24 @@ extern void ib_destroy_qp ( struct ib_device *ibdev,
|
|
355
|
357
|
struct ib_queue_pair *qp );
|
|
356
|
358
|
extern struct ib_work_queue * ib_find_wq ( struct ib_completion_queue *cq,
|
|
357
|
359
|
unsigned long qpn, int is_send );
|
|
|
360
|
+extern int ib_post_send ( struct ib_device *ibdev, struct ib_queue_pair *qp,
|
|
|
361
|
+ struct ib_address_vector *av,
|
|
|
362
|
+ struct io_buffer *iobuf );
|
|
|
363
|
+extern int ib_post_recv ( struct ib_device *ibdev, struct ib_queue_pair *qp,
|
|
|
364
|
+ struct io_buffer *iobuf );
|
|
|
365
|
+extern void ib_complete_send ( struct ib_device *ibdev,
|
|
|
366
|
+ struct ib_queue_pair *qp,
|
|
|
367
|
+ struct ib_completion *completion,
|
|
|
368
|
+ struct io_buffer *iobuf );
|
|
|
369
|
+extern void ib_complete_recv ( struct ib_device *ibdev,
|
|
|
370
|
+ struct ib_queue_pair *qp,
|
|
|
371
|
+ struct ib_completion *completion,
|
|
|
372
|
+ struct io_buffer *iobuf );
|
|
358
|
373
|
extern struct ib_device * alloc_ibdev ( size_t priv_size );
|
|
359
|
374
|
extern int register_ibdev ( struct ib_device *ibdev );
|
|
360
|
375
|
extern void unregister_ibdev ( struct ib_device *ibdev );
|
|
361
|
376
|
extern void ib_link_state_changed ( struct ib_device *ibdev );
|
|
362
|
377
|
|
|
363
|
|
-/**
|
|
364
|
|
- * Post send work queue entry
|
|
365
|
|
- *
|
|
366
|
|
- * @v ibdev Infiniband device
|
|
367
|
|
- * @v qp Queue pair
|
|
368
|
|
- * @v av Address vector
|
|
369
|
|
- * @v iobuf I/O buffer
|
|
370
|
|
- * @ret rc Return status code
|
|
371
|
|
- */
|
|
372
|
|
-static inline __attribute__ (( always_inline )) int
|
|
373
|
|
-ib_post_send ( struct ib_device *ibdev, struct ib_queue_pair *qp,
|
|
374
|
|
- struct ib_address_vector *av, struct io_buffer *iobuf ) {
|
|
375
|
|
- return ibdev->op->post_send ( ibdev, qp, av, iobuf );
|
|
376
|
|
-}
|
|
377
|
|
-
|
|
378
|
|
-/**
|
|
379
|
|
- * Post receive work queue entry
|
|
380
|
|
- *
|
|
381
|
|
- * @v ibdev Infiniband device
|
|
382
|
|
- * @v qp Queue pair
|
|
383
|
|
- * @v iobuf I/O buffer
|
|
384
|
|
- * @ret rc Return status code
|
|
385
|
|
- */
|
|
386
|
|
-static inline __attribute__ (( always_inline )) int
|
|
387
|
|
-ib_post_recv ( struct ib_device *ibdev, struct ib_queue_pair *qp,
|
|
388
|
|
- struct io_buffer *iobuf ) {
|
|
389
|
|
- return ibdev->op->post_recv ( ibdev, qp, iobuf );
|
|
390
|
|
-}
|
|
391
|
|
-
|
|
392
|
|
-/**
|
|
393
|
|
- * Complete send work queue entry
|
|
394
|
|
- *
|
|
395
|
|
- * @v ibdev Infiniband device
|
|
396
|
|
- * @v qp Queue pair
|
|
397
|
|
- * @v completion Completion
|
|
398
|
|
- * @v iobuf I/O buffer
|
|
399
|
|
- */
|
|
400
|
|
-static inline __attribute__ (( always_inline )) void
|
|
401
|
|
-ib_complete_send ( struct ib_device *ibdev, struct ib_queue_pair *qp,
|
|
402
|
|
- struct ib_completion *completion,
|
|
403
|
|
- struct io_buffer *iobuf ) {
|
|
404
|
|
- return qp->send.cq->complete_send ( ibdev, qp, completion, iobuf );
|
|
405
|
|
-}
|
|
406
|
|
-
|
|
407
|
|
-/**
|
|
408
|
|
- * Complete receive work queue entry
|
|
409
|
|
- *
|
|
410
|
|
- * @v ibdev Infiniband device
|
|
411
|
|
- * @v qp Queue pair
|
|
412
|
|
- * @v completion Completion
|
|
413
|
|
- * @v iobuf I/O buffer
|
|
414
|
|
- */
|
|
415
|
|
-static inline __attribute__ (( always_inline )) void
|
|
416
|
|
-ib_complete_recv ( struct ib_device *ibdev, struct ib_queue_pair *qp,
|
|
417
|
|
- struct ib_completion *completion,
|
|
418
|
|
- struct io_buffer *iobuf ) {
|
|
419
|
|
- return qp->recv.cq->complete_recv ( ibdev, qp, completion, iobuf );
|
|
420
|
|
-}
|
|
421
|
|
-
|
|
422
|
378
|
/**
|
|
423
|
379
|
* Poll completion queue
|
|
424
|
380
|
*
|