Files
kernel/kernel-modules/mlnx-ofa_kernel/centos/meta_patches/Support-STX-system-and-introduce-devtoolset-8.patch
Jiping Ma ec080b35e4 mlnx-ofa_kernel: Upgrade OFED driver version to 5.5-1.0.3.2
This upgrades the OFED driver related packages to the ones that are
included in MLNX_OFED_SRC-5.5-1.0.3.2.tgz. The package can be
found here: https://content.mellanox.com/ofed/MLNX_OFED-5.5-1.0.3.2
/MLNX_OFED_SRC-5.5-1.0.3.2.tgz. also removes libibverbs because
that is now included in rdma-core package, and adds mlnx-tools
package that mlnx-ofa_kernel depends on.

The new versions are:
mlnx-ofa_kernel-5.5-OFED.5.5.1.0.3.1
rdma-core-55mlnx37-1.55103
mlnx-tools-5.2.0-0.55103

Reason:
The NVIDIA Mellanox ConnectX-6 device support is required by Cloud
Platform. The required Mellanox drivers must be upgraded to the latest
version (5.4+) to support the latest features of this device.

Verification:
- Build success based on the commit(kernel: Add auxiliary bus support)
- Install onto a StarlingX system with two controller and two compute
  nodes with network adapters Mellanox's OFED. The network adapters
  of controllers are Mellanox Technologies MT27710 Family
  [ConnectX-4 Lx], the network adapters of computes are Mellanox
  Technologies MT27800 Family [ConnectX-5].
- The bootstrap procedure was successful, Check dmesg output to see
  all mlx5_core driver information are correct.
- RDMA/Infiniband over Ethernet functionalities of the Mellanox adapters
  were successfully tested using the Linux RDMA community's perftest
  package.

Note that we do not test it on the NVIDIA Mellanox ConnectX-6, because
the network adapter is not available in our lab yet. We will test it
once ConnectX-6 is ready.

This work was based on the following commit by Babak Sarashki.
https://review.opendev.org/c/starlingx/kernel/+/822660

Story: 2009878
Task: 44610
Depends-On: https://review.opendev.org/c/starlingx/tools/+/831338

Signed-off-by: Jiping Ma <jiping.ma2@windriver.com>
Change-Id: Ie2eae9a09b7f5a0a1d01a91cfd0349237b4ccdbf
2022-03-03 09:15:54 -05:00

160 lines
5.8 KiB
Diff

