Skip to content

Commit 39e9afb

Browse files
committed
Fix the put and get max's to take into account the header length.
Signed-off-by: Austen Lauria <awlauria@us.ibm.com>
1 parent 70a6244 commit 39e9afb

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

opal/mca/btl/base/btl_base_am_rdma.c

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -458,19 +458,14 @@ mca_btl_base_rdma_start(mca_btl_base_module_t *btl, struct mca_btl_base_endpoint
458458
if (sizeof(*hdr) + size <= btl->btl_eager_limit) {
459459
/* just go ahead and send the data */
460460
packet_size += size;
461-
} else if (!mca_btl_base_rdma_use_rdma_get(btl)) {
462-
packet_size += size;
463461
} else if (!mca_btl_base_rdma_use_rdma_get (btl)) {
464462
packet_size += size_t_min (size, btl->btl_max_send_size - sizeof (*hdr));
465463
} else {
466464
use_rdma = true;
467465
}
468466
} else if (MCA_BTL_BASE_AM_GET == type) {
469-
if (sizeof(mca_btl_base_rdma_response_hdr_t) + size <= btl->btl_eager_limit) {
470-
packet_size += size;
471-
} else if (!mca_btl_base_rdma_use_rdma_put(btl)) {
472-
packet_size += size_t_min(size, btl->btl_max_send_size
473-
- sizeof(mca_btl_base_rdma_response_hdr_t));
467+
if (!mca_btl_base_rdma_use_rdma_put(btl)) {
468+
packet_size += size_t_min(size, btl->btl_max_send_size - sizeof(*hdr));
474469
} else {
475470
use_rdma = true;
476471
}
@@ -1094,19 +1089,19 @@ int mca_btl_base_am_rdma_init(mca_btl_base_module_t *btl)
10941089
}
10951090

10961091
if (!(btl->btl_flags & MCA_BTL_FLAGS_PUT)) {
1097-
BTL_VERBOSE(("Enabling AM-based RDMA put for BTL %p", btl));
10981092
btl->btl_flags |= MCA_BTL_FLAGS_PUT_AM;
1099-
btl->btl_put_limit = max_operation_size;
1093+
btl->btl_put_limit = max_operation_size - sizeof(mca_btl_base_rdma_hdr_t);
11001094
btl->btl_put_alignment = operation_alignment;
11011095
btl->btl_put = mca_btl_base_am_rdma_put;
1096+
BTL_VERBOSE(("Enabling AM-based RDMA put for BTL %p. max put = %zu", btl, btl->btl_put_limit));
11021097
}
11031098

11041099
if (!(btl->btl_flags & MCA_BTL_FLAGS_GET)) {
1105-
BTL_VERBOSE(("Enabling AM-based RDMA get for BTL %p", btl));
11061100
btl->btl_flags |= MCA_BTL_FLAGS_GET_AM;
1107-
btl->btl_get_limit = max_operation_size;
1101+
btl->btl_get_limit = max_operation_size - sizeof(mca_btl_base_rdma_response_hdr_t);
11081102
btl->btl_get_alignment = operation_alignment;
11091103
btl->btl_get = mca_btl_base_am_rdma_get;
1104+
BTL_VERBOSE(("Enabling AM-based RDMA get for BTL %p. max get = %zu", btl, btl->btl_get_limit));
11101105
}
11111106

11121107
if (!(btl->btl_flags & MCA_BTL_FLAGS_ATOMIC_FOPS)) {

0 commit comments

Comments
 (0)