summaryrefslogtreecommitdiffstats
path: root/src/net/infiniband
diff options
context:
space:
mode:
authorMichael Brown2009-07-09 04:09:00 +0200
committerMichael Brown2009-07-18 00:06:34 +0200
commit80c41b90d226b8f6d80feb221a4920a0e0a88da2 (patch)
tree376989d4c3e3daf6d1a2e1595742136858750e4b /src/net/infiniband
parent[infiniband] Allow completion queue operations to be optional (diff)
downloadipxe-80c41b90d226b8f6d80feb221a4920a0e0a88da2.tar.gz
ipxe-80c41b90d226b8f6d80feb221a4920a0e0a88da2.tar.xz
ipxe-80c41b90d226b8f6d80feb221a4920a0e0a88da2.zip
[infiniband] Add notion of a queue pair type
Diffstat (limited to 'src/net/infiniband')
-rw-r--r--src/net/infiniband/ib_gma.c8
-rw-r--r--src/net/infiniband/ib_sma.c2
2 files changed, 6 insertions, 4 deletions
diff --git a/src/net/infiniband/ib_gma.c b/src/net/infiniband/ib_gma.c
index 649533ab1..1968bc275 100644
--- a/src/net/infiniband/ib_gma.c
+++ b/src/net/infiniband/ib_gma.c
@@ -343,11 +343,12 @@ int ib_gma_request ( struct ib_gma *gma, union ib_mad *mad,
*
* @v gma General management agent
* @v ibdev Infiniband device
- * @v qkey Queue key
+ * @v type Queue pair type
* @ret rc Return status code
*/
int ib_create_gma ( struct ib_gma *gma, struct ib_device *ibdev,
- unsigned long qkey ) {
+ enum ib_queue_pair_type type ) {
+ unsigned long qkey;
int rc;
/* Initialise fields */
@@ -366,7 +367,8 @@ int ib_create_gma ( struct ib_gma *gma, struct ib_device *ibdev,
}
/* Create queue pair */
- gma->qp = ib_create_qp ( ibdev, IB_GMA_NUM_SEND_WQES, gma->cq,
+ qkey = ( ( type == IB_QPT_SMA ) ? IB_QKEY_SMA : IB_QKEY_GMA );
+ gma->qp = ib_create_qp ( ibdev, type, IB_GMA_NUM_SEND_WQES, gma->cq,
IB_GMA_NUM_RECV_WQES, gma->cq, qkey );
if ( ! gma->qp ) {
DBGC ( gma, "GMA %p could not allocate queue pair\n", gma );
diff --git a/src/net/infiniband/ib_sma.c b/src/net/infiniband/ib_sma.c
index 9e99703f8..8fb332410 100644
--- a/src/net/infiniband/ib_sma.c
+++ b/src/net/infiniband/ib_sma.c
@@ -286,7 +286,7 @@ int ib_create_sma ( struct ib_sma *sma, struct ib_device *ibdev ) {
int rc;
/* Initialise GMA */
- if ( ( rc = ib_create_gma ( &sma->gma, ibdev, 0 ) ) != 0 ) {
+ if ( ( rc = ib_create_gma ( &sma->gma, ibdev, IB_QPT_SMA ) ) != 0 ) {
DBGC ( sma, "SMA %p could not create GMA: %s\n",
sma, strerror ( rc ) );
goto err_create_gma;