Browse Source

[infiniband] Include destination address vector in ib_complete_recv()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 12 years ago
parent
commit
f54a61e434

+ 8
- 2
src/drivers/infiniband/arbel.c View File

1525
 	struct arbel_recv_work_queue *arbel_recv_wq;
1525
 	struct arbel_recv_work_queue *arbel_recv_wq;
1526
 	struct arbelprm_recv_wqe *recv_wqe;
1526
 	struct arbelprm_recv_wqe *recv_wqe;
1527
 	struct io_buffer *iobuf;
1527
 	struct io_buffer *iobuf;
1528
+	struct ib_address_vector recv_dest;
1528
 	struct ib_address_vector recv_source;
1529
 	struct ib_address_vector recv_source;
1529
 	struct ib_global_route_header *grh;
1530
 	struct ib_global_route_header *grh;
1530
 	struct ib_address_vector *source;
1531
 	struct ib_address_vector *source;
1608
 			     l_key, ARBEL_INVALID_LKEY );
1609
 			     l_key, ARBEL_INVALID_LKEY );
1609
 		assert ( len <= iob_tailroom ( iobuf ) );
1610
 		assert ( len <= iob_tailroom ( iobuf ) );
1610
 		iob_put ( iobuf, len );
1611
 		iob_put ( iobuf, len );
1612
+		memset ( &recv_dest, 0, sizeof ( recv_dest ) );
1613
+		recv_dest.qpn = qpn;
1611
 		switch ( qp->type ) {
1614
 		switch ( qp->type ) {
1612
 		case IB_QPT_SMI:
1615
 		case IB_QPT_SMI:
1613
 		case IB_QPT_GSI:
1616
 		case IB_QPT_GSI:
1621
 			source->qpn = MLX_GET ( &cqe->normal, rqpn );
1624
 			source->qpn = MLX_GET ( &cqe->normal, rqpn );
1622
 			source->lid = MLX_GET ( &cqe->normal, rlid );
1625
 			source->lid = MLX_GET ( &cqe->normal, rlid );
1623
 			source->sl = MLX_GET ( &cqe->normal, sl );
1626
 			source->sl = MLX_GET ( &cqe->normal, sl );
1624
-			source->gid_present = MLX_GET ( &cqe->normal, g );
1627
+			recv_dest.gid_present = source->gid_present =
1628
+				MLX_GET ( &cqe->normal, g );
1629
+			memcpy ( &recv_dest.gid, &grh->dgid,
1630
+				 sizeof ( recv_dest.gid ) );
1625
 			memcpy ( &source->gid, &grh->sgid,
1631
 			memcpy ( &source->gid, &grh->sgid,
1626
 				 sizeof ( source->gid ) );
1632
 				 sizeof ( source->gid ) );
1627
 			break;
1633
 			break;
1633
 			return -EINVAL;
1639
 			return -EINVAL;
1634
 		}
1640
 		}
1635
 		/* Hand off to completion handler */
1641
 		/* Hand off to completion handler */
1636
-		ib_complete_recv ( ibdev, qp, source, iobuf, rc );
1642
+		ib_complete_recv ( ibdev, qp, &recv_dest, source, iobuf, rc );
1637
 	}
1643
 	}
1638
 
1644
 
1639
 	return rc;
1645
 	return rc;

+ 10
- 2
src/drivers/infiniband/hermon.c View File

1677
 	struct ib_work_queue *wq;
1677
 	struct ib_work_queue *wq;
1678
 	struct ib_queue_pair *qp;
1678
 	struct ib_queue_pair *qp;
1679
 	struct io_buffer *iobuf;
1679
 	struct io_buffer *iobuf;
1680
+	struct ib_address_vector recv_dest;
1680
 	struct ib_address_vector recv_source;
1681
 	struct ib_address_vector recv_source;
1681
 	struct ib_global_route_header *grh;
1682
 	struct ib_global_route_header *grh;
1682
 	struct ib_address_vector *source;
1683
 	struct ib_address_vector *source;
1737
 		len = MLX_GET ( &cqe->normal, byte_cnt );
1738
 		len = MLX_GET ( &cqe->normal, byte_cnt );
1738
 		assert ( len <= iob_tailroom ( iobuf ) );
