Browse Source

Obtains a response to the get path record!

tags/v0.9.3
Michael Brown 17 years ago
parent
commit
b3d3814c17

+ 172
- 9
src/drivers/net/ipoib.c View File

44
 /** IPoIB MTU */
44
 /** IPoIB MTU */
45
 #define IPOIB_MTU 2048
45
 #define IPOIB_MTU 2048
46
 
46
 
47
-/** Number of IPoIB send work queue entries */
47
+/** Number of IPoIB data send work queue entries */
48
 #define IPOIB_DATA_NUM_SEND_WQES 4
48
 #define IPOIB_DATA_NUM_SEND_WQES 4
49
 
49
 
50
-/** Number of IPoIB receive work queue entries */
51
-#define IPOIB_DATA_NUM_RECV_WQES 8
50
+/** Number of IPoIB data receive work queue entries */
51
+#define IPOIB_DATA_NUM_RECV_WQES 4
52
 
52
 
53
-/** Number of IPoIB completion entries */
53
+/** Number of IPoIB data completion entries */
54
 #define IPOIB_DATA_NUM_CQES 8
54
 #define IPOIB_DATA_NUM_CQES 8
55
 
55
 
56
+/** Number of IPoIB metadata send work queue entries */
57
+#define IPOIB_META_NUM_SEND_WQES 4
58
+
59
+/** Number of IPoIB metadata receive work queue entries */
60
+#define IPOIB_META_NUM_RECV_WQES 4
61
+
62
+/** Number of IPoIB metadata completion entries */
63
+#define IPOIB_META_NUM_CQES 8
64
+
56
 /** An IPoIB queue set */
65
 /** An IPoIB queue set */
