From: Patrisious Haddad <phaddad@xxxxxxxxxx> Introduce ibv_query_qp_data_in_order() verb, this enables an application to check whether the receiving data of the local QP is guaranteed to be in order for a given operation within its WQE. Once true, it allows user to poll for data instead of poll for completion. A detailed man page was added as well. Signed-off-by: Patrisious Haddad <phaddad@xxxxxxxxxx> Reviewed-by: Maor Gottlieb <maorg@xxxxxxxxxx> Signed-off-by: Yishai Hadas <yishaih@xxxxxxxxxx> --- debian/libibverbs1.symbols | 2 + libibverbs/CMakeLists.txt | 2 +- libibverbs/driver.h | 2 + libibverbs/dummy_ops.c | 8 ++++ libibverbs/libibverbs.map.in | 5 +++ libibverbs/man/CMakeLists.txt | 1 + libibverbs/man/ibv_query_qp_data_in_order.3.md | 62 ++++++++++++++++++++++++++ libibverbs/verbs.c | 6 +++ libibverbs/verbs.h | 14 ++++++ 9 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 libibverbs/man/ibv_query_qp_data_in_order.3.md diff --git a/debian/libibverbs1.symbols b/debian/libibverbs1.symbols index e7453b5..7b6bc8f 100644 --- a/debian/libibverbs1.symbols +++ b/debian/libibverbs1.symbols @@ -11,6 +11,7 @@ libibverbs.so.1 libibverbs1 #MINVER# IBVERBS_1.11@IBVERBS_1.11 32 IBVERBS_1.12@IBVERBS_1.12 34 IBVERBS_1.13@IBVERBS_1.13 35 + IBVERBS_1.14@IBVERBS_1.14 36 (symver)IBVERBS_PRIVATE_34 34 _ibv_query_gid_ex@IBVERBS_1.11 32 _ibv_query_gid_table@IBVERBS_1.11 32 @@ -98,6 +99,7 @@ libibverbs.so.1 libibverbs1 #MINVER# ibv_query_port@IBVERBS_1.1 1.1.6 ibv_query_qp@IBVERBS_1.0 1.1.6 ibv_query_qp@IBVERBS_1.1 1.1.6 + ibv_query_qp_data_in_order@IBVERBS_1.14 36 ibv_query_srq@IBVERBS_1.0 1.1.6 ibv_query_srq@IBVERBS_1.1 1.1.6 ibv_rate_to_mbps@IBVERBS_1.1 1.1.8 diff --git a/libibverbs/CMakeLists.txt b/libibverbs/CMakeLists.txt index 16df2c5..3c486b9 100644 --- a/libibverbs/CMakeLists.txt +++ b/libibverbs/CMakeLists.txt @@ -21,7 +21,7 @@ configure_file("libibverbs.map.in" rdma_library(ibverbs "${CMAKE_CURRENT_BINARY_DIR}/libibverbs.map" # See Documentation/versioning.md - 1 1.13.${PACKAGE_VERSION} + 1 1.14.${PACKAGE_VERSION} all_providers.c cmd.c cmd_ah.c diff --git a/libibverbs/driver.h b/libibverbs/driver.h index 926023b..8b2e045 100644 --- a/libibverbs/driver.h +++ b/libibverbs/driver.h @@ -370,6 +370,8 @@ struct verbs_context_ops { struct ibv_port_attr *port_attr); int (*query_qp)(struct ibv_qp *qp, struct ibv_qp_attr *attr, int attr_mask, struct ibv_qp_init_attr *init_attr); + int (*query_qp_data_in_order)(struct ibv_qp *qp, enum ibv_wr_opcode op, + uint32_t flags); int (*query_rt_values)(struct ibv_context *context, struct ibv_values_ex *values); int (*query_srq)(struct ibv_srq *srq, struct ibv_srq_attr *srq_attr); diff --git a/libibverbs/dummy_ops.c b/libibverbs/dummy_ops.c index 5ed67bf..bf70775 100644 --- a/libibverbs/dummy_ops.c +++ b/libibverbs/dummy_ops.c @@ -397,6 +397,12 @@ static int query_ece(struct ibv_qp *qp, struct ibv_ece *ece) return EOPNOTSUPP; } +static int query_qp_data_in_order(struct ibv_qp *qp, enum ibv_wr_opcode op, + uint32_t flags) +{ + return 0; +} + static int query_port(struct ibv_context *context, uint8_t port_num, struct ibv_port_attr *port_attr) { @@ -559,6 +565,7 @@ const struct verbs_context_ops verbs_dummy_ops = { query_ece, query_port, query_qp, + query_qp_data_in_order, query_rt_values, query_srq, read_counters, @@ -683,6 +690,7 @@ void verbs_set_ops(struct verbs_context *vctx, SET_PRIV_OP_IC(vctx, query_ece); SET_PRIV_OP_IC(ctx, query_port); SET_PRIV_OP(ctx, query_qp); + SET_PRIV_OP_IC(ctx, query_qp_data_in_order); SET_OP(vctx, query_rt_values); SET_OP(vctx, read_counters); SET_PRIV_OP(ctx, query_srq); diff --git a/libibverbs/libibverbs.map.in b/libibverbs/libibverbs.map.in index 7c0fb6a..0e39428 100644 --- a/libibverbs/libibverbs.map.in +++ b/libibverbs/libibverbs.map.in @@ -160,6 +160,11 @@ IBVERBS_1.13 { ibv_unimport_dm; } IBVERBS_1.12; +IBVERBS_1.14 { + global: + ibv_query_qp_data_in_order; +} IBVERBS_1.13; + /* 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. */ diff --git a/libibverbs/man/CMakeLists.txt b/libibverbs/man/CMakeLists.txt index 4d96e80..712a30f 100644 --- a/libibverbs/man/CMakeLists.txt +++ b/libibverbs/man/CMakeLists.txt @@ -64,6 +64,7 @@ rdma_man_pages( ibv_query_pkey.3.md ibv_query_port.3 ibv_query_qp.3 + ibv_query_qp_data_in_order.3.md ibv_query_rt_values_ex.3 ibv_query_srq.3 ibv_rate_to_mbps.3.md diff --git a/libibverbs/man/ibv_query_qp_data_in_order.3.md b/libibverbs/man/ibv_query_qp_data_in_order.3.md new file mode 100644 index 0000000..7558a92 --- /dev/null +++ b/libibverbs/man/ibv_query_qp_data_in_order.3.md @@ -0,0 +1,62 @@ +--- +date: 2020-3-3 +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_qp_data_in_order +--- + +# NAME + +ibv_query_qp_data_in_order - check if qp data is guaranteed to be in order. + +# SYNOPSIS + +```c +#include <infiniband/verbs.h> + +int ibv_query_qp_data_in_order(struct ibv_qp *qp, enum ibv_wr_opcode op, uint32_t flags); + +``` + + +# DESCRIPTION + +**ibv_query_qp_data_in_order()** Checks whether WQE data is guaranteed to be +written in-order, and thus reader may poll for data instead of poll for completion. +This function indicates data is written in-order within each WQE, but cannot be used to determine ordering between separate WQEs. +This function describes ordering at the receiving side of the QP, not the sending side. + +# ARGUMENTS +*qp* +: The local queue pair (QP) to query. + +*op* +: The operation type to query about. Different operation types may write data in a different order. + For RDMA read operations: describes ordering of RDMA reads posted on this local QP. + For RDMA write operations: describes ordering of remote RDMA writes being done into this local QP. + For RDMA send operations: describes ordering of remote RDMA sends being done into this local QP. + This function should not be used to determine ordering of other operation types. + +*flags* +: Extra field for future input. For now must be 0. + +# RETURN VALUE + +**ibv_query_qp_data_in_order()** Returns 1 if the data is guaranteed to be written in-order, 0 otherwise. + +# NOTES + +Return value is valid only when the data is read by the CPU and relaxed ordering MR is not the target of the transfer. + +# SEE ALSO + +**ibv_query_qp**(3) + +# AUTHOR + +Patrisious Haddad <phaddad@xxxxxxxxxx> + +Yochai Cohen <yochai@xxxxxxxxxx> diff --git a/libibverbs/verbs.c b/libibverbs/verbs.c index b2cba3f..19ff12f 100644 --- a/libibverbs/verbs.c +++ b/libibverbs/verbs.c @@ -684,6 +684,12 @@ LATEST_SYMVER_FUNC(ibv_query_qp, 1_1, "IBVERBS_1.1", return 0; } +int ibv_query_qp_data_in_order(struct ibv_qp *qp, enum ibv_wr_opcode op, + uint32_t flags) +{ + return get_ops(qp->context)->query_qp_data_in_order(qp, op, flags); +} + LATEST_SYMVER_FUNC(ibv_modify_qp, 1_1, "IBVERBS_1.1", int, struct ibv_qp *qp, struct ibv_qp_attr *attr, diff --git a/libibverbs/verbs.h b/libibverbs/verbs.h index 7d42095..3dd9a79 100644 --- a/libibverbs/verbs.h +++ b/libibverbs/verbs.h @@ -3148,6 +3148,20 @@ ibv_modify_qp_rate_limit(struct ibv_qp *qp, } /** + * ibv_query_qp_data_in_order - Checks whether the data is guaranteed to be + * written in-order. + * @qp: The QP to query. + * @op: Operation type. + * @flags: Extra field for future input. For now must be 0. + * + * Return Value + * ibv_query_qp_data_in_order() returns 1 if the data is guaranteed to be + * written in-order, 0 otherwise. + */ +int ibv_query_qp_data_in_order(struct ibv_qp *qp, enum ibv_wr_opcode op, + uint32_t flags); + +/** * ibv_query_qp - Returns the attribute list and current values for the * specified QP. * @qp: The QP to query. -- 1.8.3.1