1739
 		assert ( len <= iob_tailroom ( iobuf ) );
1739
 		iob_put ( iobuf, len );
1740
 		iob_put ( iobuf, len );
1741
+		memset ( &recv_dest, 0, sizeof ( recv_dest ) );
1742
+		recv_dest.qpn = qpn;
1740
 		memset ( &recv_source, 0, sizeof ( recv_source ) );
1743
 		memset ( &recv_source, 0, sizeof ( recv_source ) );
1741
 		switch ( qp->type ) {
1744
 		switch ( qp->type ) {
1742
 		case IB_QPT_SMI:
1745
 		case IB_QPT_SMI:
1750
 			source->qpn = MLX_GET ( &cqe->normal, srq_rqpn );
1753
 			source->qpn = MLX_GET ( &cqe->normal, srq_rqpn );
1751
 			source->lid = MLX_GET ( &cqe->normal, slid_smac47_32 );
1754
 			source->lid = MLX_GET ( &cqe->normal, slid_smac47_32 );
1752
 			source->sl = MLX_GET ( &cqe->normal, sl );
1755
 			source->sl = MLX_GET ( &cqe->normal, sl );
1753
-			source->gid_present = MLX_GET ( &cqe->normal, g );
1756
+			recv_dest.gid_present = source->gid_present =
1757
+				MLX_GET ( &cqe->normal, g );
1758
+			memcpy ( &recv_dest.gid, &grh->dgid,
1759
+				 sizeof ( recv_dest.gid ) );
1754
 			memcpy ( &source->gid, &grh->sgid,
1760
 			memcpy ( &source->gid, &grh->sgid,
1755
 				 sizeof ( source->gid ) );
1761
 				 sizeof ( source->gid ) );
1756
 			break;
1762
 			break;
1768
 			return -EINVAL;
1774
 			return -EINVAL;
1769
 		}
1775
 		}
1770
 		/* Hand off to completion handler */
1776
 		/* Hand off to completion handler */
1771
-		ib_complete_recv ( ibdev, qp, source, iobuf, rc );
1777
+		ib_complete_recv ( ibdev, qp, &recv_dest, source, iobuf, rc );
1772
 	}
1778
 	}
1773
 
1779
 
1774
 	return rc;
1780
 	return rc;
3155
  *
3161
  *
3156
  * @v ibdev		Infiniband device
3162
  * @v ibdev		Infiniband device
3157
  * @v qp		Queue pair
3163
  * @v qp		Queue pair
3164
+ * @v dest		Destination address vector, or NULL
3158
  * @v source		Source address vector, or NULL
3165
  * @v source		Source address vector, or NULL
3159
  * @v iobuf		I/O buffer
3166
  * @v iobuf		I/O buffer
3160
  * @v rc		Completion status code
3167
  * @v rc		Completion status code
3161
  */
3168
  */
