[infiniband] Include destination address vector in ib_complete_recv()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2012-08-31 01:48:49 +01:00
parent cbe41cb31b
commit f54a61e434
11 changed files with 55 additions and 22 deletions

View File

@@ -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;

View File

@@ -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 );

View File

@@ -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 );
}

View File

@@ -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 );
}