M. Vefa Bicakci e8cb7ff3ee Debian: Add out-of-tree driver for Broadcom NICs
This commit introduces the bnxt_en and bnxt_re out-of-tree drivers for
Broadcom's NetXtreme network adapters, disables the in-tree versions and
handles the fall-out by forcibly enabling the kernel's CONFIG_PAGE_POOL
configuration option.

In comparison to commit ec7d0d47680c ("Prepare for Broadcom drivers")
and commit 0ae9f6bd537b ("Add Broadcom NetXtreme-E drivers") that
introduce the same drivers to CentOS-based StarlingX, the following
changes were made:

- The amount of changes in bnxt_re's makefiles was reduced by taking
  advantage of the fact that /lib/modules/<kver>/{build,source} symbolic
  links point to the header and kbuild directories.

- The bnxt_en driver's makefile was modified to enable parallelized
  builds.

- The shell commands to add the 'MODULE_INFO(retpoline, "Y")'
  pre-processor directive to the bnxt_en and bnxt_re modules were
  removed, as we discovered that this causes the module to have
  'retpoline: Y' in its metadata twice, as shown by the following shell
  interaction output on a Debian-based StarlingX installation:

  $ modinfo bnxt_en | grep retpoline:
  retpoline:      Y
  retpoline:      Y

The changes inherited from CentOS-based StarlingX but which are not
mentioned in the comparison section above are as follows:

- With patch "0002-bnxt_en-bnxt_compat.h-Fix-up-a-build-failure.patch",
  we fix a build failure caused by the definition of a macro intended as
  a placeholder for an in-tree API function. The v5.10 kernel already
  defines this function, so the macro is removed.

- With patch "0003-bnxt_en-bnxt_re-Use-irq_update_affinity_hint.patch",
  we modify the bnxt_en and bnxt_re drivers so that the affinities of
  the IRQs serviced by these drivers are set up according to StarlingX's
  requirements, which is to make use of the CPU list specified by the
  irqaffinity= kernel command line argument. As was the case with
  CentOS-based StarlingX, the changes in bnxt_re take effect, but the
  changes in bnxt_en are included for completeness, as the latter code
  is compiled out with kernel versions >= 4.15. (Please see the patch
  description for further details on this.)

- The CONFIG_PAGE_POOL option is forcibly enabled, as removing bnxt_en
  from the in-tree kernel build removes the last user of
  CONFIG_PAGE_POOL, which is a dependency for the Mellanox OFED and
  bnxt_en drivers. This causes the kernel build system to automatically
  disable this option. Hence, this commit makes the CONFIG_PAGE_POOL
  option default to being enabled.

Finally, the version of the Debian package was made "1.10.2.220.0.13.0"
instead of the upstream "1.10.2-220.0.13.0", because Debian's versioning
policy only allows hyphen/dash ('-') characters in package versions when
there is no Debian revision appended to the version. Given that
StarlingX appends -1 as the Debian revision, we chose to use '.' instead
of '-' in the package version. (Another approach would have been to
relocate the '220.0.13.0' to the revision field.)

Verification notes:
- A Debian-based StarlingX ISO image is successfully built with the
  standard kernel, and the ISO image was installed onto a physical
  server with a quadport Broadcom network adapter, but with some
  workarounds. The bnxt_en and bnxt_re modules were observed to be
  automatically loaded on this server, as expected.

- One of the interfaces of the Broadcom network adapter in the
  aforementioned server was the management (OAM) interface, which was
  observed to work without obvious/apparent issues.

- The preempt-rt kernel was not tested, because an ISO image with the
  preempt-rt image could not be built due to reasons unrelated to this
  commit. That is, despite rebasing and running the following commands,
  the resulting ISO image did not start the installation process in a
  virtual machine, where a kickstart parse error was encountered:
    downloader -B rt,std -s -b && \
    build-pkgs -c -a -b rt,std && \
    build-image -t rt

Story: 2009915
Task: 45138

Change-Id: I012c8acaf18a2a2f18679ee2ddda67bf1e55d2c0
Signed-off-by: M. Vefa Bicakci <vefa.bicakci@windriver.com>
2022-04-26 23:25:41 +00:00

52 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
#
# Copyright (c) 2022 Wind River Systems, Inc.
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. The ASF licenses this
# file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# The only parameter is the name of the new directory that will contain
# the extracted source code. Be aware that this new directory will be
# created in the same directory as where this script is located when
# building.
# Tools needed: mkdir, rm, tar
DL_TARBALL=bcm_220.0.83.0.tar.gz
SRC_TARBALL=Linux/Linux_Driver/netxtreme-bnxt_en-1.10.2-220.0.13.0.tar.gz
TMPDIR="bcm_tmp"
DESTDIR="${1}"
if test -z "${DESTDIR}"; then
echo "Missing destination directory on command line."
exit 1
fi
rm -rf "${TMPDIR}"
mkdir -p "${TMPDIR}"
if ! tar -C "${TMPDIR}" --strip-components=1 -xvf "${DL_TARBALL}"; then
echo "Could not extract into ${TMPDIR}: ${DL_TARBALL}"
exit 1
fi
mkdir -p "${DESTDIR}"
if ! tar -C "${DESTDIR}" --strip-components=1 -xvf "${TMPDIR}/${SRC_TARBALL}"; then
echo "Could not extract into ${DESTDIR}: ${TMPDIR}/${SRC_TARBALL}"
exit 1
fi
rm -rf "${TMPDIR}"