diff options
author | Michael Brown | 2012-08-31 02:48:49 +0200 |
---|---|---|
committer | Michael Brown | 2012-08-31 22:22:58 +0200 |
commit | f54a61e43450fae7d045bebabc4c368d325e71d3 (patch) | |
tree | 4da3e1ff7629e7d06b7a62a9fce592a5baeee794 /src/drivers/infiniband | |
parent | [infiniband] Use explicit "source" and "dest" address vector parameter names (diff) | |
download | ipxe-f54a61e43450fae7d045bebabc4c368d325e71d3.tar.gz ipxe-f54a61e43450fae7d045bebabc4c368d325e71d3.tar.xz ipxe-f54a61e43450fae7d045bebabc4c368d325e71d3.zip |
[infiniband] Include destination address vector in ib_complete_recv()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers/infiniband')
-rw-r--r-- | src/drivers/infiniband/arbel.c | 10 | ||||
-rw-r--r-- | src/drivers/infiniband/hermon.c | 12 | ||||
-rw-r--r-- | src/drivers/infiniband/linda.c | 7 | ||||
-rw-r--r-- | src/drivers/infiniband/qib7322.c | 7 |
4 files changed, 26 insertions, 10 deletions
diff --git a/src/drivers/infiniband/arbel.c b/src/drivers/infiniband/arbel.c index 61fe4621..1a56ff9a 100644 --- a/src/drivers/infiniband/arbel.c +++ b/src/drivers/infiniband/arbel.c @@ -1525,6 +1525,7 @@ static int arbel_complete ( struct ib_device *ibdev, struct arbel_recv_work_queue *arbel_recv_wq; struct arbelprm_recv_wqe *recv_wqe; struct io_buffer *iobuf; + struct ib_address_vector recv_dest; struct ib_address_vector recv_source; struct ib_global_route_header *grh; struct ib_address_vector *source; @@ -1608,6 +1609,8 @@ static int arbel_complete ( struct ib_device *ibdev, l_key, ARBEL_INVALID_LKEY ); assert ( len <= iob_tailroom ( iobuf ) ); iob_put ( iobuf, len ); + memset ( &recv_dest, 0, sizeof ( recv_dest ) ); + recv_dest.qpn = qpn; switch ( qp->type ) { case IB_QPT_SMI: case IB_QPT_GSI: @@ -1621,7 +1624,10 @@ static int arbel_complete ( struct ib_device *ibdev, source->qpn = MLX_GET ( &cqe->normal, rqpn ); source->lid = MLX_GET ( &cqe->normal, rlid ); source->sl = MLX_GET ( &cqe->normal, sl ); - source->gid_present = MLX_GET ( &cqe->normal, g ); + recv_dest.gid_present = source->gid_present = + MLX_GET ( &cqe->normal, g ); + memcpy ( &recv_dest.gid, &grh->dgid, + sizeof ( recv_dest.gid ) ); memcpy ( &source->gid, &grh->sgid, sizeof ( source->gid ) ); break; @@ -1633,7 +1639,7 @@ static int arbel_complete ( struct ib_device *ibdev, return -EINVAL; } /* Hand off to completion handler */ - ib_complete_recv ( ibdev, qp, source, iobuf, rc ); + ib_complete_recv ( ibdev, qp, &recv_dest, source, iobuf, rc ); } return rc; diff --git a/src/drivers/infiniband/hermon.c b/src/drivers/infiniband/hermon.c index 7849b143..8a4fba94 100644 --- a/src/drivers/infiniband/hermon.c +++ b/src/drivers/infiniband/hermon.c @@ -1677,6 +1677,7 @@ static int hermon_complete ( struct ib_device *ibdev, struct ib_work_queue *wq; struct ib_queue_pair *qp; struct io_buffer *iobuf; + struct ib_address_vector recv_dest; struct ib_address_vector recv_source; struct ib_global_route_header *grh; struct ib_address_vector *source; @@ -1737,6 +1738,8 @@ static int hermon_complete ( struct ib_device *ibdev, len = MLX_GET ( &cqe->normal, byte_cnt ); assert ( len <= iob_tailroom ( iobuf ) ); iob_put ( iobuf, len ); + memset ( &recv_dest, 0, sizeof ( recv_dest ) ); + recv_dest.qpn = qpn; memset ( &recv_source, 0, sizeof ( recv_source ) ); switch ( qp->type ) { case IB_QPT_SMI: @@ -1750,7 +1753,10 @@ static int hermon_complete ( struct ib_device *ibdev, source->qpn = MLX_GET ( &cqe->normal, srq_rqpn ); source->lid = MLX_GET ( &cqe->normal, slid_smac47_32 ); source->sl = MLX_GET ( &cqe->normal, sl ); - source->gid_present = MLX_GET ( &cqe->normal, g ); + recv_dest.gid_present = source->gid_present = + MLX_GET ( &cqe->normal, g ); + memcpy ( &recv_dest.gid, &grh->dgid, + sizeof ( recv_dest.gid ) ); memcpy ( &source->gid, &grh->sgid, sizeof ( source->gid ) ); break; @@ -1768,7 +1774,7 @@ static int hermon_complete ( struct ib_device *ibdev, return -EINVAL; } /* Hand off to completion handler */ - ib_complete_recv ( ibdev, qp, source, iobuf, rc ); + ib_complete_recv ( ibdev, qp, &recv_dest, source, iobuf, rc ); } return rc; @@ -3155,12 +3161,14 @@ static void hermon_eth_complete_send ( struct ib_device *ibdev __unused, * * @v ibdev Infiniband device * @v qp Queue pair + * @v dest Destination address vector, or NULL * @v source Source address vector, or NULL * @v iobuf I/O buffer * @v rc Completion status code */ static void hermon_eth_complete_recv ( struct ib_device *ibdev __unused, struct ib_queue_pair *qp, + struct ib_address_vector *dest __unused, struct ib_address_vector *source, struct io_buffer *iobuf, int rc ) { struct net_device *netdev = ib_qp_get_ownerdata ( qp ); diff --git a/src/drivers/infiniband/linda.c b/src/drivers/infiniband/linda.c index fca17475..4afda120 100644 --- a/src/drivers/infiniband/linda.c +++ b/src/drivers/infiniband/linda.c @@ -1170,6 +1170,7 @@ static void linda_complete_recv ( struct ib_device *ibdev, struct io_buffer headers; struct io_buffer *iobuf; struct ib_queue_pair *intended_qp; + struct ib_address_vector dest; struct ib_address_vector source; unsigned int rcvtype; unsigned int pktlen; @@ -1238,7 +1239,7 @@ static void linda_complete_recv ( struct ib_device *ibdev, qp0 = ( qp->qpn == 0 ); intended_qp = NULL; if ( ( rc = ib_pull ( ibdev, &headers, ( qp0 ? &intended_qp : NULL ), - &payload_len, &source ) ) != 0 ) { + &payload_len, &dest, &source ) ) != 0 ) { DBGC ( linda, "Linda %p could not parse headers: %s\n", linda, strerror ( rc ) ); err = 1; @@ -1295,11 +1296,11 @@ static void linda_complete_recv ( struct ib_device *ibdev, qp->recv.fill--; intended_qp->recv.fill++; } - ib_complete_recv ( ibdev, intended_qp, &source, + ib_complete_recv ( ibdev, intended_qp, &dest, &source, iobuf, rc); } else { /* Completing on a skipped-over eager buffer */ - ib_complete_recv ( ibdev, qp, &source, iobuf, + ib_complete_recv ( ibdev, qp, &dest, &source, iobuf, -ECANCELED ); } diff --git a/src/drivers/infiniband/qib7322.c b/src/drivers/infiniband/qib7322.c index 89614129..9979b346 100644 --- a/src/drivers/infiniband/qib7322.c +++ b/src/drivers/infiniband/qib7322.c @@ -1413,6 +1413,7 @@ static void qib7322_complete_recv ( struct ib_device *ibdev, struct io_buffer headers; struct io_buffer *iobuf; struct ib_queue_pair *intended_qp; + struct ib_address_vector dest; struct ib_address_vector source; unsigned int rcvtype; unsigned int pktlen; @@ -1474,7 +1475,7 @@ static void qib7322_complete_recv ( struct ib_device *ibdev, qp0 = ( qp->qpn == 0 ); intended_qp = NULL; if ( ( rc = ib_pull ( ibdev, &headers, ( qp0 ? &intended_qp : NULL ), - &payload_len, &source ) ) != 0 ) { + &payload_len, &dest, &source ) ) != 0 ) { DBGC ( qib7322, "QIB7322 %p could not parse headers: %s\n", qib7322, strerror ( rc ) ); err = 1; @@ -1531,11 +1532,11 @@ static void qib7322_complete_recv ( struct ib_device *ibdev, qp->recv.fill--; intended_qp->recv.fill++; } - ib_complete_recv ( ibdev, intended_qp, &source, + ib_complete_recv ( ibdev, intended_qp, &dest, &source, iobuf, rc); } else { /* Completing on a skipped-over eager buffer */ - ib_complete_recv ( ibdev, qp, &source, iobuf, + ib_complete_recv ( ibdev, qp, &dest, &source, iobuf, -ECANCELED ); } |