Name:           rdma-core
Version:        50.0
Release:        23
Summary:        RDMA core userspace libraries and daemons
License:        GPL-2.0-only OR BSD-2-Clause AND BSD-3-Clause
Url:            https://github.com/linux-rdma/rdma-core
Source:         https://github.com/linux-rdma/rdma-core/releases/download/v%{version}/%{name}-%{version}.tar.gz

Patch1: 0001-Update-kernel-headers.patch
Patch2: 0002-libhns-Support-DSCP.patch
patch3: 0003-Update-kernel-headers.patch
patch4: 0004-libhns-Introduce-hns-direct-verbs.patch
patch5: 0005-libhns-Encapsulate-context-attribute-setting-into-a-.patch
patch6: 0006-libhns-Support-congestion-control-algorithm-configur.patch
patch7: 0007-libhns-Add-support-for-thread-domain-and-parent-doma.patch
patch8: 0008-libhns-Add-support-for-lock-free-QP.patch
patch9: 0009-libhns-Add-support-for-lock-free-CQ.patch
patch10: 0010-libhns-Add-support-for-lock-free-SRQ.patch
patch11: 0011-libhns-Support-flexible-WQE-buffer-page-size.patch
patch12: 0012-Update-kernel-headers.patch
patch13: 0013-libhns-Add-reset-stop-flow-mechanism.patch
patch14: 0014-libhns-Support-reporting-wc-as-software-mode.patch
patch15: 0015-libhns-return-error-when-post-send-in-reset-state.patch
patch16: 0016-libhns-Assign-doorbell-to-zero-when-allocate-it.patch
patch17: 0017-libhns-Fix-missing-reset-notification.patch
patch18: 0018-libhns-Fix-owner-bit-when-SQ-wraps-around-in-new-IO.patch
patch19: 0019-Update-kernel-headers.patch
patch20: 0020-libhns-Introduce-DCA-for-RC-QP.patch
patch21: 0021-libhns-Add-support-for-shrinking-DCA-memory-pool.patch
patch22: 0022-libhns-Add-support-for-attaching-QP-s-WQE-buffer.patch
patch23: 0023-libhns-Use-shared-memory-to-sync-DCA-status.patch
patch24: 0024-libhns-Sync-DCA-status-by-shared-memory.patch
patch25: 0025-libhns-Add-direct-verbs-support-to-config-DCA.patch
patch26: 0026-libhns-Add-RoH-device-IDs.patch
patch27: 0027-libhns-Add-the-parsing-of-mac-type-in-RoH-mode.patch
patch28: 0028-libhns-Fix-missing-flexible-WQE-buffer-page-flag.patch
patch29: 0029-libhns-Fix-ext_sge-page-size.patch
patch30: 0030-libhns-Remove-unused-return-value.patch
patch31: 0031-libhns-Fix-several-context-locks-issue.patch
patch32: 0032-libhns-Clean-up-signed-unsigned-mix-with-relational-.patch
patch33: 0033-libhns-Fix-missing-flag-when-creating-qp-by-hnsdv_cr.patch
patch34: 0034-librdmacm-Fix-an-overflow-bug-in-qsort-comparison-function.patch
patch35: 0035-Fix-the-stride-calculation-for-MSN-PSN-area.patch
patch37: 0037-libhns-Fix-out-of-order-issue-of-requester-when-sett.patch
patch38: 0038-libhns-Fix-reference-to-uninitialized-cq-pointer.patch
patch39: 0039-libhns-Fix-the-exception-branch-of-wr_start-is-not-l.patch
patch40: 0040-libhns-Fix-memory-leakage-when-DCA-is-enabled.patch
patch41: 0041-libhns-Fix-coredump-during-QP-destruction-when-send_.patch
patch42: 0042-libhns-Add-error-logs-to-help-diagnosis.patch
patch43: 0043-libhns-Fix-missing-fields-for-SRQ-WC.patch
patch44: 0044-libxscale-Add-Yunsilicon-User-Space-RDMA-Driver.patch
patch45: 0045-libhns-fix-incorrectly-using-fixed-pagesize.patch
patch46: 0046-libhns-fix-missing-new-IO-support-for-DCA.patch

BuildRequires:  binutils cmake >= 2.8.11 gcc libudev-devel pkgconfig pkgconfig(libnl-3.0)
BuildRequires:  pkgconfig(libnl-route-3.0) systemd systemd-devel
%ifarch %{valgrind_arches}
BuildRequires:  valgrind-devel
%endif
BuildRequires:  python3-devel python3-Cython python3 python3-docutils perl-generators
BuildRequires:  ninja-build

Requires:       systemd pciutils

Provides:       rdma = %{version}-%{release}
Obsoletes:      rdma < %{version}-%{release}
Obsoletes:      rdma-core < %{version}-%{release}
Conflicts:      infiniband-diags <= 1.6.7

%{?systemd_requires}

%define CMAKE_FLAGS -GNinja
%define make_jobs ninja-build -v %{?_smp_mflags}
%define cmake_install DESTDIR=%{buildroot} ninja-build install

%description
This is the userspace components for the Linux Kernel's drivers/infiniband subsystem.
Specifically this contains the userspace libraries for the following device nodes:

  - /dev/infiniband/uverbsX (libibverbs)
  - /dev/infiniband/rdma_cm (librdmacm)
  - /dev/infiniband/umadX (libibumad)

