From 0b0a9806551e598e7a3fcf00308329d6a192856d Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Mon, 1 Feb 2021 08:10:02 +0000 Subject: [PATCH] import rdma-core-32.0-4.el8 --- ...x-reported-error-code-from-create_cq.patch | 36 ++ ...x-reported-error-code-from-create_cq.patch | 36 ++ ....c-load-plugin-while-it-is-soft-link.patch | 39 ++ ...x-reported-error-code-from-create_cq.patch | 34 ++ ...overwrite-errno-returned-from-libibv.patch | 52 +++ ...-single-threaded-mode-for-shared-UAR.patch | 33 ++ ...id-ICM-depletion-on-multiple-domains.patch | 75 ++++ .../0001-pyverbs-Add-mlx5dv-CQ-support.patch | 57 +++ .../0001-qedr-fix-USE_AFTER_FREE-issue.patch | 41 ++ ...Add-s-option-in-rdma_server-s-manual.patch | 34 ++ ...01-srp_daemon-Fix-systemd-dependency.patch | 34 ++ SOURCES/0001-tests-Add-mlx5-CQ-tests.patch | 358 ++++++++++++++++++ ...-CQE-compression-cap-before-using-it.patch | 45 +++ ...-with-RQ-in-max_recv_sge-s-documents.patch | 48 +++ ...-type-of-some-variables-in-documents.patch | 122 ++++++ SPECS/rdma-core.spec | 38 +- 16 files changed, 1081 insertions(+), 1 deletion(-) create mode 100644 SOURCES/0001-bnxt_re-Fix-reported-error-code-from-create_cq.patch create mode 100644 SOURCES/0001-cxgb4-Fix-reported-error-code-from-create_cq.patch create mode 100644 SOURCES/0001-ibacm-acm.c-load-plugin-while-it-is-soft-link.patch create mode 100644 SOURCES/0001-libqedr-Fix-reported-error-code-from-create_cq.patch create mode 100644 SOURCES/0001-librdmacm-Don-t-overwrite-errno-returned-from-libibv.patch create mode 100644 SOURCES/0001-mlx5-Consider-single-threaded-mode-for-shared-UAR.patch create mode 100644 SOURCES/0001-mlx5-DR-Avoid-ICM-depletion-on-multiple-domains.patch create mode 100644 SOURCES/0001-pyverbs-Add-mlx5dv-CQ-support.patch create mode 100644 SOURCES/0001-qedr-fix-USE_AFTER_FREE-issue.patch create mode 100644 SOURCES/0001-rdma_server-Add-s-option-in-rdma_server-s-manual.patch create mode 100644 SOURCES/0001-srp_daemon-Fix-systemd-dependency.patch create mode 100644 SOURCES/0001-tests-Add-mlx5-CQ-tests.patch create mode 100644 SOURCES/0001-tests-Check-CQE-compression-cap-before-using-it.patch create mode 100644 SOURCES/0001-verbs-Replace-SQ-with-RQ-in-max_recv_sge-s-documents.patch create mode 100644 SOURCES/0001-verbs-Update-the-type-of-some-variables-in-documents.patch diff --git a/SOURCES/0001-bnxt_re-Fix-reported-error-code-from-create_cq.patch b/SOURCES/0001-bnxt_re-Fix-reported-error-code-from-create_cq.patch new file mode 100644 index 0000000..80b8f5b --- /dev/null +++ b/SOURCES/0001-bnxt_re-Fix-reported-error-code-from-create_cq.patch @@ -0,0 +1,36 @@ +From ef1a51192eb44e7f23d3c5b63a80c0b8b6358660 Mon Sep 17 00:00:00 2001 +From: Kamal Heib +Date: Thu, 14 Jan 2021 12:34:39 +0200 +Subject: [PATCH] bnxt_re: Fix reported error code from create_cq + +[ Upstream commit 9a1c8f63344c5b7eb911332501d48fd6b14edde1 ] + +Report EINVAL when trying to call bnxt_re_create_cq() with number of CQEs +out of the supported range. + +Fixes: fa8dce26b88c ("libbnxt_re: Add support for CQ and QP management") +Signed-off-by: Kamal Heib +Signed-off-by: Nicolas Morey-Chaisemartin +--- + providers/bnxt_re/verbs.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/providers/bnxt_re/verbs.c b/providers/bnxt_re/verbs.c +index 03237e7f8103..20902ab5c020 100644 +--- a/providers/bnxt_re/verbs.c ++++ b/providers/bnxt_re/verbs.c +@@ -173,8 +173,10 @@ struct ibv_cq *bnxt_re_create_cq(struct ibv_context *ibvctx, int ncqe, + struct bnxt_re_context *cntx = to_bnxt_re_context(ibvctx); + struct bnxt_re_dev *dev = to_bnxt_re_dev(ibvctx->device); + +- if (ncqe > dev->max_cq_depth) ++ if (!ncqe || ncqe > dev->max_cq_depth) { ++ errno = EINVAL; + return NULL; ++ } + + cq = calloc(1, sizeof(*cq)); + if (!cq) +-- +2.25.4 + diff --git a/SOURCES/0001-cxgb4-Fix-reported-error-code-from-create_cq.patch b/SOURCES/0001-cxgb4-Fix-reported-error-code-from-create_cq.patch new file mode 100644 index 0000000..46e90f5 --- /dev/null +++ b/SOURCES/0001-cxgb4-Fix-reported-error-code-from-create_cq.patch @@ -0,0 +1,36 @@ +From 5dee0eaa3a3c1f6b8e960038384e16ae730d201e Mon Sep 17 00:00:00 2001 +From: Kamal Heib +Date: Thu, 24 Dec 2020 16:11:16 +0200 +Subject: [PATCH] cxgb4: Fix reported error code from create_cq + +[ Upstream commit 8f85e04863e379d798c88a68eee5e34341961eff ] + +Report EINVAL when trying to call c4iw_create_cq() with number of CQEs +out of the supported range. + +Fixes: d6e6ae69be5e ("Add libcxgb4 files.") +Signed-off-by: Kamal Heib +Signed-off-by: Nicolas Morey-Chaisemartin +--- + providers/cxgb4/verbs.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/providers/cxgb4/verbs.c b/providers/cxgb4/verbs.c +index 32bae6906a15..d0e366f0fca4 100644 +--- a/providers/cxgb4/verbs.c ++++ b/providers/cxgb4/verbs.c +@@ -171,6 +171,11 @@ struct ibv_cq *c4iw_create_cq(struct ibv_context *context, int cqe, + struct c4iw_dev *dev = to_c4iw_dev(context->device); + int ret; + ++ if (!cqe || cqe > T4_MAX_CQ_DEPTH) { ++ errno = EINVAL; ++ return NULL; ++ } ++ + chp = calloc(1, sizeof *chp); + if (!chp) { + return NULL; +-- +2.25.4 + diff --git a/SOURCES/0001-ibacm-acm.c-load-plugin-while-it-is-soft-link.patch b/SOURCES/0001-ibacm-acm.c-load-plugin-while-it-is-soft-link.patch new file mode 100644 index 0000000..1053198 --- /dev/null +++ b/SOURCES/0001-ibacm-acm.c-load-plugin-while-it-is-soft-link.patch @@ -0,0 +1,39 @@ +From 91b414f645b0fdca914151280bb14a12258a56e7 Mon Sep 17 00:00:00 2001 +From: Honggang Li +Date: Wed, 13 Jan 2021 11:51:04 +0800 +Subject: [PATCH] ibacm: acm.c load plugin while it is soft link + +NOTE: THIS ONE IS RHEL SPECIFIC WORKAROUND COMMIT. +https://github.com/linux-rdma/rdma-core/pull/923 + +Because of commit ad5d934d688911149d795aee1d3b9fa06bf171a9, +the provider libdsap.so.1.0.0 was not opened/used for address resolution +for OPA device. + +As discussed in this closed PR: +https://github.com/linux-rdma/rdma-core/pull/848 + +I create a soft link for libdsap.so => libdsap.so.1.0.0 . The soft link +was ignored because it is a not regular file. + +Signed-off-by: Honggang Li +--- + ibacm/src/acm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ibacm/src/acm.c b/ibacm/src/acm.c +index f1c8a2fabfb4..77ffda316b0c 100644 +--- a/ibacm/src/acm.c ++++ b/ibacm/src/acm.c +@@ -2878,7 +2878,7 @@ static int acm_open_providers(void) + acm_log(0, "Error - could not stat: %s\n", file_name); + continue; + } +- if (!S_ISREG(buf.st_mode)) ++ if (!(S_ISREG(buf.st_mode) || S_ISLNK(buf.st_mode))) + continue; + + acm_log(2, "Loading provider %s...\n", file_name); +-- +2.25.4 + diff --git a/SOURCES/0001-libqedr-Fix-reported-error-code-from-create_cq.patch b/SOURCES/0001-libqedr-Fix-reported-error-code-from-create_cq.patch new file mode 100644 index 0000000..422eb51 --- /dev/null +++ b/SOURCES/0001-libqedr-Fix-reported-error-code-from-create_cq.patch @@ -0,0 +1,34 @@ +From da998d0d6eb8ca6fbe7848cf4c0808797ab9c882 Mon Sep 17 00:00:00 2001 +From: Kamal Heib +Date: Wed, 23 Dec 2020 18:49:52 +0200 +Subject: [PATCH] libqedr: Fix reported error code from create_cq + +[ Upstream commit e8b5a1d673f1eb2d93fb9fe09759fa03a6cf8aad ] + +Report EINVAL when trying to call qelr_create_cq() with number of CQEs +bigger than the supported max_cqes, also fix the printed range. + +Fixes: c0965e4fe6fe ("libqedr (qelr) verbs") +Signed-off-by: Kamal Heib +Signed-off-by: Nicolas Morey-Chaisemartin +--- + providers/qedr/qelr_verbs.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/providers/qedr/qelr_verbs.c b/providers/qedr/qelr_verbs.c +index e75d508f100b..631c9f844a95 100644 +--- a/providers/qedr/qelr_verbs.c ++++ b/providers/qedr/qelr_verbs.c +@@ -231,7 +231,8 @@ struct ibv_cq *qelr_create_cq(struct ibv_context *context, int cqe, + if (!cqe || cqe > cxt->max_cqes) { + DP_ERR(cxt->dbg_fp, + "create cq: failed. attempted to allocate %d cqes but valid range is 1...%d\n", +- cqe, cqe > cxt->max_cqes); ++ cqe, cxt->max_cqes); ++ errno = EINVAL; + return NULL; + } + +-- +2.25.4 + diff --git a/SOURCES/0001-librdmacm-Don-t-overwrite-errno-returned-from-libibv.patch b/SOURCES/0001-librdmacm-Don-t-overwrite-errno-returned-from-libibv.patch new file mode 100644 index 0000000..63f8122 --- /dev/null +++ b/SOURCES/0001-librdmacm-Don-t-overwrite-errno-returned-from-libibv.patch @@ -0,0 +1,52 @@ +From ea4c14b07e9856cdbb70fc09771ae9373d39391c Mon Sep 17 00:00:00 2001 +From: Xiao Yang +Date: Wed, 16 Dec 2020 17:22:52 +0800 +Subject: [PATCH] librdmacm: Don't overwrite errno returned from libibverbs + +[ Upstream commit 11bf28021e62235f312e3132013e3736e4e835e0 ] + +Some functions reports fixed ENOMEM when getting any failure, so +it's hard for user to know which actual error happens on them. + +Fixes: 663098bfc3ac ("Rename librdmacm") +Signed-off-by: Xiao Yang +Signed-off-by: Leon Romanovsky +Signed-off-by: Nicolas Morey-Chaisemartin +--- + librdmacm/cma.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/librdmacm/cma.c b/librdmacm/cma.c +index 6e3956558471..2e7d019a3f7f 100644 +--- a/librdmacm/cma.c ++++ b/librdmacm/cma.c +@@ -635,7 +635,7 @@ static int ucma_get_device(struct cma_id_private *id_priv, __be64 guid, + if (!cma_dev->pd) + cma_dev->pd = ibv_alloc_pd(cma_dev->verbs); + if (!cma_dev->pd) { +- ret = ERR(ENOMEM); ++ ret = -1; + goto out; + } + +@@ -1490,7 +1490,7 @@ static int ucma_create_cqs(struct rdma_cm_id *id, uint32_t send_size, uint32_t r + return 0; + err: + ucma_destroy_cqs(id); +- return ERR(ENOMEM); ++ return -1; + } + + int rdma_create_srq_ex(struct rdma_cm_id *id, struct ibv_srq_init_attr_ex *attr) +@@ -1662,7 +1662,7 @@ int rdma_create_qp_ex(struct rdma_cm_id *id, + attr->srq = id->srq; + qp = ibv_create_qp_ex(id->verbs, attr); + if (!qp) { +- ret = ERR(ENOMEM); ++ ret = -1; + goto err1; + } + +-- +2.25.4 + diff --git a/SOURCES/0001-mlx5-Consider-single-threaded-mode-for-shared-UAR.patch b/SOURCES/0001-mlx5-Consider-single-threaded-mode-for-shared-UAR.patch new file mode 100644 index 0000000..313e9fa --- /dev/null +++ b/SOURCES/0001-mlx5-Consider-single-threaded-mode-for-shared-UAR.patch @@ -0,0 +1,33 @@ +From 0d9ed0f09b92f730ae3a755415c4e68e62c4cf99 Mon Sep 17 00:00:00 2001 +From: Yishai Hadas +Date: Wed, 9 Dec 2020 09:15:39 +0200 +Subject: [PATCH] mlx5: Consider single threaded mode for shared UAR + +[ Upstream commit 9d6cbd2858d237d1d56bada430eca032074204c8 ] + +In case application uses a single threaded mode even a UAR that is +shared between QPs doesn't need to take a lock. + +Fixes: 7fdcd258bc5f ("mlx5: Move to fully dynamic UAR mode including QPs") +Signed-off-by: Yishai Hadas +Signed-off-by: Nicolas Morey-Chaisemartin +--- + providers/mlx5/verbs.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/providers/mlx5/verbs.c b/providers/mlx5/verbs.c +index 7907218295f6..cc93dc4c366e 100644 +--- a/providers/mlx5/verbs.c ++++ b/providers/mlx5/verbs.c +@@ -326,7 +326,7 @@ static void mlx5_insert_dyn_uuars(struct mlx5_context *ctx, + if (!bf_uar->dyn_alloc_uar) + bf->bfreg_dyn_index = (ctx->curr_legacy_dyn_sys_uar_page - 1) * num_bfregs_per_page + j; + bf->dyn_alloc_uar = bf_uar->dyn_alloc_uar; +- bf->need_lock = bf_uar->qp_shared; ++ bf->need_lock = bf_uar->qp_shared && !mlx5_single_threaded; + mlx5_spinlock_init(&bf->lock, bf->need_lock); + if (j != 0) { + bf->uar = bf_uar->uar; +-- +2.25.4 + diff --git a/SOURCES/0001-mlx5-DR-Avoid-ICM-depletion-on-multiple-domains.patch b/SOURCES/0001-mlx5-DR-Avoid-ICM-depletion-on-multiple-domains.patch new file mode 100644 index 0000000..89e7a73 --- /dev/null +++ b/SOURCES/0001-mlx5-DR-Avoid-ICM-depletion-on-multiple-domains.patch @@ -0,0 +1,75 @@ +From dadee6df65387ba0fea0d78cc9c99af0350d3c37 Mon Sep 17 00:00:00 2001 +From: Alex Vesker +Date: Tue, 8 Dec 2020 18:41:02 +0200 +Subject: [PATCH] mlx5: DR, Avoid ICM depletion on multiple domains + +[ Upstream commit 951fdedd1ad580a0281e9bca22477942f5256c69 ] + +When running multiple domains on the same PF, large ICM allocation can +deplete all of the resource and lead to failures on other domains, this +was seen on ConnectX6DX devices with limited size of action ICM (modify +header). +The solution is take into consideration the total available resource +size. + +Fixes: c86f095752f2 ("mlx5: DR, Increase ICM action memory allocation size up-to 8MB") +Signed-off-by: Alex Vesker +Signed-off-by: Erez Shitrit +Signed-off-by: Yishai Hadas +Signed-off-by: Nicolas Morey-Chaisemartin +--- + providers/mlx5/dr_domain.c | 26 ++++++++++++++++++++------ + 1 file changed, 20 insertions(+), 6 deletions(-) + +diff --git a/providers/mlx5/dr_domain.c b/providers/mlx5/dr_domain.c +index 0a4b565ef85b..1a999965cb9b 100644 +--- a/providers/mlx5/dr_domain.c ++++ b/providers/mlx5/dr_domain.c +@@ -283,24 +283,38 @@ static void dr_domain_caps_uninit(struct mlx5dv_dr_domain *dmn) + + static int dr_domain_check_icm_memory_caps(struct mlx5dv_dr_domain *dmn) + { ++ uint32_t max_req_bytes_log, max_req_chunks_log; ++ ++ /* Check for minimum ICM log byte size requirements */ + if (dmn->info.caps.log_modify_hdr_icm_size < DR_CHUNK_SIZE_4K + + DR_MODIFY_ACTION_LOG_SIZE) { + errno = ENOMEM; + return errno; + } + +- dmn->info.max_log_action_icm_sz = min_t(uint32_t, +- DR_CHUNK_SIZE_1024K, +- dmn->info.caps.log_modify_hdr_icm_size +- - DR_MODIFY_ACTION_LOG_SIZE); +- + if (dmn->info.caps.log_icm_size < DR_CHUNK_SIZE_1024K + + DR_STE_LOG_SIZE) { + errno = ENOMEM; + return errno; + } + +- dmn->info.max_log_sw_icm_sz = DR_CHUNK_SIZE_1024K; ++ /* Current code tries to use large allocations to improve our internal ++ * memory allocation (less DMs and less FW calls). ++ * When creating multiple domains on the same PF, we want to make sure ++ * we don't deplete all of the ICM resources on a single domain. ++ * To provide some functionality with a limited resource we will use ++ * up to 1/8 of the total available size allowing opening a domain ++ * of each type. ++ */ ++ max_req_bytes_log = dmn->info.caps.log_modify_hdr_icm_size - 3; ++ max_req_chunks_log = max_req_bytes_log - DR_MODIFY_ACTION_LOG_SIZE; ++ dmn->info.max_log_action_icm_sz = ++ min_t(uint32_t, DR_CHUNK_SIZE_1024K, max_req_chunks_log); ++ ++ max_req_bytes_log = dmn->info.caps.log_icm_size - 3; ++ max_req_chunks_log = max_req_bytes_log - DR_STE_LOG_SIZE; ++ dmn->info.max_log_sw_icm_sz = ++ min_t(uint32_t, DR_CHUNK_SIZE_1024K, max_req_chunks_log); + + return 0; + } +-- +2.25.4 + diff --git a/SOURCES/0001-pyverbs-Add-mlx5dv-CQ-support.patch b/SOURCES/0001-pyverbs-Add-mlx5dv-CQ-support.patch new file mode 100644 index 0000000..cb39deb --- /dev/null +++ b/SOURCES/0001-pyverbs-Add-mlx5dv-CQ-support.patch @@ -0,0 +1,57 @@ +From 4707d4b89fcdab09d568a823ddf521f835a47fe9 Mon Sep 17 00:00:00 2001 +From: Ido Kalir +Date: Thu, 6 Aug 2020 14:44:31 +0300 +Subject: [PATCH] pyverbs: Add mlx5dv CQ support + +Support the creation of QPInitAttr and QPInitAttrEx with a DV CQ +instance. + +Signed-off-by: Ido Kalir +Signed-off-by: Edward Srouji +--- + pyverbs/qp.pyx | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/pyverbs/qp.pyx b/pyverbs/qp.pyx +index 24dfc667227a..09d1c55af835 100644 +--- a/pyverbs/qp.pyx ++++ b/pyverbs/qp.pyx +@@ -119,7 +119,7 @@ cdef class QPInitAttr(PyverbsObject): + if scq is not None: + if type(scq) is CQ: + self.attr.send_cq = (scq).cq +- elif type(scq) is CQEX: ++ elif isinstance(scq, CQEX): + self.attr.send_cq = (scq).ibv_cq + else: + raise PyverbsUserError('Expected CQ/CQEX, got {t}'.\ +@@ -129,7 +129,7 @@ cdef class QPInitAttr(PyverbsObject): + if rcq is not None: + if type(rcq) is CQ: + self.attr.recv_cq = (rcq).cq +- elif type(rcq) is CQEX: ++ elif isinstance(rcq, CQEX): + self.attr.recv_cq = (rcq).ibv_cq + else: + raise PyverbsUserError('Expected CQ/CQEX, got {t}'.\ +@@ -282,7 +282,7 @@ cdef class QPInitAttrEx(PyverbsObject): + if scq is not None: + if type(scq) is CQ: + self.attr.send_cq = (scq).cq +- elif type(scq) is CQEX: ++ elif isinstance(scq, CQEX): + self.attr.send_cq = (scq).ibv_cq + else: + raise PyverbsUserError('Expected CQ/CQEX, got {t}'.\ +@@ -292,7 +292,7 @@ cdef class QPInitAttrEx(PyverbsObject): + if rcq is not None: + if type(rcq) is CQ: + self.attr.recv_cq = (rcq).cq +- elif type(rcq) is CQEX: ++ elif isinstance(rcq, CQEX): + self.attr.recv_cq = (rcq).ibv_cq + else: + raise PyverbsUserError('Expected CQ/CQEX, got {t}'.\ +-- +2.25.4 + diff --git a/SOURCES/0001-qedr-fix-USE_AFTER_FREE-issue.patch b/SOURCES/0001-qedr-fix-USE_AFTER_FREE-issue.patch new file mode 100644 index 0000000..9ed4ea5 --- /dev/null +++ b/SOURCES/0001-qedr-fix-USE_AFTER_FREE-issue.patch @@ -0,0 +1,41 @@ +From 9f25aebffc4f6d4d9b7ccf3e1ba911b997fb9ab4 Mon Sep 17 00:00:00 2001 +From: Honggang Li +Date: Sun, 15 Nov 2020 17:53:47 +0800 +Subject: [PATCH] qedr: fix USE_AFTER_FREE issue + +[ Upstream commit 56137398dbd58f876cb6238da9babb9500ac38b4 ] + +Issue was detected by Coverity. + +Error: USE_AFTER_FREE (CWE-416): [#def10] +rdma-core-33.0/providers/qedr/qelr_verbs.c:2678: freed_arg: "free" frees "srq". +rdma-core-33.0/providers/qedr/qelr_verbs.c:2680: pass_freed_arg: Passing freed pointer "srq" as an argument to "fprintf". +|# 2678| free(srq); +|# 2679| err0: +|# 2680|-> DP_ERR(cxt->dbg_fp, +|# 2681| "create srq: failed to create %p. rc=%d\n", srq, rc); +|# 2682| return NULL; + +Fixes: cae4a99ae679 ("libqedr: add support for XRC-SRQ's.") +Signed-off-by: Honggang Li +Signed-off-by: Nicolas Morey-Chaisemartin +--- + providers/qedr/qelr_verbs.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/providers/qedr/qelr_verbs.c b/providers/qedr/qelr_verbs.c +index 4e77a1976a91..e75d508f100b 100644 +--- a/providers/qedr/qelr_verbs.c ++++ b/providers/qedr/qelr_verbs.c +@@ -2678,7 +2678,7 @@ err1: + free(srq); + err0: + DP_ERR(cxt->dbg_fp, +- "create srq: failed to create %p. rc=%d\n", srq, rc); ++ "create srq: failed to create. rc=%d\n", rc); + return NULL; + } + +-- +2.25.4 + diff --git a/SOURCES/0001-rdma_server-Add-s-option-in-rdma_server-s-manual.patch b/SOURCES/0001-rdma_server-Add-s-option-in-rdma_server-s-manual.patch new file mode 100644 index 0000000..fd50a89 --- /dev/null +++ b/SOURCES/0001-rdma_server-Add-s-option-in-rdma_server-s-manual.patch @@ -0,0 +1,34 @@ +From d83d397af58977f9c8af3fecff6e86ce76634e4b Mon Sep 17 00:00:00 2001 +From: Xiao Yang +Date: Fri, 11 Dec 2020 14:59:10 +0800 +Subject: [PATCH] rdma_server: Add '-s' option in rdma_server's manual + +[ Upstream commit e0ec9a5204eaefeddb35de580d610e066d6a9022 ] + +Fixes: 519d8d7aa965 ("librdmacm: Add command line option to specify server") +Fixes: cdea72a1e7e6 ("librdmacm: Change server default address to any address.") +Signed-off-by: Xiao Yang +Signed-off-by: Leon Romanovsky +Signed-off-by: Nicolas Morey-Chaisemartin +--- + librdmacm/man/rdma_server.1 | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/librdmacm/man/rdma_server.1 b/librdmacm/man/rdma_server.1 +index ada2564983f3..f83633e0b195 100644 +--- a/librdmacm/man/rdma_server.1 ++++ b/librdmacm/man/rdma_server.1 +@@ -13,6 +13,10 @@ two nodes. This example is intended to provide a very simple coding + example of how to use RDMA. + .SH "OPTIONS" + .TP ++\-s server_address ++Specifies the address that the rdma_server listens on. By default the ++server listens on any address(0.0.0.0). ++.TP + \-p port + Changes the port number that the server listens on. By default the server + listens on port 7471. +-- +2.25.4 + diff --git a/SOURCES/0001-srp_daemon-Fix-systemd-dependency.patch b/SOURCES/0001-srp_daemon-Fix-systemd-dependency.patch new file mode 100644 index 0000000..f885577 --- /dev/null +++ b/SOURCES/0001-srp_daemon-Fix-systemd-dependency.patch @@ -0,0 +1,34 @@ +From d3122072034c574cadbd74df60bfe6c2464a9924 Mon Sep 17 00:00:00 2001 +From: Nicolas Morey-Chaisemartin +Date: Mon, 11 Jan 2021 10:51:01 +0100 +Subject: [PATCH] srp_daemon: Fix systemd dependency + +[ Upstream commit 460f4368ece1652bcf9c4d282e331e9422c02841 ] + +remote-fs-pre.target is a passive target that is not loaded without someone +actively requiring it. Even is remote-fs.target is active. +This means that srp_daemon will not get started at boot +unless another service explicitely requires remote-fs-pre.target. + +This solves the issue by having the srp_daemon service wanted by +the multi-user.target. + +Fixes: 1c7fe513e3e9 (srp_daemon: One systemd service per port) +Signed-off-by: Nicolas Morey-Chaisemartin +--- + srp_daemon/srp_daemon.service.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/srp_daemon/srp_daemon.service.in b/srp_daemon/srp_daemon.service.in +index 188b7e1a3712..bdd70db566af 100644 +--- a/srp_daemon/srp_daemon.service.in ++++ b/srp_daemon/srp_daemon.service.in +@@ -16,4 +16,4 @@ ProtectKernelModules=yes + RestrictRealtime=yes + + [Install] +-WantedBy=remote-fs-pre.target ++WantedBy=multi-user.target +-- +2.25.4 + diff --git a/SOURCES/0001-tests-Add-mlx5-CQ-tests.patch b/SOURCES/0001-tests-Add-mlx5-CQ-tests.patch new file mode 100644 index 0000000..8996513 --- /dev/null +++ b/SOURCES/0001-tests-Add-mlx5-CQ-tests.patch @@ -0,0 +1,358 @@ +From 8aae7abe241c81ef7d461940d7bb7f2973172b99 Mon Sep 17 00:00:00 2001 +From: Ido Kalir +Date: Tue, 18 Aug 2020 16:03:05 +0300 +Subject: [PATCH] tests: Add mlx5 CQ tests + +Add tests for mlx5dv CQ, including traffic and some bad creation flows. + +Signed-off-by: Ido Kalir +Signed-off-by: Edward Srouji +--- + tests/CMakeLists.txt | 1 + + tests/base.py | 28 ++++- + tests/mlx5_base.py | 6 +- + tests/test_mlx5_cq.py | 237 ++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 269 insertions(+), 3 deletions(-) + create mode 100644 tests/test_mlx5_cq.py + +diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt +index 4de98d08a81e..ce3b5ef25b81 100644 +--- a/tests/CMakeLists.txt ++++ b/tests/CMakeLists.txt +@@ -14,6 +14,7 @@ rdma_python_test(tests + test_cqex.py + test_device.py + test_efadv.py ++ test_mlx5_cq.py + test_mlx5_dc.py + test_mlx5_lag_affinity.py + test_mlx5_pp.py +diff --git a/tests/base.py b/tests/base.py +index 3eb5f5db9648..1ca52f0ce5bf 100644 +--- a/tests/base.py ++++ b/tests/base.py +@@ -104,6 +104,29 @@ class RDMATestCase(unittest.TestCase): + self.gid_index = gid_index + self.pkey_index = pkey_index + self.ip_addr = None ++ self.pre_environment = {} ++ ++ def set_env_variable(self, var, value): ++ """ ++ Set environment variable. The current value for each variable is stored ++ and is set back at the end of the test. ++ :param var: The name of the environment variable ++ :param value: The requested new value of this environment variable ++ """ ++ if var not in self.pre_environment.keys(): ++ self.pre_environment[var] = os.environ.get(var) ++ os.environ[var] = value ++ ++ def tearDown(self): ++ """ ++ Restore the previous environment variables values before ending the test. ++ """ ++ for k, v in self.pre_environment.items(): ++ if v is None: ++ os.environ.pop(k) ++ else: ++ os.environ[k] = v ++ super().tearDown() + + def is_eth_and_has_roce_hw_bug(self): + """ +@@ -256,7 +279,7 @@ class TrafficResources(BaseResources): + needed for traffic. + """ + def __init__(self, dev_name, ib_port, gid_index, with_srq=False, +- qp_count=1): ++ qp_count=1, msg_size=1024): + """ + Initializes a TrafficResources object with the given values and creates + basic RDMA resources. +@@ -265,11 +288,12 @@ class TrafficResources(BaseResources): + :param gid_index: Which GID index to use + :param with_srq: If True, create SRQ and attach to QPs + :param qp_count: Number of QPs to create ++ :param msg_size: Size of resource msg. If None, use 1024 as default. + """ + super(TrafficResources, self).__init__(dev_name=dev_name, + ib_port=ib_port, + gid_index=gid_index) +- self.msg_size = 1024 ++ self.msg_size = msg_size + self.num_msgs = 1000 + self.port_attr = None + self.mr = None +diff --git a/tests/mlx5_base.py b/tests/mlx5_base.py +index 099906f35129..a4202bae6a0d 100644 +--- a/tests/mlx5_base.py ++++ b/tests/mlx5_base.py +@@ -18,8 +18,9 @@ from pyverbs.mr import MR + + class Mlx5DcResources(TrafficResources): + def __init__(self, dev_name, ib_port, gid_index, send_ops_flags, +- qp_count=1): ++ qp_count=1, create_flags=0): + self.send_ops_flags = send_ops_flags ++ self.create_flags = create_flags + super().__init__(dev_name, ib_port, gid_index, with_srq=True, + qp_count=qp_count) + +@@ -77,7 +78,10 @@ class Mlx5DcResources(TrafficResources): + try: + for _ in range(self.qp_count): + comp_mask = dve.MLX5DV_QP_INIT_ATTR_MASK_DC ++ if self.create_flags: ++ comp_mask |= dve.MLX5DV_QP_INIT_ATTR_MASK_QP_CREATE_FLAGS + attr = Mlx5DVQPInitAttr(comp_mask=comp_mask, ++ create_flags=self.create_flags, + dc_init_attr=Mlx5DVDCInitAttr()) + qp = Mlx5QP(self.ctx, qp_init_attr, attr) + self.qps.append(qp) +diff --git a/tests/test_mlx5_cq.py b/tests/test_mlx5_cq.py +new file mode 100644 +index 000000000000..1f757c27345e +--- /dev/null ++++ b/tests/test_mlx5_cq.py +@@ -0,0 +1,237 @@ ++import unittest ++import errno ++ ++from pyverbs.providers.mlx5.mlx5dv import Mlx5Context, Mlx5DVContextAttr, \ ++ Mlx5DVCQInitAttr, Mlx5CQ, context_flags_to_str ++from pyverbs.pyverbs_error import PyverbsRDMAError, PyverbsUserError ++from tests.base import RDMATestCase, RCResources ++import pyverbs.providers.mlx5.mlx5_enums as dve ++from tests.mlx5_base import Mlx5DcResources ++from pyverbs.cq import CqInitAttrEx ++import pyverbs.enums as e ++import tests.utils as u ++ ++ ++def create_dv_cq(res): ++ """ ++ Create Mlx5 DV CQ. ++ :param res: An instance of BaseResources. ++ :return: None ++ """ ++ dvcq_init_attr = Mlx5DVCQInitAttr() ++ if res.cqe_comp_res_format: ++ dvcq_init_attr.cqe_comp_res_format = res.cqe_comp_res_format ++ dvcq_init_attr.comp_mask |= dve.MLX5DV_CQ_INIT_ATTR_MASK_COMPRESSED_CQE ++ if res.flags: ++ dvcq_init_attr.flags = res.flags ++ dvcq_init_attr.comp_mask |= dve.MLX5DV_CQ_INIT_ATTR_MASK_FLAGS ++ if res.cqe_size: ++ dvcq_init_attr.cqe_size = res.cqe_size ++ dvcq_init_attr.comp_mask |= dve.MLX5DV_CQ_INIT_ATTR_MASK_CQE_SIZE ++ try: ++ res.cq = Mlx5CQ(res.ctx, CqInitAttrEx(), dvcq_init_attr) ++ except PyverbsRDMAError as ex: ++ if ex.error_code == errno.EOPNOTSUPP: ++ raise unittest.SkipTest('Create Mlx5DV CQ is not supported') ++ raise ex ++ ++ ++class Mlx5CQRes(RCResources): ++ def __init__(self, dev_name, ib_port, gid_index, cqe_comp_res_format=None, ++ flags=None, cqe_size=None, msg_size=1024, requested_dev_cap=None): ++ """ ++ Initialize Mlx5 DV CQ resources based on RC resources that include RC ++ QP. ++ :param dev_name: Device name to be used ++ :param ib_port: IB port of the device to use ++ :param gid_index: Which GID index to use ++ :param cqe_comp_res_format: Type of compression to use ++ :param flags: DV CQ specific flags ++ :param cqe_size: The CQE size ++ :param msg_size: The resource msg size ++ :param requested_dev_cap: A necessary device cap. If it's not supported ++ by the device, the test will be skipped. ++ """ ++ self.cqe_comp_res_format = cqe_comp_res_format ++ self.flags = flags ++ self.cqe_size = cqe_size ++ self.requested_dev_cap = requested_dev_cap ++ super().__init__(dev_name, ib_port, gid_index, msg_size=msg_size) ++ ++ def create_context(self): ++ mlx5dv_attr = Mlx5DVContextAttr() ++ try: ++ self.ctx = Mlx5Context(mlx5dv_attr, name=self.dev_name) ++ except PyverbsUserError as ex: ++ raise unittest.SkipTest(f'Could not open mlx5 context ({ex})') ++ except PyverbsRDMAError: ++ raise unittest.SkipTest('Opening mlx5 context is not supported') ++ if self.requested_dev_cap: ++ if not self.ctx.query_mlx5_device().flags & self.requested_dev_cap: ++ miss_caps = context_flags_to_str(self.requested_dev_cap) ++ raise unittest.SkipTest(f'Device caps doesn\'t support {miss_caps}') ++ ++ def create_cq(self): ++ create_dv_cq(self) ++ ++ ++class Mlx5DvCqDcRes(Mlx5DcResources): ++ def __init__(self, dev_name, ib_port, gid_index, cqe_comp_res_format=None, ++ flags=None, cqe_size=None, create_flags=None): ++ """ ++ Initialize Mlx5 DV CQ resources based on RC resources that include RC ++ QP. ++ :param dev_name: Device name to be used ++ :param ib_port: IB port of the device to use ++ :param gid_index: Which GID index to use ++ :param cqe_comp_res_format: Type of compression to use ++ :param flags: DV CQ specific flags ++ :param cqe_size: The CQ's CQe size ++ :param create_flags: DV QP specific flags ++ """ ++ self.cqe_comp_res_format = cqe_comp_res_format ++ self.flags = flags ++ self.cqe_size = cqe_size ++ super().__init__(dev_name, ib_port, gid_index, ++ send_ops_flags=e.IBV_QP_EX_WITH_SEND, ++ create_flags=create_flags) ++ ++ def create_cq(self): ++ create_dv_cq(self) ++ ++ ++class DvCqTest(RDMATestCase): ++ def setUp(self): ++ super().setUp() ++ self.iters = 10 ++ self.server = None ++ self.client = None ++ self.traffic_args = None ++ ++ def create_players(self, resource, **resource_arg): ++ """ ++ Init DV CQ tests resources. ++ :param resource: The RDMA resources to use. ++ :param resource_arg: Dict of args that specify the resource specific ++ attributes. ++ :return: None ++ """ ++ self.client = resource(**self.dev_info, **resource_arg) ++ self.server = resource(**self.dev_info, **resource_arg) ++ self.client.pre_run(self.server.psns, self.server.qps_num) ++ self.server.pre_run(self.client.psns, self.client.qps_num) ++ if resource == Mlx5DvCqDcRes: ++ self.client.remote_dct_num = self.server.dct_qp.qp_num ++ self.server.remote_dct_num = self.client.dct_qp.qp_num ++ self.traffic_args = {'client': self.client, 'server': self.server, ++ 'iters': self.iters, 'gid_idx': self.gid_index, ++ 'port': self.ib_port} ++ ++ def test_dv_cq_traffic(self): ++ """ ++ Run SEND traffic using DC CQ. ++ """ ++ self.create_players(Mlx5CQRes) ++ u.traffic(**self.traffic_args, is_cq_ex=True) ++ ++ def test_dv_cq_compression_flags(self): ++ """ ++ Create DV CQ with different types of CQE compression formats. The test ++ also does bad flow and try to use more than one compression formats. ++ """ ++ # Create DV CQ with all legal compression flags. ++ for comp_type in [dve.MLX5DV_CQE_RES_FORMAT_CSUM_STRIDX, ++ dve.MLX5DV_CQE_RES_FORMAT_CSUM, ++ dve.MLX5DV_CQE_RES_FORMAT_HASH]: ++ self.create_players(Mlx5CQRes, cqe_comp_res_format=comp_type, ++ requested_dev_cap=dve.MLX5DV_CONTEXT_FLAGS_CQE_128B_COMP) ++ u.traffic(**self.traffic_args, is_cq_ex=True) ++ ++ # Try to create DV CQ with more than one compression flags. ++ cqe_multi_format = dve.MLX5DV_CQE_RES_FORMAT_HASH | \ ++ dve.MLX5DV_CQE_RES_FORMAT_CSUM ++ with self.assertRaises(PyverbsRDMAError) as ex: ++ self.create_players(Mlx5CQRes, cqe_comp_res_format=cqe_multi_format) ++ self.assertEqual(ex.exception.error_code, errno.EINVAL) ++ ++ def test_dv_cq_padding(self): ++ """ ++ Create DV CQ with padding flag. ++ """ ++ self.create_players(Mlx5CQRes, cqe_size=128, ++ flags=dve.MLX5DV_CQ_INIT_ATTR_FLAGS_CQE_PAD, ++ requested_dev_cap=dve.MLX5DV_CONTEXT_FLAGS_CQE_128B_PAD) ++ u.traffic(**self.traffic_args, is_cq_ex=True) ++ ++ def test_dv_cq_padding_not_aligned_cqe_size(self): ++ """ ++ Create DV CQ with padding flag when CQE size is not 128B. The creation ++ should fail because padding is supported only with CQE size of 128B. ++ """ ++ # Padding flag works only when the cqe size is 128. ++ with self.assertRaises(PyverbsRDMAError) as ex: ++ self.create_players(Mlx5CQRes, cqe_size=64, ++ flags=dve.MLX5DV_CQ_INIT_ATTR_FLAGS_CQE_PAD, ++ requested_dev_cap=dve.MLX5DV_CONTEXT_FLAGS_CQE_128B_PAD) ++ self.assertEqual(ex.exception.error_code, errno.EINVAL) ++ ++ def test_dv_cq_cqe_size_128(self): ++ """ ++ Test multiple sizes of msg using CQE size of 128B. ++ """ ++ msg_sizes = [60, # Lower than 64B ++ 70, # In range of 64B - 128B ++ 140] # Bigger than 128B ++ for size in msg_sizes: ++ self.create_players(Mlx5CQRes, cqe_size=128, msg_size=size) ++ u.traffic(**self.traffic_args, is_cq_ex=True) ++ ++ def test_dv_cq_cqe_size_64(self): ++ """ ++ Test multiple sizes of msg using CQE size of 64B. ++ """ ++ msg_sizes = [16, # Lower than 32B ++ 60, # In range of 32B - 64B ++ 70] # Bigger than 64B ++ for size in msg_sizes: ++ self.create_players(Mlx5CQRes, cqe_size=64, msg_size=size) ++ u.traffic(**self.traffic_args, is_cq_ex=True) ++ ++ def test_dv_cq_cqe_size_with_bad_size(self): ++ """ ++ Create CQ with ilegal cqe_size value. ++ """ ++ # Set the CQE size in the CQE creation. ++ with self.assertRaises(PyverbsRDMAError) as ex: ++ self.create_players(Mlx5CQRes, cqe_size=100) ++ self.assertEqual(ex.exception.error_code, errno.EINVAL) ++ ++ # Set the CQE size using the environment value. ++ self.set_env_variable('MLX5_CQE_SIZE', '100') ++ with self.assertRaises(PyverbsRDMAError) as ex: ++ self.create_players(Mlx5CQRes) ++ self.assertEqual(ex.exception.error_code, errno.EINVAL) ++ ++ def test_dv_cq_cqe_size_environment_var(self): ++ """ ++ Create DV CQs with all the legal cqe_size values using the environment ++ variable mechanism. ++ """ ++ for cqe_size in ['64', '128']: ++ self.set_env_variable('MLX5_CQE_SIZE', cqe_size) ++ self.create_players(Mlx5CQRes) ++ ++ def test_scatter_to_cqe_control_by_qp(self): ++ """ ++ Create QP with specific SCATTER_TO_CQE flags. The test set different ++ values in the scatter2cqe environment variable and create the QP with ++ enable/disable flags. The QP should ignore the environment variable ++ value and behave according to the specific creation flag. ++ """ ++ for s2c_env_val in ['0', '1']: ++ for qp_s2c_value in [dve.MLX5DV_QP_CREATE_DISABLE_SCATTER_TO_CQE, ++ dve.MLX5DV_QP_CREATE_ALLOW_SCATTER_TO_CQE]: ++ self.set_env_variable('MLX5_SCATTER_TO_CQE', s2c_env_val) ++ self.create_players(Mlx5DvCqDcRes, create_flags=qp_s2c_value) ++ u.traffic(**self.traffic_args, new_send=True, ++ send_op=e.IBV_QP_EX_WITH_SEND, is_cq_ex=True) +-- +2.25.4 + diff --git a/SOURCES/0001-tests-Check-CQE-compression-cap-before-using-it.patch b/SOURCES/0001-tests-Check-CQE-compression-cap-before-using-it.patch new file mode 100644 index 0000000..075fc09 --- /dev/null +++ b/SOURCES/0001-tests-Check-CQE-compression-cap-before-using-it.patch @@ -0,0 +1,45 @@ +From 7be6d311d4bbdb93d06abfc9888e9f805d2d6fdb Mon Sep 17 00:00:00 2001 +From: Edward Srouji +Date: Wed, 30 Dec 2020 17:03:34 +0200 +Subject: [PATCH] tests: Check CQE compression cap before using it + +Add a CQE compression capability check in mlx5 CQ tests before creating +a CQ. If the device does not support the requested CQE compression type, +the test will be skipped. + +Fixes: 8aae7abe241c ("tests: Add mlx5 CQ tests") +Signed-off-by: Edward Srouji +Reviewed-by: Ido Kalir +--- + tests/test_mlx5_cq.py | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/tests/test_mlx5_cq.py b/tests/test_mlx5_cq.py +index 1f757c27345e..8be568c54262 100644 +--- a/tests/test_mlx5_cq.py ++++ b/tests/test_mlx5_cq.py +@@ -2,7 +2,7 @@ import unittest + import errno + + from pyverbs.providers.mlx5.mlx5dv import Mlx5Context, Mlx5DVContextAttr, \ +- Mlx5DVCQInitAttr, Mlx5CQ, context_flags_to_str ++ Mlx5DVCQInitAttr, Mlx5CQ, context_flags_to_str, cqe_comp_to_str + from pyverbs.pyverbs_error import PyverbsRDMAError, PyverbsUserError + from tests.base import RDMATestCase, RCResources + import pyverbs.providers.mlx5.mlx5_enums as dve +@@ -22,6 +22,12 @@ def create_dv_cq(res): + if res.cqe_comp_res_format: + dvcq_init_attr.cqe_comp_res_format = res.cqe_comp_res_format + dvcq_init_attr.comp_mask |= dve.MLX5DV_CQ_INIT_ATTR_MASK_COMPRESSED_CQE ++ # Check CQE compression capability ++ cqe_comp_caps = res.ctx.query_mlx5_device().cqe_comp_caps ++ if not (cqe_comp_caps['supported_format'] & res.cqe_comp_res_format) or \ ++ not cqe_comp_caps['max_num']: ++ cqe_comp_str = cqe_comp_to_str(res.cqe_comp_res_format) ++ raise unittest.SkipTest(f'CQE compression {cqe_comp_str} is not supported') + if res.flags: + dvcq_init_attr.flags = res.flags + dvcq_init_attr.comp_mask |= dve.MLX5DV_CQ_INIT_ATTR_MASK_FLAGS +-- +2.25.4 + diff --git a/SOURCES/0001-verbs-Replace-SQ-with-RQ-in-max_recv_sge-s-documents.patch b/SOURCES/0001-verbs-Replace-SQ-with-RQ-in-max_recv_sge-s-documents.patch new file mode 100644 index 0000000..3f292ed --- /dev/null +++ b/SOURCES/0001-verbs-Replace-SQ-with-RQ-in-max_recv_sge-s-documents.patch @@ -0,0 +1,48 @@ +From e86cfd2fcf1a48bebb6055d8016469aa75a17768 Mon Sep 17 00:00:00 2001 +From: Xiao Yang +Date: Thu, 14 Jan 2021 13:23:37 +0800 +Subject: [PATCH] verbs: Replace SQ with RQ in max_recv_sge's documents + +[ Upstream commit 380acc92201e6a038258403a36291671b6041ebe ] + +Fix copy/paste mistake. + +Fixes: 9845a77c8812 ("Add remaining libibverbs manpages") +Fixes: 058c67977dad ("XRC man pages") +Signed-off-by: Xiao Yang +Signed-off-by: Leon Romanovsky +Signed-off-by: Nicolas Morey-Chaisemartin +--- + libibverbs/man/ibv_create_qp.3 | 2 +- + libibverbs/man/ibv_create_qp_ex.3 | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libibverbs/man/ibv_create_qp.3 b/libibverbs/man/ibv_create_qp.3 +index 1cdf247445d2..dfbd245fa7b7 100644 +--- a/libibverbs/man/ibv_create_qp.3 ++++ b/libibverbs/man/ibv_create_qp.3 +@@ -40,7 +40,7 @@ struct ibv_qp_cap { + uint32_t max_send_wr; /* Requested max number of outstanding WRs in the SQ */ + uint32_t max_recv_wr; /* Requested max number of outstanding WRs in the RQ */ + uint32_t max_send_sge; /* Requested max number of scatter/gather (s/g) elements in a WR in the SQ */ +-uint32_t max_recv_sge; /* Requested max number of s/g elements in a WR in the SQ */ ++uint32_t max_recv_sge; /* Requested max number of s/g elements in a WR in the RQ */ + uint32_t max_inline_data;/* Requested max number of data (bytes) that can be posted inline to the SQ, otherwise 0 */ + .in -8 + }; +diff --git a/libibverbs/man/ibv_create_qp_ex.3 b/libibverbs/man/ibv_create_qp_ex.3 +index 277e9fa05e61..309281262ac6 100644 +--- a/libibverbs/man/ibv_create_qp_ex.3 ++++ b/libibverbs/man/ibv_create_qp_ex.3 +@@ -49,7 +49,7 @@ struct ibv_qp_cap { + uint32_t max_send_wr; /* Requested max number of outstanding WRs in the SQ */ + uint32_t max_recv_wr; /* Requested max number of outstanding WRs in the RQ */ + uint32_t max_send_sge; /* Requested max number of scatter/gather (s/g) elements in a WR in the SQ */ +-uint32_t max_recv_sge; /* Requested max number of s/g elements in a WR in the SQ */ ++uint32_t max_recv_sge; /* Requested max number of s/g elements in a WR in the RQ */ + uint32_t max_inline_data;/* Requested max number of data (bytes) that can be posted inline to the SQ, otherwise 0 */ + .in -8 + }; +-- +2.25.4 + diff --git a/SOURCES/0001-verbs-Update-the-type-of-some-variables-in-documents.patch b/SOURCES/0001-verbs-Update-the-type-of-some-variables-in-documents.patch new file mode 100644 index 0000000..fe90690 --- /dev/null +++ b/SOURCES/0001-verbs-Update-the-type-of-some-variables-in-documents.patch @@ -0,0 +1,122 @@ +From 7472c8b823221507f83052037750dd48fdeabff3 Mon Sep 17 00:00:00 2001 +From: Xiao Yang +Date: Mon, 11 Jan 2021 16:57:24 +0800 +Subject: [PATCH] verbs: Update the type of some variables in documents + +[ Upstream commit 503ee09888b8454de502d88821b9d872faebe75a ] + +The type of some variables has been changed from int to +unsigned int thus update the corresponding documents. + +Fixes: 8fe7f12f1723 ("verbs: Bitwise flag values should be unsigned") +Signed-off-by: Xiao Yang +Signed-off-by: Leon Romanovsky +Signed-off-by: Nicolas Morey-Chaisemartin +--- + libibverbs/man/ibv_bind_mw.3 | 4 ++-- + libibverbs/man/ibv_create_cq_ex.3 | 2 +- + libibverbs/man/ibv_modify_qp.3 | 2 +- + libibverbs/man/ibv_poll_cq.3 | 2 +- + libibverbs/man/ibv_post_send.3 | 4 ++-- + libibverbs/man/ibv_query_qp.3 | 2 +- + 6 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/libibverbs/man/ibv_bind_mw.3 b/libibverbs/man/ibv_bind_mw.3 +index af309d000dea..6b995af7b436 100644 +--- a/libibverbs/man/ibv_bind_mw.3 ++++ b/libibverbs/man/ibv_bind_mw.3 +@@ -28,7 +28,7 @@ is an ibv_mw_bind struct, as defined in . + struct ibv_mw_bind { + .in +8 + uint64_t wr_id; /* User defined WR ID */ +-int send_flags; /* Use ibv_send_flags */ ++unsigned int send_flags; /* Use ibv_send_flags */ + struct ibv_mw_bind_info bind_info; /* MW bind information */ + .in -8 + } +@@ -40,7 +40,7 @@ struct ibv_mw_bind_info { + struct ibv_mr *mr; /* The MR to bind the MW to */ + uint64_t addr; /* The address the MW should start at */ + uint64_t length; /* The length (in bytes) the MW should span */ +-int mw_access_flags; /* Access flags to the MW. Use ibv_access_flags */ ++unsigned int mw_access_flags; /* Access flags to the MW. Use ibv_access_flags */ + .in -8 + }; + .fi +diff --git a/libibverbs/man/ibv_create_cq_ex.3 b/libibverbs/man/ibv_create_cq_ex.3 +index 0f05693ec3bb..81eb37b96e75 100644 +--- a/libibverbs/man/ibv_create_cq_ex.3 ++++ b/libibverbs/man/ibv_create_cq_ex.3 +@@ -122,7 +122,7 @@ Below members and functions are used in order to poll the current completion. Th + .BI "uint32_t ibv_wc_read_src_qp(struct ibv_cq_ex " "*cq"); \c + Get the source QP number field from the current completion. + +-.BI "int ibv_wc_read_wc_flags(struct ibv_cq_ex " "*cq"); \c ++.BI "unsigned int ibv_wc_read_wc_flags(struct ibv_cq_ex " "*cq"); \c + Get the QP flags field from the current completion. + + .BI "uint16_t ibv_wc_read_pkey_index(struct ibv_cq_ex " "*cq"); \c +diff --git a/libibverbs/man/ibv_modify_qp.3 b/libibverbs/man/ibv_modify_qp.3 +index fd8596491e2f..a8cd19acdf54 100644 +--- a/libibverbs/man/ibv_modify_qp.3 ++++ b/libibverbs/man/ibv_modify_qp.3 +@@ -32,7 +32,7 @@ uint32_t qkey; /* Q_Key for the QP (valid only + uint32_t rq_psn; /* PSN for receive queue (valid only for RC/UC QPs) */ + uint32_t sq_psn; /* PSN for send queue (valid only for RC/UC QPs) */ + uint32_t dest_qp_num; /* Destination QP number (valid only for RC/UC QPs) */ +-int qp_access_flags; /* Mask of enabled remote access operations (valid only for RC/UC QPs) */ ++unsigned int qp_access_flags; /* Mask of enabled remote access operations (valid only for RC/UC QPs) */ + struct ibv_qp_cap cap; /* QP capabilities (valid if HCA supports QP resizing) */ + struct ibv_ah_attr ah_attr; /* Primary path address vector (valid only for RC/UC QPs) */ + struct ibv_ah_attr alt_ah_attr; /* Alternate path address vector (valid only for RC/UC QPs) */ +diff --git a/libibverbs/man/ibv_poll_cq.3 b/libibverbs/man/ibv_poll_cq.3 +index 957fd151495a..823865808202 100644 +--- a/libibverbs/man/ibv_poll_cq.3 ++++ b/libibverbs/man/ibv_poll_cq.3 +@@ -39,7 +39,7 @@ uint32_t invalidated_rkey; /* Local RKey that was invalidated */ + }; + uint32_t qp_num; /* Local QP number of completed WR */ + uint32_t src_qp; /* Source QP number (remote QP number) of completed WR (valid only for UD QPs) */ +-int wc_flags; /* Flags of the completed WR */ ++unsigned int wc_flags; /* Flags of the completed WR */ + uint16_t pkey_index; /* P_Key index (valid only for GSI QPs) */ + uint16_t slid; /* Source LID */ + uint8_t sl; /* Service Level */ +diff --git a/libibverbs/man/ibv_post_send.3 b/libibverbs/man/ibv_post_send.3 +index 4fb99f7ccde0..2c488b090578 100644 +--- a/libibverbs/man/ibv_post_send.3 ++++ b/libibverbs/man/ibv_post_send.3 +@@ -34,7 +34,7 @@ struct ibv_send_wr *next; /* Pointer to next WR in list, N + struct ibv_sge *sg_list; /* Pointer to the s/g array */ + int num_sge; /* Size of the s/g array */ + enum ibv_wr_opcode opcode; /* Operation type */ +-int send_flags; /* Flags of the WR properties */ ++unsigned int send_flags; /* Flags of the WR properties */ + union { + .in +8 + __be32 imm_data; /* Immediate data (in network byte order) */ +@@ -103,7 +103,7 @@ struct ibv_mw_bind_info { + struct ibv_mr *mr; /* The Memory region (MR) to bind the MW to */ + uint64_t addr; /* The address the MW should start at */ + uint64_t length; /* The length (in bytes) the MW should span */ +-int mw_access_flags; /* Access flags to the MW. Use ibv_access_flags */ ++unsigned int mw_access_flags; /* Access flags to the MW. Use ibv_access_flags */ + .in -8 + }; + .fi +diff --git a/libibverbs/man/ibv_query_qp.3 b/libibverbs/man/ibv_query_qp.3 +index 907bc56a52ef..05242def03b9 100644 +--- a/libibverbs/man/ibv_query_qp.3 ++++ b/libibverbs/man/ibv_query_qp.3 +@@ -37,7 +37,7 @@ uint32_t qkey; /* Q_Key of the QP (valid only for + uint32_t rq_psn; /* PSN for receive queue (valid only for RC/UC QPs) */ + uint32_t sq_psn; /* PSN for send queue (valid only for RC/UC QPs) */ + uint32_t dest_qp_num; /* Destination QP number (valid only for RC/UC QPs) */ +-int qp_access_flags; /* Mask of enabled remote access operations (valid only for RC/UC QPs) */ ++unsigned int qp_access_flags; /* Mask of enabled remote access operations (valid only for RC/UC QPs) */ + struct ibv_qp_cap cap; /* QP capabilities */ + struct ibv_ah_attr ah_attr; /* Primary path address vector (valid only for RC/UC QPs) */ + struct ibv_ah_attr alt_ah_attr; /* Alternate path address vector (valid only for RC/UC QPs) */ +-- +2.25.4 + diff --git a/SPECS/rdma-core.spec b/SPECS/rdma-core.spec index 967c140..172ec7c 100644 --- a/SPECS/rdma-core.spec +++ b/SPECS/rdma-core.spec @@ -1,6 +1,6 @@ Name: rdma-core Version: 32.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: RDMA core userspace libraries and daemons # Almost everything is licensed under the OFA dual GPLv2, 2 Clause BSD license @@ -28,6 +28,22 @@ Patch205: 0001-efa-Flush-write-combining-writes-before-writing-to-t.patch Patch206: 0001-udaddy-Fix-create_reply_ah-error-flow.patch Patch207: 0001-infiniband-diags-specify-the-HCA-name-and-Port-numbe.patch Patch208: 0001-libqedr-Set-XRC-functions-only-in-RoCE-mode.patch +Patch209: 0001-qedr-fix-USE_AFTER_FREE-issue.patch +Patch210: 0001-mlx5-Consider-single-threaded-mode-for-shared-UAR.patch +Patch211: 0001-rdma_server-Add-s-option-in-rdma_server-s-manual.patch +Patch212: 0001-librdmacm-Don-t-overwrite-errno-returned-from-libibv.patch +Patch213: 0001-libqedr-Fix-reported-error-code-from-create_cq.patch +Patch214: 0001-cxgb4-Fix-reported-error-code-from-create_cq.patch +Patch215: 0001-verbs-Update-the-type-of-some-variables-in-documents.patch +Patch216: 0001-verbs-Replace-SQ-with-RQ-in-max_recv_sge-s-documents.patch +Patch217: 0001-bnxt_re-Fix-reported-error-code-from-create_cq.patch +Patch218: 0001-mlx5-DR-Avoid-ICM-depletion-on-multiple-domains.patch +Patch219: 0001-srp_daemon-Fix-systemd-dependency.patch +Patch220: 0001-pyverbs-Add-mlx5dv-CQ-support.patch +Patch221: 0001-tests-Add-mlx5-CQ-tests.patch +Patch222: 0001-tests-Check-CQE-compression-cap-before-using-it.patch +# RHEL specific patch for OPA ibacm plugin +Patch300: 0001-ibacm-acm.c-load-plugin-while-it-is-soft-link.patch # Do not build static libs by default. %define with_static %{?_with_static: 1} %{?!_with_static: 0} @@ -278,6 +294,21 @@ easy, object-oriented access to IB verbs. %patch206 -p1 %patch207 -p1 %patch208 -p1 +%patch209 -p1 +%patch210 -p1 +%patch211 -p1 +%patch212 -p1 +%patch213 -p1 +%patch214 -p1 +%patch215 -p1 +%patch216 -p1 +%patch217 -p1 +%patch218 -p1 +%patch219 -p1 +%patch220 -p1 +%patch221 -p1 +%patch222 -p1 +%patch300 -p1 %build @@ -663,6 +694,11 @@ fi %endif %changelog +* Thu Jan 28 2021 Honggang Li - 32.0-4 +- Update to upstream stable release v32.1 +- Fix mlx5 pyverbs CQ test +- Resolves: bz1915745, bz1907377 + * Tue Dec 22 2020 Honggang Li - 32.0-3 - libqedr: Set XRC functions only in RoCE mode - Resolves: bz1894516