Skip to content

Commit

Permalink
librdmacm: Connect rdma_connect to the ECE
Browse files Browse the repository at this point in the history
The ECE options are handled to the kernel at the time
of connection request, e.g. rdma_connect().

Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
  • Loading branch information
Leon Romanovsky committed Jun 15, 2020
1 parent 4358b12 commit e18bee2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions librdmacm/cma.c
Expand Up @@ -1706,6 +1706,13 @@ static void ucma_copy_conn_param_to_kern(struct cma_id_private *id_priv,
}
}

static void ucma_copy_ece_param_to_kern_req(struct cma_id_private *id_priv,
struct ucma_abi_ece *dst)
{
dst->vendor_id = id_priv->local_ece.vendor_id;
dst->attr_mod = id_priv->local_ece.options;
}

int rdma_connect(struct rdma_cm_id *id, struct rdma_conn_param *conn_param)
{
uint32_t qp_num = conn_param ? conn_param->qp_num : 0;
Expand Down Expand Up @@ -1738,6 +1745,8 @@ int rdma_connect(struct rdma_cm_id *id, struct rdma_conn_param *conn_param)
ucma_copy_conn_param_to_kern(id_priv, &cmd.conn_param, conn_param,
qp_num, srq);

ucma_copy_ece_param_to_kern_req(id_priv, &cmd.ece);

ret = write(id->channel->fd, &cmd, sizeof cmd);
if (ret != sizeof cmd)
return (ret >= 0) ? ERR(ENODATA) : -1;
Expand Down
6 changes: 6 additions & 0 deletions librdmacm/rdma_cma_abi.h
Expand Up @@ -227,13 +227,19 @@ struct ucma_abi_ud_param {
__u8 reserved2[4]; /* Round to 8-byte boundary to support 32/64 */
};

struct ucma_abi_ece {
__u32 vendor_id;
__u32 attr_mod;
};

struct ucma_abi_connect {
__u32 cmd;
__u16 in;
__u16 out;
struct ucma_abi_conn_param conn_param;
__u32 id;
__u32 reserved;
struct ucma_abi_ece ece;
};

struct ucma_abi_listen {
Expand Down

0 comments on commit e18bee2

Please sign in to comment.