3162
 static void hermon_eth_complete_recv ( struct ib_device *ibdev __unused,
3169
 static void hermon_eth_complete_recv ( struct ib_device *ibdev __unused,
3163
 				       struct ib_queue_pair *qp,
3170
 				       struct ib_queue_pair *qp,
3171
+				       struct ib_address_vector *dest __unused,
3164
 				       struct ib_address_vector *source,
3172
 				       struct ib_address_vector *source,
3165
 				       struct io_buffer *iobuf, int rc ) {
3173
 				       struct io_buffer *iobuf, int rc ) {
3166
 	struct net_device *netdev = ib_qp_get_ownerdata ( qp );
3174
 	struct net_device *netdev = ib_qp_get_ownerdata ( qp );

+ 4
- 3
src/drivers/infiniband/linda.c View File

1170
 	struct io_buffer headers;
1170
 	struct io_buffer headers;
1171
 	struct io_buffer *iobuf;
1171
 	struct io_buffer *iobuf;
1172
 	struct ib_queue_pair *intended_qp;
1172
 	struct ib_queue_pair *intended_qp;
1173
+	struct ib_address_vector dest;
1173
 	struct ib_address_vector source;
1174
 	struct ib_address_vector source;
1174
 	unsigned int rcvtype;
1175
 	unsigned int rcvtype;
1175
 	unsigned int pktlen;
1176
 	unsigned int pktlen;
1238
 	qp0 = ( qp->qpn == 0 );
1239
 	qp0 = ( qp->qpn == 0 );
1239
 	intended_qp = NULL;
1240
 	intended_qp = NULL;
1240
 	if ( ( rc = ib_pull ( ibdev, &headers, ( qp0 ? &intended_qp : NULL ),
1241
 	if ( ( rc = ib_pull ( ibdev, &headers, ( qp0 ? &intended_qp : NULL ),
1241
-			      &payload_len, &source ) ) != 0 ) {
1242
+			      &payload_len, &dest, &source ) ) != 0 ) {
1242
 		DBGC ( linda, "Linda %p could not parse headers: %s\n",
1243
 		DBGC ( linda, "Linda %p could not parse headers: %s\n",
1243
 		       linda, strerror ( rc ) );
1244
 		       linda, strerror ( rc ) );
1244
 		err = 1;
1245
 		err = 1;
1295
 				qp->recv.fill--;
1296
 				qp->recv.fill--;
1296
 				intended_qp->recv.fill++;
1297
 				intended_qp->recv.fill++;
1297
 			}
1298
 			}
1298
-			ib_complete_recv ( ibdev, intended_qp, &source,
1299
+			ib_complete_recv ( ibdev, intended_qp, &dest, &source,
1299
 					   iobuf, rc);
1300
 					   iobuf, rc);
1300
 		} else {
1301
 		} else {
1301
 			/* Completing on a skipped-over eager buffer */
1302
 			/* Completing on a skipped-over eager buffer */
1302
-			ib_complete_recv ( ibdev, qp, &source, iobuf,
1303
+			ib_complete_recv ( ibdev, qp, &dest, &source, iobuf,
1303
 					   -ECANCELED );
1304
 					   -ECANCELED );
1304
 		}
1305
 		}
1305
 
1306
 

+ 4
- 3
src/drivers/infiniband/qib7322.c View File

1413
 	struct io_buffer headers;
1413
 	struct io_buffer headers;
1414
 	struct io_buffer *iobuf;
1414
 	struct io_buffer *iobuf;
1415
 	struct ib_queue_pair *intended_qp;
1415
 	struct ib_queue_pair *intended_qp;
1416
+	struct ib_address_vector dest;
1416
 	struct ib_address_vector source;
1417
 	struct ib_address_vector source;
1417
 	unsigned int rcvtype;
1418
 	unsigned int rcvtype;
1418
 	unsigned int pktlen;
1419
 	unsigned int pktlen;
1474
 	qp0 = ( qp->qpn == 0 );
1475
 	qp0 = ( qp->qpn == 0 );
1475
 	intended_qp = NULL;
1476
 	intended_qp = NULL;
1476
 	if ( ( rc = ib_pull ( ibdev, &headers, ( qp0 ? &intended_qp : NULL ),
1477
 	if ( ( rc = ib_pull ( ibdev, &headers, ( qp0 ? &intended_qp : NULL ),
1477
-			      &payload_len, &source ) ) != 0 ) {
1478
+			      &payload_len, &dest, &source ) ) != 0 ) {
1478
 		DBGC ( qib7322, "QIB7322 %p could not parse headers: %s\n",
1479
 		DBGC ( qib7322, "QIB7322 %p could not parse headers: %s\n",
1479
 		       qib7322, strerror ( rc ) );
1480
 		       qib7322, strerror ( rc ) );
1480
 		err = 1;
1481
 		err = 1;
1531
 				qp->recv.fill--;
1532
 				qp->recv.fill--;
1532
 				intended_qp->recv.fill++;
1533
 				intended_qp->recv.fill++;
1533
 			}
1534
 			}
1534
-			ib_complete_recv ( ibdev, intended_qp, &source,
1535
+			ib_complete_recv ( ibdev, intended_qp, &dest, &source,
1535
 					   iobuf, rc);
1536
 					   iobuf, rc);
1536
 		} else {
1537
 		} else {
1537
 			/* Completing on a skipped-over eager buffer */
1538
 			/* Completing on a skipped-over eager buffer */
1538
-			ib_complete_recv ( ibdev, qp, &source, iobuf,
1539
+			ib_complete_recv ( ibdev, qp, &dest, &source, iobuf,
1539
 					   -ECANCELED );
1540
 					   -ECANCELED );
1540
 		}
