diff --git a/.compat-dapl.metadata b/.compat-dapl.metadata new file mode 100644 index 0000000..398e765 --- /dev/null +++ b/.compat-dapl.metadata @@ -0,0 +1 @@ +e5c49d91bf42ee216f40c7da1c290fb7e2af7aab SOURCES/compat-dapl-1.2.19.tar.gz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..864e0ba --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/compat-dapl-1.2.19.tar.gz diff --git a/SOURCES/0005-compat-dapl-add-s390x-platform-support.patch b/SOURCES/0005-compat-dapl-add-s390x-platform-support.patch new file mode 100644 index 0000000..7ea1d16 --- /dev/null +++ b/SOURCES/0005-compat-dapl-add-s390x-platform-support.patch @@ -0,0 +1,135 @@ +--- + dapl/udapl/linux/dapl_osd.h | 37 +++++++++++++++++++++++++++++- + test/dapltest/mdep/linux/dapl_mdep_user.c | 9 +++++++ + test/dapltest/mdep/linux/dapl_mdep_user.h | 9 ++++++- + 3 files changed, 53 insertions(+), 2 deletions(-) + +--- a/dapl/udapl/linux/dapl_osd.h ++++ b/dapl/udapl/linux/dapl_osd.h +@@ -49,7 +49,9 @@ + #error UNDEFINED OS TYPE + #endif /* __linux__ */ + +-#if !defined (__i386__) && !defined (__ia64__) && !defined(__x86_64__) && !defined(__PPC__) && !defined(__PPC64__) ++#if !defined(__i386__) && !defined(__ia64__) \ ++&& !defined(__x86_64__) && !defined(__PPC__) && !defined(__PPC64__) \ ++&& !defined(__s390x__) + #error UNDEFINED ARCH + #endif + +@@ -142,6 +144,22 @@ int dapl_os_get_env_val ( + + + /* atomic functions */ ++#ifdef __s390x__ ++#define DAPL_CS_ADD(ptr, op_val) ({ \ ++ int old_val, new_val; \ ++ __asm__ __volatile__( \ ++ " l %0,%2\n" \ ++ "0: lr %1,%0\n" \ ++ " ar %1,%3\n" \ ++ " cs %0,%1,%2\n" \ ++ " jl 0b" \ ++ : "=&d" (old_val), "=&d" (new_val), \ ++ "=Q" (*ptr) \ ++ : "d" (op_val), "Q" (*ptr) \ ++ : "cc", "memory"); \ ++ new_val; \ ++}) ++#endif + + /* dapl_os_atomic_inc + * +@@ -165,6 +183,11 @@ dapl_os_atomic_inc ( + #else + IA64_FETCHADD(old_value,v,1,4); + #endif ++#elif defined(__s390x__) ++ DAT_COUNT tmp; ++ DAT_COUNT delta = 1; ++ ++ tmp = DAPL_CS_ADD(v, delta); + #elif defined(__PPC__) || defined(__PPC64__) + int tmp; + +@@ -204,6 +227,11 @@ dapl_os_atomic_dec ( + #else + IA64_FETCHADD(old_value,v,-1,4); + #endif ++#elif defined(__s390x__) ++ DAT_COUNT tmp; ++ DAT_COUNT delta = -1; ++ ++ tmp = DAPL_CS_ADD(v, delta); + #elif defined (__PPC__) || defined(__PPC64__) + int tmp; + +@@ -259,6 +287,13 @@ dapl_os_atomic_assign ( + #else + current_value = ia64_cmpxchg(acq,v,match_value,new_value,4); + #endif /* __ia64__ */ ++#elif defined(__s390x__) ++ __asm__ __volatile__( ++ " cs %0,%2,%1\n" ++ : "+d" (match_value), "=Q" (*v) ++ : "d" (new_value), "Q" (*v) ++ : "cc", "memory"); ++ current_value = match_value; + #elif defined(__PPC__) || defined(__PPC64__) + __asm__ __volatile__ ( + " lwsync\n\ +--- a/test/dapltest/mdep/linux/dapl_mdep_user.c ++++ b/test/dapltest/mdep/linux/dapl_mdep_user.c +@@ -181,6 +181,14 @@ DT_Mdep_GetTime (void) + return tv.tv_sec * 1000 + tv.tv_usec / 1000; + } + ++#ifdef __s390x__ ++double ++DT_Mdep_GetCpuMhz ( ++ void ) ++{ ++ return 1; ++} ++#else + double + DT_Mdep_GetCpuMhz ( + void ) +@@ -232,6 +240,7 @@ DT_Mdep_GetCpuMhz ( + return strtod (mhz_str, NULL) / DT_TSC_BASE; + } + ++#endif + + unsigned long + DT_Mdep_GetContextSwitchNum (void ) +--- a/test/dapltest/mdep/linux/dapl_mdep_user.h ++++ b/test/dapltest/mdep/linux/dapl_mdep_user.h +@@ -143,11 +143,18 @@ DT_Mdep_GetTimeStamp ( void ) + asm volatile("rdtsc" : "=a" (__a), "=d" (__d)); + return ((unsigned long)__a) | (((unsigned long)__d)<<32); + #else ++#if defined(__s390x__) ++ DT_Mdep_TimeStamp x; ++ ++ asm volatile("stck %0" : "=Q" (x) : : "cc"); ++ return x >> 2; ++#else + #error "Linux CPU architecture - unimplemented" + #endif + #endif + #endif + #endif ++#endif + } + + /* +@@ -157,7 +164,7 @@ DT_Mdep_GetTimeStamp ( void ) + * world. E.g. %llx for gcc, %I64x for Windows + */ + +-#if defined(__x86_64__) || defined(__ia64__) ++#if defined(__x86_64__) || defined(__ia64__) || defined(__s390x__) + #define F64d "%ld" + #define F64u "%lu" + #define F64x "%lx" diff --git a/SOURCES/compat-dapl-1.2.19-compile.patch b/SOURCES/compat-dapl-1.2.19-compile.patch new file mode 100644 index 0000000..a2bb3e7 --- /dev/null +++ b/SOURCES/compat-dapl-1.2.19-compile.patch @@ -0,0 +1,11 @@ +--- compat-dapl-1.2.19/dat/common/dat_strerror.c.orig 2014-01-06 15:46:44.937613612 -0500 ++++ compat-dapl-1.2.19/dat/common/dat_strerror.c 2014-01-06 15:46:59.656227202 -0500 +@@ -618,7 +618,7 @@ dat_strerror ( + { + return DAT_INVALID_PARAMETER; + } +- else if (minor_message != NULL) ++ else if (minor_message) + { + if ( DAT_SUCCESS != dat_strerror_minor (value, minor_message) ) + { diff --git a/SPECS/compat-dapl.spec b/SPECS/compat-dapl.spec new file mode 100644 index 0000000..3e3026f --- /dev/null +++ b/SPECS/compat-dapl.spec @@ -0,0 +1,145 @@ +Name: compat-dapl +Epoch: 1 +Version: 1.2.19 +Release: 4%{?dist} +Summary: Library providing access to the DAT 1.2 API +Group: System Environment/Libraries +Obsoletes: udapl < 1.3, dapl < 1.2.2, compat-dapl-1.2.5 < 2.1 +License: GPLv2 or BSD or CPL +Url: https://openfabrics.org/ +Source0: https://www.openfabrics.org/downloads/dapl/%{name}-%{version}.tar.gz +Patch0: compat-dapl-1.2.19-compile.patch +Patch1: 0005-compat-dapl-add-s390x-platform-support.patch +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Requires(post): /sbin/ldconfig +Requires(postun): /sbin/ldconfig +BuildRequires: libibverbs-devel > 1.1.4, librdmacm-devel > 1.0.14 +BuildRequires: autoconf, libtool, dapl-devel > 2.0.31 +ExcludeArch: aarch64 s390 +%description +The DAT programming API provides a means of utilizing high performance +network technologies, such as InfiniBand and iWARP, without needing to +write your program to use those technologies directy. This package +contains the libraries that implement version 1.2 of the DAT API. The +current (and recommended version for any new code) is 2.0. These 1.2 +libraries are provided solely for backward compatibily. + +%package devel +Summary: Development files for the dapl-1.2 compat libdat and libdapl libraries +Group: System Environment/Libraries +Requires: %{name} = %{epoch}:%{version}-%{release} +Obsoletes: udapl-devel < 1.3, dapl-devel < 1.2.2, compat-dapl-devel-1.2.5 < 2.1 +%description devel +Header files for the dapl-1.2 compat libdat and libdapl library. + +%package static +Summary: Static libdat and libdapl libraries +Group: System Environment/Libraries +Requires: %{name}-devel = %{epoch}:%{version}-%{release} +Obsoletes: dapl-devel-static < 1.2.14, compat-dapl-static-1.2.5 < 2.1 +%description static +Static versions of the dapl-1.2 compat libdat and libdapl libraries. + +%package utils +Summary: Test suites for dapl 1.2 libraries +Group: System Environment/Libraries +Requires: %{name} = %{epoch}:%{version}-%{release} +%description utils +Useful test suites to validate the dapl library API's and operation. + +%prep +%setup -q +%patch0 -p1 -b .compile +%patch1 -p1 -b .s390x +aclocal -I config && libtoolize --force --copy && autoheader && \ + automake --foreign --add-missing --copy && autoconf + +%build +%configure CFLAGS="$CFLAGS -fno-strict-aliasing" --sysconfdir=%{_sysconfdir}/rdma/compat-dapl +make %{?_smp_mflags} + +%install +rm -rf %{buildroot} +make DESTDIR=%{buildroot} install +# remove unpackaged files from the buildroot +rm -f %{buildroot}%{_libdir}/*.la %{buildroot}%{_mandir}/man5/* + +%clean +rm -rf %{buildroot} + +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + +%files +%defattr(-,root,root,-) +%{_libdir}/libdat.so.* +%{_libdir}/libdaplcma.so.* +%{_libdir}/libdaplscm.so.* +%config(noreplace) %{_sysconfdir}/rdma/compat-dapl/dat.conf +%doc AUTHORS ChangeLog COPYING README + +%files devel +%defattr(-,root,root,-) +%{_libdir}/libdat.so +%{_libdir}/libdaplcma.so +%{_libdir}/libdaplscm.so +%dir %{_includedir}/dat +%{_includedir}/dat/* + +%files static +%defattr(-,root,root,-) +%{_libdir}/libdat.a +%{_libdir}/libdaplcma.a +%{_libdir}/libdaplscm.a + +%files utils +%defattr(-,root,root,-) +%{_bindir}/*1 +%{_mandir}/man1/*1.1.gz + +%changelog +* Thu Jul 16 2015 Doug Ledford - 1:1.2.19-4 +- Add s390 support patch +- Resolves: bz1196211 + +* Mon Jan 6 2014 Jay Fenlason - 1:1.2.19-3 +- Add -compile patch + Resolves: rhbz1048849 + +* Fri Dec 27 2013 Daniel Mach +- Mass rebuild 2013-12-27 + +* Mon Jan 23 2012 Doug Ledford - 1:1.2.19-2 +- Bump and rebuild against new libibverbs (FDR link speed support) +- Related: bz750609 + +* Fri Jul 22 2011 Doug Ledford - 1:1.2.19-1 +- Update to latest upstream release (1.2.15 -> 1.2.19) +- Remove 3 patches rolled into upstream +- Update exclusive arch to accommodate i686 arch +- Related: bz725016, bz724896 + +* Fri Jan 28 2011 Jay Fenlason - 1:1.2.15-2.2.el6 +- compat-dapl-cleanup-cr-linkings-after-dto-error-on-ep.patch + Resolves: bz635155 + +* Mon Aug 02 2010 Jay Fenlason - 1:1.2.15-2.1.el6 +- Include pipe-leak patch to close + Resolves: rhbz619439 - OFED1.5.1: uDAPL - cma: memory leak of FD's (DB2 pureScale) + This required some whitspace editing--apparently the patch was garbled + somewhere in transit. +- Include the cma-memleak-verbs-CQ-compl-chans-fix patch to close + Resolves: rhbz619443 - OFED1.5.1: uDAPL handles close on forked child exit (DB2 pureScale) + +* Sun Mar 07 2010 Doug Ledford - 1:1.2.15-2.el6 +- Fix various rpmlint wanrings in spec file +- Version all of the obsoletes +- Now that this is no longer part of the dapl rpm, it needs its own + doc macro so that the license and whatnot are on the system when the + package is installed +- Related: bz555835 + +* Thu Jan 21 2010 Jay Fenlason 1:1.2.15-1.el5 +- Change sysconfig file to /etc/rdma/compat-dapl to match the change in dapl +- Split out into separate source rpm from the dapl-2.0.25-2.el5.src.rpm + Resolves: rhbz#557170 split compat-dapl into a separate srpm