Parcourir la source

[infiniband] Centralise SMA and GMA queue constants

tags/v0.9.8
Michael Brown il y a 15 ans
Parent
révision
365b8db5cf

+ 7
- 7
src/drivers/net/ipoib.c Voir le fichier

@@ -394,8 +394,8 @@ static int ipoib_get_path_record ( struct ipoib_device *ipoib,
394 394
 	memset ( &av, 0, sizeof ( av ) );
395 395
 	av.lid = ibdev->sm_lid;
396 396
 	av.sl = ibdev->sm_sl;
397
-	av.qpn = IB_SA_QPN;
398
-	av.qkey = IB_GLOBAL_QKEY;
397
+	av.qpn = IB_QPN_GMA;
398
+	av.qkey = IB_QKEY_GMA;
399 399
 
400 400
 	/* Post send request */
401 401
 	if ( ( rc = ib_post_send ( ibdev, ipoib->meta.qp, &av,
@@ -455,8 +455,8 @@ static int ipoib_mc_member_record ( struct ipoib_device *ipoib,
455 455
 	memset ( &av, 0, sizeof ( av ) );
456 456
 	av.lid = ibdev->sm_lid;
457 457
 	av.sl = ibdev->sm_sl;
458
-	av.qpn = IB_SA_QPN;
459
-	av.qkey = IB_GLOBAL_QKEY;
458
+	av.qpn = IB_QPN_GMA;
459
+	av.qkey = IB_QKEY_GMA;
460 460
 
461 461
 	/* Post send request */
462 462
 	if ( ( rc = ib_post_send ( ibdev, ipoib->meta.qp, &av,
@@ -511,7 +511,7 @@ static int ipoib_transmit ( struct net_device *netdev,
511 511
 	av.gid_present = 1;
512 512
 	if ( dest->mac.qpn == htonl ( IPOIB_BROADCAST_QPN ) ) {
513 513
 		/* Broadcast */
514
-		av.qpn = IB_BROADCAST_QPN;
514
+		av.qpn = IB_QPN_BROADCAST;
515 515
 		av.lid = ipoib->broadcast_lid;
516 516
 		gid = &ipoib->broadcast_gid;
517 517
 	} else {
@@ -835,7 +835,7 @@ static int ipoib_open ( struct net_device *netdev ) {
835 835
 				     IPOIB_META_NUM_CQES, &ipoib_meta_cq_op,
836 836
 				     IPOIB_META_NUM_SEND_WQES,
837 837
 				     IPOIB_META_NUM_RECV_WQES,
838
-				     IB_GLOBAL_QKEY ) ) != 0 ) {
838
+				     IB_QKEY_GMA ) ) != 0 ) {
839 839
 		DBGC ( ipoib, "IPoIB %p could not allocate metadata QP: %s\n",
840 840
 		       ipoib, strerror ( rc ) );
841 841
 		goto err_create_meta_qset;
@@ -847,7 +847,7 @@ static int ipoib_open ( struct net_device *netdev ) {
847 847
 				     IPOIB_DATA_NUM_CQES, &ipoib_data_cq_op,
848 848
 				     IPOIB_DATA_NUM_SEND_WQES,
849 849
 				     IPOIB_DATA_NUM_RECV_WQES,
850
-				     IB_GLOBAL_QKEY ) ) != 0 ) {
850
+				     IB_QKEY_GMA ) ) != 0 ) {
851 851
 		DBGC ( ipoib, "IPoIB %p could not allocate data QP: %s\n",
852 852
 		       ipoib, strerror ( rc ) );
853 853
 		goto err_create_data_qset;

+ 0
- 6
src/include/gpxe/ib_packet.h Voir le fichier

@@ -106,12 +106,6 @@ enum ib_bth_opcode {
106 106
 	BTH_OPCODE_UD_SEND = 0x64,
107 107
 };
108 108
 
109
-/** Default Infiniband partition key */
110
-#define IB_PKEY_NONE 0xffff
111
-
112
-/** Subnet management queue pair number */
113
-#define IB_QPN_SMP 0
114
-
115 109
 /** An Infiniband Datagram Extended Transport Header */
116 110
 struct ib_datagram_extended_transport_header {
117 111
 	/** Queue key */

+ 14
- 5
src/include/gpxe/infiniband.h Voir le fichier

@@ -15,14 +15,23 @@ FILE_LICENCE ( GPL2_OR_LATER );
15 15
 #include <gpxe/ib_packet.h>
16 16
 #include <gpxe/ib_mad.h>
17 17
 
18
-/** Subnet administrator QPN */
19
-#define IB_SA_QPN 1
18
+/** Subnet management QPN */
19
+#define IB_QPN_SMA 0
20
+
21
+/** Subnet management queue key */
22
+#define IB_QKEY_SMA 0
23
+
24
+/** General management QPN */
25
+#define IB_QPN_GMA 1
26
+
27
+/** General management queue key */
28
+#define IB_QKEY_GMA 0x80010000UL
20 29
 
21 30
 /** Broadcast QPN */
22
-#define IB_BROADCAST_QPN 0xffffffUL
31
+#define IB_QPN_BROADCAST 0xffffffUL
23 32
 
24
-/** Subnet administrator queue key */
25
-#define IB_GLOBAL_QKEY 0x80010000UL
33
+/** Default Infiniband partition key */
34
+#define IB_PKEY_NONE 0xffff
26 35
 
27 36
 /**
28 37
  * Maximum payload size

+ 1
- 1
src/net/infiniband/ib_packet.c Voir le fichier

@@ -76,7 +76,7 @@ int ib_push ( struct ib_device *ibdev, struct io_buffer *iobuf,
76 76
 	lrh_len = ( payload_len + iob_len ( iobuf ) - orig_iob_len );
77 77
 
78 78
 	/* Construct LRH */
79
-	vl = ( ( av->qpn == IB_QPN_SMP ) ? IB_VL_SMP : IB_VL_DEFAULT );
79
+	vl = ( ( av->qpn == IB_QPN_SMA ) ? IB_VL_SMP : IB_VL_DEFAULT );
80 80
 	lrh->vl__lver = ( vl << 4 );
81 81
 	lnh = ( grh ? IB_LNH_GRH : IB_LNH_BTH );
82 82
 	lrh->sl__lnh = ( ( av->sl << 4 ) | lnh );

+ 1
- 1
src/net/infiniband/ib_sma.c Voir le fichier

@@ -460,7 +460,7 @@ int ib_create_sma ( struct ib_sma *sma, struct ib_device *ibdev,
460 460
 	ib_qp_set_ownerdata ( sma->qp, sma );
461 461
 
462 462
 	/* If we don't get QP0, we can't function */
463
-	if ( sma->qp->qpn != IB_QPN_SMP ) {
463
+	if ( sma->qp->qpn != IB_QPN_SMA ) {
464 464
 		DBGC ( sma, "SMA %p on QPN %lx, needs to be on QPN 0\n",
465 465
 		       sma, sma->qp->qpn );
466 466
 		rc = -ENOTSUP;

Chargement…
Annuler
Enregistrer