Skip to content

Commit

Permalink
UCT/RDMACM: fix uct_rdmacm_cm_cqs hash key
Browse files Browse the repository at this point in the history
Backport from master branch:
    openucx#6495

Signed-off-by: Evgeny Leksikov <evgenylek@mellanox.com>
  • Loading branch information
changchengx committed Jan 24, 2022
1 parent f124663 commit 1f99b8e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/uct/ib/rdmacm/rdmacm_cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,14 @@ ucs_status_t uct_rdmacm_cm_reject(struct rdma_cm_id *id)
}

ucs_status_t uct_rdmacm_cm_get_cq(uct_rdmacm_cm_t *cm, struct ibv_context *verbs,
uint32_t pd_key, struct ibv_cq **cq_p)
struct ibv_cq **cq_p)
{
struct ibv_cq *cq;
khiter_t iter;
int ret;

iter = kh_put(uct_rdmacm_cm_cqs, &cm->cqs, pd_key, &ret);
iter = kh_put(uct_rdmacm_cm_cqs, &cm->cqs,
ibv_get_device_guid(verbs->device), &ret);
if (ret == -1) {
ucs_error("cm %p: cannot allocate hash entry for CQ", cm);
return UCS_ERR_NO_MEMORY;
Expand Down
4 changes: 2 additions & 2 deletions src/uct/ib/rdmacm/rdmacm_cm.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <ucs/datastruct/khash.h>


KHASH_MAP_INIT_INT(uct_rdmacm_cm_cqs, struct ibv_cq*);
KHASH_MAP_INIT_INT64(uct_rdmacm_cm_cqs, struct ibv_cq*);


/**
Expand Down Expand Up @@ -46,7 +46,7 @@ ucs_status_t uct_rdmacm_cm_ack_event(struct rdma_cm_event *event);
ucs_status_t uct_rdmacm_cm_reject(struct rdma_cm_id *id);

ucs_status_t uct_rdmacm_cm_get_cq(uct_rdmacm_cm_t *cm, struct ibv_context *verbs,
uint32_t pd_key, struct ibv_cq **cq);
struct ibv_cq **cq);

void uct_rdmacm_cm_cqs_cleanup(uct_rdmacm_cm_t *cm);

Expand Down
2 changes: 1 addition & 1 deletion src/uct/ib/rdmacm/rdmacm_cm_ep.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ uct_rdamcm_cm_ep_set_qp_num(struct rdma_conn_param *conn_param,
ucs_status_t status;

status = uct_rdmacm_cm_get_cq(uct_rdmacm_cm_ep_get_cm(cep), cep->id->verbs,
cep->id->pd->handle, &cq);
&cq);
if (status != UCS_OK) {
return status;
}
Expand Down

0 comments on commit 1f99b8e

Please sign in to comment.