bnxt_en: Automatically load bnxt_re

This commit ensures that the bnxt_re module is automatically loaded
whenever bnxt_en is loaded by StarlingX's boot-up process or manually by
the user.

The bnxt_re module is not automatically loaded, and this requires
manually loading the module before being able to use RDMA.

In contrast, bnxt_en has aliases that allows it to be automatically
loaded on systems with compatible Broadcom network adapters.

This commit adds a 'softdep' modprobe hook for bnxt_en, so that the
bnxt_re module is automatically loaded after the bnxt_en module is
loaded.

In terms of alternatives, the following options were considered:

- Always load bnxt_en and bnxt_re, like Mellanox OFED's drivers.
  This option's main drawback is that the modules will always consume
  resources such as kernel memory, even when a compatible network
  adapter is not available.

- Use install and remove hooks.
  This option is functionally similar to having a softdep hook, but
  allows the use of arbitrary shell commands. We did not opt for this
  option, because the modprobe.conf manual page mentions that the
  install/remove hooks will eventually be deprecated.

Verification
- An ISO image was built successfully using a monolithic incremental
  build procedure.
- The built ISO image was installed onto a virtual machine in All-in-One
  simplex mode, low-latency profile.
- The bnxt_en module was loaded using "sudo modprobe bnxt_en". "lsmod"
  showed that both bnxt_en and bnxt_re were loaded.
- The bnxt_en module was removed using "sudo modprobe -v -r bnxt_en",
  which indicated that bnxt_re and bnxt_en were removed, in that order.
  The end result was confirmed with "lsmod".

Story: 2009915
Task: 44917

Change-Id: I6f58ed7b1cd07d856ae9fba5f27820adf8f649d0
Signed-off-by: M. Vefa Bicakci <vefa.bicakci@windriver.com>
This commit is contained in:
M. Vefa Bicakci 2022-03-30 13:25:20 -04:00
parent 6fe8d60832
commit 3dc5327a84
3 changed files with 7 additions and 0 deletions

View File

@ -38,6 +38,7 @@ Requires(post): /usr/sbin/depmod
Requires(postun): /usr/sbin/depmod
Source0: netxtreme-%{kmod_name}-%{version}-%{upstream_release}.tar.gz
Source1: modprobe.conf
Patch0001: 0001-bnxt_re-Makefile-Adapt-to-mlnx-ofa_kernel-for-Starli.patch
Patch0002: 0002-bnxt_en-bnxt_compat.h-Fix-up-a-build-failure.patch
@ -104,6 +105,9 @@ mkdir -p ${dest_dir_bnxt_re}
install -m 744 ${src_dir_bnxt_en} ${dest_dir_bnxt_en}
install -m 744 ${src_dir_bnxt_re} ${dest_dir_bnxt_re}
install -d %{buildroot}%{_sysconfdir}/modprobe.d
install -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/modprobe.d/bnxt.conf
### Adapted from i40e
# Strip the modules(s).
find %{buildroot} -type f -name \*.ko -exec %{__strip} --strip-debug \{\} \;
@ -120,6 +124,7 @@ done
%files
%defattr(644,root,root,755)
/lib/modules/%{kversion}/extra/%{kmod_name}/
%{_sysconfdir}/modprobe.d/bnxt.conf
%post
if [ -e "/boot/System.map-%{kversion}" ]; then

View File

@ -1,5 +1,6 @@
COPY_LIST=" \
$PATCHES_BASE/* \
$PKG_BASE/files/modprobe.conf \
$STX_BASE/downloads/netxtreme-bnxt_en-1.10.2-220.0.13.0.tar.gz \
"

View File

@ -0,0 +1 @@
softdep bnxt_en post: bnxt_re