[infiniband] Use explicit "source" and "dest" address vector parameter names

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2012-08-31 00:47:37 +01:00
parent f747fac3e1
commit cbe41cb31b
11 changed files with 159 additions and 153 deletions

View File

@@ -263,7 +263,6 @@ struct ib_queue_pair * ib_create_qp ( struct ib_device *ibdev,
*
* @v ibdev Infiniband device
* @v qp Queue pair
* @v av New address vector, if applicable
* @ret rc Return status code
*/
int ib_modify_qp ( struct ib_device *ibdev, struct ib_queue_pair *qp ) {
@@ -384,14 +383,14 @@ struct ib_work_queue * ib_find_wq ( struct ib_completion_queue *cq,
*
* @v ibdev Infiniband device
* @v qp Queue pair
* @v av Address vector
* @v dest Destination address vector
* @v iobuf I/O buffer
* @ret rc Return status code
*/
int ib_post_send ( struct ib_device *ibdev, struct ib_queue_pair *qp,
struct ib_address_vector *av,
struct ib_address_vector *dest,
struct io_buffer *iobuf ) {
struct ib_address_vector av_copy;
struct ib_address_vector dest_copy;
int rc;
/* Check queue fill level */
@@ -402,21 +401,21 @@ int ib_post_send ( struct ib_device *ibdev, struct ib_queue_pair *qp,
}
/* Use default address vector if none specified */
if ( ! av )
av = &qp->av;
if ( ! dest )
dest = &qp->av;
/* Make modifiable copy of address vector */
memcpy ( &av_copy, av, sizeof ( av_copy ) );
av = &av_copy;
memcpy ( &dest_copy, dest, sizeof ( dest_copy ) );
dest = &dest_copy;
/* Fill in optional parameters in address vector */
if ( ! av->qkey )
av->qkey = qp->qkey;
if ( ! av->rate )
av->rate = IB_RATE_2_5;
if ( ! dest->qkey )
dest->qkey = qp->qkey;
if ( ! dest->rate )
dest->rate = IB_RATE_2_5;
/* Post to hardware */
if ( ( rc = ibdev->op->post_send ( ibdev, qp, av, iobuf ) ) != 0 ) {
if ( ( rc = ibdev->op->post_send ( ibdev, qp, dest, iobuf ) ) != 0 ) {
DBGC ( ibdev, "IBDEV %p QPN %#lx could not post send WQE: "
"%s\n", ibdev, qp->qpn, strerror ( rc ) );
return rc;
@@ -487,16 +486,16 @@ void ib_complete_send ( struct ib_device *ibdev, struct ib_queue_pair *qp,
*
* @v ibdev Infiniband device
* @v qp Queue pair
* @v av Address vector, or NULL
* @v source Source address vector, or NULL
* @v iobuf I/O buffer
* @v rc Completion status code
*/
void ib_complete_recv ( struct ib_device *ibdev, struct ib_queue_pair *qp,
struct ib_address_vector *av,
struct ib_address_vector *source,
struct io_buffer *iobuf, int rc ) {
if ( qp->recv.cq->op->complete_recv ) {
qp->recv.cq->op->complete_recv ( ibdev, qp, av, iobuf, rc );
qp->recv.cq->op->complete_recv ( ibdev, qp, source, iobuf, rc );
} else {
free_iob ( iobuf );
}