mirror of
https://github.com/xcat2/xNBA.git
synced 2025-02-22 05:19:55 +00:00
[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:
parent
1f7d550246
commit
b0c563824b
@ -831,10 +831,10 @@ static int hermon_alloc_qpn ( struct ib_device *ibdev,
|
||||
port_offset = ( ibdev->port - HERMON_PORT_BASE );
|
||||
|
||||
switch ( qp->type ) {
|
||||
case IB_QPT_SMA:
|
||||
case IB_QPT_SMI:
|
||||
qp->qpn = ( hermon->special_qpn_base + port_offset );
|
||||
return 0;
|
||||
case IB_QPT_GMA:
|
||||
case IB_QPT_GSI:
|
||||
qp->qpn = ( hermon->special_qpn_base + 2 + port_offset );
|
||||
return 0;
|
||||
case IB_QPT_UD:
|
||||
@ -892,15 +892,15 @@ static unsigned int hermon_rate ( struct ib_address_vector *av ) {
|
||||
*/
|
||||
static unsigned int hermon_sched_queue ( struct ib_device *ibdev,
|
||||
struct ib_queue_pair *qp ) {
|
||||
return ( ( ( qp->type == IB_QPT_SMA ) ?
|
||||
return ( ( ( qp->type == IB_QPT_SMI ) ?
|
||||
HERMON_SCHED_QP0 : HERMON_SCHED_DEFAULT ) |
|
||||
( ( ibdev->port - 1 ) << 6 ) );
|
||||
}
|
||||
|
||||
/** Queue pair transport service type map */
|
||||
static uint8_t hermon_qp_st[] = {
|
||||
[IB_QPT_SMA] = HERMON_ST_MLX,
|
||||
[IB_QPT_GMA] = HERMON_ST_MLX,
|
||||
[IB_QPT_SMI] = HERMON_ST_MLX,
|
||||
[IB_QPT_GSI] = HERMON_ST_MLX,
|
||||
[IB_QPT_UD] = HERMON_ST_UD,
|
||||
[IB_QPT_RC] = HERMON_ST_RC,
|
||||
};
|
||||
@ -1214,7 +1214,7 @@ hermon_fill_mlx_send_wqe ( struct ib_device *ibdev,
|
||||
icrc, 0 /* generate ICRC */,
|
||||
max_statrate, hermon_rate ( av ),
|
||||
slr, 0,
|
||||
v15, ( ( qp->ext_qpn == IB_QPN_SMA ) ? 1 : 0 ) );
|
||||
v15, ( ( qp->ext_qpn == IB_QPN_SMI ) ? 1 : 0 ) );
|
||||
MLX_FILL_1 ( &wqe->mlx.ctrl, 3, rlid, av->lid );
|
||||
MLX_FILL_1 ( &wqe->mlx.data[0], 0,
|
||||
byte_count, iob_len ( &headers ) );
|
||||
@ -1264,8 +1264,8 @@ static unsigned int
|
||||
struct ib_address_vector *av,
|
||||
struct io_buffer *iobuf,
|
||||
union hermon_send_wqe *wqe ) = {
|
||||
[IB_QPT_SMA] = hermon_fill_mlx_send_wqe,
|
||||
[IB_QPT_GMA] = hermon_fill_mlx_send_wqe,
|
||||
[IB_QPT_SMI] = hermon_fill_mlx_send_wqe,
|
||||
[IB_QPT_GSI] = hermon_fill_mlx_send_wqe,
|
||||
[IB_QPT_UD] = hermon_fill_ud_send_wqe,
|
||||
[IB_QPT_RC] = hermon_fill_rc_send_wqe,
|
||||
};
|
||||
@ -1444,8 +1444,8 @@ static int hermon_complete ( struct ib_device *ibdev,
|
||||
assert ( len <= iob_tailroom ( iobuf ) );
|
||||
iob_put ( iobuf, len );
|
||||
switch ( qp->type ) {
|
||||
case IB_QPT_SMA:
|
||||
case IB_QPT_GMA:
|
||||
case IB_QPT_SMI:
|
||||
case IB_QPT_GSI:
|
||||
case IB_QPT_UD:
|
||||
assert ( iob_len ( iobuf ) >= sizeof ( *grh ) );
|
||||
grh = iobuf->data;
|
||||
|
@ -15,17 +15,17 @@ FILE_LICENCE ( GPL2_OR_LATER );
|
||||
#include <gpxe/ib_packet.h>
|
||||
#include <gpxe/ib_mad.h>
|
||||
|
||||
/** Subnet management QPN */
|
||||
#define IB_QPN_SMA 0
|
||||
/** Subnet management interface QPN */
|
||||
#define IB_QPN_SMI 0
|
||||
|
||||
/** Subnet management queue key */
|
||||
#define IB_QKEY_SMA 0
|
||||
/** Subnet management interface queue key */
|
||||
#define IB_QKEY_SMI 0
|
||||
|
||||
/** General management QPN */
|
||||
#define IB_QPN_GMA 1
|
||||
/** General service interface QPN */
|
||||
#define IB_QPN_GSI 1
|
||||
|
||||
/** General management queue key */
|
||||
#define IB_QKEY_GMA 0x80010000UL
|
||||
/** General service interface queue key */
|
||||
#define IB_QKEY_GSI 0x80010000UL
|
||||
|
||||
/** Broadcast QPN */
|
||||
#define IB_QPN_BROADCAST 0xffffffUL
|
||||
@ -124,8 +124,8 @@ struct ib_multicast_gid {
|
||||
|
||||
/** An Infiniband queue pair type */
|
||||
enum ib_queue_pair_type {
|
||||
IB_QPT_SMA,
|
||||
IB_QPT_GMA,
|
||||
IB_QPT_SMI,
|
||||
IB_QPT_GSI,
|
||||
IB_QPT_UD,
|
||||
IB_QPT_RC,
|
||||
};
|
||||
|
@ -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;
|
||||
|
@ -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 ) );
|
||||
|
@ -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 );
|
||||
|
Loading…
x
Reference in New Issue
Block a user