mirror of
https://github.com/ipxe/ipxe
synced 2025-12-27 18:12:36 +03:00
[arbel] Randomise the high-order bits of queue pair numbers
This is a backport of commit 0b1222f ("[hermon] Randomise the
high-order bits of queue pair numbers") to the Arbel driver.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -360,8 +360,8 @@ struct arbel_recv_work_queue {
|
||||
*/
|
||||
#define ARBEL_MAX_QPS 8
|
||||
|
||||
/** Base queue pair number */
|
||||
#define ARBEL_QPN_BASE 0x550000
|
||||
/** Queue pair number randomisation mask */
|
||||
#define ARBEL_QPN_RANDOM_MASK 0xfff000
|
||||
|
||||
/** An Arbel queue pair */
|
||||
struct arbel_queue_pair {
|
||||
@@ -564,7 +564,9 @@ arbel_cq_arm_doorbell_idx ( struct arbel *arbel,
|
||||
*/
|
||||
static inline unsigned int
|
||||
arbel_send_doorbell_idx ( struct arbel *arbel, struct ib_queue_pair *qp ) {
|
||||
return ( ARBEL_MAX_CQS + ( qp->qpn - arbel->special_qpn_base ) );
|
||||
return ( ARBEL_MAX_CQS +
|
||||
( ( qp->qpn & ~ARBEL_QPN_RANDOM_MASK ) -
|
||||
arbel->special_qpn_base ) );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -577,7 +579,8 @@ arbel_send_doorbell_idx ( struct arbel *arbel, struct ib_queue_pair *qp ) {
|
||||
static inline unsigned int
|
||||
arbel_recv_doorbell_idx ( struct arbel *arbel, struct ib_queue_pair *qp ) {
|
||||
return ( ARBEL_MAX_DOORBELL_RECORDS - ARBEL_MAX_CQS -
|
||||
( qp->qpn - arbel->special_qpn_base ) - 1 );
|
||||
( ( qp->qpn & ~ARBEL_QPN_RANDOM_MASK ) -
|
||||
arbel->special_qpn_base ) - 1 );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user