57
 struct ipoib_queue_set {
66
 struct ipoib_queue_set {
58
 	/** Completion queue */
67
 	/** Completion queue */
84
  ****************************************************************************
93
  ****************************************************************************
85
  */
94
  */
86
 
95
 
96
+/** Broadcast QPN used in IPoIB MAC addresses
97
+ *
98
+ * This is a guaranteed invalid real QPN
99
+ */
100
+#define IPOIB_BROADCAST_QPN 0xffffffffUL
101
+
87
 /** Broadcast IPoIB address */
102
 /** Broadcast IPoIB address */
88
 static struct ipoib_mac ipoib_broadcast = {
103
 static struct ipoib_mac ipoib_broadcast = {
89
-	.gid = { { 0xff, 0x12, 0x40, 0x1b, 0x00, 0x00, 0x00, 0x00,
90
-		   0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff } },
104
+	.qpn = ntohl ( IPOIB_BROADCAST_QPN ),
91
 };
105
 };
92
 
106
 
93
 /**
107
 /**
244
 	return rc;
258
 	return rc;
245
 }
259
 }
246
 
260
 
261
+/**
262
+ * Transmit path record request
263
+ *
264
+ * @v ipoib		IPoIB device
265
+ * @v gid		Destination GID
266
+ * @ret rc		Return status code
267
+ */
268
+static int ipoib_get_path_record ( struct ipoib_device *ipoib,
269
+				   struct ib_gid *gid ) {
270
+	struct ib_device *ibdev = ipoib->ibdev;
271
+	struct io_buffer *iobuf;
272
+	struct ib_mad_path_record *path_record;
273
+	struct ib_address_vector av;
274
+ 	static uint32_t tid = 0;
275
+	int rc;
276
+
277
+	DBG ( "get_path_record():\n" );
278
+	int get_path_record(struct ib_gid *dgid, uint16_t *dlid_p,
279
+			    uint8_t *sl_p, uint8_t *rate_p);
280
+	uint16_t tmp_dlid;
281
+	uint8_t tmp_sl;
282
+	uint8_t tmp_rate;
283
+	get_path_record ( gid, &tmp_dlid, &tmp_sl, &tmp_rate );
284
+
285
+	DBG ( "ipoib_get_path_record():\n" );
286
+
287
+	/* Allocate I/O buffer */
288
+	iobuf = alloc_iob ( sizeof ( *path_record ) );
289
+	if ( ! iobuf )
290
+		return -ENOMEM;
291
+	iob_put ( iobuf, sizeof ( *path_record ) );
292
+	path_record = iobuf->data;
293
+	memset ( path_record, 0, sizeof ( *path_record ) );
294
+
295
+	/* Construct path record request */
296
+	path_record->mad_hdr.base_version = IB_MGMT_BASE_VERSION;
297
+	path_record->mad_hdr.mgmt_class = IB_MGMT_CLASS_SUBN_ADM;
298
+	path_record->mad_hdr.class_version = 2;
299
+	path_record->mad_hdr.method = IB_MGMT_METHOD_GET;
300
+	path_record->mad_hdr.attr_id = htons ( IB_SA_ATTR_PATH_REC );
301
+	path_record->mad_hdr.tid = tid++;
302
+	path_record->sa_hdr.comp_mask[1] =
303
+		htonl ( IB_SA_PATH_REC_DGID | IB_SA_PATH_REC_SGID );
304
+	memcpy ( &path_record->dgid, gid, sizeof ( path_record->dgid ) );
305
+	memcpy ( &path_record->sgid, &ibdev->port_gid,
306
+		 sizeof ( path_record->sgid ) );
307
+
308
+	DBG_HD ( path_record, sizeof ( *path_record ) );
309
+
310
+	/* Construct address vector */
311
+	memset ( &av, 0, sizeof ( av ) );
312
+	av.dlid = ibdev->sm_lid;
313
+	av.dest_qp = IB_SA_QPN;
314
+	av.qkey = IB_SA_QKEY;
315
+
316
+	/* Post send request */
317
+	if ( ( rc = ib_post_send ( ibdev, ipoib->meta.qp, &av,
318
+				   iobuf ) ) != 0 ) {
319
+		DBGC ( ipoib, "IPoIB %p could not send get path record: %s\n",
320
+		       ipoib, strerror ( rc ) );
321
+		free_iob ( iobuf );
322
+		return rc;
323
+	}
324
+
325
+	return 0;
326
+}
327
+
247
 /**
328
 /**
248
  * Transmit packet via IPoIB network device
329
  * Transmit packet via IPoIB network device
249
  *
330
  *
256
 	struct ipoib_device *ipoib = netdev->priv;
337
 	struct ipoib_device *ipoib = netdev->priv;
257
 	struct ib_device *ibdev = ipoib->ibdev;
338
 	struct ib_device *ibdev = ipoib->ibdev;
258
 	struct ipoib_pseudo_hdr *ipoib_pshdr = iobuf->data;
339
 	struct ipoib_pseudo_hdr *ipoib_pshdr = iobuf->data;
340
+	int rc;
259
 
341
 
260
 	if ( iob_len ( iobuf ) < sizeof ( *ipoib_pshdr ) ) {
342
 	if ( iob_len ( iobuf ) < sizeof ( *ipoib_pshdr ) ) {
261
 		DBGC ( ipoib, "IPoIB %p buffer too short\n", ipoib );
343
 		DBGC ( ipoib, "IPoIB %p buffer too short\n", ipoib );
262
 		return -EINVAL;
344
 		return -EINVAL;
263
 	}
345
 	}
264
 
346
 
347
+	DBG ( "TX pseudo-header:\n" );
348
+	DBG_HD ( ipoib_pshdr, sizeof ( *ipoib_pshdr ) );
349
+	if ( ipoib_pshdr->peer.qpn != htonl ( IPOIB_BROADCAST_QPN ) ) {
350
+		DBG ( "Get path record\n" );
351
+		rc = ipoib_get_path_record ( ipoib, &ipoib_pshdr->peer.gid );
352
+		free_iob ( iobuf );
353
+		return 0;
354
+	}
355
+
265
 	iob_pull ( iobuf, ( sizeof ( *ipoib_pshdr ) ) );
356
 	iob_pull ( iobuf, ( sizeof ( *ipoib_pshdr ) ) );
266
 	return ib_post_send ( ibdev, ipoib->data.qp,
357
 	return ib_post_send ( ibdev, ipoib->data.qp,
267
 			      &hack_ipoib_bcast_av, iobuf );
358
 			      &hack_ipoib_bcast_av, iobuf );
268
 }
359
 }
269
 
360
 
270
 /**
361
 /**
271
- * Handle IPoIB send completion
362
+ * Handle IPoIB data send completion
272
  *
363
  *
273
  * @v ibdev		Infiniband device
364
  * @v ibdev		Infiniband device
274
  * @v qp		Queue pair
365
  * @v qp		Queue pair
286
 }
377
 }
287
 
378
 
288
 /**
379
 /**
289
- * Handle IPoIB receive completion
380
+ * Handle IPoIB data receive completion
290
  *
381
  *
291
  * @v ibdev		Infiniband device
382
  * @v ibdev		Infiniband device
292
  * @v qp		Queue pair
383
  * @v qp		Queue pair
315
 	ipoib->data.recv_fill--;
406
 	ipoib->data.recv_fill--;
316
 }
407
 }
317
 
408
 
409
+/**
410
+ * Handle IPoIB metadata send completion
411
+ *
412
+ * @v ibdev		Infiniband device
413
+ * @v qp		Queue pair
414
+ * @v completion	Completion
415
+ * @v iobuf		I/O buffer
416
+ */
417
+static void ipoib_meta_complete_send ( struct ib_device *ibdev __unused,
418
+				       struct ib_queue_pair *qp,
419
+				       struct ib_completion *completion,
420
+				       struct io_buffer *iobuf ) {
421
+	struct net_device *netdev = qp->owner_priv;
422
+	struct ipoib_device *ipoib = netdev->priv;
423
+
424
+	DBG ( "Woohoo! METADATA TX completion\n" );
425
+
426
+
427
+	if ( completion->syndrome ) {
428
+		DBGC ( ipoib, "IPoIB %p metadata TX completion error %x\n",
429
+		       ipoib, completion->syndrome );
430
+	}
431
+	free_iob ( iobuf );
432
+}
433
+
434
+/**
435
+ * Handle IPoIB metadata receive completion
436
+ *
437
+ * @v ibdev		Infiniband device
438
+ * @v qp		Queue pair
439
+ * @v completion	Completion
440
+ * @v iobuf		I/O buffer
441
+ */
442
+static void ipoib_meta_complete_recv ( struct ib_device *ibdev __unused,
443
+				       struct ib_queue_pair *qp,
444
+				       struct ib_completion *completion,
445
+				       struct io_buffer *iobuf ) {
446
+	struct net_device *netdev = qp->owner_priv;
447
+	struct ipoib_device *ipoib = netdev->priv;
448
+
449
+	DBG ( "***************** META TX!!!!!! ********\n" );
450
+
451
+	if ( completion->syndrome ) {
452
+		DBGC ( ipoib, "IPoIB %p metadata RX completion error %x\n",
453
+		       ipoib, completion->syndrome );
454
+	} else {
455
+		iob_put ( iobuf, completion->len );
456
+		DBG ( "Metadata RX:\n" );
457
+		DBG_HD ( iobuf->data, iob_len ( iobuf ) );
458
+	}
459
+
460
+	ipoib->meta.recv_fill--;
461
+	free_iob ( iobuf );
462
+}
463
+
318
 /**
464
 /**
319
  * Refill IPoIB receive ring
465
  * Refill IPoIB receive ring
320
  *
466
  *
349
 
495
 
350
 	ib_poll_cq ( ibdev, ipoib->data.cq, ipoib_data_complete_send,
496
 	ib_poll_cq ( ibdev, ipoib->data.cq, ipoib_data_complete_send,
351
 		     ipoib_data_complete_recv );
497
 		     ipoib_data_complete_recv );
498
+	ib_poll_cq ( ibdev, ipoib->meta.cq, ipoib_meta_complete_send,
499
+		     ipoib_meta_complete_recv );
500
+	ipoib_refill_recv ( ipoib, &ipoib->meta );
352
 	ipoib_refill_recv ( ipoib, &ipoib->data );
501
 	ipoib_refill_recv ( ipoib, &ipoib->data );
353
 }
502
 }
354
 
503
 
382
 		return rc;
531
 		return rc;
383
 	}
532
 	}
384
 
533
 
385
-	/* Fill receive ring */
534
+	/* Fill receive rings */
535
+	ipoib_refill_recv ( ipoib, &ipoib->meta );
386
 	ipoib_refill_recv ( ipoib, &ipoib->data );
536
 	ipoib_refill_recv ( ipoib, &ipoib->data );
387
 
537
 
388
 	return 0;
538
 	return 0;
436
 	ipoib->netdev = netdev;
586
 	ipoib->netdev = netdev;
437
 	ipoib->ibdev = ibdev;
587
 	ipoib->ibdev = ibdev;
438
 
588
 
589
+	/* Allocate metadata queue set */
590
+	if ( ( rc = ipoib_create_qset ( ipoib, &ipoib->meta,
591
+					IPOIB_META_NUM_CQES,
592
+					IPOIB_META_NUM_SEND_WQES,
593
+					IPOIB_META_NUM_RECV_WQES,
594
+					IB_SA_QKEY ) ) != 0 ) {
595
+		DBGC ( ipoib, "IPoIB %p could not allocate metadata QP: %s\n",
596
+		       ipoib, strerror ( rc ) );
597
+		goto err_create_meta_qset;
598
+	}
599
+
439
 	/* Allocate data queue set */
600
 	/* Allocate data queue set */
440
 	if ( ( rc = ipoib_create_qset ( ipoib, &ipoib->data,
601
 	if ( ( rc = ipoib_create_qset ( ipoib, &ipoib->data,
441
 					IPOIB_DATA_NUM_CQES,
602
 					IPOIB_DATA_NUM_CQES,
461
  err_register_netdev:
622
  err_register_netdev:
462
 	ipoib_destroy_qset ( ipoib, &ipoib->data );
623
 	ipoib_destroy_qset ( ipoib, &ipoib->data );
463
  err_create_data_qset:
624
  err_create_data_qset:
625
+	ipoib_destroy_qset ( ipoib, &ipoib->meta );
626
+ err_create_meta_qset:
464
 	netdev_nullify ( netdev );
627
 	netdev_nullify ( netdev );
465
 	netdev_put ( netdev );
628
 	netdev_put ( netdev );
466
 	return rc;
629
 	return rc;

+ 4
- 1
src/drivers/net/mlx_ipoib/ib_mad.c View File

264
 	return is_good ? 0 : -1;
264
 	return is_good ? 0 : -1;
265
 }
265
 }
266
 
266
 
267
-static int get_path_record(union ib_gid_u *dgid, __u16 * dlid_p, u8 * sl_p,
267
+int get_path_record(union ib_gid_u *dgid, __u16 * dlid_p, u8 * sl_p,
268
 			   u8 * rate_p)
268
 			   u8 * rate_p)
269
 {
269
 {
270
 	struct path_record_mad_st *mad, *rcv_mad;
270
 	struct path_record_mad_st *mad, *rcv_mad;
321
 	cpu_to_be_buf(mad, sizeof *mad);
321
 	cpu_to_be_buf(mad, sizeof *mad);
322
 	memcpy(mad->path_record.sgid.raw, ib_data.port_gid.raw, 16);
322
 	memcpy(mad->path_record.sgid.raw, ib_data.port_gid.raw, 16);
323
 
323
 
324
+	DBG ( "data:\n" );
325
+	DBG_HD ( mad, sizeof ( *mad ) );
326
+
324
 	rc = post_send_req(qp, snd_wqe, 1);
327
 	rc = post_send_req(qp, snd_wqe, 1);
325
 	if (rc) {
328
 	if (rc) {
326
 		eprintf("");
329
 		eprintf("");

+ 1
- 1
src/drivers/net/mlx_ipoib/ib_mad.h View File

104
 	struct ib_mad_st mad;
104
 	struct ib_mad_st mad;
105
 } __attribute__ ((packed));
105
 } __attribute__ ((packed));
106
 
106
 
107
-static int get_path_record(union ib_gid_u *dgid, __u16 * dlid_p, __u8 * sl_p,
107
+int get_path_record(union ib_gid_u *dgid, __u16 * dlid_p, __u8 * sl_p,
108
 			   __u8 * rate_p);
108
 			   __u8 * rate_p);
109
 
109
 
110
 #endif				/* __ib_mad_h__ */
110
 #endif				/* __ib_mad_h__ */

+ 37
- 5
src/drivers/net/mlx_ipoib/mt25218.c View File

174
 		size_t dump_len = in_len;
174
 		size_t dump_len = in_len;
175
 		if ( dump_len > 256 )
175
 		if ( dump_len > 256 )
176
 			dump_len = 256;
176
 			dump_len = 256;
177
-		DBG ( "Input:\n" );
178
-		DBG_HD ( in, dump_len );
177
+		//		DBG ( "Input:\n" );
178
+		//		DBG_HD ( in, dump_len );
179
 	}
179
 	}
180
 
180
 
181
 	/* Issue command */
181
 	/* Issue command */
212
 		size_t dump_len = out_len;
212
 		size_t dump_len = out_len;
213
 		if ( dump_len > 256 )
213
 		if ( dump_len > 256 )
214
 			dump_len = 256;
214
 			dump_len = 256;
215
-		DBG ( "Output:\n" );
216
-		DBG_HD ( out, dump_len );
215
+		//		DBG ( "Output:\n" );
216
+		//		DBG_HD ( out, dump_len );
217
 	}
217
 	}
218
 
218
 
219
 	return 0;
219
 	return 0;
749
 
749
 
750
 /** GID used for GID-less send work queue entries */
750
 /** GID used for GID-less send work queue entries */
751
 static const struct ib_gid arbel_no_gid = {
751
 static const struct ib_gid arbel_no_gid = {
752
-	{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2 }
752
+	{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0 }
753
 };
753
 };
754
 
754
 
755
 /**
755
 /**
805
 	MLX_FILL_1 ( &wqe->ud, 3, ud_address_vector.sl, av->sl );
805
 	MLX_FILL_1 ( &wqe->ud, 3, ud_address_vector.sl, av->sl );
806
 	gid = ( av->gid_present ? &av->gid : &arbel_no_gid );
806
 	gid = ( av->gid_present ? &av->gid : &arbel_no_gid );
807
 	memcpy ( &wqe->ud.u.dwords[4], gid, sizeof ( *gid ) );
807
 	memcpy ( &wqe->ud.u.dwords[4], gid, sizeof ( *gid ) );
808
+	
809
+	if ( ! av->gid_present ) {
810
+		DBG ( "no_gid:\n" );
811
+		DBG_HD ( &arbel_no_gid, sizeof ( arbel_no_gid ) );
812
+		DBG ( "gid:\n" );
813
+		DBG_HD ( &wqe->ud.u.dwords[4], 16 );
814
+	}
815
+	
808
 	MLX_FILL_1 ( &wqe->ud, 8, destination_qp, av->dest_qp );
816
 	MLX_FILL_1 ( &wqe->ud, 8, destination_qp, av->dest_qp );
809
 	MLX_FILL_1 ( &wqe->ud, 9, q_key, av->qkey );
817
 	MLX_FILL_1 ( &wqe->ud, 9, q_key, av->qkey );
810
 	MLX_FILL_1 ( &wqe->data[0], 0, byte_count, iob_len ( iobuf ) );
818
 	MLX_FILL_1 ( &wqe->data[0], 0, byte_count, iob_len ( iobuf ) );
821
 		     f, 1,
829
 		     f, 1,
822
 		     always1, 1 );
830
 		     always1, 1 );
823
 
831
 
832
+
833
+	DBG ( "arbel_post_send()\n" );
834
+	DBG_HD ( wqe, sizeof ( *wqe ) );
835
+
836
+
824
 	/* Update doorbell record */
837
 	/* Update doorbell record */
825
 	barrier();
838
 	barrier();
826
 	qp_db_rec = &arbel->db_rec[arbel_send_wq->doorbell_idx].qp;
839
 	qp_db_rec = &arbel->db_rec[arbel_send_wq->doorbell_idx].qp;
1248
 	return 0;
1261
 	return 0;
1249
 }
1262
 }
1250
 
1263
 
1264
+static int arbel_get_sm_lid ( struct arbel *arbel,
1265
+			      unsigned long *sm_lid ) {
1266
+	struct ib_mad_port_info port_info;
1267
+	int rc;
1268
+
1269
+	if ( ( rc = arbel_get_port_info ( arbel, &port_info ) ) != 0 )
1270
+		return rc;
1271
+	*sm_lid = ntohs ( port_info.mastersm_lid );
1272
+	return 0;
1273
+}
1274
+
1251
 static int arbel_get_broadcast_gid ( struct arbel *arbel,
1275
 static int arbel_get_broadcast_gid ( struct arbel *arbel,
1252
 				     struct ib_gid *broadcast_gid ) {
1276
 				     struct ib_gid *broadcast_gid ) {
1253
 	static const struct ib_gid ipv4_broadcast_gid = {
1277
 	static const struct ib_gid ipv4_broadcast_gid = {
1323
 	arbel->limits.reserved_qps =
1347
 	arbel->limits.reserved_qps =
1324
 		( 1 << MLX_GET ( &dev_lim, log2_rsvd_qps ) );
1348
 		( 1 << MLX_GET ( &dev_lim, log2_rsvd_qps ) );
1325
 
1349
 
1350
+	/* Get subnet manager LID */
1351
+	if ( ( rc = arbel_get_sm_lid ( arbel, &ibdev->sm_lid ) ) != 0 ) {
1352
+		DBGC ( arbel, "Arbel %p could not determine subnet manager "
1353
+		       "LID: %s\n", arbel, strerror ( rc ) );
1354
+		goto err_get_sm_lid;
1355
+	}
1356
+
1326
 	/* Get port GID */
1357
 	/* Get port GID */
1327
 	if ( ( rc = arbel_get_port_gid ( arbel, &ibdev->port_gid ) ) != 0 ) {
1358
 	if ( ( rc = arbel_get_port_gid ( arbel, &ibdev->port_gid ) ) != 0 ) {
1328
 		DBGC ( arbel, "Arbel %p could not determine port GID: %s\n",
1359
 		DBGC ( arbel, "Arbel %p could not determine port GID: %s\n",
1362
  err_ipoib_probe:
1393
  err_ipoib_probe:
1363
  err_get_broadcast_gid:
1394
  err_get_broadcast_gid:
1364
  err_get_port_gid:
1395
  err_get_port_gid:
1396
+ err_get_sm_lid:
1365
  err_query_dev_lim:
1397
  err_query_dev_lim:
1366
 	ib_driver_close ( 0 );
1398
 	ib_driver_close ( 0 );
1367
  err_ib_driver_init:
1399
  err_ib_driver_init:

+ 62
- 1
src/include/gpxe/infiniband.h View File

10
 #include <stdint.h>
10
 #include <stdint.h>
11
 #include <gpxe/device.h>
11
 #include <gpxe/device.h>
12
 
12
 
13
+/** Subnet administrator QPN */
14
+#define IB_SA_QPN	1
15
+
16
+/** Subnet administrator queue key */
17
+#define IB_SA_QKEY	0x80010000UL
18
+
13
 /** An Infiniband Global Identifier */
19
 /** An Infiniband Global Identifier */
14
 struct ib_gid {
20
 struct ib_gid {
15
 	uint8_t bytes[16];
21
 	uint8_t bytes[16];
250
 	/** Port GID */
256
 	/** Port GID */
251
 	struct ib_gid port_gid;
257
 	struct ib_gid port_gid;
252
 	/** Broadcast GID */
258
 	/** Broadcast GID */
253
-	struct ib_gid broadcast_gid;	
259
+	struct ib_gid broadcast_gid;
260
+	/** Subnet manager LID */
261
+	unsigned long sm_lid;
254
 	/** Underlying device */
262
 	/** Underlying device */
255
 	struct device *dev;
263
 	struct device *dev;
256
 	/** Infiniband operations */
264
 	/** Infiniband operations */
422
 #define IB_SMP_ATTR_LED_INFO			0x0031
430
 #define IB_SMP_ATTR_LED_INFO			0x0031
423
 #define IB_SMP_ATTR_VENDOR_MASK			0xFF00
431
 #define IB_SMP_ATTR_VENDOR_MASK			0xFF00
424
 
432
 
433
+#define IB_SA_ATTR_MC_MEMBER_REC		0x38
434
+#define IB_SA_ATTR_PATH_REC			0x35
435
+
436
+#define IB_SA_MCMEMBER_REC_MGID			(1<<0)
437
+#define IB_SA_MCMEMBER_REC_PORT_GID		(1<<1)
438
+#define IB_SA_MCMEMBER_REC_QKEY			(1<<2)
439
+#define IB_SA_MCMEMBER_REC_MLID			(1<<3)
440
+#define IB_SA_MCMEMBER_REC_MTU_SELECTOR		(1<<4)
441
+#define IB_SA_MCMEMBER_REC_MTU			(1<<5)
442
+#define IB_SA_MCMEMBER_REC_TRAFFIC_CLASS	(1<<6)
443
+#define IB_SA_MCMEMBER_REC_PKEY			(1<<7)
444
+#define IB_SA_MCMEMBER_REC_RATE_SELECTOR	(1<<8)
445
+#define IB_SA_MCMEMBER_REC_RATE			(1<<9)
446
+#define IB_SA_MCMEMBER_REC_PACKET_LIFE_TIME_SELECTOR	(1<<10)
447
+#define IB_SA_MCMEMBER_REC_PACKET_LIFE_TIME	(1<<11)
448
+#define IB_SA_MCMEMBER_REC_SL			(1<<12)
449
+#define IB_SA_MCMEMBER_REC_FLOW_LABEL		(1<<13)
450
+#define IB_SA_MCMEMBER_REC_HOP_LIMIT		(1<<14)
451
+#define IB_SA_MCMEMBER_REC_SCOPE		(1<<15)
452
+#define IB_SA_MCMEMBER_REC_JOIN_STATE		(1<<16)
453
+#define IB_SA_MCMEMBER_REC_PROXY_JOIN		(1<<17)
454
+
455
+#define IB_SA_PATH_REC_DGID			(1<<2)
456
+#define IB_SA_PATH_REC_SGID			(1<<3)
457
+
425
 struct ib_mad_hdr {
458
 struct ib_mad_hdr {
426
 	uint8_t base_version;
459
 	uint8_t base_version;
427
 	uint8_t mgmt_class;
460
 	uint8_t mgmt_class;
435
 	uint32_t attr_mod;
468
 	uint32_t attr_mod;
436
 } __attribute__ (( packed ));
469
 } __attribute__ (( packed ));
437
 
470
 
471
+struct ib_sa_hdr {
472
+	uint32_t sm_key[2];
473
+	uint16_t reserved;
474
+	uint16_t attrib_offset;
475
+	uint32_t comp_mask[2];
476
+} __attribute__ (( packed ));
477
+
478
+struct ib_rmpp_hdr {
479
+	uint32_t raw[3];
480
+} __attribute__ (( packed ));
481
+
438
 struct ib_mad_data {
482
 struct ib_mad_data {
439
 	struct ib_mad_hdr mad_hdr;
483
 	struct ib_mad_hdr mad_hdr;
440
 	uint8_t data[232];
484
 	uint8_t data[232];
475
 	uint16_t pkey[16][2];
519
 	uint16_t pkey[16][2];
476
 } __attribute__ (( packed ));
520
 } __attribute__ (( packed ));
477
 
521
 
522
+struct ib_mad_path_record {
523
+	struct ib_mad_hdr mad_hdr;
524
+	struct ib_rmpp_hdr rmpp_hdr;
525
+	struct ib_sa_hdr sa_hdr;
526
+	uint32_t reserved0[2];
527
+	struct ib_gid dgid;
528
+	struct ib_gid sgid;
529
+	uint16_t dlid;
530
+	uint16_t slid;
531
+	uint32_t hop_limit__flow_label__raw_traffic;
532
+	uint32_t pkey__numb_path__reversible__tclass;
533
+	uint32_t rate__rate_selector__mtu__mtu_selector__sl__reserved;
534
+	uint32_t preference__packet_lifetime__packet_lifetime_selector;
535
+	uint32_t reserved1[35];
536
+} __attribute__ (( packed ));
537
+
478
 union ib_mad {
538
 union ib_mad {
479
 	struct ib_mad_hdr mad_hdr;
539
 	struct ib_mad_hdr mad_hdr;
480
 	struct ib_mad_data data;
540
 	struct ib_mad_data data;
481
 	struct ib_mad_guid_info guid_info;
541
 	struct ib_mad_guid_info guid_info;
482
 	struct ib_mad_port_info port_info;
542
 	struct ib_mad_port_info port_info;
483
 	struct ib_mad_pkey_table pkey_table;
543
 	struct ib_mad_pkey_table pkey_table;
544
+	struct ib_mad_path_record path_record;
484
 } __attribute__ (( packed ));
545
 } __attribute__ (( packed ));
485
 
546
 
486
 #endif /* _GPXE_INFINIBAND_H */
547
 #endif /* _GPXE_INFINIBAND_H */

Loading…
Cancel
Save