@@ -69,10 +69,11 @@ Infiniband::dumpStats()
6969Infiniband::QueuePair*
7070Infiniband::createQueuePair (ibv_qp_type type, int ibPhysicalPort, ibv_srq *srq,
7171 ibv_cq *txcq, ibv_cq *rxcq, uint32_t maxSendWr,
72- uint32_t maxRecvWr, uint32_t QKey)
72+ uint32_t maxRecvWr, uint32_t maxSendSges,
73+ uint32_t QKey)
7374{
7475 return new QueuePair (*this , type, ibPhysicalPort, srq, txcq, rxcq,
75- maxSendWr, maxRecvWr, QKey);
76+ maxSendWr, maxRecvWr, maxSendSges, QKey);
7677}
7778
7879/* *
@@ -508,12 +509,15 @@ Infiniband::pollCompletionQueue(ibv_cq *cq, int numEntries, ibv_wc *retWcArray)
508509 * \param maxRecvWr
509510 * Maximum number of outstanding receive work requests allowed on
510511 * this QueuePair.
512+ * \param maxSendSges
513+ * Maximum number of scatter-gather entries per work request allowed on
514+ * this QueuePair.
511515 * \param QKey
512516 * UD Queue Pairs only. The QKey for this pair.
513517 */
514518Infiniband::QueuePair::QueuePair (Infiniband& infiniband, ibv_qp_type type,
515519 int ibPhysicalPort, ibv_srq *srq, ibv_cq *txcq, ibv_cq *rxcq,
516- uint32_t maxSendWr, uint32_t maxRecvWr, uint32_t QKey)
520+ uint32_t maxSendWr, uint32_t maxRecvWr, uint32_t maxSendSges, uint32_t QKey)
517521 : infiniband(infiniband),
518522 type (type),
519523 ctxt(infiniband.device.ctxt),
@@ -538,7 +542,7 @@ Infiniband::QueuePair::QueuePair(Infiniband& infiniband, ibv_qp_type type,
538542 qpia.srq = srq; // use the same shared receive queue
539543 qpia.cap .max_send_wr = maxSendWr; // max outstanding send requests
540544 qpia.cap .max_recv_wr = maxRecvWr; // max outstanding recv requests
541- qpia.cap .max_send_sge = 1 ; // max send scatter-gather elements
545+ qpia.cap .max_send_sge = maxSendSges; // max send scatter-gather elements
542546 qpia.cap .max_recv_sge = 1 ; // max recv scatter-gather elements
543547 qpia.cap .max_inline_data = // max bytes of immediate data on send q
544548 MAX_INLINE_DATA;
@@ -993,13 +997,17 @@ Infiniband::Address::getHandle() const
993997 return ah;
994998 }
995999
996- // Must allocate a new address handle.
997- ibv_ah_attr attr;
998- attr.dlid = lid;
999- attr.src_path_bits = 0 ;
1000- attr.is_global = 0 ;
1001- attr.sl = 0 ;
1002- attr.port_num = downCast<uint8_t >(physicalPort);
1000+ // Must allocate a new address handle. See also:
1001+ // https://www.rdmamojo.com/2012/09/22/ibv_create_ah/
1002+ ibv_ah_attr attr = {
1003+ .grh = {},
1004+ .dlid = lid,
1005+ .sl = 0 ,
1006+ .src_path_bits = 0 ,
1007+ .static_rate = 0 ,
1008+ .is_global = 0 ,
1009+ .port_num = downCast<uint8_t >(physicalPort)
1010+ };
10031011 infiniband.totalAddressHandleAllocCalls += 1 ;
10041012 uint64_t start = Cycles::rdtsc ();
10051013 ah = ibv_create_ah (infiniband.pd .pd , &attr);
0 commit comments