From 1d4303a0b442785fa726f64c66a79330c373b931 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Apr 27 2021 07:56:53 +0000 Subject: import rdma-core-22.4-6.el7_9 --- diff --git a/SOURCES/0001-rdma-ndd-fix-udev-racy-issue-for-system-with-multipl.patch b/SOURCES/0001-rdma-ndd-fix-udev-racy-issue-for-system-with-multipl.patch new file mode 100644 index 0000000..473a892 --- /dev/null +++ b/SOURCES/0001-rdma-ndd-fix-udev-racy-issue-for-system-with-multipl.patch @@ -0,0 +1,56 @@ +From 12642839a58a1e6240b5c3376ee87f783c475f3d Mon Sep 17 00:00:00 2001 +From: Honggang Li +Date: Tue, 16 Mar 2021 21:12:09 -0400 +Subject: [PATCH] rdma-ndd: fix udev racy issue for system with multiple + InfiniBand HCAs + +[ Upstream commit 649d6b8c58fcc8afa809cf874b65b03a5607143c ] + +After read the system hostname, the function `monitor` calls function +`set_rdma_node_desc` to initialize the node description for HCAs had +been detected by kernel. + +For system with multiple InfiniBand HCAs, only the first HCA is +guaranteed to be detected by kernel at this point. The systemd udev +"add" event for the rest HCAs may be emitted before rdma-ndd listen +udev event via function `get_udev_fd`. That means the "add" event +will never be sent to rdma-ndd service, as rdma-ndd not ready for udev +even yet. So, the node description for those HCAs may not be updated +by rdma-ndd during system boot. + +With this patch, rdma-ndd will initialize the node description after +it listen to udev. InfiniBand HCAs detected after the initialization +will be handled by udev even. + +Reported-by: Georg Sauthoff +Tested-by: Georg Sauthoff +Signed-off-by: Honggang Li +Signed-off-by: Nicolas Morey-Chaisemartin +--- + rdma-ndd/rdma-ndd.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/rdma-ndd/rdma-ndd.c b/rdma-ndd/rdma-ndd.c +index 418d1de9456b..03d0b79dd7f8 100644 +--- a/rdma-ndd/rdma-ndd.c ++++ b/rdma-ndd/rdma-ndd.c +@@ -254,7 +254,6 @@ static void monitor(bool systemd) + } + + read_hostname(hn_fd, hostname, sizeof(hostname)); +- set_rdma_node_desc((const char *)hostname, 1); + + fds[0].fd = hn_fd; + fds[0].events = 0; +@@ -269,6 +268,8 @@ static void monitor(bool systemd) + if (systemd) + sd_notify(0, "READY=1"); + ++ set_rdma_node_desc((const char *)hostname, 1); ++ + while (1) { + if (poll(fds, numfds, -1) <= 0) { + syslog(LOG_ERR, "Poll %s failed; exiting\n", SYS_HOSTNAME); +-- +2.25.4 + diff --git a/SPECS/rdma-core.spec b/SPECS/rdma-core.spec index c16d59e..319c78c 100644 --- a/SPECS/rdma-core.spec +++ b/SPECS/rdma-core.spec @@ -1,11 +1,8 @@ Name: rdma-core Version: 22.4 -Release: 5%{?dist} +Release: 6%{?dist} Summary: RDMA core userspace libraries and daemons -%ifnarch %{arm} -%define dma_coherent 1 -%endif # Almost everything is licensed under the OFA dual GPLv2, 2 Clause BSD license # providers/ipathverbs/ Dual licensed using a BSD license with an extra patent clause # providers/rxe/ Incorporates code from ipathverbs and contains the patent clause @@ -39,6 +36,7 @@ Patch107: 0001-bnxt_re-lib-Add-remaining-pci-ids-for-gen-P5-devices.patch Patch108: 0002-bnxt_re-lib-Recognize-additional-5750x-device-ID-s.patch Patch109: 0001-libibverbs-Fix-ABI_placeholder1-and-ABI_placeholder2.patch +Patch110: 0001-rdma-ndd-fix-udev-racy-issue-for-system-with-multipl.patch # Do not build static libs by default. %define with_static %{?_with_static: 1} %{?!_with_static: 0} @@ -72,6 +70,8 @@ Obsoletes: libibcm < %{version}-%{release} # the ndd utility moved from infiniband-diags to rdma-core Conflicts: infiniband-diags <= 1.6.5 Requires: pciutils +# 32-bit arm is missing required arch-specific memory barriers, +ExcludeArch: %{arm} # Since we recommend developers use Ninja, so should packagers, for consistency. %define CMAKE_FLAGS %{nil} @@ -122,12 +122,10 @@ Provides: libhfi1-static = %{version}-%{release} Obsoletes: libhfi1-static < %{version}-%{release} Provides: libipathverbs-static = %{version}-%{release} Obsoletes: libipathverbs-static < %{version}-%{release} -%if 0%{?dma_coherent} Provides: libmlx4-static = %{version}-%{release} Obsoletes: libmlx4-static < %{version}-%{release} Provides: libmlx5-static = %{version}-%{release} Obsoletes: libmlx5-static < %{version}-%{release} -%endif Provides: libnes-static = %{version}-%{release} Obsoletes: libnes-static < %{version}-%{release} Provides: libocrdma-static = %{version}-%{release} @@ -157,14 +155,12 @@ Provides: libi40iw = %{version}-%{release} Obsoletes: libi40iw < %{version}-%{release} Provides: libipathverbs = %{version}-%{release} Obsoletes: libipathverbs < %{version}-%{release} -%if 0%{?dma_coherent} Provides: libmlx4 = %{version}-%{release} Obsoletes: libmlx4 < %{version}-%{release} %ifnarch s390 Provides: libmlx5 = %{version}-%{release} Obsoletes: libmlx5 < %{version}-%{release} %endif -%endif Provides: libmthca = %{version}-%{release} Obsoletes: libmthca < %{version}-%{release} Provides: libnes = %{version}-%{release} @@ -304,6 +300,7 @@ discover and use SCSI devices via the SCSI RDMA Protocol over InfiniBand. %patch107 -p1 %patch108 -p1 %patch109 -p1 +%patch110 -p1 %build @@ -354,22 +351,16 @@ mkdir -p %{buildroot}%{dracutlibdir}/modules.d/05rdma mkdir -p %{buildroot}%{sysmodprobedir} install -D -m0644 redhat/rdma.conf %{buildroot}/%{_sysconfdir}/rdma/rdma.conf install -D -m0644 redhat/rdma.sriov-vfs %{buildroot}/%{_sysconfdir}/rdma/sriov-vfs -%if 0%{?dma_coherent} install -D -m0644 redhat/rdma.mlx4.conf %{buildroot}/%{_sysconfdir}/rdma/mlx4.conf -%endif install -D -m0755 redhat/rdma.ifup-ib %{buildroot}/%{_sysconfdir}/sysconfig/network-scripts/ifup-ib install -D -m0755 redhat/rdma.ifdown-ib %{buildroot}/%{_sysconfdir}/sysconfig/network-scripts/ifdown-ib install -D -m0644 redhat/rdma.service %{buildroot}%{_unitdir}/rdma.service install -D -m0755 redhat/rdma.modules-setup.sh %{buildroot}%{dracutlibdir}/modules.d/05rdma/module-setup.sh install -D -m0644 redhat/rdma.udev-rules %{buildroot}%{_udevrulesdir}/98-rdma.rules -%if 0%{?dma_coherent} install -D -m0644 redhat/rdma.mlx4.sys.modprobe %{buildroot}%{sysmodprobedir}/libmlx4.conf -%endif install -D -m0755 redhat/rdma.kernel-init %{buildroot}%{_libexecdir}/rdma-init-kernel install -D -m0755 redhat/rdma.sriov-init %{buildroot}%{_libexecdir}/rdma-set-sriov-vf -%if 0%{?dma_coherent} install -D -m0755 redhat/rdma.mlx4-setup.sh %{buildroot}%{_libexecdir}/mlx4-setup.sh -%endif # ibacm bin/ib_acme -D . -O @@ -418,11 +409,9 @@ rm -rf %{buildroot}/%{_initrddir}/ %doc %{_docdir}/%{name}-%{version}/udev.md %config(noreplace) %{_sysconfdir}/rdma/* %config(noreplace) %{_sysconfdir}/udev/rules.d/* -%if 0%{?dma_coherent} %ifnarch s390 %config(noreplace) %{_sysconfdir}/modprobe.d/mlx4.conf %endif -%endif %config(noreplace) %{_sysconfdir}/modprobe.d/truescale.conf %{_sysconfdir}/sysconfig/network-scripts/* %{_unitdir}/rdma-hw.target @@ -431,14 +420,10 @@ rm -rf %{buildroot}/%{_initrddir}/ %dir %{dracutlibdir}/modules.d/05rdma %{dracutlibdir}/modules.d/05rdma/module-setup.sh %{_udevrulesdir}/* -%if 0%{?dma_coherent} %{sysmodprobedir}/libmlx4.conf -%endif %{_libexecdir}/rdma-init-kernel %{_libexecdir}/rdma-set-sriov-vf -%if 0%{?dma_coherent} %{_libexecdir}/mlx4-setup.sh -%endif %{_libexecdir}/truescale-serdes.cmds %{_sbindir}/rdma-ndd %{_unitdir}/rdma-ndd.service @@ -460,13 +445,11 @@ rm -rf %{buildroot}/%{_initrddir}/ %{_mandir}/man3/rdma* %{_mandir}/man3/umad* %{_mandir}/man3/*_to_ibv_rate.* -%if 0%{?dma_coherent} %ifnarch s390 %{_mandir}/man3/mlx4dv* %{_mandir}/man3/mlx5dv* %{_mandir}/man7/mlx5dv* %endif -%endif %{_mandir}/man7/rdma_cm.* %files -n libibverbs @@ -474,24 +457,20 @@ rm -rf %{buildroot}/%{_initrddir}/ %dir %{_libdir}/libibverbs %{_libdir}/libibverbs*.so.* %{_libdir}/libibverbs/*.so -%if 0%{?dma_coherent} %ifnarch s390 %{_libdir}/libmlx4.so.* %{_libdir}/libmlx5.so.* %endif -%endif %config(noreplace) %{_sysconfdir}/libibverbs.d/*.driver %doc %{_docdir}/%{name}-%{version}/libibverbs.md %doc %{_docdir}/%{name}-%{version}/rxe.md %doc %{_docdir}/%{name}-%{version}/tag_matching.md %{_bindir}/rxe_cfg %{_mandir}/man7/rxe* -%if 0%{?dma_coherent} %ifnarch s390 %{_mandir}/man7/mlx4dv* %{_mandir}/man7/mlx5dv* %endif -%endif %{_mandir}/man8/rxe* %files -n libibverbs-utils @@ -573,6 +552,10 @@ rm -rf %{buildroot}/%{_initrddir}/ %doc %{_docdir}/%{name}-%{version}/ibsrpdm.md %changelog +* Mon Apr 12 2021 Honggang Li - 22.4-6 +- rdma-ndd: fix udev racy issue for system with multiple InfiniBand HCAs +- Resolves: rhbz#1937699 + * Sat Jun 06 2020 Honggang Li - 22.4-5 - libibverbs: Fix ABI_placeholder1 and ABI_placeholder2 assignment - Resolves: rhbz#1843221