1
1

This is the complete commit for the TCP header issue. Jeff commit a partial

fix (r14749) and then backed it out (r14753).

As we are unable to send more than a 32 bits length over TCP in one go, there
is no reason to have an uint64 length in the header. This reduce the size
of the TCP header.

This commit was SVN r14755.

The following SVN revision numbers were found above:
  r14749 --> open-mpi/ompi@48c026ce6b
  r14753 --> open-mpi/ompi@28ed850b4c
Этот коммит содержится в:
George Bosilca 2007-05-24 16:40:49 +00:00
родитель f744e09462
Коммит 7459ab45f1
2 изменённых файлов: 25 добавлений и 35 удалений

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

@ -247,49 +247,45 @@ mca_btl_base_descriptor_t* mca_btl_tcp_prepare_src(
size_t max_data = *size;
int rc;
if( OPAL_UNLIKELY(max_data > UINT32_MAX) ) { /* limit the size to what we support */
max_data = (size_t)UINT32_MAX;
}
/*
* if we aren't pinning the data and the requested size is less
* than the eager limit pack into a fragment from the eager pool
*/
*/
if (max_data+reserve <= btl->btl_eager_limit) {
MCA_BTL_TCP_FRAG_ALLOC_EAGER(frag, rc);
}
/*
* otherwise pack as much data as we can into a fragment
* that is the max send size.
*/
else {
} else {
/*
* otherwise pack as much data as we can into a fragment
* that is the max send size.
*/
MCA_BTL_TCP_FRAG_ALLOC_MAX(frag, rc);
}
if(NULL == frag) {
if( OPAL_UNLIKELY(NULL == frag) ) {
return NULL;
}
frag->segments[0].seg_addr.pval = (frag + 1);
frag->segments[0].seg_len = reserve;
if(max_data == 0) {
frag->base.des_src_cnt = 1;
} else if(ompi_convertor_need_buffers(convertor)) {
frag->base.des_src_cnt = 1;
if(ompi_convertor_need_buffers(convertor)) {
if (max_data + reserve > frag->size) {
max_data = frag->size - reserve;
}
iov.iov_len = max_data;
iov.iov_base = (IOVBASE_TYPE*)(((unsigned char*)(frag->segments[0].seg_addr.pval)) + reserve);
rc = ompi_convertor_pack(convertor, &iov, &iov_count, &max_data );
if( rc < 0 ) {
if( OPAL_UNLIKELY(rc < 0) ) {
mca_btl_tcp_free(btl, &frag->base);
return NULL;
}
frag->segments[0].seg_len += max_data;
frag->base.des_src_cnt = 1;
} else {
@ -297,7 +293,7 @@ mca_btl_base_descriptor_t* mca_btl_tcp_prepare_src(
iov.iov_base = NULL;
rc = ompi_convertor_pack(convertor, &iov, &iov_count, &max_data );
if( rc < 0 ) {
if( OPAL_UNLIKELY(rc < 0) ) {
mca_btl_tcp_free(btl, &frag->base);
return NULL;
}
@ -341,8 +337,11 @@ mca_btl_base_descriptor_t* mca_btl_tcp_prepare_dst(
mca_btl_tcp_frag_t* frag;
int rc;
if( OPAL_UNLIKELY((*size) > UINT32_MAX) ) { /* limit the size to what we support */
*size = (size_t)UINT32_MAX;
}
MCA_BTL_TCP_FRAG_ALLOC_USER(frag, rc);
if(NULL == frag) {
if( OPAL_UNLIKELY(NULL == frag) ) {
return NULL;
}

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

@ -25,9 +25,7 @@
#include "btl_tcp.h"
#include "opal/types.h"
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
#endif
BEGIN_C_DECLS
/**
* TCP header.
@ -37,32 +35,25 @@ extern "C" {
#define MCA_BTL_TCP_HDR_TYPE_PUT 2
#define MCA_BTL_TCP_HDR_TYPE_GET 3
struct mca_btl_tcp_hdr_t {
mca_btl_base_header_t base;
uint8_t type;
uint16_t count;
#if OMPI_ENABLE_HETEROGENEOUS_SUPPORT
/* uint64_t may be required to be 8 byte aligned. */
uint8_t padding[4];
#endif
uint64_t size;
uint32_t size;
};
typedef struct mca_btl_tcp_hdr_t mca_btl_tcp_hdr_t;
#define MCA_BTL_TCP_HDR_HTON(hdr) \
do { \
hdr.count = htons(hdr.count); \
hdr.size = hton64(hdr.size); \
hdr.size = htonl(hdr.size); \
} while (0)
#define MCA_BTL_TCP_HDR_NTOH(hdr) \
do { \
hdr.count = ntohs(hdr.count); \
hdr.size = ntoh64(hdr.size); \
hdr.size = ntohl(hdr.size); \
} while (0)
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
END_C_DECLS
#endif