Skip to content

Commit

Permalink
Merge pull request #745 from rleon/ece
Browse files Browse the repository at this point in the history
Add Enhanced Connection Established (ECE)
  • Loading branch information
rleon committed Jun 18, 2020
2 parents 1b6f57e + 74b213d commit 9fc7152
Show file tree
Hide file tree
Showing 33 changed files with 813 additions and 88 deletions.
3 changes: 3 additions & 0 deletions debian/libibverbs1.symbols
Expand Up @@ -7,6 +7,7 @@ libibverbs.so.1 libibverbs1 #MINVER#
IBVERBS_1.7@IBVERBS_1.7 25
IBVERBS_1.8@IBVERBS_1.8 28
IBVERBS_1.9@IBVERBS_1.9 30
IBVERBS_1.10@IBVERBS_1.10 31
(symver)IBVERBS_PRIVATE_25 25
ibv_ack_async_event@IBVERBS_1.0 1.1.6
ibv_ack_async_event@IBVERBS_1.1 1.1.6
Expand Down Expand Up @@ -78,6 +79,7 @@ libibverbs.so.1 libibverbs1 #MINVER#
ibv_qp_to_qp_ex@IBVERBS_1.6 24
ibv_query_device@IBVERBS_1.0 1.1.6
ibv_query_device@IBVERBS_1.1 1.1.6
ibv_query_ece@IBVERBS_1.10 31
ibv_query_gid@IBVERBS_1.0 1.1.6
ibv_query_gid@IBVERBS_1.1 1.1.6
ibv_query_pkey@IBVERBS_1.0 1.1.6
Expand All @@ -100,6 +102,7 @@ libibverbs.so.1 libibverbs1 #MINVER#
ibv_resize_cq@IBVERBS_1.0 1.1.6
ibv_resize_cq@IBVERBS_1.1 1.1.6
ibv_resolve_eth_l2_from_gid@IBVERBS_1.1 1.2.0
ibv_set_ece@IBVERBS_1.10 31
ibv_wc_status_str@IBVERBS_1.1 1.1.6
mbps_to_ibv_rate@IBVERBS_1.1 1.1.8
mult_to_ibv_rate@IBVERBS_1.0 1.1.6
53 changes: 1 addition & 52 deletions debian/librdmacm-dev.install
Expand Up @@ -6,57 +6,6 @@ usr/include/rdma/rsocket.h
usr/lib/*/librdmacm*.so
usr/lib/*/librdmacm.a
usr/lib/*/pkgconfig/librdmacm.pc
usr/share/man/man3/rdma_accept.3
usr/share/man/man3/rdma_ack_cm_event.3
usr/share/man/man3/rdma_bind_addr.3
usr/share/man/man3/rdma_connect.3
usr/share/man/man3/rdma_create_ep.3
usr/share/man/man3/rdma_create_event_channel.3
usr/share/man/man3/rdma_create_id.3
usr/share/man/man3/rdma_create_qp.3
usr/share/man/man3/rdma_create_srq.3
usr/share/man/man3/rdma_dereg_mr.3
usr/share/man/man3/rdma_destroy_ep.3
usr/share/man/man3/rdma_destroy_event_channel.3
usr/share/man/man3/rdma_destroy_id.3
usr/share/man/man3/rdma_destroy_qp.3
usr/share/man/man3/rdma_destroy_srq.3
usr/share/man/man3/rdma_disconnect.3
usr/share/man/man3/rdma_establish.3
usr/share/man/man3/rdma_event_str.3
usr/share/man/man3/rdma_free_devices.3
usr/share/man/man3/rdma_get_cm_event.3
usr/share/man/man3/rdma_get_devices.3
usr/share/man/man3/rdma_get_dst_port.3
usr/share/man/man3/rdma_get_local_addr.3
usr/share/man/man3/rdma_get_peer_addr.3
usr/share/man/man3/rdma_get_recv_comp.3
usr/share/man/man3/rdma_get_request.3
usr/share/man/man3/rdma_get_send_comp.3
usr/share/man/man3/rdma_get_src_port.3
usr/share/man/man3/rdma_getaddrinfo.3
usr/share/man/man3/rdma_init_qp_attr.3
usr/share/man/man3/rdma_join_multicast.3
usr/share/man/man3/rdma_join_multicast_ex.3
usr/share/man/man3/rdma_leave_multicast.3
usr/share/man/man3/rdma_listen.3
usr/share/man/man3/rdma_migrate_id.3
usr/share/man/man3/rdma_notify.3
usr/share/man/man3/rdma_post_read.3
usr/share/man/man3/rdma_post_readv.3
usr/share/man/man3/rdma_post_recv.3
usr/share/man/man3/rdma_post_recvv.3
usr/share/man/man3/rdma_post_send.3
usr/share/man/man3/rdma_post_sendv.3
usr/share/man/man3/rdma_post_ud_send.3
usr/share/man/man3/rdma_post_write.3
usr/share/man/man3/rdma_post_writev.3
usr/share/man/man3/rdma_reg_msgs.3
usr/share/man/man3/rdma_reg_read.3
usr/share/man/man3/rdma_reg_write.3
usr/share/man/man3/rdma_reject.3
usr/share/man/man3/rdma_resolve_addr.3
usr/share/man/man3/rdma_resolve_route.3
usr/share/man/man3/rdma_set_option.3
usr/share/man/man3/rdma_*.3
usr/share/man/man7/rdma_cm.7
usr/share/man/man7/rsocket.7
4 changes: 4 additions & 0 deletions debian/librdmacm1.symbols
Expand Up @@ -3,6 +3,7 @@ librdmacm.so.1 librdmacm1 #MINVER#
RDMACM_1.0@RDMACM_1.0 1.0.15
RDMACM_1.1@RDMACM_1.1 16
RDMACM_1.2@RDMACM_1.2 23
RDMACM_1.3@RDMACM_1.3 31
raccept@RDMACM_1.0 1.0.16
rbind@RDMACM_1.0 1.0.16
rclose@RDMACM_1.0 1.0.16
Expand Down Expand Up @@ -31,6 +32,7 @@ librdmacm.so.1 librdmacm1 #MINVER#
rdma_get_cm_event@RDMACM_1.0 1.0.15
rdma_get_devices@RDMACM_1.0 1.0.15
rdma_get_dst_port@RDMACM_1.0 1.0.19
rdma_get_remote_ece@RDMACM_1.3 31
rdma_get_request@RDMACM_1.0 1.0.15
rdma_get_src_port@RDMACM_1.0 1.0.19
rdma_getaddrinfo@RDMACM_1.0 1.0.15
Expand All @@ -42,8 +44,10 @@ librdmacm.so.1 librdmacm1 #MINVER#
rdma_migrate_id@RDMACM_1.0 1.0.15
rdma_notify@RDMACM_1.0 1.0.15
rdma_reject@RDMACM_1.0 1.0.15
rdma_reject_ece@RDMACM_1.3 31
rdma_resolve_addr@RDMACM_1.0 1.0.15
rdma_resolve_route@RDMACM_1.0 1.0.15
rdma_set_local_ece@RDMACM_1.3 31
rdma_set_option@RDMACM_1.0 1.0.15
rfcntl@RDMACM_1.0 1.0.16
rgetpeername@RDMACM_1.0 1.0.16
Expand Down
9 changes: 7 additions & 2 deletions kernel-headers/rdma/mlx5-abi.h
Expand Up @@ -100,6 +100,7 @@ struct mlx5_ib_alloc_ucontext_req_v2 {
enum mlx5_ib_alloc_ucontext_resp_mask {
MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_CORE_CLOCK_OFFSET = 1UL << 0,
MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_DUMP_FILL_MKEY = 1UL << 1,
MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_ECE = 1UL << 2,
};

enum mlx5_user_cmds_supp_uhw {
Expand Down Expand Up @@ -322,6 +323,8 @@ struct mlx5_ib_create_qp {
__aligned_u64 sq_buf_addr;
__aligned_u64 access_key;
};
__u32 ece_options;
__u32 reserved;
};

/* RX Hash function flags */
Expand Down Expand Up @@ -371,7 +374,7 @@ enum mlx5_ib_create_qp_resp_mask {

struct mlx5_ib_create_qp_resp {
__u32 bfreg_index;
__u32 reserved;
__u32 ece_options;
__u32 comp_mask;
__u32 tirn;
__u32 tisn;
Expand Down Expand Up @@ -420,12 +423,14 @@ struct mlx5_ib_burst_info {
struct mlx5_ib_modify_qp {
__u32 comp_mask;
struct mlx5_ib_burst_info burst_info;
__u32 reserved;
__u32 ece_options;
};

struct mlx5_ib_modify_qp_resp {
__u32 response_length;
__u32 dctn;
__u32 ece_options;
__u32 reserved;
};

struct mlx5_ib_create_wq_resp {
Expand Down
11 changes: 10 additions & 1 deletion kernel-headers/rdma/rdma_user_cm.h
Expand Up @@ -210,10 +210,16 @@ struct rdma_ucm_ud_param {
__u8 reserved[7];
};

struct rdma_ucm_ece {
__u32 vendor_id;
__u32 attr_mod;
};

struct rdma_ucm_connect {
struct rdma_ucm_conn_param conn_param;
__u32 id;
__u32 reserved;
struct rdma_ucm_ece ece;
};

struct rdma_ucm_listen {
Expand All @@ -226,12 +232,14 @@ struct rdma_ucm_accept {
struct rdma_ucm_conn_param conn_param;
__u32 id;
__u32 reserved;
struct rdma_ucm_ece ece;
};

struct rdma_ucm_reject {
__u32 id;
__u8 private_data_len;
__u8 reserved[3];
__u8 reason;
__u8 reserved[2];
__u8 private_data[RDMA_MAX_PRIVATE_DATA];
};

Expand Down Expand Up @@ -291,6 +299,7 @@ struct rdma_ucm_event_resp {
struct rdma_ucm_ud_param ud;
} param;
__u32 reserved;
struct rdma_ucm_ece ece;
};

/* Option levels */
Expand Down
2 changes: 1 addition & 1 deletion libibverbs/CMakeLists.txt
Expand Up @@ -21,7 +21,7 @@ configure_file("libibverbs.map.in"

rdma_library(ibverbs "${CMAKE_CURRENT_BINARY_DIR}/libibverbs.map"
# See Documentation/versioning.md
1 1.9.${PACKAGE_VERSION}
1 1.10.${PACKAGE_VERSION}
all_providers.c
cmd.c
cmd_ah.c
Expand Down
2 changes: 2 additions & 0 deletions libibverbs/driver.h
Expand Up @@ -339,6 +339,7 @@ struct verbs_context_ops {
const struct ibv_query_device_ex_input *input,
struct ibv_device_attr_ex *attr,
size_t attr_size);
int (*query_ece)(struct ibv_qp *qp, struct ibv_ece *ece);
int (*query_port)(struct ibv_context *context, uint8_t port_num,
struct ibv_port_attr *port_attr);
int (*query_qp)(struct ibv_qp *qp, struct ibv_qp_attr *attr,
Expand All @@ -359,6 +360,7 @@ struct verbs_context_ops {
int (*rereg_mr)(struct verbs_mr *vmr, int flags, struct ibv_pd *pd,
void *addr, size_t length, int access);
int (*resize_cq)(struct ibv_cq *cq, int cqe);
int (*set_ece)(struct ibv_qp *qp, struct ibv_ece *ece);
};

static inline struct verbs_device *
Expand Down
14 changes: 14 additions & 0 deletions libibverbs/dummy_ops.c
Expand Up @@ -387,6 +387,11 @@ static int query_device_ex(struct ibv_context *context,
return ibv_query_device(context, &attr->orig_attr);
}

static int query_ece(struct ibv_qp *qp, struct ibv_ece *ece)
{
return EOPNOTSUPP;
}

static int query_port(struct ibv_context *context, uint8_t port_num,
struct ibv_port_attr *port_attr)
{
Expand Down Expand Up @@ -450,6 +455,11 @@ static int resize_cq(struct ibv_cq *cq, int cqe)
return EOPNOTSUPP;
}

static int set_ece(struct ibv_qp *qp, struct ibv_ece *ece)
{
return EOPNOTSUPP;
}

/*
* Ops in verbs_dummy_ops simply return an EOPNOTSUPP error code when called, or
* do nothing. They are placed in the ops structures if the provider does not
Expand Down Expand Up @@ -519,6 +529,7 @@ const struct verbs_context_ops verbs_dummy_ops = {
post_srq_recv,
query_device,
query_device_ex,
query_ece,
query_port,
query_qp,
query_rt_values,
Expand All @@ -529,6 +540,7 @@ const struct verbs_context_ops verbs_dummy_ops = {
req_notify_cq,
rereg_mr,
resize_cq,
set_ece,
};

/*
Expand Down Expand Up @@ -635,6 +647,7 @@ void verbs_set_ops(struct verbs_context *vctx,
SET_OP(ctx, post_srq_recv);
SET_PRIV_OP(ctx, query_device);
SET_OP(vctx, query_device_ex);
SET_PRIV_OP_IC(vctx, query_ece);
SET_PRIV_OP_IC(ctx, query_port);
SET_PRIV_OP(ctx, query_qp);
SET_OP(vctx, query_rt_values);
Expand All @@ -645,6 +658,7 @@ void verbs_set_ops(struct verbs_context *vctx,
SET_OP(ctx, req_notify_cq);
SET_PRIV_OP(ctx, rereg_mr);
SET_PRIV_OP(ctx, resize_cq);
SET_PRIV_OP_IC(vctx, set_ece);

#undef SET_OP
#undef SET_OP2
Expand Down
6 changes: 6 additions & 0 deletions libibverbs/libibverbs.map.in
Expand Up @@ -131,6 +131,12 @@ IBVERBS_1.9 {
ibv_get_device_index;
} IBVERBS_1.8;

IBVERBS_1.10 {
global:
ibv_query_ece;
ibv_set_ece;
} IBVERBS_1.9;

/* If any symbols in this stanza change ABI then the entire staza gets a new symbol
version. See the top level CMakeLists.txt for this setting. */

Expand Down
2 changes: 2 additions & 0 deletions libibverbs/man/CMakeLists.txt
Expand Up @@ -52,6 +52,7 @@ rdma_man_pages(
ibv_post_srq_recv.3
ibv_query_device.3
ibv_query_device_ex.3
ibv_query_ece.3.md
ibv_query_gid.3.md
ibv_query_pkey.3.md
ibv_query_port.3
Expand All @@ -66,6 +67,7 @@ rdma_man_pages(
ibv_req_notify_cq.3.md
ibv_rereg_mr.3.md
ibv_resize_cq.3.md
ibv_set_ece.3.md
ibv_srq_pingpong.1
ibv_uc_pingpong.1
ibv_ud_pingpong.1
Expand Down
75 changes: 75 additions & 0 deletions libibverbs/man/ibv_query_ece.3.md
@@ -0,0 +1,75 @@
---
date: 2020-01-22
footer: libibverbs
header: "Libibverbs Programmer's Manual"
layout: page
license: 'Licensed under the OpenIB.org BSD license (FreeBSD Variant) - See COPYING.md'
section: 3
title: IBV_QUERY_ECE
---

# NAME

ibv_query_ece - query ECE options.

# SYNOPSIS

```c
#include <infiniband/verbs.h>

int ibv_query_ece(struct ibv_qp *qp, struct ibv_ece *ece);
```
# DESCRIPTION
**ibv_query_ece()** query ECE options.
Return to the user current ECE state for the QP.
# ARGUMENTS
*qp*
: The queue pair (QP) associated with the ECE options.
## *ece* Argument
: The ECE values.
```c
struct ibv_ece {
uint32_t vendor_id;
uint32_t options;
uint32_t comp_mask;
};
```

*vendor_id*
: Unique identifier of the provider vendor on the network.
The providers will set IEEE OUI here to distinguish itself
in non-homogenius network.

*options*
: Provider specific attributes which are supported.

*comp_mask*
: Bitmask specifying what fields in the structure are valid.

# RETURN VALUE

**ibv_query_ece()** returns 0 when the call was successful, or the errno value
which indicates the failure reason.

*EOPNOTSUPP*
: libibverbs or provider driver doesn't support the ibv_set_ece() verb.

*EINVAL*
: In one of the following:
o The QP is invalid.
o The ECE options are invalid.

# SEE ALSO

**ibv_set_ece**(3),

# AUTHOR

Leon Romanovsky <leonro@mellanox.com>

0 comments on commit 9fc7152

Please sign in to comment.