%package        devel
Summary:        RDMA core development libraries and headers
Requires:       %{name} = %{version}-%{release}
Requires:       libibverbs%{?_isa} = %{version}-%{release}
Provides:       libibverbs-devel = %{version}-%{release}
Obsoletes:      libibverbs-devel < %{version}-%{release}
Requires:       libibumad%{?_isa} = %{version}-%{release}
Provides:       libibumad-devel = %{version}-%{release}
Obsoletes:      libibumad-devel < %{version}-%{release}
Requires:       librdmacm%{?_isa} = %{version}-%{release}
Provides:       librdmacm-devel = %{version}-%{release}
Obsoletes:      librdmacm-devel < %{version}-%{release}
Provides:       ibacm-devel = %{version}-%{release}
Obsoletes:      ibacm-devel < %{version}-%{release}
Requires:       infiniband-diags%{?_isa} = %{version}-%{release}
Provides:       infiniband-diags-devel = %{version}-%{release}
Obsoletes:      infiniband-diags-devel < %{version}-%{release}
Provides:       libibmad-devel = %{version}-%{release}
Obsoletes:      libibmad-devel < %{version}-%{release}

BuildRequires:  pkgconfig(libnl-3.0) pkgconfig(libnl-route-3.0)

%description    devel
RDMA core development libraries and headers.

%package -n infiniband-diags
Summary: InfiniBand Diagnostic Tools
Requires: libibumad%{?_isa} = %{version}-%{release}
Provides: perl(IBswcountlimits)
Provides: libibmad = %{version}-%{release}
Obsoletes: libibmad < %{version}-%{release}
Obsoletes: openib-diags < 1.3

%description -n infiniband-diags
This package provides IB diagnostic programs and scripts needed to diagnose an
IB subnet.  infiniband-diags now also provides libibmad.  libibmad provides
low layer IB functions for use by the IB diagnostic and management
programs. These include MAD, SA, SMP, and other basic IB functions.

%package -n infiniband-diags-compat
Summary: OpenFabrics Alliance InfiniBand Diagnostic Tools

%description -n infiniband-diags-compat
Deprecated scripts and utilities which provide duplicated functionality, most
often at a reduced performance. These are maintained for the time being for
compatibility reasons.

%package -n libibverbs
Summary: A library and drivers for direct userspace use of RDMA (InfiniBand/iWARP/RoCE) hardware
Provides: libcxgb4 = %{version}-%{release}
Obsoletes: libcxgb4 < %{version}-%{release}
Provides: libefa = %{version}-%{release}
Obsoletes: libefa < %{version}-%{release}
Provides: libhfi1 = %{version}-%{release}
Obsoletes: libhfi1 < %{version}-%{release}
Provides: libhns = %{version}-%{release}
Obsoletes: libhns < %{version}-%{release}
Provides: libipathverbs = %{version}-%{release}
Obsoletes: libipathverbs < %{version}-%{release}
Provides: libirdma = %{version}-%{release}
Obsoletes: libirdma < %{version}-%{release}
Provides: libmana = %{version}-%{release}
Obsoletes: libmana < %{version}-%{release}
Provides: libmlx4 = %{version}-%{release}
Obsoletes: libmlx4 < %{version}-%{release}
Provides: libmlx5 = %{version}-%{release}
Obsoletes: libmlx5 < %{version}-%{release}
Provides: libmthca = %{version}-%{release}
Obsoletes: libmthca < %{version}-%{release}
Provides: libocrdma = %{version}-%{release}
Obsoletes: libocrdma < %{version}-%{release}
Provides: librxe = %{version}-%{release}
Obsoletes: librxe < %{version}-%{release}
Provides: libxscale = %{version}-%{release}
Obsoletes: libxscale < %{version}-%{release}

%description -n libibverbs
libibverbs is a library that allows userspace processes to use RDMA
"verbs" as described in the InfiniBand Architecture Specification and
the RDMA Protocol Verbs Specification.  This includes direct hardware
access from userspace to InfiniBand/iWARP adapters (kernel bypass) for
fast path operations.

Device-specific plug-in ibverbs userspace drivers are included:

- libcxgb4: Chelsio T4 iWARP HCA
- libefa: Amazon Elastic Fabric Adapter
- libhfi1: Intel Omni-Path HFI
- libhns: HiSilicon Hip08/09/10 SoC
- libipathverbs: QLogic InfiniPath HCA
- libirdma: Intel Ethernet Connection RDMA
- libmana: Microsoft Azure Network Adapter
- libmlx4: Mellanox ConnectX-3 InfiniBand HCA
- libmlx5: Mellanox Connect-IB/X-4+ InfiniBand HCA
- libmthca: Mellanox InfiniBand HCA
- libocrdma: Emulex OneConnect RDMA/RoCE Device
- libqedr: QLogic QL4xxx RoCE HCA
- librxe: A software implementation of the RoCE protocol
- libsiw: A software implementation of the iWarp protocol
- libvmw_pvrdma: VMware paravirtual RDMA device
- libxscale: Yunsilicon RDMA device

%package -n libibverbs-utils
Summary: Examples for the libibverbs library
Requires: libibverbs%{?_isa} = %{version}-%{release}

%description -n libibverbs-utils
Useful libibverbs example programs such as ibv_devinfo, which
displays information about RDMA devices.

%package -n ibacm
Summary: InfiniBand Communication Manager Assistant
%{?systemd_requires}

