mirror of
https://github.com/ipxe/ipxe
synced 2025-12-19 19:49:45 +03:00
[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.
This commit is contained in:
@@ -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 ) ) ),
|
||||
|
||||
Reference in New Issue
Block a user