summaryrefslogtreecommitdiffstats
path: root/src/net/infiniband
diff options
context:
space:
mode:
authorMichael Brown2009-07-09 16:52:04 +0200
committerMichael Brown2009-07-18 00:06:34 +0200
commitf1d92fa8865c281cb7da31f2e3b62ece3f2f9ca1 (patch)
treed07c05965bd108d02d3c1b6fd1ac1574f70200d5 /src/net/infiniband
parent[infiniband] Always create an SMA and a GMA (diff)
downloadipxe-f1d92fa8865c281cb7da31f2e3b62ece3f2f9ca1.tar.gz
ipxe-f1d92fa8865c281cb7da31f2e3b62ece3f2f9ca1.tar.xz
ipxe-f1d92fa8865c281cb7da31f2e3b62ece3f2f9ca1.zip
[infiniband] Allow external QPN to differ from real QPN
Most IB hardware seems not to allow allocation of the genuine QPNs 0 and 1, so allow for the externally-visible QPN (as constructed and parsed by ib_packet, where used) to differ from the real hardware-allocated QPN.
Diffstat (limited to 'src/net/infiniband')
-rw-r--r--src/net/infiniband/ib_packet.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/net/infiniband/ib_packet.c b/src/net/infiniband/ib_packet.c
index 409ef2f8..689e00dc 100644
--- a/src/net/infiniband/ib_packet.c
+++ b/src/net/infiniband/ib_packet.c
@@ -58,7 +58,7 @@ int ib_push ( struct ib_device *ibdev, struct io_buffer *iobuf,
unsigned int lnh;
DBGC2 ( ibdev, "IBDEV %p TX %04x:%08lx => %04x:%08lx (key %08lx)\n",
- ibdev, ibdev->lid, qp->qpn, av->lid, av->qpn, av->qkey );
+ ibdev, ibdev->lid, qp->ext_qpn, av->lid, av->qpn, av->qkey );
/* Calculate packet length */
pad_len = ( (-payload_len) & 0x3 );
@@ -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 = ( ( av->qpn == IB_QPN_SMA ) ? IB_VL_SMP : IB_VL_DEFAULT );
+ vl = ( ( qp->ext_qpn == IB_QPN_SMA ) ? 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 );
@@ -104,7 +104,7 @@ int ib_push ( struct ib_device *ibdev, struct io_buffer *iobuf,
/* Construct DETH */
deth->qkey = htonl ( av->qkey );
- deth->src_qp = htonl ( qp->qpn );
+ deth->src_qp = htonl ( qp->ext_qpn );
DBGCP_HDA ( ibdev, 0, iobuf->data,
( iob_len ( iobuf ) - orig_iob_len ) );
@@ -233,8 +233,8 @@ int ib_pull ( struct ib_device *ibdev, struct io_buffer *iobuf,
}
DBGC2 ( ibdev, "IBDEV %p RX %04x:%08lx <= %04x:%08lx (key %08x)\n",
- ibdev, lid,
- ( IB_LID_MULTICAST( lid ) ? ( qp ? (*qp)->qpn : -1UL ) : qpn ),
+ ibdev, lid, ( IB_LID_MULTICAST( lid ) ?
+ ( qp ? (*qp)->ext_qpn : -1UL ) : qpn ),
av->lid, av->qpn, ntohl ( deth->qkey ) );
DBGCP_HDA ( ibdev, 0,
( iobuf->data - ( orig_iob_len - iob_len ( iobuf ) ) ),