Rebase to upstream release v37.2

Resolves: rhbz#2035043, rhbz#2034948

Signed-off-by: Honggang Li <honli@redhat.com>
This commit is contained in:
Honggang Li 2022-01-07 03:04:52 -05:00
parent dbc6697108
commit 843d103f59
6 changed files with 161 additions and 2 deletions

1
.gitignore vendored
View File

@ -14,3 +14,4 @@
/rdma-core-34.0.tar.gz /rdma-core-34.0.tar.gz
/rdma-core-35.0.tar.gz /rdma-core-35.0.tar.gz
/rdma-core-37.1.tar.gz /rdma-core-37.1.tar.gz
/rdma-core-37.2.tar.gz

View File

@ -0,0 +1,41 @@
From 02fb24d24bd705822254133fa82c007ab3487af8 Mon Sep 17 00:00:00 2001
From: Selvin Xavier <selvin.xavier@broadcom.com>
Date: Sun, 16 Jan 2022 11:10:08 -0800
Subject: [PATCH] bnxt_re/lib: Check pointer validity while freeing queue
pointers
qp->jrqq can be NULL in SRQ case or when accessed from error path.
Avoid segfault by adding check before accessing qp->jrqq and qp->jsqq.
Fixes: f92837e29fd4 ("bnxt_re/lib: consolidate hwque and swque in common structure")
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
---
providers/bnxt_re/verbs.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/providers/bnxt_re/verbs.c b/providers/bnxt_re/verbs.c
index 14fb58b7..ca113537 100644
--- a/providers/bnxt_re/verbs.c
+++ b/providers/bnxt_re/verbs.c
@@ -820,10 +820,14 @@ static int bnxt_re_check_qp_limits(struct bnxt_re_context *cntx,
static void bnxt_re_free_queue_ptr(struct bnxt_re_qp *qp)
{
- free(qp->jrqq->hwque);
- free(qp->jrqq);
- free(qp->jsqq->hwque);
- free(qp->jsqq);
+ if (qp->jrqq) {
+ free(qp->jrqq->hwque);
+ free(qp->jrqq);
+ }
+ if (qp->jsqq) {
+ free(qp->jsqq->hwque);
+ free(qp->jsqq);
+ }
}
static int bnxt_re_alloc_queue_ptr(struct bnxt_re_qp *qp,
--
2.31.1

View File

@ -0,0 +1,44 @@
From 3ea45d65d42e5daf032164240abebec82e987f90 Mon Sep 17 00:00:00 2001
From: Mark Zhang <markzhang@nvidia.com>
Date: Mon, 20 Dec 2021 11:19:46 +0200
Subject: [PATCH] mlx5: Initialize wr_data when post a work request
[ Upstream commit 4c905646de3e75bdccada4abe9f0d273d76eaf50 ]
With raw_wqe feature enabled, the wc opcode will be set to
IBV_WC_DRIVER2 if the wr_data is set to it.
So if wr_data is not initialized, there's a chance that it happens to be
IBV_WC_DRIVER2, then the application gets this wc opcode unexpectedly.
Fixes: 8ff1c5c3c411 ("mlx5: Introduce mlx5dv_wr_raw_wqe builder")
Signed-off-by: Mark Zhang <markzhang@nvidia.com>
Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
---
providers/mlx5/qp.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/providers/mlx5/qp.c b/providers/mlx5/qp.c
index 70c1afb2..8a99f504 100644
--- a/providers/mlx5/qp.c
+++ b/providers/mlx5/qp.c
@@ -871,6 +871,7 @@ static inline int _mlx5_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr,
seg += sizeof *ctrl;
size = sizeof *ctrl / 16;
+ qp->sq.wr_data[idx] = 0;
switch (ibqp->qp_type) {
case IBV_QPT_XRC_SEND:
@@ -1251,6 +1252,8 @@ static inline void _common_wqe_init_op(struct ibv_qp_ex *ibqp, int ib_op,
mqp->sq.wr_data[idx] = IBV_WC_DRIVER1;
else if (mlx5_op == MLX5_OPCODE_MMO)
mqp->sq.wr_data[idx] = IBV_WC_DRIVER3;
+ else
+ mqp->sq.wr_data[idx] = 0;
ctrl = mlx5_get_send_wqe(mqp, idx);
*(uint32_t *)((void *)ctrl + 8) = 0;
--
2.31.1

View File

@ -0,0 +1,63 @@
From 698f2ae804767635342694d31d9590fe6ad2217e Mon Sep 17 00:00:00 2001
From: Kamal Heib <kamalheib1@gmail.com>
Date: Wed, 8 Dec 2021 16:12:11 +0200
Subject: [PATCH] tests: Fix comparing qp_state for iWARP providers.
The initial QP state for iWARP providers is IBV_QPS_INIT (not
IBV_QPS_RESET), Change the test to handle this case.
Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
---
tests/test_qp.py | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/tests/test_qp.py b/tests/test_qp.py
index b952c95e..a66f724f 100644
--- a/tests/test_qp.py
+++ b/tests/test_qp.py
@@ -14,6 +14,7 @@ from pyverbs.pyverbs_error import PyverbsRDMAError
from pyverbs.qp import QPInitAttr, QPAttr, QP
from tests.base import PyverbsAPITestCase
import pyverbs.utils as pu
+import pyverbs.device as d
import pyverbs.enums as e
from pyverbs.pd import PD
from pyverbs.cq import CQ
@@ -177,6 +178,11 @@ class QPTest(PyverbsAPITestCase):
self.assertLessEqual(orig_cap.max_recv_sge, init_attr.cap.max_recv_sge)
self.assertLessEqual(orig_cap.max_inline_data, init_attr.cap.max_inline_data)
+ def get_node_type(self):
+ for dev in d.get_device_list():
+ if dev.name.decode() == self.ctx.name:
+ return dev.node_type
+
def query_qp_common_test(self, qp_type):
with PD(self.ctx) as pd:
with CQ(self.ctx, 100, None, None, 0) as cq:
@@ -190,14 +196,20 @@ class QPTest(PyverbsAPITestCase):
caps = qia.cap
qp = self.create_qp(pd, qia, False, False, self.ib_port)
qp_attr, qp_init_attr = qp.query(e.IBV_QP_STATE | e.IBV_QP_CAP)
- self.verify_qp_attrs(caps, e.IBV_QPS_RESET, qp_init_attr, qp_attr)
+ if self.get_node_type() == e.IBV_NODE_RNIC:
+ self.verify_qp_attrs(caps, e.IBV_QPS_INIT, qp_init_attr, qp_attr)
+ else:
+ self.verify_qp_attrs(caps, e.IBV_QPS_RESET, qp_init_attr, qp_attr)
# Extended QP
qia = get_qp_init_attr_ex(cq, pd, self.attr, self.attr_ex, qp_type)
caps = qia.cap # Save them to verify values later
qp = self.create_qp(self.ctx, qia, True, False, self.ib_port)
qp_attr, qp_init_attr = qp.query(e.IBV_QP_STATE | e.IBV_QP_CAP)
- self.verify_qp_attrs(caps, e.IBV_QPS_RESET, qp_init_attr, qp_attr)
+ if self.get_node_type() == e.IBV_NODE_RNIC:
+ self.verify_qp_attrs(caps, e.IBV_QPS_INIT, qp_init_attr, qp_attr)
+ else:
+ self.verify_qp_attrs(caps, e.IBV_QPS_RESET, qp_init_attr, qp_attr)
def test_query_rc_qp(self):
"""
--
2.31.1

View File

@ -1,5 +1,5 @@
Name: rdma-core Name: rdma-core
Version: 37.1 Version: 37.2
Release: 1%{?dist} Release: 1%{?dist}
Summary: RDMA core userspace libraries and daemons Summary: RDMA core userspace libraries and daemons
@ -12,6 +12,9 @@ Url: https://github.com/linux-rdma/rdma-core
Source: https://github.com/linux-rdma/rdma-core/releases/download/v%{version}/%{name}-%{version}.tar.gz Source: https://github.com/linux-rdma/rdma-core/releases/download/v%{version}/%{name}-%{version}.tar.gz
Patch1: 0001-kernel-boot-Do-not-perform-device-rename-on-OPA-devi.patch Patch1: 0001-kernel-boot-Do-not-perform-device-rename-on-OPA-devi.patch
Patch2: udev-keep-NAME_KERNEL-as-default-interface-naming-co.patch Patch2: udev-keep-NAME_KERNEL-as-default-interface-naming-co.patch
Patch3: 0001-tests-Fix-comparing-qp_state-for-iWARP-providers.patch
Patch4: 0001-bnxt_re-lib-Check-pointer-validity-while-freeing-que.patch
Patch5: 0001-mlx5-Initialize-wr_data-when-post-a-work-request.patch
# Do not build static libs by default. # Do not build static libs by default.
%define with_static %{?_with_static: 1} %{?!_with_static: 0} %define with_static %{?_with_static: 1} %{?!_with_static: 0}
@ -269,6 +272,9 @@ easy, object-oriented access to IB verbs.
%if 0%{?rhel} %if 0%{?rhel}
%patch2 -p1 %patch2 -p1
%endif %endif
%patch3 -p1
%patch4 -p1
%patch5 -p1
%build %build
@ -622,6 +628,10 @@ fi
%endif %endif
%changelog %changelog
* Tue Jan 18 2022 Honggang Li <honli@redhat.com> - 37.2-1
- Rebase to upstream release v37.2
- Resolves: rhbz#2035043, rhbz#2034948
* Wed Oct 20 2021 Honggang Li <honli@redhat.com> - 37.1-1 * Wed Oct 20 2021 Honggang Li <honli@redhat.com> - 37.1-1
- Rebase to upstream release v37.1 - Rebase to upstream release v37.1
- Resolves: rhbz#1994803 - Resolves: rhbz#1994803

View File

@ -1 +1 @@
SHA512 (rdma-core-37.1.tar.gz) = 102b4500ffcbd8ef0036a6d10ec35a42bd4132e0dbac53b8f52c37f90284168273dde38a66ebc38ee84a86f625855741e688e0cdfe64dc6a8280ef939ed2c4a8 SHA512 (rdma-core-37.2.tar.gz) = 11b0670ce78bb8207e24c373abdbd950d98e590f23344496ec6fdeebb51370acda993a24ab014bf09ecf9ea23abeb486a6c4384003da2d284ad3c157d30bc431