From: Leon Romanovsky <leonro@xxxxxxxxxxxx> The ECE options are handled to the kernel at the time of connection request, e.g. rdma_connect(). Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx> --- librdmacm/cma.c | 9 +++++++++ librdmacm/rdma_cma_abi.h | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/librdmacm/cma.c b/librdmacm/cma.c index 8d2342b5..e912410b 100644 --- a/librdmacm/cma.c +++ b/librdmacm/cma.c @@ -1547,6 +1547,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; @@ -1579,6 +1586,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; diff --git a/librdmacm/rdma_cma_abi.h b/librdmacm/rdma_cma_abi.h index ab4adb00..6451862e 100644 --- a/librdmacm/rdma_cma_abi.h +++ b/librdmacm/rdma_cma_abi.h @@ -223,6 +223,11 @@ 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; @@ -230,6 +235,7 @@ struct ucma_abi_connect { struct ucma_abi_conn_param conn_param; __u32 id; __u32 reserved; + struct ucma_abi_ece ece; }; struct ucma_abi_listen { -- 2.24.1