%description -n ibacm
The ibacm daemon helps reduce the load of managing path record lookups on
large InfiniBand fabrics by providing a user space implementation of what
is functionally similar to an ARP cache.  The use of ibacm, when properly
configured, can reduce the SA packet load of a large IB cluster from O(n^2)
to O(n).  The ibacm daemon is started and normally runs in the background,
user applications need not know about this daemon as long as their app
uses librdmacm to handle connection bring up/tear down.  The librdmacm
library knows how to talk directly to the ibacm daemon to retrieve data.

%package -n iwpmd
Summary: iWarp Port Mapper userspace daemon
%{?systemd_requires}

%description -n iwpmd
iwpmd provides a userspace service for iWarp drivers to claim
tcp ports through the standard socket interface.

%package -n libibumad
Summary: OpenFabrics Alliance InfiniBand umad (userspace management datagram) library

%description -n libibumad
libibumad provides the userspace management datagram (umad) library
functions, which sit on top of the umad modules in the kernel. These
are used by the IB diagnostic and management tools, including OpenSM.

%package -n librdmacm
Summary: Userspace RDMA Connection Manager

%description -n librdmacm
librdmacm provides a userspace RDMA Communication Management API.

%package -n librdmacm-utils
Summary: Examples for the librdmacm library
Requires: librdmacm%{?_isa} = %{version}-%{release}

%description -n librdmacm-utils
Example test programs for the librdmacm library.

%package -n srp_daemon
Summary: Tools for using the InfiniBand SRP protocol devices
Obsoletes: srptools <= 1.0.3
Provides: srptools = %{version}-%{release}
Obsoletes: openib-srptools <= 0.0.6
%{?systemd_requires}

%description -n srp_daemon
In conjunction with the kernel ib_srp driver, srp_daemon allows you to
discover and use SCSI devices via the SCSI RDMA Protocol over InfiniBand.

%package -n python3-pyverbs
Summary: Python3 API over IB verbs
%{?python_provide:%python_provide python3-pyverbs}

%description -n python3-pyverbs
Pyverbs is a Cython-based Python API over libibverbs, providing an
easy, object-oriented access to IB verbs.

%package help
Summary: Documents for %{name}
Buildarch: noarch
Requires: man info
Provides: infiniband-diags-help = %{version}-%{release}
Obsoletes: infiniband-diags-help < %{version}-%{release}

%description help
Man pages and other related documents for %{name}.

%prep
%autosetup -p1

%build
%if 0%{?_rundir:1}
%else
%define _rundir /var/run
%endif

%{!?EXTRA_CMAKE_FLAGS: %define EXTRA_CMAKE_FLAGS %{nil}}

%cmake %{CMAKE_FLAGS} \
         -DCMAKE_BUILD_TYPE=Release \
         -DCMAKE_INSTALL_BINDIR:PATH=%{_bindir} \
         -DCMAKE_INSTALL_SBINDIR:PATH=%{_sbindir} \
         -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} \
         -DCMAKE_INSTALL_LIBEXECDIR:PATH=%{_libexecdir} \
         -DCMAKE_INSTALL_LOCALSTATEDIR:PATH=%{_localstatedir} \
         -DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=%{_sharedstatedir} \
         -DCMAKE_INSTALL_INCLUDEDIR:PATH=%{_includedir} \
         -DCMAKE_INSTALL_INFODIR:PATH=%{_infodir} \
         -DCMAKE_INSTALL_MANDIR:PATH=%{_mandir} \
         -DCMAKE_INSTALL_SYSCONFDIR:PATH=%{_sysconfdir} \
         -DCMAKE_INSTALL_SYSTEMD_SERVICEDIR:PATH=%{_unitdir} \
         -DCMAKE_INSTALL_INITDDIR:PATH=%{_initrddir} \
         -DCMAKE_INSTALL_RUNDIR:PATH=%{_rundir} \
         -DCMAKE_INSTALL_DOCDIR:PATH=%{_docdir}/%{name}-%{version} \
         -DCMAKE_INSTALL_UDEV_RULESDIR:PATH=%{_udevrulesdir} \
         -DCMAKE_INSTALL_PERLDIR:PATH=%{perl_vendorlib} \
         -DENABLE_IBDIAGS_COMPAT:BOOL=True \
         -DENABLE_STATIC=1 \
         %{EXTRA_CMAKE_FLAGS} \
         -DPYTHON_EXECUTABLE:PATH=%{__python3} \
         -DCMAKE_INSTALL_PYTHON_ARCH_LIB:PATH=%{python3_sitearch} \
         -DNO_PYVERBS=0
%make_jobs

%install
%cmake_install

mkdir -p %{buildroot}/%{_sysconfdir}/rdma

%global dracutlibdir %{_prefix}/lib/dracut
%global sysmodprobedir %{_prefix}/lib/modprobe.d
mkdir -p %{buildroot}%{_sysconfdir}/udev/rules.d
mkdir -p %{buildroot}%{_libexecdir}
mkdir -p %{buildroot}%{_udevrulesdir}
mkdir -p %{buildroot}%{dracutlibdir}/modules.d/05rdma
mkdir -p %{buildroot}%{sysmodprobedir}
install -D -m 0644 redhat/rdma.mlx4.conf %{buildroot}/%{_sysconfdir}/rdma/mlx4.conf
install -D -m 0755 redhat/rdma.modules-setup.sh %{buildroot}%{dracutlibdir}/modules.d/05rdma/module-setup.sh
install -D -m 0644 redhat/rdma.mlx4.sys.modprobe %{buildroot}%{sysmodprobedir}/libmlx4.conf
install -D -m 0755 redhat/rdma.mlx4-setup.sh %{buildroot}%{_libexecdir}/mlx4-setup.sh
rm -f %{buildroot}%{_sysconfdir}/rdma/modules/rdma.conf
install -D -m0644 redhat/rdma.conf %{buildroot}%{_sysconfdir}/rdma/modules/rdma.conf