1541
 		}
1541
 
1542
 

+ 2
- 0
src/drivers/net/ipoib.c View File

480
  *
480
  *
481
  * @v ibdev		Infiniband device
481
  * @v ibdev		Infiniband device
482
  * @v qp		Queue pair
482
  * @v qp		Queue pair
483
+ * @v dest		Destination address vector, or NULL
483
  * @v source		Source address vector, or NULL
484
  * @v source		Source address vector, or NULL
484
  * @v iobuf		I/O buffer
485
  * @v iobuf		I/O buffer
485
  * @v rc		Completion status code
486
  * @v rc		Completion status code
486
  */
487
  */
487
 static void ipoib_complete_recv ( struct ib_device *ibdev __unused,
488
 static void ipoib_complete_recv ( struct ib_device *ibdev __unused,
488
 				  struct ib_queue_pair *qp,
489
 				  struct ib_queue_pair *qp,
490
+				  struct ib_address_vector *dest __unused,
489
 				  struct ib_address_vector *source,
491
 				  struct ib_address_vector *source,
490
 				  struct io_buffer *iobuf, int rc ) {
492
 				  struct io_buffer *iobuf, int rc ) {
491
 	struct ipoib_device *ipoib = ib_qp_get_ownerdata ( qp );
493
 	struct ipoib_device *ipoib = ib_qp_get_ownerdata ( qp );

+ 1
- 0
src/include/ipxe/ib_packet.h View File

155
 		     const struct ib_address_vector *dest );
155
 		     const struct ib_address_vector *dest );
156
 extern int ib_pull ( struct ib_device *ibdev, struct io_buffer *iobuf,
156
 extern int ib_pull ( struct ib_device *ibdev, struct io_buffer *iobuf,
157
 		     struct ib_queue_pair **qp, size_t *payload_len,
157
 		     struct ib_queue_pair **qp, size_t *payload_len,
158
+		     struct ib_address_vector *dest,
158
 		     struct ib_address_vector *source );
159
 		     struct ib_address_vector *source );
159
 
160
 
160
 #endif /* _IPXE_IB_PACKET_H */
161
 #endif /* _IPXE_IB_PACKET_H */

+ 3
- 0
src/include/ipxe/infiniband.h View File

205
 	 *
205
 	 *
206
 	 * @v ibdev		Infiniband device
206
 	 * @v ibdev		Infiniband device
207
 	 * @v qp		Queue pair
207
 	 * @v qp		Queue pair
208
+	 * @v dest		Destination address vector, or NULL
208
 	 * @v source		Source address vector, or NULL
209
 	 * @v source		Source address vector, or NULL
209
 	 * @v iobuf		I/O buffer
210
 	 * @v iobuf		I/O buffer
210
 	 * @v rc		Completion status code
211
 	 * @v rc		Completion status code
211
 	 */
212
 	 */
212
 	void ( * complete_recv ) ( struct ib_device *ibdev,
213
 	void ( * complete_recv ) ( struct ib_device *ibdev,
213
 				   struct ib_queue_pair *qp,
214
 				   struct ib_queue_pair *qp,
215
+				   struct ib_address_vector *dest,
214
 				   struct ib_address_vector *source,
216
 				   struct ib_address_vector *source,
215
 				   struct io_buffer *iobuf, int rc );
217
 				   struct io_buffer *iobuf, int rc );
216
 };
218
 };
511
 			       struct io_buffer *iobuf, int rc );
513
 			       struct io_buffer *iobuf, int rc );
512
 extern void ib_complete_recv ( struct ib_device *ibdev,
514
 extern void ib_complete_recv ( struct ib_device *ibdev,
513
 			       struct ib_queue_pair *qp,
515
 			       struct ib_queue_pair *qp,
516
+			       struct ib_address_vector *dest,
514
 			       struct ib_address_vector *source,
517
 			       struct ib_address_vector *source,
515
 			       struct io_buffer *iobuf, int rc );
518
 			       struct io_buffer *iobuf, int rc );
516
 extern void ib_refill_recv ( struct ib_device *ibdev,
519
 extern void ib_refill_recv ( struct ib_device *ibdev,

+ 5
- 2
src/net/infiniband.c View File

304
 	}
304
 	}
