Selaa lähdekoodia

[infiniband] Change IB_{QPN,QKEY,QPT} names from {SMA,GMA} to {SMI,GSI}

The IBA specification refers to management "interfaces" and "agents".
The interface is the component that connects to the queue pair and
sends and receives MADs; the agent is the component that constructs
the reply to the MAD.

Rename the IB_{QPN,QKEY,QPT} constants as a first step towards making
this separation in gPXE.
tags/v0.9.8
Michael Brown 15 vuotta sitten
vanhempi
commit
b0c563824b

+ 10
- 10
src/drivers/infiniband/hermon.c Näytä tiedosto

@@ -831,10 +831,10 @@ static int hermon_alloc_qpn ( struct ib_device *ibdev,
831 831
 	port_offset = ( ibdev->port - HERMON_PORT_BASE );
832 832
 
833 833
 	switch ( qp->type ) {
834
-	case IB_QPT_SMA:
834
+	case IB_QPT_SMI:
835 835
 		qp->qpn = ( hermon->special_qpn_base + port_offset );
836 836
 		return 0;
837
-	case IB_QPT_GMA:
837
+	case IB_QPT_GSI:
838 838
 		qp->qpn = ( hermon->special_qpn_base + 2 + port_offset );
839 839
 		return 0;
840 840
 	case IB_QPT_UD:
@@ -892,15 +892,15 @@ static unsigned int hermon_rate ( struct ib_address_vector *av ) {
892 892
  */
893 893
 static unsigned int hermon_sched_queue ( struct ib_device *ibdev,
894 894
 					 struct ib_queue_pair *qp ) {
895
-	return ( ( ( qp->type == IB_QPT_SMA ) ?
895
+	return ( ( ( qp->type == IB_QPT_SMI ) ?
896 896
 		   HERMON_SCHED_QP0 : HERMON_SCHED_DEFAULT ) |
897 897
 		 ( ( ibdev->port - 1 ) << 6 ) );
898 898
 }
899 899
 
900 900
 /** Queue pair transport service type map */
901 901
 static uint8_t hermon_qp_st[] = {
902
-	[IB_QPT_SMA] = HERMON_ST_MLX,
903
-	[IB_QPT_GMA] = HERMON_ST_MLX,
902
+	[IB_QPT_SMI] = HERMON_ST_MLX,
903
+	[IB_QPT_GSI] = HERMON_ST_MLX,
904 904
 	[IB_QPT_UD] = HERMON_ST_UD,
905 905
 	[IB_QPT_RC] = HERMON_ST_RC,
906 906
 };
@@ -1214,7 +1214,7 @@ hermon_fill_mlx_send_wqe ( struct ib_device *ibdev,
1214 1214
 		     icrc, 0 /* generate ICRC */,
1215 1215
 		     max_statrate, hermon_rate ( av ),
1216 1216
 		     slr, 0,
1217
-		     v15, ( ( qp->ext_qpn == IB_QPN_SMA ) ? 1 : 0 ) );
1217
+		     v15, ( ( qp->ext_qpn == IB_QPN_SMI ) ? 1 : 0 ) );
1218 1218
 	MLX_FILL_1 ( &wqe->mlx.ctrl, 3, rlid, av->lid );
1219 1219
 	MLX_FILL_1 ( &wqe->mlx.data[0], 0,
1220 1220
 		     byte_count, iob_len ( &headers ) );
@@ -1264,8 +1264,8 @@ static unsigned int
1264 1264
 			       struct ib_address_vector *av,
1265 1265
 			       struct io_buffer *iobuf,
1266 1266
 			       union hermon_send_wqe *wqe ) = {
1267
-	[IB_QPT_SMA] = hermon_fill_mlx_send_wqe,
1268
-	[IB_QPT_GMA] = hermon_fill_mlx_send_wqe,
1267
+	[IB_QPT_SMI] = hermon_fill_mlx_send_wqe,
1268
+	[IB_QPT_GSI] = hermon_fill_mlx_send_wqe,
1269 1269
 	[IB_QPT_UD] = hermon_fill_ud_send_wqe,
1270 1270
 	[IB_QPT_RC] = hermon_fill_rc_send_wqe,
1271 1271
 };
@@ -1444,8 +1444,8 @@ static int hermon_complete ( struct ib_device *ibdev,
1444 1444
 		assert ( len <= iob_tailroom ( iobuf ) );
1445 1445
 		iob_put ( iobuf, len );
1446 1446
 		switch ( qp->type ) {
1447
-		case IB_QPT_SMA:
1448
-		case IB_QPT_GMA:
1447
+		case IB_QPT_SMI:
1448
+		case IB_QPT_GSI:
1449 1449
 		case IB_QPT_UD:
1450 1450
 			assert ( iob_len ( iobuf ) >= sizeof ( *grh ) );
1451 1451
 			grh = iobuf->data;

+ 10
- 10
src/include/gpxe/infiniband.h Näytä tiedosto

@@ -15,17 +15,17 @@ FILE_LICENCE ( GPL2_OR_LATER );
15 15
 #include <gpxe/ib_packet.h>
16 16
 #include <gpxe/ib_mad.h>
17 17
 
18
-/** Subnet management QPN */
19
-#define IB_QPN_SMA 0
18
+/** Subnet management interface QPN */
19
+#define IB_QPN_SMI 0
20 20
 
21
-/** Subnet management queue key */
22
-#define IB_QKEY_SMA 0
21
+/** Subnet management interface queue key */
22
+#define IB_QKEY_SMI 0
23 23
 
24
-/** General management QPN */
25
-#define IB_QPN_GMA 1
24
+/** General service interface QPN */
25
+#define IB_QPN_GSI 1
26 26
 
27
-/** General management queue key */
28
-#define IB_QKEY_GMA 0x80010000UL
27
+/** General service interface queue key */
28
+#define IB_QKEY_GSI 0x80010000UL
29 29
 
30 30
 /** Broadcast QPN */
31 31
 #define IB_QPN_BROADCAST 0xffffffUL
@@ -124,8 +124,8 @@ struct ib_multicast_gid {
124 124
 
125 125
 /** An Infiniband queue pair type */
126 126
 enum ib_queue_pair_type {
127
-	IB_QPT_SMA,
128
-	IB_QPT_GMA,
127
+	IB_QPT_SMI,
128
+	IB_QPT_GSI,
129 129
 	IB_QPT_UD,
130 130
 	IB_QPT_RC,
131 131
 };

+ 6
- 6
src/net/infiniband.c Näytä tiedosto

@@ -209,11 +209,11 @@ struct ib_queue_pair * ib_create_qp ( struct ib_device *ibdev,
209 209
 
210 210
 	/* Calculate externally-visible QPN */
211 211
 	switch ( type ) {
212
-	case IB_QPT_SMA:
213
-		qp->ext_qpn = IB_QPN_SMA;
212
+	case IB_QPT_SMI:
213
+		qp->ext_qpn = IB_QPN_SMI;
214 214
 		break;
215
-	case IB_QPT_GMA:
216
-		qp->ext_qpn = IB_QPN_GMA;
215
+	case IB_QPT_GSI:
216
+		qp->ext_qpn = IB_QPN_GSI;
217 217
 		break;
218 218
 	default:
219 219
 		qp->ext_qpn = qp->qpn;
@@ -535,7 +535,7 @@ int ib_open ( struct ib_device *ibdev ) {
535 535
 	}
536 536
 
537 537
 	/* Create subnet management agent */
538
-	ibdev->sma = ib_create_gma ( ibdev, IB_QPT_SMA );
538
+	ibdev->sma = ib_create_gma ( ibdev, IB_QPT_SMI );
539 539
 	if ( ! ibdev->sma ) {
540 540
 		DBGC ( ibdev, "IBDEV %p could not create SMA\n", ibdev );
541 541
 		rc = -ENOMEM;
@@ -543,7 +543,7 @@ int ib_open ( struct ib_device *ibdev ) {
543 543
 	}
544 544
 
545 545
 	/* Create general management agent */
546
-	ibdev->gma = ib_create_gma ( ibdev, IB_QPT_GMA );
546
+	ibdev->gma = ib_create_gma ( ibdev, IB_QPT_GSI );
547 547
 	if ( ! ibdev->gma ) {
548 548
 		DBGC ( ibdev, "IBDEV %p could not create GMA\n", ibdev );
549 549
 		rc = -ENOMEM;

+ 3
- 3
src/net/infiniband/ib_gma.c Näytä tiedosto

@@ -590,8 +590,8 @@ int ib_gma_request ( struct ib_gma *gma, union ib_mad *mad,
590 590
 	} else {
591 591
 		request->av.lid = ibdev->sm_lid;
592 592
 		request->av.sl = ibdev->sm_sl;
593
-		request->av.qpn = IB_QPN_GMA;
594
-		request->av.qkey = IB_QKEY_GMA;
593
+		request->av.qpn = IB_QPN_GSI;
594
+		request->av.qkey = IB_QKEY_GSI;
595 595
 	}
596 596
 
597 597
 	/* Copy MAD body */
@@ -656,7 +656,7 @@ struct ib_gma * ib_create_gma ( struct ib_device *ibdev,
656 656
 	DBGC ( gma, "GMA %p running on QPN %#lx\n", gma, gma->qp->qpn );
657 657
 
658 658
 	/* Set queue key */
659
-	gma->qp->qkey = ( ( type == IB_QPT_SMA ) ? IB_QKEY_SMA : IB_QKEY_GMA );
659
+	gma->qp->qkey = ( ( type == IB_QPT_SMI ) ? IB_QKEY_SMI : IB_QKEY_GSI );
660 660
 	if ( ( rc = ib_modify_qp ( ibdev, gma->qp ) ) != 0 ) {
661 661
 		DBGC ( gma, "GMA %p could not set queue key: %s\n",
662 662
 		       gma, strerror ( rc ) );

+ 1
- 1
src/net/infiniband/ib_packet.c Näytä tiedosto

@@ -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 = ( ( qp->ext_qpn == IB_QPN_SMA ) ? IB_VL_SMP : IB_VL_DEFAULT );
79
+	vl = ( ( qp->ext_qpn == IB_QPN_SMI ) ? 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 );

Loading…
Peruuta
Tallenna