1
1

If there is an eager rdma credit, but there is no WQE to send a packet we add it

to a pending queue of eager rdma QP instead of correct pending list. This patch
fixes this by getting reed of "eager rdma qp" notion. Packet is always send
over its order QP. The patch also adds two pending queues for high and low prio
packets. Only high prio packets are sent over eager RDMA channel.

This commit was SVN r16780.
Этот коммит содержится в:
Gleb Natapov 2007-11-28 07:12:44 +00:00
родитель 6a2d210b7d
Коммит a9f864d15c
8 изменённых файлов: 317 добавлений и 289 удалений

Просмотреть файл

@ -825,9 +825,10 @@ int mca_btl_openib_finalize(struct mca_btl_base_module_t* btl)
/* Release SRQ resources */
for(qp = 0; qp < mca_btl_openib_component.num_qps; qp++) {
if(BTL_OPENIB_QP_TYPE_SRQ(qp)){
MCA_BTL_OPENIB_CLEAN_PENDING_FRAGS(
&openib_btl->qps[qp].u.srq_qp.pending_frags);
&openib_btl->qps[qp].u.srq_qp.pending_frags[0]);
MCA_BTL_OPENIB_CLEAN_PENDING_FRAGS(
&openib_btl->qps[qp].u.srq_qp.pending_frags[1]);
if (ibv_destroy_srq(openib_btl->qps[qp].u.srq_qp.srq)){
BTL_VERBOSE(("Failed to close SRQ %d", qp));
@ -835,7 +836,8 @@ int mca_btl_openib_finalize(struct mca_btl_base_module_t* btl)
}
/* Destroy free lists */
OBJ_DESTRUCT(&openib_btl->qps[qp].u.srq_qp.pending_frags);
OBJ_DESTRUCT(&openib_btl->qps[qp].u.srq_qp.pending_frags[0]);
OBJ_DESTRUCT(&openib_btl->qps[qp].u.srq_qp.pending_frags[1]);
OBJ_DESTRUCT(&openib_btl->qps[qp].send_free);
OBJ_DESTRUCT(&openib_btl->qps[qp].recv_free);
} else {

Просмотреть файл

@ -195,8 +195,6 @@ struct mca_btl_openib_component_t {
int want_fork_support;
#endif
int rdma_qp;
int eager_rdma_qp;
}; typedef struct mca_btl_openib_component_t mca_btl_openib_component_t;
OMPI_MODULE_DECLSPEC extern mca_btl_openib_component_t mca_btl_openib_component;
@ -259,9 +257,7 @@ struct mca_btl_openib_module_srq_qp_t {
int32_t rd_posted;
int32_t sd_credits; /* the max number of outstanding sends on a QP when using SRQ */
/* i.e. the number of frags that can be outstanding (down counter) */
opal_list_t pending_frags; /**< list of pending frags */
opal_list_t pending_frags[2]; /**< list of high/low prio frags */
}; typedef struct mca_btl_openib_module_srq_qp_t mca_btl_openib_module_srq_qp_t;
struct mca_btl_openib_module_qp_t {
@ -565,9 +561,6 @@ static inline int mca_btl_openib_post_srr(mca_btl_openib_module_t* openib_btl,
return OMPI_SUCCESS;
}
#define BTL_OPENIB_EAGER_RDMA_QP(QP) \
((QP) == mca_btl_openib_component.eager_rdma_qp)
#define BTL_OPENIB_RDMA_QP(QP) \
((QP) == mca_btl_openib_component.rdma_qp)

Просмотреть файл

@ -87,15 +87,13 @@ static void merge_values(ompi_btl_openib_ini_values_t *target,
static int btl_openib_handle_incoming(mca_btl_openib_module_t *openib_btl,
mca_btl_openib_endpoint_t *endpoint,
mca_btl_openib_recv_frag_t *frag,
size_t byte_len, const int prio);
size_t byte_len);
static char* btl_openib_component_status_to_string(enum ibv_wc_status status);
static int btl_openib_component_progress(void);
static int btl_openib_module_progress(mca_btl_openib_hca_t *hca);
static void btl_openib_frag_progress_pending_pp(
mca_btl_base_endpoint_t *endpoint,
const int qp);
static void btl_openib_frag_progress_pending_srq(
mca_btl_openib_module_t* openib_btl, const int qp);
static void progress_pending_frags_pp(mca_btl_base_endpoint_t *, const int);
static void progress_pending_frags_srq( mca_btl_openib_module_t* , const int);
static void progress_pending_eager_rdma(mca_btl_base_endpoint_t*);
static void btl_openib_frag_progress_pending_put_get(
mca_btl_openib_module_t* openib_btl, mca_btl_base_endpoint_t *endpoint,
const int qp);
@ -233,33 +231,39 @@ static void btl_openib_control(struct mca_btl_base_module_t* btl,
to_base_frag(des)->segment.seg_addr.pval;
mca_btl_openib_eager_rdma_header_t *rdma_hdr;
mca_btl_openib_rdma_credits_header_t *credits_hdr;
int qp = to_recv_frag(des)->qp_idx;
if(BTL_OPENIB_EAGER_RDMA_QP(qp)) {
/* if not sent via rdma */
if(!MCA_BTL_OPENIB_RDMA_FRAG(des) &&
ctl_hdr->type == MCA_BTL_OPENIB_CONTROL_CREDITS) {
OPAL_THREAD_ADD32(&endpoint->qps[qp].u.pp_qp.cm_received, 1);
/* rd_posted don't account for rsv preposts for credit message but
* receive path decreased it for each message receive no matter if
* it is credit message or not. So fix rd_posted value here. */
OPAL_THREAD_ADD32((int32_t*)&endpoint->qps[qp].u.pp_qp.rd_posted, 1);
}
} else if (ctl_hdr->type == MCA_BTL_OPENIB_CONTROL_CREDITS) {
OPAL_THREAD_ADD32(&endpoint->qps[qp].u.pp_qp.cm_received, 1);
/* see above */
OPAL_THREAD_ADD32((int32_t*)&endpoint->qps[qp].u.pp_qp.rd_posted, 1);
}
int qp;
switch (ctl_hdr->type) {
case MCA_BTL_OPENIB_CONTROL_CREDITS:
credits_hdr = (mca_btl_openib_rdma_credits_header_t*)ctl_hdr;
if(endpoint->nbo) {
BTL_OPENIB_RDMA_CREDITS_HEADER_NTOH((*credits_hdr));
BTL_OPENIB_RDMA_CREDITS_HEADER_NTOH(*credits_hdr);
}
if(credits_hdr->rdma_credits)
qp = credits_hdr->qpn;
/* if not sent via rdma */
if(!MCA_BTL_OPENIB_RDMA_FRAG(des)) {
OPAL_THREAD_ADD32(&endpoint->qps[qp].u.pp_qp.cm_received, 1);
/* rd_posted don't account for rsv preposts for credit message but
* receive path decreased it for each message received no matter if
* it is credit message or not. So fix rd_posted value here. */
OPAL_THREAD_ADD32(&endpoint->qps[qp].u.pp_qp.rd_posted, 1);
} else {
mca_btl_openib_header_t *hdr = to_recv_frag(des)->hdr;
/* if received via rdma the update credits here since they will not
* be update in handle_incomming() function because qp num is not
* known there */
OPAL_THREAD_ADD32(&endpoint->qps[qp].u.pp_qp.sd_credits,
hdr->credits);
progress_pending_frags_pp(endpoint, qp);
}
if(credits_hdr->rdma_credits) {
OPAL_THREAD_ADD32(&endpoint->eager_rdma_remote.tokens,
credits_hdr->rdma_credits);
progress_pending_eager_rdma(endpoint);
}
break;
case MCA_BTL_OPENIB_CONTROL_RDMA:
rdma_hdr = (mca_btl_openib_eager_rdma_header_t*)ctl_hdr;
@ -272,22 +276,19 @@ static void btl_openib_control(struct mca_btl_base_module_t* btl,
));
if(endpoint->nbo) {
BTL_OPENIB_EAGER_RDMA_CONTROL_HEADER_NTOH((*rdma_hdr));
BTL_OPENIB_EAGER_RDMA_CONTROL_HEADER_NTOH(*rdma_hdr);
}
BTL_VERBOSE(("received rkey %lu, rdma_start.lval %llu, pval %p, ival %u\n",
rdma_hdr->rkey,
(unsigned long) rdma_hdr->rdma_start.lval,
rdma_hdr->rdma_start.pval,
rdma_hdr->rdma_start.ival
));
}
BTL_VERBOSE(("received rkey %lu, rdma_start.lval %llu, pval %p,"
" ival %u\n", rdma_hdr->rkey,
(unsigned long) rdma_hdr->rdma_start.lval,
rdma_hdr->rdma_start.pval, rdma_hdr->rdma_start.ival));
if (endpoint->eager_rdma_remote.base.pval) {
BTL_ERROR(("Got RDMA connect twice!"));
return;
}
endpoint->eager_rdma_remote.rkey = rdma_hdr->rkey;
endpoint->eager_rdma_remote.rkey = rdma_hdr->rkey;
endpoint->eager_rdma_remote.base.lval = rdma_hdr->rdma_start.lval;
endpoint->eager_rdma_remote.tokens =
mca_btl_openib_component.eager_rdma_num - 1;
@ -766,7 +767,7 @@ static int finish_btl_init(mca_btl_openib_module_t *openib_btl)
sizeof(mca_btl_openib_footer_t) +
sizeof(mca_btl_openib_eager_rdma_header_t);
init_data->order = mca_btl_openib_component.eager_rdma_qp;
init_data->order = MCA_BTL_NO_ORDER;
init_data->list = &openib_btl->send_free_control;
if(OMPI_SUCCESS != ompi_free_list_init_ex(&openib_btl->send_free_control,
@ -785,7 +786,10 @@ static int finish_btl_init(mca_btl_openib_module_t *openib_btl)
OBJ_CONSTRUCT(&openib_btl->qps[qp].recv_free, ompi_free_list_t);
if(BTL_OPENIB_QP_TYPE_SRQ(qp)) {
OBJ_CONSTRUCT(&openib_btl->qps[qp].u.srq_qp.pending_frags, opal_list_t);
OBJ_CONSTRUCT(&openib_btl->qps[qp].u.srq_qp.pending_frags[0],
opal_list_t);
OBJ_CONSTRUCT(&openib_btl->qps[qp].u.srq_qp.pending_frags[1],
opal_list_t);
openib_btl->qps[qp].u.srq_qp.sd_credits =
mca_btl_openib_component.qp_infos[qp].u.srq_qp.sd_max;
}
@ -1124,7 +1128,7 @@ static void merge_values(ompi_btl_openib_ini_values_t *target,
static int btl_openib_handle_incoming(mca_btl_openib_module_t *openib_btl,
mca_btl_openib_endpoint_t *endpoint,
mca_btl_openib_recv_frag_t *frag,
size_t byte_len, const int qp)
size_t byte_len)
{
mca_btl_base_descriptor_t *des = &to_base_frag(frag)->base;
mca_btl_openib_header_t *hdr = frag->hdr;
@ -1141,27 +1145,24 @@ static int btl_openib_handle_incoming(mca_btl_openib_module_t *openib_btl,
openib_btl->ib_reg[hdr->tag].cbfunc(&openib_btl->super, hdr->tag, des,
openib_btl->ib_reg[hdr->tag].cbdata);
if(BTL_OPENIB_IS_RDMA_CREDITS(hdr->credits) &&
BTL_OPENIB_CREDITS(hdr->credits) > 0) {
OPAL_THREAD_ADD32(&endpoint->eager_rdma_remote.tokens,
BTL_OPENIB_CREDITS(hdr->credits));
if(BTL_OPENIB_IS_RDMA_CREDITS(hdr->credits)) {
if(BTL_OPENIB_CREDITS(hdr->credits) > 0) {
OPAL_THREAD_ADD32(&endpoint->eager_rdma_remote.tokens,
BTL_OPENIB_CREDITS(hdr->credits));
progress_pending_eager_rdma(endpoint);
}
} else {
int qp = to_base_frag(frag)->base.order;
if(BTL_OPENIB_QP_TYPE_PP(qp) && hdr->credits > 0) {
OPAL_THREAD_ADD32(&endpoint->qps[qp].u.pp_qp.sd_credits,
hdr->credits);
progress_pending_frags_pp(endpoint, qp);
}
if(hdr->cm_seen)
OPAL_THREAD_ADD32(&endpoint->qps[qp].u.pp_qp.cm_sent,-hdr->cm_seen);
}
if(hdr->cm_seen) {
OPAL_THREAD_ADD32(&endpoint->qps[qp].u.pp_qp.cm_sent, -hdr->cm_seen);
}
/* We may receive credits here so try to progress only things that
* may be pending because of credit shortage */
if(BTL_OPENIB_QP_TYPE_PP(qp) || BTL_OPENIB_EAGER_RDMA_QP(qp)) {
btl_openib_frag_progress_pending_pp(endpoint, qp);
}
return OMPI_SUCCESS;
}
@ -1240,28 +1241,52 @@ static char* btl_openib_component_status_to_string(enum ibv_wc_status status)
}
}
#define BTL_OPENIB_TOKENS(E, P) \
(BTL_OPENIB_QP_TYPE_SRQ(P) ? 1 : ((E)->qps[(P)].u.pp_qp.sd_credits + \
((BTL_OPENIB_EAGER_RDMA_QP(P))?(E)->eager_rdma_remote.tokens:0)))
static void btl_openib_frag_progress_pending_pp(
mca_btl_base_endpoint_t *endpoint, const int qp)
static void progress_pending_eager_rdma(mca_btl_base_endpoint_t *ep)
{
int qp;
opal_list_item_t *frag;
size_t i, len = opal_list_get_size(&endpoint->qps[qp].pending_frags);
/* check to see if we need to progress any pending descriptors */
for(i = 0; i < len && endpoint->qps[qp].sd_wqe > 0 &&
BTL_OPENIB_TOKENS(endpoint, qp) > 0; i++) {
OPAL_THREAD_LOCK(&endpoint->endpoint_lock);
frag = opal_list_remove_first(&(endpoint->qps[qp].pending_frags));
OPAL_THREAD_UNLOCK(&endpoint->endpoint_lock);
if(NULL == frag)
break;
if(mca_btl_openib_endpoint_send(endpoint, to_send_frag(frag)) ==
OMPI_ERR_OUT_OF_RESOURCE)
break;
/* Go over all QPs and try to send high prio packets over eager rdma
* channel */
OPAL_THREAD_LOCK(&ep->endpoint_lock);
for(qp = 0; qp < mca_btl_openib_component.num_qps; qp++) {
while(ep->qps[qp].sd_wqe > 0 && ep->eager_rdma_remote.tokens > 0) {
frag = opal_list_remove_first(&ep->qps[qp].pending_frags[0]);
if(NULL == frag)
break;
mca_btl_openib_endpoint_post_send(ep, to_send_frag(frag));
}
if(ep->eager_rdma_remote.tokens == 0)
break;
}
OPAL_THREAD_UNLOCK(&ep->endpoint_lock);
}
static inline int
get_enpoint_credits(mca_btl_base_endpoint_t *ep, const int qp)
{
return BTL_OPENIB_QP_TYPE_PP(qp) ? ep->qps[qp].u.pp_qp.sd_credits : 1;
}
static void progress_pending_frags_pp(mca_btl_base_endpoint_t *ep, const int qp)
{
int i, rc;
opal_list_item_t *frag;
OPAL_THREAD_LOCK(&ep->endpoint_lock);
for(i = 0; i < 2; i++) {
while(ep->qps[qp].sd_wqe > 0 && (get_enpoint_credits(ep, qp) +
(1 - i) * ep->eager_rdma_remote.tokens) > 0)
{
frag = opal_list_remove_first(&ep->qps[qp].pending_frags[i]);
if(NULL == frag)
break;
rc = mca_btl_openib_endpoint_post_send(ep, to_send_frag(frag));
if(rc != OMPI_SUCCESS)
break;
}
}
OPAL_THREAD_UNLOCK(&ep->endpoint_lock);
}
static void btl_openib_frag_progress_pending_put_get(
@ -1295,27 +1320,27 @@ static void btl_openib_frag_progress_pending_put_get(
}
}
static void btl_openib_frag_progress_pending_srq(
mca_btl_openib_module_t* openib_btl, const int qp)
static void progress_pending_frags_srq(mca_btl_openib_module_t* openib_btl,
const int qp)
{
opal_list_item_t *frag;
size_t i, len;
int i;
assert(BTL_OPENIB_QP_TYPE_SRQ(qp));
len = opal_list_get_size(&openib_btl->qps[qp].u.srq_qp.pending_frags);
for(i = 0; i < len && openib_btl->qps[qp].u.srq_qp.sd_credits > 0; i++) {
/* dequeue resources due to global flow control */
OPAL_THREAD_LOCK(&openib_btl->ib_lock);
frag =
opal_list_remove_first(&openib_btl->qps[qp].u.srq_qp.pending_frags);
OPAL_THREAD_UNLOCK(&openib_btl->ib_lock);
if(NULL == frag)
break;
if(mca_btl_openib_endpoint_send(to_com_frag(frag)->endpoint,
to_send_frag(frag)) == OMPI_ERR_OUT_OF_RESOURCE)
break;
for(i = 0; i < 2; i++) {
while(openib_btl->qps[qp].u.srq_qp.sd_credits > 0) {
OPAL_THREAD_LOCK(&openib_btl->ib_lock);
frag = opal_list_remove_first(
&openib_btl->qps[qp].u.srq_qp.pending_frags[i]);
OPAL_THREAD_UNLOCK(&openib_btl->ib_lock);
if(NULL == frag)
break;
mca_btl_openib_endpoint_send(to_com_frag(frag)->endpoint,
to_send_frag(frag));
}
}
}
@ -1394,7 +1419,6 @@ static int btl_openib_component_progress(void)
if(MCA_BTL_OPENIB_RDMA_FRAG_LOCAL(frag)) {
uint32_t size;
int qp;
opal_atomic_rmb();
if(endpoint->nbo) {
BTL_OPENIB_FOOTER_NTOH(*frag->ftr);
@ -1418,8 +1442,7 @@ static int btl_openib_component_progress(void)
ret = btl_openib_handle_incoming(openib_btl,
to_com_frag(frag)->endpoint, frag,
size - sizeof(mca_btl_openib_footer_t),
frag->qp_idx);
size - sizeof(mca_btl_openib_footer_t));
if (ret != MPI_SUCCESS) {
openib_btl->error_cb(&openib_btl->super,
MCA_BTL_ERROR_FLAGS_FATAL);
@ -1440,8 +1463,9 @@ static int btl_openib_component_progress(void)
}
OPAL_THREAD_UNLOCK(&endpoint->eager_rdma_local.lock);
qp = mca_btl_openib_component.eager_rdma_qp;
send_credits(endpoint, qp);
/* send credits over qp 0 since it should always be present
* anyway */
send_credits(endpoint, 0);
count++;
} else
OPAL_THREAD_UNLOCK(&endpoint->eager_rdma_local.lock);
@ -1522,12 +1546,13 @@ static int btl_openib_module_progress(mca_btl_openib_hca_t* hca)
OPAL_THREAD_ADD32(&endpoint->qps[qp].sd_wqe, 1);
if(IBV_WC_SEND == wc.opcode && BTL_OPENIB_QP_TYPE_SRQ(qp)) {
OPAL_THREAD_ADD32(&openib_btl->qps[qp].u.srq_qp.sd_credits, 1);
OPAL_THREAD_ADD32(&openib_btl->qps[qp].u.srq_qp.sd_credits,
1);
/* new SRQ credit available. Try to progress pending frags*/
btl_openib_frag_progress_pending_srq(openib_btl, qp);
progress_pending_frags_srq(openib_btl, qp);
}
/* new wqe or/and get token available. Try to progress pending frags */
btl_openib_frag_progress_pending_pp(endpoint, qp);
progress_pending_frags_pp(endpoint, qp);
btl_openib_frag_progress_pending_put_get(openib_btl, endpoint, qp);
count++;
@ -1542,7 +1567,7 @@ static int btl_openib_module_progress(mca_btl_openib_hca_t* hca)
/* Process a RECV */
if(btl_openib_handle_incoming(openib_btl, endpoint,
to_recv_frag(frag), wc.byte_len, qp) != OMPI_SUCCESS) {
to_recv_frag(frag), wc.byte_len) != OMPI_SUCCESS) {
openib_btl->error_cb(&openib_btl->super,
MCA_BTL_ERROR_FLAGS_FATAL);
return 0;

Просмотреть файл

@ -47,117 +47,118 @@
static void mca_btl_openib_endpoint_construct(mca_btl_base_endpoint_t* endpoint);
static void mca_btl_openib_endpoint_destruct(mca_btl_base_endpoint_t* endpoint);
static int post_send(mca_btl_openib_module_t *openib_btl,
mca_btl_openib_endpoint_t *endpoint, mca_btl_openib_send_frag_t *frag,
const int qp, const int do_rdma)
static int post_send(mca_btl_openib_endpoint_t *ep,
mca_btl_openib_send_frag_t *frag, const bool rdma)
{
struct ibv_send_wr *bad_wr;
mca_btl_openib_module_t *openib_btl = ep->endpoint_btl;
mca_btl_base_segment_t *seg = &to_base_frag(frag)->segment;
struct ibv_sge *sg = &to_com_frag(frag)->sg_entry;
struct ibv_send_wr *sr_desc = &to_out_frag(frag)->sr_desc;
assert(!do_rdma || BTL_OPENIB_EAGER_RDMA_QP(qp));
struct ibv_send_wr *bad_wr;
int qp = to_base_frag(frag)->base.order;
sg->length = seg->seg_len + sizeof(mca_btl_openib_header_t) +
(do_rdma ? sizeof(mca_btl_openib_footer_t) : 0);
(rdma ? sizeof(mca_btl_openib_footer_t) : 0);
if(sg->length <= openib_btl->ib_inline_max) {
sr_desc->send_flags = IBV_SEND_SIGNALED|IBV_SEND_INLINE;
} else {
sr_desc->send_flags = IBV_SEND_SIGNALED;
if(sg->length <= openib_btl->ib_inline_max) {
sr_desc->send_flags = IBV_SEND_SIGNALED | IBV_SEND_INLINE;
} else {
sr_desc->send_flags = IBV_SEND_SIGNALED;
}
if(endpoint->nbo)
if(ep->nbo)
BTL_OPENIB_HEADER_HTON(*frag->hdr);
if(do_rdma) {
if(rdma) {
int32_t head;
mca_btl_openib_footer_t* ftr = (mca_btl_openib_footer_t*)
(((char*)seg->seg_addr.pval) + seg->seg_len);
mca_btl_openib_footer_t* ftr =
(mca_btl_openib_footer_t*)(((char*)seg->seg_addr.pval) +
seg->seg_len);
sr_desc->opcode = IBV_WR_RDMA_WRITE;
MCA_BTL_OPENIB_RDMA_FRAG_SET_SIZE(ftr, sg->length);
MCA_BTL_OPENIB_RDMA_MAKE_LOCAL(ftr);
#if OMPI_ENABLE_DEBUG
((mca_btl_openib_footer_t*)(((char*)seg->seg_addr.pval) +
seg->seg_len))->seq = endpoint->eager_rdma_remote.seq++;
seg->seg_len))->seq = ep->eager_rdma_remote.seq++;
#endif
if(endpoint->nbo)
BTL_OPENIB_FOOTER_HTON((*ftr));
if(ep->nbo)
BTL_OPENIB_FOOTER_HTON(*ftr);
sr_desc->wr.rdma.rkey = endpoint->eager_rdma_remote.rkey;
MCA_BTL_OPENIB_RDMA_MOVE_INDEX(endpoint->eager_rdma_remote.head, head);
sr_desc->wr.rdma.rkey = ep->eager_rdma_remote.rkey;
MCA_BTL_OPENIB_RDMA_MOVE_INDEX(ep->eager_rdma_remote.head, head);
sr_desc->wr.rdma.remote_addr =
endpoint->eager_rdma_remote.base.lval +
ep->eager_rdma_remote.base.lval +
head * openib_btl->eager_rdma_frag_size +
sizeof(mca_btl_openib_header_t) +
mca_btl_openib_component.eager_limit +
sizeof(mca_btl_openib_footer_t);
sr_desc->wr.rdma.remote_addr -= sg->length;
} else {
if(BTL_OPENIB_QP_TYPE_SRQ(qp)) {
if(BTL_OPENIB_QP_TYPE_SRQ(qp)) {
sr_desc->opcode = IBV_WR_SEND_WITH_IMM;
sr_desc->imm_data = endpoint->rem_info.rem_index;
sr_desc->imm_data = ep->rem_info.rem_index;
} else {
sr_desc->opcode = IBV_WR_SEND;
}
}
to_base_frag(frag)->base.order = qp;
assert(sg->addr == (uint64_t)frag->hdr);
return ibv_post_send(endpoint->qps[qp].lcl_qp, sr_desc, &bad_wr);
return ibv_post_send(ep->qps[qp].lcl_qp, sr_desc, &bad_wr);
}
/*
* post a send to the work queue
*/
static int btl_openib_acquire_send_resources(
mca_btl_openib_module_t *openib_btl,
mca_btl_openib_endpoint_t *endpoint,
mca_btl_openib_send_frag_t *frag, int *qp, int *do_rdma)
static inline int acruire_wqe(mca_btl_openib_endpoint_t *endpoint,
mca_btl_openib_send_frag_t *frag)
{
if(*do_rdma) {
if(OPAL_THREAD_ADD32(&endpoint->eager_rdma_remote.tokens, -1) < 0) {
OPAL_THREAD_ADD32(&endpoint->eager_rdma_remote.tokens, 1);
*do_rdma = 0;
} else {
*qp = mca_btl_openib_component.eager_rdma_qp;
}
}
int qp = to_base_frag(frag)->base.order;
int prio = !(to_base_frag(frag)->base.des_flags & MCA_BTL_DES_FLAGS_PRIORITY);
if(OPAL_THREAD_ADD32(&endpoint->qps[*qp].sd_wqe, -1) < 0) {
OPAL_THREAD_ADD32(&endpoint->qps[*qp].sd_wqe, 1);
if(*do_rdma)
OPAL_THREAD_ADD32(&endpoint->eager_rdma_remote.tokens, 1);
opal_list_append(&endpoint->qps[*qp].pending_frags,
if(OPAL_THREAD_ADD32(&endpoint->qps[qp].sd_wqe, -1) < 0) {
OPAL_THREAD_ADD32(&endpoint->qps[qp].sd_wqe, 1);
opal_list_append(&endpoint->qps[qp].pending_frags[prio],
(opal_list_item_t *)frag);
return OMPI_ERR_OUT_OF_RESOURCE;
}
if(*do_rdma)
return OMPI_SUCCESS;
return OMPI_SUCCESS;
}
if(BTL_OPENIB_QP_TYPE_PP(*qp)) {
if(OPAL_THREAD_ADD32(&endpoint->qps[*qp].u.pp_qp.sd_credits, -1) < 0) {
OPAL_THREAD_ADD32(&endpoint->qps[*qp].u.pp_qp.sd_credits, 1);
OPAL_THREAD_ADD32(&endpoint->qps[*qp].sd_wqe, 1);
opal_list_append(&endpoint->qps[*qp].pending_frags,
static inline int
acquire_eager_rdma_send_credit(mca_btl_openib_endpoint_t *endpoint)
{
if(OPAL_THREAD_ADD32(&endpoint->eager_rdma_remote.tokens, -1) < 0) {
OPAL_THREAD_ADD32(&endpoint->eager_rdma_remote.tokens, 1);
return OMPI_ERR_OUT_OF_RESOURCE;
}
return OMPI_SUCCESS;
}
static int acquire_send_credit(mca_btl_openib_endpoint_t *endpoint,
mca_btl_openib_send_frag_t *frag)
{
mca_btl_openib_module_t *openib_btl = endpoint->endpoint_btl;
int qp = to_base_frag(frag)->base.order;
int prio = !(to_base_frag(frag)->base.des_flags & MCA_BTL_DES_FLAGS_PRIORITY);
if(BTL_OPENIB_QP_TYPE_PP(qp)) {
if(OPAL_THREAD_ADD32(&endpoint->qps[qp].u.pp_qp.sd_credits, -1) < 0) {
OPAL_THREAD_ADD32(&endpoint->qps[qp].u.pp_qp.sd_credits, 1);
opal_list_append(&endpoint->qps[qp].pending_frags[prio],
(opal_list_item_t *)frag);
return OMPI_ERR_OUT_OF_RESOURCE;
}
} else {
if(OPAL_THREAD_ADD32(&openib_btl->qps[*qp].u.srq_qp.sd_credits, -1) < 0) {
OPAL_THREAD_ADD32(&openib_btl->qps[*qp].u.srq_qp.sd_credits, 1);
OPAL_THREAD_ADD32(&endpoint->qps[*qp].sd_wqe, 1);
if(OPAL_THREAD_ADD32(&openib_btl->qps[qp].u.srq_qp.sd_credits, -1) < 0) {
OPAL_THREAD_ADD32(&openib_btl->qps[qp].u.srq_qp.sd_credits, 1);
OPAL_THREAD_LOCK(&openib_btl->ib_lock);
opal_list_append(&openib_btl->qps[*qp].u.srq_qp.pending_frags,
opal_list_append(&openib_btl->qps[qp].u.srq_qp.pending_frags[prio],
(opal_list_item_t *)frag);
OPAL_THREAD_UNLOCK(&openib_btl->ib_lock);
return OMPI_ERR_OUT_OF_RESOURCE;
}
}
return OMPI_SUCCESS;
}
@ -166,77 +167,87 @@ static int btl_openib_acquire_send_resources(
TO = FROM; \
} while(0 == OPAL_ATOMIC_CMPSET_32(&FROM, TO, 0))
/* this function os called with endpoint->endpoint_lock held */
static inline int mca_btl_openib_endpoint_post_send(
mca_btl_openib_module_t* openib_btl,
mca_btl_openib_endpoint_t *endpoint,
/* this function is called with endpoint->endpoint_lock held */
int mca_btl_openib_endpoint_post_send(mca_btl_openib_endpoint_t *endpoint,
mca_btl_openib_send_frag_t *frag)
{
mca_btl_openib_header_t *hdr = frag->hdr;
mca_btl_base_descriptor_t *des = &to_base_frag(frag)->base;
int do_rdma = 0, qp, ib_rc;
int qp, ib_rc;
int32_t cm_return;
if(des->order != MCA_BTL_NO_ORDER) {
qp = des->order; /* if order is provided use it */
} else {
qp = frag->qp_idx;
bool do_rdma = false;
if(des->des_src->seg_len <= mca_btl_openib_component.eager_limit &&
(des->des_flags & MCA_BTL_DES_FLAGS_PRIORITY))
do_rdma = 1; /* High priority frag. Try to send over eager RDMA */
if(OPAL_LIKELY(des->order == MCA_BTL_NO_ORDER))
des->order = frag->qp_idx;
qp = des->order;
if(acruire_wqe(endpoint, frag) != OMPI_SUCCESS)
return OMPI_ERR_OUT_OF_RESOURCE;
if(des->des_src->seg_len <= mca_btl_openib_component.eager_limit &&
(des->des_flags & MCA_BTL_DES_FLAGS_PRIORITY)) {
/* High priority frag. Try to send over eager RDMA */
if(acquire_eager_rdma_send_credit(endpoint) == OMPI_SUCCESS)
do_rdma = true;
}
if(btl_openib_acquire_send_resources(openib_btl, endpoint, frag, &qp,
&do_rdma) == OMPI_ERR_OUT_OF_RESOURCE)
if(!do_rdma && acquire_send_credit(endpoint, frag) != OMPI_SUCCESS) {
OPAL_THREAD_ADD32(&endpoint->qps[qp].sd_wqe, 1);
return OMPI_ERR_OUT_OF_RESOURCE;
}
GET_CREDITS(endpoint->eager_rdma_local.credits, hdr->credits);
if(hdr->credits)
hdr->credits |= BTL_OPENIB_RDMA_CREDITS_FLAG;
hdr->cm_seen = 0;
if(!do_rdma) {
if(BTL_OPENIB_QP_TYPE_PP(qp) && 0 == hdr->credits) {
GET_CREDITS(endpoint->qps[qp].u.pp_qp.rd_credits, hdr->credits);
}
GET_CREDITS(endpoint->qps[qp].u.pp_qp.cm_return, cm_return);
/* cm_seen is only 8 bytes, but cm_return is 32 bytes */
if(cm_return > 255) {
hdr->cm_seen = 255;
cm_return -= 255;
OPAL_THREAD_ADD32(&endpoint->qps[qp].u.pp_qp.cm_return, cm_return);
} else {
hdr->cm_seen = cm_return;
}
}
ib_rc = post_send(endpoint, frag, do_rdma);
if(!ib_rc)
return OMPI_SUCCESS;
hdr->credits = 0;
if(BTL_OPENIB_EAGER_RDMA_QP(qp)) {
GET_CREDITS(endpoint->eager_rdma_local.credits, hdr->credits);
if(hdr->credits)
hdr->credits |= BTL_OPENIB_RDMA_CREDITS_FLAG;
}
if(BTL_OPENIB_QP_TYPE_PP(qp) && 0 == hdr->credits) {
GET_CREDITS(endpoint->qps[qp].u.pp_qp.rd_credits, hdr->credits);
if(endpoint->nbo)
BTL_OPENIB_HEADER_NTOH(*hdr);
if(BTL_OPENIB_IS_RDMA_CREDITS(hdr->credits)) {
OPAL_THREAD_ADD32(&endpoint->eager_rdma_local.credits,
BTL_OPENIB_CREDITS(hdr->credits));
}
GET_CREDITS(endpoint->qps[qp].u.pp_qp.cm_return, cm_return);
/* cm_seen is only 8 bytes, but cm_return is 32 bytes */
if(cm_return > 255) {
hdr->cm_seen = 255;
cm_return -= 255;
OPAL_THREAD_ADD32(&endpoint->qps[qp].u.pp_qp.cm_return, cm_return);
OPAL_THREAD_ADD32(&endpoint->qps[qp].sd_wqe, 1);
if(do_rdma) {
OPAL_THREAD_ADD32(&endpoint->eager_rdma_remote.tokens, 1);
} else {
hdr->cm_seen = cm_return;
}
ib_rc = post_send(openib_btl, endpoint, frag, qp, do_rdma);
if(ib_rc) {
if(endpoint->nbo) {
BTL_OPENIB_HEADER_NTOH(*hdr);
}
if(BTL_OPENIB_IS_RDMA_CREDITS(hdr->credits)) {
OPAL_THREAD_ADD32(&endpoint->eager_rdma_local.credits,
BTL_OPENIB_CREDITS(hdr->credits));
}
OPAL_THREAD_ADD32(&endpoint->qps[qp].sd_wqe, 1);
if(do_rdma) {
OPAL_THREAD_ADD32(&endpoint->eager_rdma_remote.tokens, 1);
if(BTL_OPENIB_QP_TYPE_PP(qp)) {
OPAL_THREAD_ADD32(&endpoint->qps[qp].u.pp_qp.rd_credits,
hdr->credits);
OPAL_THREAD_ADD32(&endpoint->qps[qp].u.pp_qp.sd_credits, 1);
} else {
if(BTL_OPENIB_QP_TYPE_PP(qp)) {
OPAL_THREAD_ADD32(&endpoint->qps[qp].u.pp_qp.rd_credits, hdr->credits);
OPAL_THREAD_ADD32(&endpoint->qps[qp].u.pp_qp.sd_credits, 1);
} else {
OPAL_THREAD_ADD32(&openib_btl->qps[qp].u.srq_qp.sd_credits, 1);
}
mca_btl_openib_module_t *openib_btl = endpoint->endpoint_btl;
OPAL_THREAD_ADD32(&openib_btl->qps[qp].u.srq_qp.sd_credits, 1);
}
BTL_ERROR(("error posting send request error %d: %s\n",
ib_rc, strerror(ib_rc)));
return OMPI_ERROR;
}
return OMPI_SUCCESS;
BTL_ERROR(("error posting send request error %d: %s\n",
ib_rc, strerror(ib_rc)));
return OMPI_ERROR;
}
@ -258,7 +269,8 @@ static void mca_btl_openib_endpoint_construct_qp(mca_btl_base_endpoint_t *endpoi
endpoint->rem_info.rem_qps[qp].rem_qp_num = 0;
endpoint->rem_info.rem_qps[qp].rem_psn = 0;
OBJ_CONSTRUCT(&endpoint->qps[qp].pending_frags, opal_list_t);
OBJ_CONSTRUCT(&endpoint->qps[qp].pending_frags[0], opal_list_t);
OBJ_CONSTRUCT(&endpoint->qps[qp].pending_frags[1], opal_list_t);
if(BTL_OPENIB_QP_TYPE_PP(qp)) {
/* local credits are set here such that on initial posting
* of the receive buffers we end up with zero credits to return
@ -301,10 +313,15 @@ static void mca_btl_openib_endpoint_construct(mca_btl_base_endpoint_t* endpoint)
(mca_btl_openib_endpoint_qp_t*)
malloc(sizeof(mca_btl_openib_endpoint_qp_t) *
mca_btl_openib_component.num_qps);
memset(endpoint->qps, 0, sizeof(mca_btl_openib_endpoint_qp_t) *
mca_btl_openib_component.num_qps);
endpoint->rem_info.rem_qps =
(mca_btl_openib_rem_qp_info_t*)
malloc(sizeof(mca_btl_openib_rem_qp_info_t) *
mca_btl_openib_component.num_qps);
memset(endpoint->rem_info.rem_qps, 0,
sizeof(mca_btl_openib_rem_qp_info_t) *
mca_btl_openib_component.num_qps);
}
endpoint->endpoint_btl = 0;
@ -373,8 +390,10 @@ static void mca_btl_openib_endpoint_destruct(mca_btl_base_endpoint_t* endpoint)
if(MCA_BTL_IB_CLOSED != endpoint->endpoint_state) {
for(qp = 0; qp < mca_btl_openib_component.num_qps; qp++) {
OBJ_DESTRUCT(&endpoint->qps[qp].pending_frags);
MCA_BTL_OPENIB_CLEAN_PENDING_FRAGS(&endpoint->qps[qp].pending_frags);
MCA_BTL_OPENIB_CLEAN_PENDING_FRAGS(&endpoint->qps[qp].pending_frags[0]);
MCA_BTL_OPENIB_CLEAN_PENDING_FRAGS(&endpoint->qps[qp].pending_frags[1]);
OBJ_DESTRUCT(&endpoint->qps[qp].pending_frags[0]);
OBJ_DESTRUCT(&endpoint->qps[qp].pending_frags[1]);
if(ibv_destroy_qp(endpoint->qps[qp].lcl_qp)) {
BTL_ERROR(("Failed to destroy QP:%d\n", qp));
}
@ -422,7 +441,6 @@ void mca_btl_openib_endpoint_connected(mca_btl_openib_endpoint_t *endpoint)
{
opal_list_item_t *frag_item;
mca_btl_openib_send_frag_t *frag;
mca_btl_openib_module_t *openib_btl;
endpoint->endpoint_state = MCA_BTL_IB_CONNECTED;
@ -434,11 +452,9 @@ void mca_btl_openib_endpoint_connected(mca_btl_openib_endpoint_t *endpoint)
while (!opal_list_is_empty(&(endpoint->pending_lazy_frags))) {
frag_item = opal_list_remove_first(&(endpoint->pending_lazy_frags));
frag = to_send_frag(frag_item);
openib_btl = endpoint->endpoint_btl;
/* We need to post this one */
if(OMPI_SUCCESS != mca_btl_openib_endpoint_post_send(openib_btl,
endpoint, frag))
if(OMPI_ERROR == mca_btl_openib_endpoint_post_send(endpoint, frag))
BTL_ERROR(("Error posting send"));
}
}
@ -452,7 +468,6 @@ int mca_btl_openib_endpoint_send(mca_btl_base_endpoint_t* endpoint,
{
int rc;
bool call_progress = false;
mca_btl_openib_module_t *openib_btl;
OPAL_THREAD_LOCK(&endpoint->endpoint_lock);
switch(endpoint->endpoint_state) {
@ -498,18 +513,16 @@ int mca_btl_openib_endpoint_send(mca_btl_base_endpoint_t* endpoint,
break;
case MCA_BTL_IB_CONNECTED:
{
openib_btl = endpoint->endpoint_btl;
BTL_VERBOSE(("Send to : %d, len : %lu, frag : %p",
endpoint->endpoint_proc->proc_guid.vpid,
frag->sg_entry.length,
frag));
rc = mca_btl_openib_endpoint_post_send(openib_btl, endpoint, frag);
break;
}
default:
rc = OMPI_ERR_UNREACH;
BTL_VERBOSE(("Send to : %d, len : %lu, frag : %p",
endpoint->endpoint_proc->proc_guid.vpid,
frag->sg_entry.length, frag));
rc = mca_btl_openib_endpoint_post_send(endpoint, frag);
if(rc == OMPI_ERR_OUT_OF_RESOURCE )
rc = OMPI_SUCCESS;
break;
default:
rc = OMPI_ERR_UNREACH;
break;
}
OPAL_THREAD_UNLOCK(&endpoint->endpoint_lock);
if(call_progress) opal_progress();
@ -555,16 +568,18 @@ void mca_btl_openib_endpoint_send_credits(mca_btl_openib_endpoint_t* endpoint,
mca_btl_openib_module_t* openib_btl = endpoint->endpoint_btl;
mca_btl_openib_send_control_frag_t* frag;
mca_btl_openib_rdma_credits_header_t *credits_hdr;
int do_rdma = 0, ib_rc;
int ib_rc;
bool do_rdma = false;
int32_t cm_return;
frag = endpoint->qps[qp].credit_frag;
if(NULL == frag) {
if(OPAL_UNLIKELY(NULL == frag)) {
MCA_BTL_IB_FRAG_ALLOC_CREDIT_WAIT(openib_btl, frag, ib_rc);
frag->qp_idx = qp;
endpoint->qps[qp].credit_frag = frag;
/* set those once and forever */
to_base_frag(frag)->base.order = qp;
to_base_frag(frag)->base.des_cbfunc = mca_btl_openib_endpoint_credits;
to_base_frag(frag)->base.des_cbdata = NULL;
to_com_frag(frag)->endpoint = endpoint;
@ -577,15 +592,9 @@ void mca_btl_openib_endpoint_send_credits(mca_btl_openib_endpoint_t* endpoint,
credits_hdr =
(mca_btl_openib_rdma_credits_header_t*)
to_base_frag(frag)->segment.seg_addr.pval;
if(BTL_OPENIB_EAGER_RDMA_QP(qp)) {
if(OPAL_THREAD_ADD32(&endpoint->eager_rdma_remote.tokens, -1) < 0) {
OPAL_THREAD_ADD32(&endpoint->eager_rdma_remote.tokens, 1);
} else {
do_rdma = 1;
}
}
if(0 == do_rdma) {
if(acquire_eager_rdma_send_credit(endpoint) == MPI_SUCCESS) {
do_rdma = true;
} else {
if(OPAL_THREAD_ADD32(&endpoint->qps[qp].u.pp_qp.cm_sent, 1) >
(mca_btl_openib_component.qp_infos[qp].u.pp_qp.rd_rsv - 1)) {
OPAL_THREAD_ADD32(&endpoint->qps[qp].u.pp_qp.cm_sent, -1);
@ -596,26 +605,28 @@ void mca_btl_openib_endpoint_send_credits(mca_btl_openib_endpoint_t* endpoint,
GET_CREDITS(endpoint->qps[qp].u.pp_qp.rd_credits, frag->hdr->credits);
GET_CREDITS(endpoint->qps[qp].u.pp_qp.cm_return, cm_return);
if(cm_return > 255) {
frag->hdr->cm_seen = 255;
cm_return -= 255;
OPAL_THREAD_ADD32(&endpoint->qps[qp].u.pp_qp.cm_return, cm_return);
} else {
frag->hdr->cm_seen = cm_return;
frag->hdr->cm_seen = 0;
if(!do_rdma) {
GET_CREDITS(endpoint->qps[qp].u.pp_qp.cm_return, cm_return);
if(cm_return > 255) {
frag->hdr->cm_seen = 255;
cm_return -= 255;
OPAL_THREAD_ADD32(&endpoint->qps[qp].u.pp_qp.cm_return, cm_return);
} else {
frag->hdr->cm_seen = cm_return;
}
}
/* send eager RDMA credits only for eager RDMA QP */
if(BTL_OPENIB_EAGER_RDMA_QP(qp)) {
GET_CREDITS(endpoint->eager_rdma_local.credits,
credits_hdr->rdma_credits);
}
GET_CREDITS(endpoint->eager_rdma_local.credits, credits_hdr->rdma_credits);
credits_hdr->qpn = qp;
credits_hdr->control.type = MCA_BTL_OPENIB_CONTROL_CREDITS;
if(endpoint->nbo)
BTL_OPENIB_RDMA_CREDITS_HEADER_HTON((*credits_hdr));
BTL_OPENIB_RDMA_CREDITS_HEADER_HTON(*credits_hdr);
if(!(ib_rc = post_send(openib_btl, endpoint, frag, qp, do_rdma)))
ib_rc = post_send(endpoint, frag, do_rdma);
if(0 == ib_rc)
return;
if(endpoint->nbo) {
@ -748,7 +759,7 @@ void mca_btl_openib_endpoint_connect_eager_rdma(
item->ptr = buf + i * openib_btl->eager_rdma_frag_size;
OBJ_CONSTRUCT(item, mca_btl_openib_recv_frag_t);
init_data.order = mca_btl_openib_component.eager_rdma_qp;
init_data.order = MCA_BTL_NO_ORDER;
init_data.list = NULL;
mca_btl_openib_frag_init(item, &init_data);

Просмотреть файл

@ -116,10 +116,9 @@ struct mca_btl_openib_endpoint_qp_t {
struct ibv_qp* lcl_qp; /* Local QP (Low and High) */
uint32_t lcl_psn;
int32_t sd_wqe; /**< number of available send wqe entries */
opal_list_t pending_frags; /**< put fragments here if there
is no wqe available or, in
case of PP QP, if there is
no credit available */
opal_list_t pending_frags[2]; /**< put fragments here if there is no wqe
available or, in case of PP QP, if there is
no credit available */
int32_t rd_credit_send_lock; /**< Lock credit send fragment */
mca_btl_openib_send_control_frag_t *credit_frag;
union {
@ -198,12 +197,14 @@ typedef mca_btl_base_endpoint_t mca_btl_openib_endpoint_t;
OBJ_CLASS_DECLARATION(mca_btl_openib_endpoint_t);
int mca_btl_openib_endpoint_send(mca_btl_base_endpoint_t* endpoint,
struct mca_btl_openib_send_frag_t* frag);
int mca_btl_openib_endpoint_send(mca_btl_base_endpoint_t*,
mca_btl_openib_send_frag_t*);
int mca_btl_openib_endpoint_post_send(mca_btl_openib_endpoint_t*,
mca_btl_openib_send_frag_t*);
void mca_btl_openib_endpoint_send_credits(mca_btl_base_endpoint_t*, const int);
void mca_btl_openib_endpoint_connect_eager_rdma(mca_btl_openib_endpoint_t*);
int mca_btl_openib_endpoint_post_recvs(mca_btl_openib_endpoint_t *endpoint);
void mca_btl_openib_endpoint_connected(mca_btl_openib_endpoint_t *endpoint);
int mca_btl_openib_endpoint_post_recvs(mca_btl_openib_endpoint_t*);
void mca_btl_openib_endpoint_connected(mca_btl_openib_endpoint_t*);
@ -282,11 +283,8 @@ static inline int mca_btl_openib_endpoint_post_rr_all(mca_btl_base_endpoint_t *e
static inline bool check_send_credits(mca_btl_openib_endpoint_t *endpoint,
const int qp)
{
if(BTL_OPENIB_EAGER_RDMA_QP(qp)) {
if(endpoint->eager_rdma_local.credits > endpoint->eager_rdma_local.rd_win) {
return true;
}
}
if(endpoint->eager_rdma_local.credits > endpoint->eager_rdma_local.rd_win)
return true;
if(BTL_OPENIB_QP_TYPE_PP(qp)) {
if(endpoint->qps[qp].u.pp_qp.rd_credits >=

Просмотреть файл

@ -119,27 +119,27 @@ typedef struct mca_btl_openib_eager_rdma_header_t mca_btl_openib_eager_rdma_head
#define BTL_OPENIB_EAGER_RDMA_CONTROL_HEADER_HTON(h) \
do { \
h.rkey = htonl(h.rkey); \
h.rdma_start.lval = hton64(h.rdma_start.lval); \
(h).rkey = htonl((h).rkey); \
(h).rdma_start.lval = hton64((h).rdma_start.lval); \
} while (0)
#define BTL_OPENIB_EAGER_RDMA_CONTROL_HEADER_NTOH(h) \
do { \
h.rkey = ntohl(h.rkey); \
h.rdma_start.lval = ntoh64(h.rdma_start.lval); \
#define BTL_OPENIB_EAGER_RDMA_CONTROL_HEADER_NTOH(h) \
do { \
(h).rkey = ntohl((h).rkey); \
(h).rdma_start.lval = ntoh64((h).rdma_start.lval); \
} while (0)
struct mca_btl_openib_rdma_credits_header_t {
mca_btl_openib_control_header_t control;
uint8_t padding[1];
uint8_t qpn;
uint16_t rdma_credits;
};
typedef struct mca_btl_openib_rdma_credits_header_t mca_btl_openib_rdma_credits_header_t;
#define BTL_OPENIB_RDMA_CREDITS_HEADER_HTON(h) \
do { \
h.rdma_credits = htons(h.rdma_credits); \
(h).rdma_credits = htons((h).rdma_credits); \
} while (0)
#define BTL_OPENIB_RDMA_CREDITS_HEADER_NTOH(h) \

Просмотреть файл

@ -638,7 +638,6 @@ static int mca_btl_openib_mca_setup_qps(void)
}
mca_btl_openib_component.rdma_qp = mca_btl_openib_component.num_qps - 1;
mca_btl_openib_component.eager_rdma_qp = 0;
/* Register any MCA params for the connect pseudo-components */

Просмотреть файл

@ -282,7 +282,7 @@ static int qp_create_all(mca_btl_base_endpoint_t* endpoint)
srq = endpoint->endpoint_btl->qps[qp].u.srq_qp.srq;
max_recv_wr = mca_btl_openib_component.qp_infos[qp].rd_num;
max_send_wr = mca_btl_openib_component.qp_infos[qp].u.srq_qp.sd_max
+ BTL_OPENIB_EAGER_RDMA_QP(qp);
+ 1;
}
rc = qp_create_one(endpoint, prio, qp, srq, max_recv_wr, max_send_wr);