Skip to content

Commit

Permalink
librdmacm: Return ECE results through rdma_accept
Browse files Browse the repository at this point in the history
Passive side (server) returns its answer through REP message,
which is constructed as a result of rdma_accept().

Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
  • Loading branch information
Leon Romanovsky committed Jun 15, 2020
1 parent e18bee2 commit cc0a636
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions librdmacm/cma.c
Expand Up @@ -1827,6 +1827,14 @@ int rdma_get_request(struct rdma_cm_id *listen, struct rdma_cm_id **id)
return ret;
}

static void ucma_copy_ece_param_to_kern_rep(struct cma_id_private *id_priv,
struct ucma_abi_ece *dst)
{
/* Return result with same ID as received. */
dst->vendor_id = id_priv->remote_ece.vendor_id;
dst->attr_mod = id_priv->local_ece.options;
}

int rdma_accept(struct rdma_cm_id *id, struct rdma_conn_param *conn_param)
{
uint32_t qp_num = id->qp ? id->qp->qp_num : conn_param->qp_num;
Expand Down Expand Up @@ -1868,6 +1876,7 @@ int rdma_accept(struct rdma_cm_id *id, struct rdma_conn_param *conn_param)
cmd.uid = (uintptr_t) id_priv;
ucma_copy_conn_param_to_kern(id_priv, &cmd.conn_param, conn_param,
qp_num, srq);
ucma_copy_ece_param_to_kern_rep(id_priv, &cmd.ece);

ret = write(id->channel->fd, &cmd, sizeof cmd);
if (ret != sizeof cmd) {
Expand Down
1 change: 1 addition & 0 deletions librdmacm/rdma_cma_abi.h
Expand Up @@ -258,6 +258,7 @@ struct ucma_abi_accept {
struct ucma_abi_conn_param conn_param;
__u32 id;
__u32 reserved;
struct ucma_abi_ece ece;
};

struct ucma_abi_reject {
Expand Down

0 comments on commit cc0a636

Please sign in to comment.