Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit d728a4d

Browse files
committed
btl/openib: set send flags only after endpoint is connected
The max inline send size on a queue pair is not available until after the endpoint is connected. Before this commit the send flags (including the inline flag) were set before this value was initialized. This commit moves setting the send_flags down to mca_btl_openib_put_internal which is only called after the endpoint is connected. This fixes a bug when using osc/rdma. Signed-off-by: Nathan Hjelm <[email protected]> (cherry picked from commit open-mpi/ompi@5e13e1a) Signed-off-by: Nathan Hjelm <[email protected]>
1 parent c71996e commit d728a4d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

opal/mca/btl/openib/btl_openib_put.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ int mca_btl_openib_put (mca_btl_base_module_t *btl, struct mca_btl_base_endpoint
8585

8686
/* post descriptor */
8787
to_out_frag(frag)->sr_desc.opcode = IBV_WR_RDMA_WRITE;
88-
to_out_frag(frag)->sr_desc.send_flags = ib_send_flags(size, &(ep->qps[qp]), 1);
8988
to_out_frag(frag)->sr_desc.wr.rdma.remote_addr = remote_address;
9089

9190
qp_inflight_wqe_to_frag(ep, qp, to_com_frag(frag));
@@ -140,11 +139,14 @@ int mca_btl_openib_put_internal (mca_btl_base_module_t *btl, struct mca_btl_base
140139
struct ibv_send_wr *bad_wr;
141140
int rc;
142141

142+
/* NTH: the inline send size and remote SRQ number are only available once the endpoint is
143+
* connected. By setting these values here instead of mca_btl_openib_put we guarantee
144+
* both fields are initialized */
145+
to_out_frag(frag)->sr_desc.send_flags = ib_send_flags (to_com_frag(frag)->sg_entry.length,
146+
&(ep->qps[qp]), 1);
147+
143148
#if HAVE_XRC
144149
if (MCA_BTL_XRC_ENABLED && BTL_OPENIB_QP_TYPE_XRC(qp)) {
145-
/* NTH: the remote SRQ number is only available once the endpoint is connected. By
146-
* setting the value here instead of mca_btl_openib_put we guarantee the rem_srqs
147-
* array is initialized. */
148150
#if OPAL_HAVE_CONNECTX_XRC
149151
to_out_frag(frag)->sr_desc.xrc_remote_srq_num = ep->rem_info.rem_srqs[qp].rem_srq_num;
150152
#elif OPAL_HAVE_CONNECTX_XRC_DOMAINS

0 commit comments

Comments
 (0)