btl/uct: fix bug when using a transport without zero-copy
This commit fixes a crash that can occur if a transport is usable but doesn't have zero-copy support. In this case do not attempt to use zero-copy and set the max send size off the bcopy limit. Signed-off-by: Nathan Hjelm <hjelmn@google.com>
Этот коммит содержится в:
родитель
526775dfd7
Коммит
8473a66466
@ -175,7 +175,8 @@ int mca_btl_uct_send_frag (mca_btl_uct_module_t *uct_btl, mca_btl_uct_base_frag_
|
||||
if (!context->in_am_callback) {
|
||||
mca_btl_uct_context_lock (context);
|
||||
/* attempt to post the fragment */
|
||||
if (NULL != frag->base.super.registration) {
|
||||
if (NULL != frag->base.super.registration &&
|
||||
(context->uct_iface_attr.cap.flags & UCT_IFACE_FLAG_AM_ZCOPY)) {
|
||||
frag->comp.dev_context = context;
|
||||
ucs_status = uct_ep_am_zcopy (ep_handle, MCA_BTL_UCT_FRAG, &frag->header, sizeof (frag->header),
|
||||
&frag->uct_iov, 1, 0, &frag->comp.uct_comp);
|
||||
|
@ -461,8 +461,14 @@ static void mca_btl_uct_set_tl_am (mca_btl_uct_module_t *module, mca_btl_uct_tl_
|
||||
tl->max_device_contexts = mca_btl_uct_component.num_contexts_per_module;
|
||||
}
|
||||
|
||||
module->super.btl_max_send_size = MCA_BTL_UCT_TL_ATTR(tl, 0).cap.am.max_zcopy - sizeof (mca_btl_uct_am_header_t);
|
||||
module->super.btl_eager_limit = MCA_BTL_UCT_TL_ATTR(tl, 0).cap.am.max_bcopy - sizeof (mca_btl_uct_am_header_t);
|
||||
module->super.btl_eager_limit = MCA_BTL_UCT_TL_ATTR(tl, 0).cap.am.max_bcopy -
|
||||
sizeof (mca_btl_uct_am_header_t);
|
||||
if (MCA_BTL_UCT_TL_ATTR(tl, 0).cap.flags & UCT_IFACE_FLAG_AM_ZCOPY) {
|
||||
module->super.btl_max_send_size = MCA_BTL_UCT_TL_ATTR(tl, 0).cap.am.max_zcopy -
|
||||
sizeof (mca_btl_uct_am_header_t);
|
||||
} else {
|
||||
module->super.btl_max_send_size = module->super.btl_eager_limit;
|
||||
}
|
||||
}
|
||||
|
||||
static int mca_btl_uct_set_tl_conn (mca_btl_uct_module_t *module, mca_btl_uct_tl_t *tl)
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user