305
 	for ( i = 0 ; i < qp->recv.num_wqes ; i++ ) {
305
 	for ( i = 0 ; i < qp->recv.num_wqes ; i++ ) {
306
 		if ( ( iobuf = qp->recv.iobufs[i] ) != NULL ) {
306
 		if ( ( iobuf = qp->recv.iobufs[i] ) != NULL ) {
307
-			ib_complete_recv ( ibdev, qp, NULL, iobuf,
307
+			ib_complete_recv ( ibdev, qp, NULL, NULL, iobuf,
308
 					   -ECANCELED );
308
 					   -ECANCELED );
309
 		}
309
 		}
310
 	}
310
 	}
486
  *
486
  *
487
  * @v ibdev		Infiniband device
487
  * @v ibdev		Infiniband device
488
  * @v qp		Queue pair
488
  * @v qp		Queue pair
489
+ * @v dest		Destination address vector, or NULL
489
  * @v source		Source address vector, or NULL
490
  * @v source		Source address vector, or NULL
490
  * @v iobuf		I/O buffer
491
  * @v iobuf		I/O buffer
491
  * @v rc		Completion status code
492
  * @v rc		Completion status code
492
  */
493
  */
493
 void ib_complete_recv ( struct ib_device *ibdev, struct ib_queue_pair *qp,
494
 void ib_complete_recv ( struct ib_device *ibdev, struct ib_queue_pair *qp,
495
+			struct ib_address_vector *dest,
494
 			struct ib_address_vector *source,
496
 			struct ib_address_vector *source,
495
 			struct io_buffer *iobuf, int rc ) {
497
 			struct io_buffer *iobuf, int rc ) {
496
 
498
 
497
 	if ( qp->recv.cq->op->complete_recv ) {
499
 	if ( qp->recv.cq->op->complete_recv ) {
498
-		qp->recv.cq->op->complete_recv ( ibdev, qp, source, iobuf, rc );
500
+		qp->recv.cq->op->complete_recv ( ibdev, qp, dest, source,
501
+						 iobuf, rc );
499
 	} else {
502
 	} else {
500
 		free_iob ( iobuf );
503
 		free_iob ( iobuf );
501
 	}
504
 	}

+ 2
- 0
src/net/infiniband/ib_cmrc.c View File

220
  *
220
  *
221
  * @v ibdev		Infiniband device
221
  * @v ibdev		Infiniband device
222
  * @v qp		Queue pair
222
  * @v qp		Queue pair
223
+ * @v dest		Destination address vector, or NULL
223
  * @v source		Source address vector, or NULL
224
  * @v source		Source address vector, or NULL
224
  * @v iobuf		I/O buffer
225
  * @v iobuf		I/O buffer
225
  * @v rc		Completion status code
226
  * @v rc		Completion status code
226
  */
227
  */
227
 static void ib_cmrc_complete_recv ( struct ib_device *ibdev __unused,
228
 static void ib_cmrc_complete_recv ( struct ib_device *ibdev __unused,
228
 				    struct ib_queue_pair *qp,
229
 				    struct ib_queue_pair *qp,
230
+				    struct ib_address_vector *dest __unused,
229
 				    struct ib_address_vector *source __unused,
231
 				    struct ib_address_vector *source __unused,
230
 				    struct io_buffer *iobuf, int rc ) {
232
 				    struct io_buffer *iobuf, int rc ) {
231
 	struct ib_cmrc_connection *cmrc = ib_qp_get_ownerdata ( qp );
233
 	struct ib_cmrc_connection *cmrc = ib_qp_get_ownerdata ( qp );

+ 3
- 1
src/net/infiniband/ib_mi.c View File

112
  *
112
  *
113
  * @v ibdev		Infiniband device
113
  * @v ibdev		Infiniband device
114
  * @v qp		Queue pair
114
  * @v qp		Queue pair
115
- * @v source		Address vector
115
+ * @v dest		Destination address vector
116
+ * @v source		Source address vector
116
  * @v iobuf		I/O buffer
117
  * @v iobuf		I/O buffer
117
  * @v rc		Completion status code
118
  * @v rc		Completion status code
118
  */
119
  */
119
 static void ib_mi_complete_recv ( struct ib_device *ibdev,
120
 static void ib_mi_complete_recv ( struct ib_device *ibdev,
120
 				  struct ib_queue_pair *qp,
121
 				  struct ib_queue_pair *qp,
122
+				  struct ib_address_vector *dest __unused,
121
 				  struct ib_address_vector *source,
123
 				  struct ib_address_vector *source,
122
 				  struct io_buffer *iobuf, int rc ) {
124
 				  struct io_buffer *iobuf, int rc ) {
123
 	struct ib_mad_interface *mi = ib_qp_get_ownerdata ( qp );
125
 	struct ib_mad_interface *mi = ib_qp_get_ownerdata ( qp );

+ 13
- 9
src/net/infiniband/ib_packet.c View File

122
  * @v iobuf		I/O buffer containing headers
122
  * @v iobuf		I/O buffer containing headers
123
  * @v qp		Queue pair to fill in, or NULL
123
  * @v qp		Queue pair to fill in, or NULL
124
  * @v payload_len	Payload length to fill in, or NULL
124
  * @v payload_len	Payload length to fill in, or NULL
125
+ * @v dest		Destination address vector to fill in
125
  * @v source		Source address vector to fill in
126
  * @v source		Source address vector to fill in
126
  * @ret rc		Return status code
127
  * @ret rc		Return status code
127
  */
128
  */
128
 int ib_pull ( struct ib_device *ibdev, struct io_buffer *iobuf,
129
 int ib_pull ( struct ib_device *ibdev, struct io_buffer *iobuf,
129
 	      struct ib_queue_pair **qp, size_t *payload_len,
130
 	      struct ib_queue_pair **qp, size_t *payload_len,
131
+	      struct ib_address_vector *dest,
130
 	      struct ib_address_vector *source ) {
132
 	      struct ib_address_vector *source ) {
131
 	struct ib_local_route_header *lrh;
133
 	struct ib_local_route_header *lrh;
132
 	struct ib_global_route_header *grh;
134
 	struct ib_global_route_header *grh;
135
 	size_t orig_iob_len = iob_len ( iobuf );
137
 	size_t orig_iob_len = iob_len ( iobuf );
136
 	unsigned int lnh;
138
 	unsigned int lnh;
137
 	size_t pad_len;
139
 	size_t pad_len;
138
-	unsigned long qpn;
139
-	unsigned int lid;
140
 
140
 
141
 	/* Clear return values */
141
 	/* Clear return values */
142
 	if ( qp )
142
 	if ( qp )
143
 		*qp = NULL;
143
 		*qp = NULL;
144
 	if ( payload_len )
144
 	if ( payload_len )
145
 		*payload_len = 0;
145
 		*payload_len = 0;
146
+	memset ( dest, 0, sizeof ( *dest ) );
146
 	memset ( source, 0, sizeof ( *source ) );
147
 	memset ( source, 0, sizeof ( *source ) );
147
 
148
 
148
 	/* Extract LRH */
149
 	/* Extract LRH */
153
 	}
154
 	}
154
 	lrh = iobuf->data;
155
 	lrh = iobuf->data;
155
 	iob_pull ( iobuf, sizeof ( *lrh ) );
156
 	iob_pull ( iobuf, sizeof ( *lrh ) );
157
+	dest->lid = ntohs ( lrh->dlid );
158
+	dest->sl = ( lrh->sl__lnh >> 4 );
156
 	source->lid = ntohs ( lrh->slid );
159
 	source->lid = ntohs ( lrh->slid );
157
 	source->sl = ( lrh->sl__lnh >> 4 );
160
 	source->sl = ( lrh->sl__lnh >> 4 );
158
 	lnh = ( lrh->sl__lnh & 0x3 );
161
 	lnh = ( lrh->sl__lnh & 0x3 );
159
-	lid = ntohs ( lrh->dlid );
160
 
162
 
161
 	/* Reject unsupported packets */
163
 	/* Reject unsupported packets */
162
 	if ( ! ( ( lnh == IB_LNH_BTH ) || ( lnh == IB_LNH_GRH ) ) ) {
164
 	if ( ! ( ( lnh == IB_LNH_BTH ) || ( lnh == IB_LNH_GRH ) ) ) {
174
 		}
176
 		}
175
 		grh = iobuf->data;
177
 		grh = iobuf->data;
176
 		iob_pull ( iobuf, sizeof ( *grh ) );
178
 		iob_pull ( iobuf, sizeof ( *grh ) );
179
+		dest->gid_present = 1;
180
+		memcpy ( &dest->gid, &grh->dgid, sizeof ( dest->gid ) );
177
 		source->gid_present = 1;
181
 		source->gid_present = 1;
178
 		memcpy ( &source->gid, &grh->sgid, sizeof ( source->gid ) );
182
 		memcpy ( &source->gid, &grh->sgid, sizeof ( source->gid ) );
179
 	} else {
183
 	} else {
193
 		       ibdev, bth->opcode );
197
 		       ibdev, bth->opcode );
194
 		return -ENOTSUP;
198
 		return -ENOTSUP;
195
 	}
199
 	}
196
-	qpn = ntohl ( bth->dest_qp );
200
+	dest->qpn = ntohl ( bth->dest_qp );
197
 
201
 
198
 	/* Extract DETH */
202
 	/* Extract DETH */
199
 	if ( iob_len ( iobuf ) < sizeof ( *deth ) ) {
203
 	if ( iob_len ( iobuf ) < sizeof ( *deth ) ) {
216
 
220
 
217
 	/* Determine destination QP, if applicable */
221
 	/* Determine destination QP, if applicable */
218
 	if ( qp ) {
222
 	if ( qp ) {
219
-		if ( IB_LID_MULTICAST ( lid ) && grh ) {
223
+		if ( IB_LID_MULTICAST ( dest->lid ) && grh ) {
220
 			if ( ! ( *qp = ib_find_qp_mgid ( ibdev, &grh->dgid ))){
224
 			if ( ! ( *qp = ib_find_qp_mgid ( ibdev, &grh->dgid ))){
221
 				DBGC ( ibdev, "IBDEV %p RX for unknown MGID "
225
 				DBGC ( ibdev, "IBDEV %p RX for unknown MGID "
222
 				       IB_GID_FMT "\n",
226
 				       IB_GID_FMT "\n",
224
 				return -ENODEV;
228
 				return -ENODEV;
225
 			}
229
 			}
226
 		} else {
230
 		} else {
227
-			if ( ! ( *qp = ib_find_qp_qpn ( ibdev, qpn ) ) ) {
231
+			if ( ! ( *qp = ib_find_qp_qpn ( ibdev, dest->qpn ) ) ) {
228
 				DBGC ( ibdev, "IBDEV %p RX for nonexistent "
232
 				DBGC ( ibdev, "IBDEV %p RX for nonexistent "
229
-				       "QPN %lx\n", ibdev, qpn );
233
+				       "QPN %lx\n", ibdev, dest->qpn );
230
 				return -ENODEV;
234
 				return -ENODEV;
231
 			}
235
 			}
232
 		}
236
 		}
234
 	}
238
 	}
235
 
239
 
236
 	DBGC2 ( ibdev, "IBDEV %p RX %04x:%08lx <= %04x:%08lx (key %08x)\n",
240
 	DBGC2 ( ibdev, "IBDEV %p RX %04x:%08lx <= %04x:%08lx (key %08x)\n",
237
-		ibdev, lid, ( IB_LID_MULTICAST( lid ) ?
238
-			      ( qp ? (*qp)->ext_qpn : -1UL ) : qpn ),
241
+		ibdev, dest->lid, ( IB_LID_MULTICAST ( dest->lid ) ?
242
+			      ( qp ? (*qp)->ext_qpn : -1UL ) : dest->qpn ),
239
 		source->lid, source->qpn, ntohl ( deth->qkey ) );
243
 		source->lid, source->qpn, ntohl ( deth->qkey ) );
240
 	DBGCP_HDA ( ibdev, 0,
244
 	DBGCP_HDA ( ibdev, 0,
241
 		    ( iobuf->data - ( orig_iob_len - iob_len ( iobuf ) ) ),
245
 		    ( iobuf->data - ( orig_iob_len - iob_len ( iobuf ) ) ),

Loading…
Cancel
Save