bin/ib_acme -D . -O
install -D -m 0644 ibacm_opts.cfg %{buildroot}%{_sysconfdir}/rdma/

rm -rf %{buildroot}/%{_initrddir}/
rm -f %{buildroot}/%{_sbindir}/srp_daemon.sh

%post
if [ -x /sbin/udevadm ];then
/sbin/udevadm trigger --subsystem-match=infiniband --action=change || true
/sbin/udevadm trigger --subsystem-match=net --action=change || true
/sbin/udevadm trigger --subsystem-match=infiniband_mad --action=change || true
fi

%post -n ibacm
%systemd_post ibacm.service
%preun -n ibacm
%systemd_preun ibacm.service
%postun -n ibacm
%systemd_postun_with_restart ibacm.service

%post -n srp_daemon
%systemd_post srp_daemon.service
%preun -n srp_daemon
%systemd_preun srp_daemon.service
%postun -n srp_daemon
%systemd_postun_with_restart srp_daemon.service

%post -n iwpmd
%systemd_post iwpmd.service
%preun -n iwpmd
%systemd_preun iwpmd.service
%postun -n iwpmd
%systemd_postun_with_restart iwpmd.service

%files
%dir %{_sysconfdir}/rdma
%config(noreplace) %{_sysconfdir}/rdma/mlx4.conf
%config(noreplace) %{_sysconfdir}/rdma/modules/infiniband.conf
%config(noreplace) %{_sysconfdir}/rdma/modules/iwarp.conf
%config(noreplace) %{_sysconfdir}/rdma/modules/opa.conf
%config(noreplace) %{_sysconfdir}/rdma/modules/rdma.conf
%config(noreplace) %{_sysconfdir}/rdma/modules/roce.conf
%dir %{_sysconfdir}/modprobe.d
%config(noreplace) %{_sysconfdir}/modprobe.d/mlx4.conf
%config(noreplace) %{_sysconfdir}/modprobe.d/truescale.conf
%{_unitdir}/rdma-hw.target
%{_unitdir}/rdma-load-modules@.service
%dir %{dracutlibdir}
%dir %{dracutlibdir}/modules.d
%dir %{dracutlibdir}/modules.d/05rdma
%{dracutlibdir}/modules.d/05rdma/module-setup.sh
%dir %{_udevrulesdir}
%{_udevrulesdir}/../rdma_rename
%{_udevrulesdir}/60-rdma-ndd.rules
%{_udevrulesdir}/60-rdma-persistent-naming.rules
%{_udevrulesdir}/75-rdma-description.rules
%{_udevrulesdir}/90-rdma-hw-modules.rules
%{_udevrulesdir}/90-rdma-ulp-modules.rules
%{_udevrulesdir}/90-rdma-umad.rules
%dir %{sysmodprobedir}
%{sysmodprobedir}/libmlx4.conf
%{_libexecdir}/mlx4-setup.sh
%{_libexecdir}/truescale-serdes.cmds
%{_sbindir}/rdma-ndd
%{_unitdir}/rdma-ndd.service
%{_mandir}/man7/rxe*
%{_mandir}/man8/rdma-ndd.*
%license COPYING.*

