[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.
This commit is contained in:
Michael Brown
2009-08-02 22:57:01 +01:00
parent 1f7d550246
commit b0c563824b
5 changed files with 30 additions and 30 deletions

View File

@@ -209,11 +209,11 @@ struct ib_queue_pair * ib_create_qp ( struct ib_device *ibdev,
/* Calculate externally-visible QPN */
switch ( type ) {
case IB_QPT_SMA:
qp->ext_qpn = IB_QPN_SMA;
case IB_QPT_SMI:
qp->ext_qpn = IB_QPN_SMI;
break;
case IB_QPT_GMA:
qp->ext_qpn = IB_QPN_GMA;
case IB_QPT_GSI:
qp->ext_qpn = IB_QPN_GSI;
break;
default:
qp->ext_qpn = qp->qpn;
@@ -535,7 +535,7 @@ int ib_open ( struct ib_device *ibdev ) {
}
/* Create subnet management agent */
ibdev->sma = ib_create_gma ( ibdev, IB_QPT_SMA );
ibdev->sma = ib_create_gma ( ibdev, IB_QPT_SMI );
if ( ! ibdev->sma ) {
DBGC ( ibdev, "IBDEV %p could not create SMA\n", ibdev );
rc = -ENOMEM;
@@ -543,7 +543,7 @@ int ib_open ( struct ib_device *ibdev ) {
}
/* Create general management agent */
ibdev->gma = ib_create_gma ( ibdev, IB_QPT_GMA );
ibdev->gma = ib_create_gma ( ibdev, IB_QPT_GSI );
if ( ! ibdev->gma ) {
DBGC ( ibdev, "IBDEV %p could not create GMA\n", ibdev );
rc = -ENOMEM;

View File

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

View File

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