Skip to content

Commit

Permalink
UCP/RKEY: Fix review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bureddy committed Oct 31, 2018
1 parent 417895a commit 4b22ebb
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/ucp/core/ucp_rkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

static struct {
ucp_md_map_t md_map;
uint8_t mem_type;
} UCS_S_PACKED ucp_mem_dummy_buffer = {0, 0};
uint8_t mem_type;
} UCS_S_PACKED ucp_mem_dummy_buffer = {0, UCT_MD_MEM_TYPE_HOST};


size_t ucp_rkey_packed_size(ucp_context_h context, ucp_md_map_t md_map)
Expand Down Expand Up @@ -359,6 +359,7 @@ static ucp_lane_index_t ucp_config_find_rma_lane(ucp_context_h context,
ucp_md_index_t md_index;
uct_md_attr_t *md_attr;
uint8_t rkey_index;
int valid_mem_type_lane;
int prio;

for (prio = 0; prio < UCP_MAX_LANES; ++prio) {
Expand All @@ -372,10 +373,12 @@ static ucp_lane_index_t ucp_config_find_rma_lane(ucp_context_h context,
md_index = config->md_index[lane];
md_attr = &context->tl_mds[md_index].attr;

valid_mem_type_lane = (!rkey || ((md_attr->cap.mem_type == mem_type) &&
(md_attr->cap.mem_type == rkey->mem_type)));

if ((md_index != UCP_NULL_RESOURCE) &&
(!(md_attr->cap.flags & UCT_MD_FLAG_NEED_RKEY)) &&
(!rkey || (md_attr->cap.mem_type == mem_type &&
md_attr->cap.mem_type == rkey->mem_type)))
(valid_mem_type_lane))
{
/* Lane does not need rkey, can use the lane with invalid rkey */
*uct_rkey_p = UCT_INVALID_RKEY;
Expand Down

0 comments on commit 4b22ebb

Please sign in to comment.