%files devel
%dir %{_includedir}/infiniband
%dir %{_includedir}/rdma
%{_includedir}/infiniband/*
%{_includedir}/rdma/*
%{_libdir}/lib*.a
%{_libdir}/lib*.so
%{_libdir}/pkgconfig/*.pc
%{_mandir}/man3/efadv*
%{_mandir}/man3/ibv_*
%{_mandir}/man3/rdma*
%{_mandir}/man3/umad*
%{_mandir}/man3/*_to_ibv_rate.*
%{_mandir}/man7/rdma_cm.*
%{_mandir}/man3/manadv*
%{_mandir}/man3/mlx5dv*
%{_mandir}/man3/mlx4dv*
%{_mandir}/man7/efadv*
%{_mandir}/man7/manadv*
%{_mandir}/man7/mlx5dv*
%{_mandir}/man7/mlx4dv*
%{_mandir}/man3/ibnd_*

%files -n infiniband-diags-compat
%{_sbindir}/ibcheckerrs
%{_mandir}/man8/ibcheckerrs*
%{_sbindir}/ibchecknet
%{_mandir}/man8/ibchecknet*
%{_sbindir}/ibchecknode
%{_mandir}/man8/ibchecknode*
%{_sbindir}/ibcheckport
%{_mandir}/man8/ibcheckport.*
%{_sbindir}/ibcheckportwidth
%{_mandir}/man8/ibcheckportwidth*
%{_sbindir}/ibcheckportstate
%{_mandir}/man8/ibcheckportstate*
%{_sbindir}/ibcheckwidth
%{_mandir}/man8/ibcheckwidth*
%{_sbindir}/ibcheckstate
%{_mandir}/man8/ibcheckstate*
%{_sbindir}/ibcheckerrors
%{_mandir}/man8/ibcheckerrors*
%{_sbindir}/ibdatacounts
%{_mandir}/man8/ibdatacounts*
%{_sbindir}/ibdatacounters
%{_mandir}/man8/ibdatacounters*
%{_sbindir}/ibdiscover.pl
%{_mandir}/man8/ibdiscover*
%{_sbindir}/ibswportwatch.pl
%{_mandir}/man8/ibswportwatch*
%{_sbindir}/ibqueryerrors.pl
%{_sbindir}/iblinkinfo.pl
%{_sbindir}/ibprintca.pl
%{_mandir}/man8/ibprintca*
%{_sbindir}/ibprintswitch.pl
%{_mandir}/man8/ibprintswitch*
%{_sbindir}/ibprintrt.pl
%{_mandir}/man8/ibprintrt*
%{_sbindir}/set_nodedesc.sh

%files -n infiniband-diags
%{_sbindir}/ibaddr
%{_mandir}/man8/ibaddr*
%{_sbindir}/ibnetdiscover
%{_mandir}/man8/ibnetdiscover*
%{_sbindir}/ibping
%{_mandir}/man8/ibping*
%{_sbindir}/ibportstate
%{_mandir}/man8/ibportstate*
%{_sbindir}/ibroute
%{_mandir}/man8/ibroute.*
%{_sbindir}/ibstat
%{_mandir}/man8/ibstat.*
%{_sbindir}/ibsysstat
%{_mandir}/man8/ibsysstat*
%{_sbindir}/ibtracert
%{_mandir}/man8/ibtracert*
%{_sbindir}/perfquery
%{_mandir}/man8/perfquery*
%{_sbindir}/sminfo
%{_mandir}/man8/sminfo*
%{_sbindir}/smpdump
%{_mandir}/man8/smpdump*
%{_sbindir}/smpquery
%{_mandir}/man8/smpquery*
%{_sbindir}/saquery
%{_mandir}/man8/saquery*
%{_sbindir}/vendstat
%{_mandir}/man8/vendstat*
%{_sbindir}/iblinkinfo
%{_mandir}/man8/iblinkinfo*
%{_sbindir}/ibqueryerrors
%{_mandir}/man8/ibqueryerrors*
%{_sbindir}/ibcacheedit
%{_mandir}/man8/ibcacheedit*
%{_sbindir}/ibccquery
%{_mandir}/man8/ibccquery*
%{_sbindir}/ibccconfig
%{_mandir}/man8/ibccconfig*
%{_sbindir}/dump_fts
%{_mandir}/man8/dump_fts*
%{_sbindir}/ibhosts
%{_mandir}/man8/ibhosts*
%{_sbindir}/ibswitches
%{_mandir}/man8/ibswitches*
%{_sbindir}/ibnodes
%{_mandir}/man8/ibnodes*
%{_sbindir}/ibrouters
%{_mandir}/man8/ibrouters*
%{_sbindir}/ibfindnodesusing.pl
%{_mandir}/man8/ibfindnodesusing*
%{_sbindir}/ibidsverify.pl
%{_mandir}/man8/ibidsverify*
%{_sbindir}/check_lft_balance.pl
%{_mandir}/man8/check_lft_balance*
%{_sbindir}/dump_lfts.sh
%{_mandir}/man8/dump_lfts*
%{_sbindir}/dump_mfts.sh
%{_mandir}/man8/dump_mfts*
%{_sbindir}/ibclearerrors
%{_mandir}/man8/ibclearerrors*
%{_sbindir}/ibclearcounters
%{_mandir}/man8/ibclearcounters*
%{_sbindir}/ibstatus
%{_mandir}/man8/ibstatus*
%{_mandir}/man8/infiniband-diags*
%{_libdir}/libibmad*.so.*
%{_libdir}/libibnetdisc*.so.*
%{perl_vendorlib}/IBswcountlimits.pm
%config(noreplace) %{_sysconfdir}/infiniband-diags/error_thresholds
%config(noreplace) %{_sysconfdir}/infiniband-diags/ibdiag.conf

%files -n libibverbs
%dir %{_sysconfdir}/libibverbs.d
%dir %{_libdir}/libibverbs
%{_libdir}/libefa.so.*
%{_libdir}/libhns.so.*
%{_libdir}/libibverbs*.so.*
%{_libdir}/libibverbs/*.so
%{_libdir}/libmana.so.*
%{_libdir}/libmlx5.so.*
%{_libdir}/libmlx4.so.*
%{_libdir}/libxscale.so.*
%config(noreplace) %{_sysconfdir}/libibverbs.d/*.driver

%files -n libibverbs-utils
%{_bindir}/ibv_*
%{_mandir}/man1/ibv_*

%files -n ibacm
%config(noreplace) %{_sysconfdir}/rdma/ibacm_opts.cfg
%{_bindir}/ib_acme
%{_sbindir}/ibacm
%{_mandir}/man1/ib_acme.*
%{_mandir}/man7/ibacm.*
%{_mandir}/man7/ibacm_prov.*
%{_mandir}/man8/ibacm.*
%{_unitdir}/ibacm.service
%{_unitdir}/ibacm.socket
%dir %{_libdir}/ibacm
%{_libdir}/ibacm/*

%files -n iwpmd
%{_sbindir}/iwpmd
%{_unitdir}/iwpmd.service
%config(noreplace) %{_sysconfdir}/rdma/modules/iwpmd.conf
%config(noreplace) %{_sysconfdir}/iwpmd.conf
%{_udevrulesdir}/90-iwpmd.rules
%{_mandir}/man8/iwpmd.*
%{_mandir}/man5/iwpmd.*

%files -n libibumad
%{_libdir}/libibumad*.so.*

%files -n librdmacm
%{_libdir}/librdmacm*.so.*
%dir %{_libdir}/rsocket
%{_libdir}/rsocket/*.so*
%{_mandir}/man7/rsocket.*

%files -n librdmacm-utils
%{_bindir}/cmtime
%{_bindir}/mckey
%{_bindir}/rcopy
%{_bindir}/rdma_client
%{_bindir}/rdma_server
%{_bindir}/rdma_xclient
%{_bindir}/rdma_xserver
%{_bindir}/riostream
%{_bindir}/rping
%{_bindir}/rstream
%{_bindir}/ucmatose
%{_bindir}/udaddy
%{_bindir}/udpong
%{_mandir}/man1/cmtime.*
%{_mandir}/man1/mckey.*
%{_mandir}/man1/rcopy.*
%{_mandir}/man1/rdma_client.*
%{_mandir}/man1/rdma_server.*
%{_mandir}/man1/rdma_xclient.*
%{_mandir}/man1/rdma_xserver.*
%{_mandir}/man1/riostream.*
%{_mandir}/man1/rping.*
%{_mandir}/man1/rstream.*
%{_mandir}/man1/ucmatose.*
%{_mandir}/man1/udaddy.*
%{_mandir}/man1/udpong.*

%files -n srp_daemon
%config(noreplace) %{_sysconfdir}/srp_daemon.conf
%config(noreplace) %{_sysconfdir}/rdma/modules/srp_daemon.conf
%{_libexecdir}/srp_daemon/start_on_all_ports
%{_unitdir}/srp_daemon.service
%{_unitdir}/srp_daemon_port@.service
%{_sbindir}/ibsrpdm
%{_sbindir}/srp_daemon
%{_sbindir}/run_srp_daemon
%{_udevrulesdir}/60-srp_daemon.rules
%{_mandir}/man5/srp_daemon.service.5*
%{_mandir}/man5/srp_daemon_port@.service.5*
%{_mandir}/man8/ibsrpdm.8*
%{_mandir}/man8/srp_daemon.8*

%files -n python3-pyverbs
%{python3_sitearch}/pyverbs
%{_docdir}/%{name}-%{version}/tests/*.py

%files help
%doc %{_docdir}/%{name}-%{version}/rxe.md
%doc %{_docdir}/%{name}-%{version}/udev.md
%doc %{_docdir}/%{name}-%{version}/ibacm.md
%doc %{_docdir}/%{name}-%{version}/README.md
%doc %{_docdir}/%{name}-%{version}/ibsrpdm.md
%doc %{_docdir}/%{name}-%{version}/MAINTAINERS
%doc %{_docdir}/%{name}-%{version}/librdmacm.md
%doc %{_docdir}/%{name}-%{version}/libibverbs.md
%doc %{_docdir}/%{name}-%{version}/tag_matching.md
%doc %{_docdir}/%{name}-%{version}/70-persistent-ipoib.rules

%changelog
* Mon Mar 31 2025 Xinghai Cen <cenxinghai@h-partners.com> - 50.0-23
- Type: bugfix
- ID: NA
- SUG: NA
- DESC: Fix some bugs for libhns


* Wed Feb 26 2025 Xin Tian <tianx@yunsilicon.com> - 50.0-22
- Type: requirement
- ID: NA
- SUG: NA
- DESC: Add Yunsilicon user space RDMA driver

* Fri Jan 17 2025 Xinghai Cen <cenxinghai@h-partners.com> - 50.0-21
- Type: bugfix
- ID: NA
- SUG: NA
- DESC: Fix missing fields for SRQ WC

* Wed Jan 08 2025 Funda Wang <fundawang@yeah.net> - 50.0-20
- Type: bugfix
- ID: NA
- SUG: NA
- DESC: Try sync with master codebase

* Fri Jan 3 2025 Xinghai Cen <cenxinghai@h-partners.com> - 50.0-18
- Type: requirement
- ID: NA
- SUG: NA
- DESC: Add error logs to help diagnosis

* Thu Nov 28 2024 Xinghai Cen <cenxinghai@h-partners.com> - 50.0-17
- Type: bugfix
- ID: NA
- SUG: NA
- DESC: Fix coredump during QP destruction when send_cq == recv_cq

* Mon Nov 25 2024 Xinghai Cen <cenxinghai@h-partners.com> - 50.0-16
- Type: bugfix
- ID: NA
- SUG: NA
- DESC: Fixes several bugs for libhns

* Fri Nov 15 2024 Xinghai Cen <cenxinghai@h-partners.com> - 50.0-15
- Type: bugfix
- ID: NA
- SUG: NA
- DESC: Two bugfixes in post_send flow

* Fri Nov 08 2024 Funda Wang <fundawang@yeah.net> - 50.0-14
- adopt to new cmake macro
- migrated to SPDX license
- drop useless setup macro, cause it duplicates with autosetup
- drop useless ldconfig_scriptlets, it has been done through glibc's
  filetriggers since openeuler 1.0

* Tue Jan 7 2025 Xinghai Cen <cenxinghai@h-partners.com> - 50.0-13
- Type: requirment
- ID: NA
- SUG: NA
- DESC: No code modification, just a pile

* Wed Jul 17 2024 dfh <dufuhang@kylinos.cn> - 50.0-12
- Type: bugfix
- ID: NA
- SUG: NA
- DESC: Fix the stride calculation for MSN/PSN area

* Wed May 29 zhangyaqi <zhangyaqi@kylinos.cn> - 50.0-11
- Type: bugfix
- ID: NA
- SUG: NA
- DESC: Fix an overflow bug in qsort comparison function

* Sun May 12 2024 yinsist <jianhui.oerv@isrc.iscas.ac.cn> - 50.0-10
- Type: requirement
- ID: NA
- SUG: NA
- DESC: Valgrind does not support certain architectures like RISC-V, Before depending on Valgrind, first check if Valgrind supports the architecture

* Sat May 11 2024 Juan Zhou <zhoujuan51@h-partners.com> - 50.0-9
- Type: bugfix
- ID: NA
- SUG: NA
- DESC: Some bugfixes and cleanups

* Mon May 6 2024 Juan Zhou <zhoujuan51@h-partners.com> - 50.0-8
- Type: bugfix
- ID: NA
- SUG: NA
- DESC: Fix flexible WQE buffer page related issues

* Fri Apr 12 2024 Ke Chen <chenke54@huawei.com> - 50.0-7
- Type: requirement
- ID: NA
- SUG: NA
- DESC: Add support for ROH

* Thu Apr 11 2024 Ran Zhou <zhouran10@h-partners.com> - 50.0-6
- Type: requirement
- ID: NA
- SUG: NA
- DESC: Add support for DCA

* Tue Mar 26 2024 Ran Zhou <zhouran10@h-partners.com> - 50.0-5
- Type: requirement
- ID: NA
- SUG: NA
- DESC: Support software wc and fix commit info of previous patches

* Thu Mar 21 2024 Ran Zhou <zhouran10@h-partners.com> - 50.0-4
- Type: requirement
- ID: NA
- SUG: NA
- DESC: Support td lock-free

* Tue Mar 12 2024 Ran Zhou <zhouran10@h-partners.com> - 50.0-3
- Type: requirement
- ID: NA
- SUG: NA
- DESC: Backport congestion control from mainline

* Thu Feb 22 2024 Ran Zhou <zhouran10@h-partners.com> - 50.0-2
- Type: requirement
- ID: NA
- SUG: NA
- DESC: Support DSCP

* Tue Feb 6 2024 Ran Zhou <zhouran10@h-partners.com> - 50.0-1
- Type: requirement
- ID: NA
- SUG: NA
- DESC: Update to 50.0

* Thu Jan 25 2024 Ran Zhou <zhouran10@h-partners.com> - 41.0-27
- Type: requirement
- ID: NA
- SUG: NA
- DESC: Add neccessary dependencies for rdma-core-devel

* Tue Dec 19 2023 Juan Zhou <zhoujuan51@h-partners.com> - 41.0-26
- Type: requirement
- ID: NA
- SUG: NA
- DESC: Separate some packages from rdma-core

* Tue Dec 12 2023 Ran Zhou <zhouran10@h-partners.com> - 41.0-25
- Type: bugfix
- ID: NA
- SUG: NA
- DESC: Fix congest type flags error and replace a corrupt patch

* Fri Dec 8 2023 Ran Zhou <zhouran10@h-partners.com> - 41.0-24
- Type: bugfix
- ID: NA
- SUG: NA
- DESC: Fix missing DB when compiler does not support SVE

* Thu Dec 7 2023 Ran Zhou <zhouran10@h-partners.com> - 41.0-23
- Type: bugfix
- ID: NA
- SUG: NA
- DESC: Bugfix for lock and owner bit 

* Fri Dec 1 2023 Ran Zhou <zhouran10@h-partners.com> - 41.0-22
- Type: bugfix
- ID: NA
- SUG: NA
- DESC: Bugfix for wrong timing of modifying ibv_qp state to err 

* Mon Nov 27 2023 Ran Zhou <zhouran10@h-partners.com> - 41.0-21
- Type: bugfix
- ID: NA
- SUG: NA
- DESC: Corrects several minor issues found in review

* Wed Nov 22 2023 Ran Zhou <zhouran10@h-partners.com> - 41.0-20
- Type: bugfix
- ID: NA
- SUG: NA
- DESC: Get dmac from kernel driver

* Tue Oct 31 2023 Ran Zhou <zhouran10@h-partners.com> - 41.0-19
- Type: requirement
- ID: NA
- SUG: NA
- DESC: Support STARS over RDMA

* Thu Oct 26 2023 Juan Zhou <zhoujuan51@h-partners.com> - 41.0-18
- Type: requirement
- ID: NA
- SUG: NA
- DESC: Skip resolving MAC for RDMA over UBLink

* Wed Oct 25 2023 Ran Zhou <zhouran10@h-partners.com> - 41.0-17
- Type: requirement
- ID: NA
- SUG: NA
- DESC: Support SRQ record doorbell

* Tue Oct 24 2023 Ran Zhou <zhouran10@h-partners.com> - 41.0-16
- Type: requirement
- ID: NA
- SUG: NA
- DESC: Support flexible WQE buffer page size

* Tue Sep 26 2023 Juan Zhou <zhoujuan51@h-partners.com> - 41.0-15
- Type: requirement
- ID: NA
- SUG: NA
- DESC: Support reporting wc as software mode

* Tue Jul 25 2023 Juan Zhou <zhoujuan51@h-partners.com> - 41.0-14
- Type: bugfix
- ID: NA
- SUG: NA
- DESC: Two patchs are uploaded from rdma-core mainline

* Fri Jun 9 2023 Juan Zhou <zhoujuan51@h-partners.com> - 41.0-13
- Type: bugfix
- ID: NA
- SUG: NA
- DESC: Support user to choose using UD sl or pktype to adapt MPI APP

* Fri Jun 2 2023 Juan Zhou <zhoujuan51@h-partners.com> - 41.0-12
- Type: bugfix
- ID: NA
- SUG: NA
- DESC: Backport bugfix for hns

* Thu May 11 2023 Juan Zhou <zhoujuan51@h-partners.com> - 41.0-11
- Type: bugfix
- ID: NA
- SUG: NA
- DESC: Fix the sge number related errors and remove local invalidate operation

* Mon Apr 17 2023 Juan Zhou <zhoujuan51@h-partners.com> - 41.0-10
- Type: bugfix
- ID: NA
- SUG: NA
- DESC: Add support for SVE Direct WQE for libhns

* Thu Apr 13 2023 Juan Zhou <zhoujuan51@h-partners.com> - 41.0-9
- Type: requirement
- ID: NA
- SUG: NA
- DESC: Support congestion control algorithm configuration

* Wed Dec 14 2022 Yixing Liu <liuyixing1@huawei.com> - 41.0-6
- Type: requirement
- ID: NA
- SUG: NA
- DESC: Support libhns reset stop ring db mechanism

* Wed Nov 30 2022 tangchengchang <tangchengchang@huawei.com> - 41.0-7
- Type: requirement
- ID: NA
- SUG: NA
- DESC: Add support for hns DCA

* Mon Nov 28 2022 Yixing Liu <liuyixing1@huawei.com> - 41.0-6
- Type: requirement
- ID: NA
- SUG: NA
- DESC: Support libhns td unlock

* Mon Nov 07 2022 Guofeng Yue <yueguofeng@hisilicon.com> - 41.0-5
- Type: requirement
- ID: NA
- SUG: NA
- DESC: Support hns RoH mode

* Sun Nov 06 2022 tangchengchang <tangchengchang@huawei.com> - 41.0-4
- Type: bugfix
- ID: NA
- SUG: NA
- DESC: Backport bugfix from rdma-core 41.1

* Sat Oct 29 2022 tangchengchang <tangchengchang@huawei.com> - 41.0-3
- Type: requirement
- ID: NA
- SUG: NA
- DESC: Support rq inline and cqe inline

* Sat Oct 08 2022 luoyouming <luoyouming@huawei.com> - 41.0-2
- Type: requirement
- ID: NA
- SUG: NA
- DESC: Support rq inline and cqe inline

* Mon Jul 25 2022 tangchengchang <tangchengchang@huawei.com> - 41.0-1
- Type: requirement
- ID: NA
- SUG: NA
- DESC: update to 41.0

* Mon Jul 11 2022 luozhengfeng <luozhengfeng@h-partners.com> - 35.1-3
- Type: bugfix
- ID: NA
- SUG: NA
- DESC: bugfix and refactor for hns SRQ and SGE

* Mon Jan 10 2022 tangchengchang <tangchengchang@huawei.com> - 35.1-2
- Type: requirement
- ID: NA
- SUG: NA
- DESC: Add support for hns DWQE

* Thu Dec 09 2021 gaihuiying <gaihuiying1@huawei.com> - 35.1-1
- Type: requirement
- ID: NA
- SUG: NA
- DESC: update to 35.1

* Sun Sep 26 2021 seuzw <930zhaowei@163.com> - 35.0-3
- Type: bugfix
- ID: NA
- SUG: NA
- DESC: Use -e para to make transferred meaning take effect

* Thu Sep 23 2021 zhongxuan <zhongxuan2@huawei.com> - 35.0-2
- Type: bugfix
- ID: NA
- SUG: NA
- DESC: increase maximum number of cpus

* Fri Jul 2 2021 liyangyang <liyangyang20@huawei.com> - 35.0-1
- Type: bugfix
- ID: NA
- SUG: NA
- DESC: update to 35.0

* Mon Apr 20 2020 majun <majun65@huawei.com> - 28.1-2
- Type: bugfix
- ID: NA
- SUG: NA
- DESC: fix install problem

* Sat Apr 18 2020 majun <majun65@huawei.com> - 28.1-1
- Type: bugfix
- ID: NA
- SUG: NA
- DESC: update to 28.1

* Thu Mar 19 2020 wangxiaopeng <wangxiaopeng7@huawei.com> - 20.1-7
- Type: bugfix
- ID: NA
- SUG: NA
- DESC: fix upgrate problem

* Fri Oct 11 2019 jiangchuangang <jiangchuangang@huawei.com> - 20.1-6
- Type: enhancement
- ID: NA
- SUG: NA
- DESC: remove pandoc from BuildRequires

* Sat Sep 21 2019 openEuler Buildteam <buildteam@openeuler.org> - 20.1-5
- Package init