From 24a7530968184bd133432e1f8dfccebef772bc7e Mon Sep 17 00:00:00 2001
From: Jiping Ma <jiping.ma2@windriver.com>
Date: Fri, 28 Jan 2022 23:28:18 -0800
Subject: [PATCH] Support STX system and introduce devtoolset-8
Signed-off-by: Jiping Ma <jiping.ma2@windriver.com>
---
mlnx-ofa_kernel.spec | 46 ++++++++++++++++++++++++++++++++------------
1 file changed, 34 insertions(+), 12 deletions(-)
diff --git a/SPECS/mlnx-ofa_kernel.spec b/SPECS/mlnx-ofa_kernel.spec
index 6a6cde0..3e0d564 100644
--- a/SPECS/mlnx-ofa_kernel.spec
+++ b/SPECS/mlnx-ofa_kernel.spec
@@ -25,10 +25,19 @@
# and/or other materials provided with the distribution.
#
#
+%if "%{_tis_build_type}" == "rt"
+%define bt_ext -rt
+%else
+%undefine bt_ext
+%endif
# KMP is disabled by default
%{!?KMP: %global KMP 0}
-
+BuildRequires: kernel%{?bt_ext}-devel, openssl
+BuildRequires: devtoolset-8-build
+BuildRequires: devtoolset-8-binutils
+BuildRequires: devtoolset-8-gcc
+BuildRequires: devtoolset-8-make
%global WITH_SYSTEMD %(if ( test -d "%{_unitdir}" > /dev/null); then echo -n '1'; else echo -n '0'; fi)
%{!?configure_options: %global configure_options --with-core-mod --with-user_mad-mod --with-user_access-mod --with-addr_trans-mod --with-mlx5-mod --with-mlxfw-mod --with-ipoib-mod}
@@ -43,11 +52,11 @@
%global IS_RHEL_VENDOR "%{_vendor}" == "redhat" || ("%{_vendor}" == "bclinux") || ("%{_vendor}" == "openEuler")
-%{!?KVERSION: %global KVERSION %(uname -r)}
+%{!?KVERSION: %global KVERSION %(rpm -q kernel%{?bt_ext}-devel | sort --version-sort | tail -1 | sed 's/kernel%{?bt_ext}-devel-//')}
%global kernel_version %{KVERSION}
%global krelver %(echo -n %{KVERSION} | sed -e 's/-/_/g')
# take path to kernel sources if provided, otherwise look in default location (for non KMP rpms).
-%{!?K_SRC: %global K_SRC /lib/modules/%{KVERSION}/build}
+%{!?K_SRC: %global K_SRC /usr/src/kernels/%{KVERSION}}
# Select packages to build
@@ -62,7 +71,8 @@
%{!?KERNEL_SOURCES: %global KERNEL_SOURCES /lib/modules/%{KVERSION}/source}
-%{!?_name: %global _name mlnx-ofa_kernel}
+%define _basename mlnx-ofa_kernel
+%define _name %{_basename}%{?bt_ext}
%{!?_version: %global _version 5.5}
%{!?_release: %global _release OFED.5.5.1.0.3.1}
%global _kmp_rel %{_release}%{?_kmp_build_num}%{?_dist}
@@ -74,11 +84,12 @@
Summary: Infiniband HCA Driver
Name: %{_name}
Version: %{_version}
-Release: %{_release}%{?_dist}
+Release: %{_release}%{?_dist}%{?_tis_dist}.%{tis_patch_ver}
License: GPLv2
Url: http://www.mellanox.com/
Group: System Environment/Base
-Source: %{_name}-%{_version}.tgz
+Source: %{_basename}-%{_version}.tgz
+Source100: modules-load.conf
BuildRoot: %{?build_root:%{build_root}}%{!?build_root:/var/tmp/OFED}
Vendor: Mellanox Technologies
Obsoletes: kernel-ib
@@ -148,7 +159,7 @@ Obsoletes: mlnx-en-debuginfo
Obsoletes: mlnx-en-sources
Obsoletes: mlnx-rdma-rxe
Version: %{_version}
-Release: %{_release}.kver.%{krelver}
+Release: %{_release}%{?_tis_dist}.%{tis_patch_ver}
Summary: Infiniband Driver and ULPs kernel modules
Group: System Environment/Libraries
%description -n %{non_kmp_pname}
@@ -163,7 +174,7 @@ Version: %{_version}
%if "%{KMP}" == "1"
Release: %{_release}%{?_dist}
%else
-Release: %{_release}.kver.%{krelver}
+Release: %{_release}%{?_tis_dist}.%{tis_patch_ver}
%endif
Obsoletes: kernel-ib-devel
Obsoletes: kernel-ib
@@ -252,13 +263,16 @@ drivers against it.
%{!?install_mod_dir: %global install_mod_dir updates}
%prep
-%setup -n %{_name}-%{_version}
+%setup -n %{_basename}-%{_version}
set -- *
mkdir source
mv "$@" source/
mkdir obj
%build
+%if 0%{?rhel} == 7
+source scl_source enable devtoolset-8 || :
+%endif
export EXTRA_CFLAGS='-DVERSION=\"%version\"'
export INSTALL_MOD_DIR=%{install_mod_dir}
export CONF_OPTIONS="%{configure_options}"
@@ -277,12 +291,17 @@ for flavor in %flavors_to_build; do
done
%install
+%if 0%{?rhel} == 7
+source scl_source enable devtoolset-8 || :
+%endif
export RECORD_PY_FILES=1
export INSTALL_MOD_PATH=%{buildroot}
export INSTALL_MOD_DIR=%{install_mod_dir}
-export NAME=%{name}
+export NAME=%{_basename}
export VERSION=%{version}
export PREFIX=%{_prefix}
+export MODULE_SIGN_PRIV_KEY=/usr/src/kernels/%{KVERSION}/signing_key.pem
+export MODULE_SIGN_PUB_KEY=/usr/src/kernels/%{KVERSION}/signing_key.x509
for flavor in %flavors_to_build; do
export KSRC=%{kernel_source $flavor}
export KVERSION=%{kernel_release $KSRC}
@@ -327,14 +346,16 @@ echo "override ${mod_name} * weak-updates/%{_name}${mod_path}" >> %{buildroot}%{
echo "override ${mod_name} * extra/%{_name}${mod_path}" >> %{buildroot}%{_sysconfdir}/depmod.d/zz01-%{_name}-${mod_name}.conf
done
%endif
+%{__install} -d %{buildroot}%{_sysconfdir}/modules-load.d
+%{__install} -m 644 %{SOURCE100} %{buildroot}%{_sysconfdir}/modules-load.d/mlnx.conf
%endif
# copy sources
mkdir -p %{buildroot}/%{_prefix}/src/ofa_kernel-%{version}
mkdir -p %{buildroot}/%{_prefix}/src/ofa_kernel/%{_arch}
-cp -a %{_builddir}/%{name}-%{version}/source %{buildroot}/%{_prefix}/src/ofa_kernel-%{version}/source
+cp -a %{_builddir}/%{_basename}-%{version}/source %{buildroot}/%{_prefix}/src/ofa_kernel-%{version}/source
ln -s ofa_kernel-%{version}/source %{buildroot}/%{_prefix}/src/mlnx-ofa_kernel-%{version}
-cp -a %{_builddir}/src/%{name}/* %{buildroot}/%{_prefix}/src/ofa_kernel/%{_arch}/%{KVERSION}
+cp -a %{_builddir}/src/%{_basename}/* %{buildroot}/%{_prefix}/src/ofa_kernel/%{_arch}/%{KVERSION}
# Fix path of BACKPORT_INCLUDES
sed -i -e "s@=-I.*backport_includes@=-I/usr/src/ofa_kernel-$VERSION/backport_includes@" %{buildroot}/%{_prefix}/src/ofa_kernel/%{_arch}/%{KVERSION}/configure.mk.kernel || true
rm -rf %{_builddir}/src
@@ -681,6 +702,7 @@ update-alternatives --remove \
%config(noreplace) %{_sysconfdir}/depmod.d/zz01-%{_name}-*.conf
%endif
%endif
+%{_sysconfdir}/modules-load.d/mlnx.conf
%endif
%files -n %{devel_pname}
--
2.31.1