1
1

btl: fix warning about enum type and modify btl_sendi to allow the

value NULL for the descriptor

The send inline optimization uses the btl_sendi function to achieve
lower latency and higher message rates. The problem is the btl_sendi
function was allowed to return a descriptor to the caller. This is fine
for some paths but not ok for the send inline optimization. To fix
this the btl now must be able to handle descriptor = NULL.
Этот коммит содержится в:
Nathan Hjelm 2014-11-04 14:09:37 -07:00 коммит произвёл Nathan Hjelm
родитель 271818f887
Коммит 4ccb20b097
5 изменённых файлов: 18 добавлений и 8 удалений

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

@ -279,7 +279,7 @@ enum {
/** The btl supports atomic bitwise exclusive or */
MCA_BTL_ATOMIC_SUPPORTS_XOR = 0x00000800,
/** The btl supports atomic compare-and-swap */
MCA_BTL_ATOMIC_SUPPORTS_CSWAP = 0x80000000,
MCA_BTL_ATOMIC_SUPPORTS_CSWAP = 0x10000000,
};
enum mca_btl_base_atomic_op_t {
@ -839,7 +839,8 @@ typedef int (*mca_btl_base_module_send_fn_t)(
* @param flags (IN) Flags.
* @param tag (IN) The tag value used to notify the peer.
* @param descriptor (OUT) The descriptor to be returned unable to be sent immediately
* (may be NULL).
*
* @retval OPAL_SUCCESS The send was successfully queued
* @retval OPAL_ERROR The send failed
* @retval OPAL_ERR_UNREACH The endpoint is not reachable

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

@ -223,7 +223,9 @@ int mca_btl_scif_sendi (struct mca_btl_base_module_t *btl,
rc = mca_btl_scif_send_get_buffer (endpoint, length, &base);
if (OPAL_UNLIKELY(OPAL_SUCCESS != rc)) {
*descriptor = NULL;
if (NULL != descriptor) {
*descriptor = NULL;
}
return OPAL_ERR_OUT_OF_RESOURCE;
}

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

@ -947,9 +947,12 @@ int mca_btl_sm_sendi( struct mca_btl_base_module_t* btl,
return OPAL_SUCCESS;
}
/* presumably, this code path will never get executed */
*descriptor = mca_btl_sm_alloc( btl, endpoint, order,
payload_size + header_size, flags);
if (NULL != descriptor) {
/* presumably, this code path will never get executed */
*descriptor = mca_btl_sm_alloc( btl, endpoint, order,
payload_size + header_size, flags);
}
return OPAL_ERR_RESOURCE_BUSY;
}

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

@ -135,7 +135,9 @@ int mca_btl_ugni_sendi (struct mca_btl_base_module_t *btl,
return OPAL_SUCCESS;
} while (0);
*descriptor = NULL;
if (NULL != descriptor) {
*descriptor = NULL;
}
return OPAL_ERR_OUT_OF_RESOURCE;
}

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

@ -98,7 +98,9 @@ int mca_btl_vader_sendi (struct mca_btl_base_module_t *btl,
/* write the fragment pointer to peer's the FIFO. the progress function will return the fragment */
if (!vader_fifo_write_ep (frag->hdr, endpoint)) {
*descriptor = &frag->base;
if (descriptor) {
*descriptor = &frag->base;
}
return OPAL_ERR_OUT_OF_RESOURCE;
}