Quellcode durchsuchen

[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 vor 15 Jahren
Ursprung
Commit
b0c563824b

+ 10
- 10
src/drivers/infiniband/hermon.c Datei anzeigen

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

+ 10
- 10
src/include/gpxe/infiniband.h Datei anzeigen

15
 #include <gpxe/ib_packet.h>
15
 #include <gpxe/ib_packet.h>
16
 #include <gpxe/ib_mad.h>
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
 /** Broadcast QPN */
30
 /** Broadcast QPN */
31
 #define IB_QPN_BROADCAST 0xffffffUL
31
 #define IB_QPN_BROADCAST 0xffffffUL
124
 
124
 
125
 /** An Infiniband queue pair type */
125
 /** An Infiniband queue pair type */
126
 enum ib_queue_pair_type {
126
 enum ib_queue_pair_type {
127
-	IB_QPT_SMA,
128
-	IB_QPT_GMA,
127
+	IB_QPT_SMI,
128
+	IB_QPT_GSI,
129
 	IB_QPT_UD,
129
 	IB_QPT_UD,
130
 	IB_QPT_RC,
130
 	IB_QPT_RC,
131
 };
131
 };

+ 6
- 6
src/net/infiniband.c Datei anzeigen

209
 
209
 
210
 	/* Calculate externally-visible QPN */
210
 	/* Calculate externally-visible QPN */
211
 	switch ( type ) {
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
 		break;
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
 		break;
217
 		break;
218
 	default:
218
 	default:
219
 		qp->ext_qpn = qp->qpn;
219
 		qp->ext_qpn = qp->qpn;
535
 	}
535
 	}
536
 
536
 
537
 	/* Create subnet management agent */
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
 	if ( ! ibdev->sma ) {
539
 	if ( ! ibdev->sma ) {
540
 		DBGC ( ibdev, "IBDEV %p could not create SMA\n", ibdev );
540
 		DBGC ( ibdev, "IBDEV %p could not create SMA\n", ibdev );
541
 		rc = -ENOMEM;
541
 		rc = -ENOMEM;
543
 	}
543
 	}
544
 
544
 
545
 	/* Create general management agent */
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
 	if ( ! ibdev->gma ) {
547
 	if ( ! ibdev->gma ) {
548
 		DBGC ( ibdev, "IBDEV %p could not create GMA\n", ibdev );
548
 		DBGC ( ibdev, "IBDEV %p could not create GMA\n", ibdev );
549
 		rc = -ENOMEM;
549
 		rc = -ENOMEM;

+ 3
- 3
src/net/infiniband/ib_gma.c Datei anzeigen

590
 	} else {
590
 	} else {
591
 		request->av.lid = ibdev->sm_lid;
591
 		request->av.lid = ibdev->sm_lid;
592
 		request->av.sl = ibdev->sm_sl;
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
 	/* Copy MAD body */
597
 	/* Copy MAD body */
656
 	DBGC ( gma, "GMA %p running on QPN %#lx\n", gma, gma->qp->qpn );
656
 	DBGC ( gma, "GMA %p running on QPN %#lx\n", gma, gma->qp->qpn );
657
 
657
 
658
 	/* Set queue key */
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
 	if ( ( rc = ib_modify_qp ( ibdev, gma->qp ) ) != 0 ) {
660
 	if ( ( rc = ib_modify_qp ( ibdev, gma->qp ) ) != 0 ) {
661
 		DBGC ( gma, "GMA %p could not set queue key: %s\n",
661
 		DBGC ( gma, "GMA %p could not set queue key: %s\n",
662
 		       gma, strerror ( rc ) );
662
 		       gma, strerror ( rc ) );

+ 1
- 1
src/net/infiniband/ib_packet.c Datei anzeigen

76
 	lrh_len = ( payload_len + iob_len ( iobuf ) - orig_iob_len );
76
 	lrh_len = ( payload_len + iob_len ( iobuf ) - orig_iob_len );
77
 
77
 
78
 	/* Construct LRH */
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
 	lrh->vl__lver = ( vl << 4 );
80
 	lrh->vl__lver = ( vl << 4 );
81
 	lnh = ( grh ? IB_LNH_GRH : IB_LNH_BTH );
81
 	lnh = ( grh ? IB_LNH_GRH : IB_LNH_BTH );
82
 	lrh->sl__lnh = ( ( av->sl << 4 ) | lnh );
82
 	lrh->sl__lnh = ( ( av->sl << 4 ) | lnh );

Laden…
Abbrechen
Speichern