From d356d88bc5fcb987b80dfd459da7997519ae4546 Mon Sep 17 00:00:00 2001 From: eabdullin Date: Tue, 11 Nov 2025 21:48:25 +0000 Subject: [PATCH] import UBI rdma-core-57.0-2.el10 --- .gitignore | 2 +- ...the-data-copy-during-the-low-latency.patch | 34 ------- ...ts-Ensure-graceful-resource-cleaning.patch | 89 +++++++++++++++++++ ...pyverbs-Change-PD-object-return-type.patch | 43 +++++++++ rdma-core.spec | 30 ++++++- sources | 2 +- 6 files changed, 161 insertions(+), 39 deletions(-) delete mode 100644 0001-bnxt_re-lib-Fix-the-data-copy-during-the-low-latency.patch create mode 100644 0001-tests-Ensure-graceful-resource-cleaning.patch create mode 100644 0002-pyverbs-Change-PD-object-return-type.patch diff --git a/.gitignore b/.gitignore index d7349b0..df0e2b0 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -rdma-core-54.0.tar.gz +rdma-core-57.0.tar.gz diff --git a/0001-bnxt_re-lib-Fix-the-data-copy-during-the-low-latency.patch b/0001-bnxt_re-lib-Fix-the-data-copy-during-the-low-latency.patch deleted file mode 100644 index 08ac16b..0000000 --- a/0001-bnxt_re-lib-Fix-the-data-copy-during-the-low-latency.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 9558f227b158291bc3eb7044938d711e388802ce Mon Sep 17 00:00:00 2001 -From: Selvin Xavier -Date: Mon, 10 Mar 2025 07:38:03 -0700 -Subject: [PATCH] bnxt_re/lib: Fix the data copy during the low latency push - path - -The pointer used in the destination buffer is not correctly -type casted, because of which the data gets corrupted while copying. -The issue is seen in the previous adapters that has the low latency -push enabled. Fixing the pointer casting. - -Fixes: 52d0870c3eac ("bnxt_re/lib: Enable low latency push") -Reported-By: Kamal Heib -Signed-off-by: Selvin Xavier ---- - providers/bnxt_re/main.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/providers/bnxt_re/main.h b/providers/bnxt_re/main.h -index 7a9d48e1cf01..067b0c18df8d 100644 ---- a/providers/bnxt_re/main.h -+++ b/providers/bnxt_re/main.h -@@ -598,7 +598,7 @@ static inline void bnxt_re_copy_data_to_pb(struct bnxt_re_push_buffer *pbuf, - int indx; - - for (indx = 0; indx < idx; indx++) { -- dst = (uintptr_t *)(pbuf->pbuf + 2 * (indx + offset)); -+ dst = (uintptr_t *)(pbuf->pbuf) + 2 * indx + offset; - src = (uintptr_t *)(pbuf->wqe[indx]); - mmio_write64(dst, *src); - --- -2.49.0 - diff --git a/0001-tests-Ensure-graceful-resource-cleaning.patch b/0001-tests-Ensure-graceful-resource-cleaning.patch new file mode 100644 index 0000000..2b42364 --- /dev/null +++ b/0001-tests-Ensure-graceful-resource-cleaning.patch @@ -0,0 +1,89 @@ +From a9eb7409fb0b6af5dc54ae222286926b6a028ef0 Mon Sep 17 00:00:00 2001 +From: Edward Srouji +Date: Tue, 4 Mar 2025 16:02:35 +0200 +Subject: [PATCH] tests: Ensure graceful resource cleaning + +A SEGFAULT was observed recently on some environments with +python 3.12.X. +To work around the issue and ensure that python garbage collector exiting +gracefully, a new decorator was added that catches SkipTest unittest +exceptions and closes the context and its underlying resources. + +An a example of a segmentation fault occurrence that this test fixes: +$ python3 tests/run_tests.py test_mlx5_dma_memcpy +sTraceback (most recent call last): + File "cq.pyx", line 359, in pyverbs.cq.CQEX.close +pyverbs.pyverbs_error.PyverbsRDMAError: Failed to destroy CQEX. Errno: +9, Bad file descriptor +Exception ignored in: 'pyverbs.cq.CQEX.__dealloc__' +Traceback (most recent call last): + File "cq.pyx", line 359, in pyverbs.cq.CQEX.close +pyverbs.pyverbs_error.PyverbsRDMAError: Failed to destroy CQEX. Errno: +9, Bad file descriptor +Segmentation fault (core dumped) + +Signed-off-by: Edward Srouji +--- + tests/base.py | 32 +++++++++++++++++++++++++++++++- + 1 file changed, 31 insertions(+), 1 deletion(-) + +diff --git a/tests/base.py b/tests/base.py +index 2738714612ec..c6ffa1beca1a 100644 +--- a/tests/base.py ++++ b/tests/base.py +@@ -3,6 +3,7 @@ + + import multiprocessing as mp + import subprocess ++import functools + import unittest + import tempfile + import random +@@ -532,7 +533,35 @@ class RDMACMBaseTest(RDMATestCase): + sys.exit(2) + + +-class BaseResources(object): ++def catch_skiptest(func): ++ """ ++ Decorator to catch unittest.SkipTest in __init__ resource functions. ++ It gracefully closes the context and all of its underlying resources. ++ """ ++ @functools.wraps(func) ++ def wrapper(self, *args, **kwargs): ++ try: ++ func(self, *args, **kwargs) ++ except unittest.SkipTest as e: ++ if hasattr(self, 'ctx') and self.ctx: ++ self.ctx.close() ++ raise e ++ return wrapper ++ ++ ++class SkipTestMeta(type): ++ """ ++ Metaclass to automatically wrap __init__ in catch_skiptest. ++ It should only be used in resource classes, such as those inheriting from ++ BaseResources. ++ """ ++ def __new__(cls, name, bases, dct): ++ if "__init__" in dct: ++ dct["__init__"] = catch_skiptest(dct["__init__"]) ++ return super().__new__(cls, name, bases, dct) ++ ++ ++class BaseResources(object, metaclass=SkipTestMeta): + """ + BaseResources class is a base aggregator object which contains basic + resources like Context and PD. It opens a context over the given device +@@ -548,6 +577,7 @@ class BaseResources(object): + self.dev_name = dev_name + self.gid_index = gid_index + self.ib_port = ib_port ++ self.ctx = None + self.create_context() + self.create_pd() + +-- +2.49.0 + diff --git a/0002-pyverbs-Change-PD-object-return-type.patch b/0002-pyverbs-Change-PD-object-return-type.patch new file mode 100644 index 0000000..844b206 --- /dev/null +++ b/0002-pyverbs-Change-PD-object-return-type.patch @@ -0,0 +1,43 @@ +From 47c3855f3b84c47cb471cbba8090a6997e07be57 Mon Sep 17 00:00:00 2001 +From: Shachar Kagan +Date: Mon, 28 Apr 2025 17:18:18 +0300 +Subject: [PATCH] pyverbs: Change PD object return type + +Change PD object return type to be compatible with Cython 3.x + +Signed-off-by: Shachar Kagan +Signed-off-by: Edward Srouji +--- + pyverbs/pd.pyx | 2 +- + pyverbs/providers/mlx5/mlx5dv_objects.pyx | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/pyverbs/pd.pyx b/pyverbs/pd.pyx +index 2d84e0b68d10..d8845e8a058b 100644 +--- a/pyverbs/pd.pyx ++++ b/pyverbs/pd.pyx +@@ -151,7 +151,7 @@ cdef class PD(PyverbsCM): + + @property + def pd(self): +- return self.pd ++ return self.pd + + + cdef void *pd_alloc(v.ibv_pd *pd, void *pd_context, size_t size, +diff --git a/pyverbs/providers/mlx5/mlx5dv_objects.pyx b/pyverbs/providers/mlx5/mlx5dv_objects.pyx +index e7776205a150..0567e81a06e8 100644 +--- a/pyverbs/providers/mlx5/mlx5dv_objects.pyx ++++ b/pyverbs/providers/mlx5/mlx5dv_objects.pyx +@@ -182,7 +182,7 @@ cdef class Mlx5DvObj(PyverbsObject): + self.dv_qp = dv_qp + if pd: + dv_pd = Mlx5DvPD() +- self.obj.pd.in_ = pd.pd ++ self.obj.pd.in_ = pd.pd + self.obj.pd.out = &(dv_pd.dv_pd) + self.dv_pd = dv_pd + if srq: +-- +2.49.0 + diff --git a/rdma-core.spec b/rdma-core.spec index 3fa25d3..5d951b5 100644 --- a/rdma-core.spec +++ b/rdma-core.spec @@ -9,7 +9,7 @@ ## END: Set by rpmautospec Name: rdma-core -Version: 54.0 +Version: 57.0 Release: %autorelease Summary: RDMA core userspace libraries and daemons @@ -20,7 +20,8 @@ Summary: RDMA core userspace libraries and daemons License: GPLv2 or BSD Url: https://github.com/linux-rdma/rdma-core Source: https://github.com/linux-rdma/rdma-core/releases/download/v%{version}/%{name}-%{version}.tar.gz -Patch0001: 0001-bnxt_re-lib-Fix-the-data-copy-during-the-low-latency.patch +Patch0001: 0001-tests-Ensure-graceful-resource-cleaning.patch +Patch0002: 0002-pyverbs-Change-PD-object-return-type.patch Patch9999: 9999-udev-keep-NAME_KERNEL-as-default-interface-naming-co.patch # Do not build static libs by default. %define with_static %{?_with_static: 1} %{?!_with_static: 0} @@ -36,7 +37,9 @@ BuildRequires: pkgconfig BuildRequires: pkgconfig(libnl-3.0) BuildRequires: pkgconfig(libnl-route-3.0) BuildRequires: /usr/bin/rst2man +%ifarch %{valgrind_arches} BuildRequires: valgrind-devel +%endif BuildRequires: systemd BuildRequires: systemd-devel %if 0%{?fedora} >= 32 || 0%{?rhel} >= 8 @@ -292,6 +295,7 @@ easy, object-oriented access to IB verbs. %prep %setup -q %patch 0001 -p1 +%patch 0002 -p1 %if 0%{?rhel} %patch 9999 -p1 %endif @@ -381,6 +385,17 @@ if [ -x /sbin/udevadm ]; then /sbin/udevadm trigger --subsystem-match=net --action=change || true /sbin/udevadm trigger --subsystem-match=infiniband_mad --action=change || true fi +%systemd_post rdma-load-modules@rdma.service +%systemd_post rdma-load-modules@infiniband.service +%systemd_post rdma-load-modules@roce.service +%preun -n rdma-core +%systemd_preun rdma-load-modules@rdma.service +%systemd_preun rdma-load-modules@infiniband.service +%systemd_preun rdma-load-modules@roce.service +%postun -n rdma-core +%systemd_postun_with_restart rdma-load-modules@rdma.service +%systemd_postun_with_restart rdma-load-modules@infiniband.service +%systemd_postun_with_restart rdma-load-modules@roce.service %post -n ibacm %systemd_post ibacm.service @@ -683,7 +698,16 @@ fi %changelog ## START: Generated by rpmautospec -* Mon Apr 28 2025 Kamal Heib - 54.0-2 +* Thu Aug 07 2025 Kamal Heib - 57.0-2 +- Fix pyverbs tests + +* Mon Jun 02 2025 Kamal Heib - 57.0-1 +- Rebase to upstream release v57.0 + +* Fri May 02 2025 Andrea Bolognani - 54.0-3 +- Properly check %%{valgrind_arches} + +* Fri Apr 25 2025 Kamal Heib - 54.0-2 - Fix data corruption in bnxt_re * Mon Nov 04 2024 Kamal Heib - 54.0-1 diff --git a/sources b/sources index 324fb35..feb1d68 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rdma-core-54.0.tar.gz) = efb98dec017e1eb71ed6f2b652d557d0444c672ff388927bdd724c81bb4baeb5617c81fff609f794c1ff128ab93ae26ed4502bd0ebf14e157737b1b08d0fb4b9 +SHA512 (rdma-core-57.0.tar.gz) = 4a904d34af6863655545fe720cc25a8800684f63c51cebb67be2058363949217903957dc925c69d41294362ccff75fb0d37f3bc31cd6f6f252a804d6713f62cf