Jiping Ma ec1eeccb70 kernel-modules: re-enable bnxt_en
This commit re-enables the bnxt_en/bnxt_re OOT drivers.

We also upgrade to the driver versions recommended by Broadcom.
Upgrade the bnxt_en/bnxt_re version to 227.0.130.0 from 220.0.13.0.
(For clarity, the main driver package file name is "bcm_227.1.111.0b.tar.gz".)

The package libbnxt-re also is upgraded to the related version 227.0.130.0
because of the drivers upgradation.

We encountered a few the version compatibility issues between
bnxt_en/bnxt_re drivers and the 6.6.7 kernel. We adapted drivers' code
to the kernel 6.6.7 by referring to the upstream commits.

Verification:
* bnxt_en/bnxt_re:
  - Installation of the ISO image is successful with standard and
    low-latency profiles.
  - Physical function interfaces are up and pass packets for rt and std.
  - Create vfs, ensure that the interface can come up and pass packets.
  - RDMA/Infiniband over Ethernet functionalities of the Broadcom
    adapters were successfully tested using the Linux RDMA community's
    perftest package.

Story: 2011056
Task: 49876

Signed-off-by: Jiping Ma <jiping.ma2@windriver.com>
Change-Id: I2931cf333c28ee69662913e81c65340e633fbbc8
(cherry picked from commit cbe03073af71c49e4d3ca4e107ca8e2f2df435f0)
Signed-off-by: Jiping Ma <jiping.ma2@windriver.com>
2024-07-10 23:28:50 +00:00

88 lines
3.2 KiB
Makefile
Executable File

#!/usr/bin/make -f
#
# 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.
#
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1
%:
dh $@
WITH_MOD_SIGN ?= 1
kheaders_name=$(shell ls /usr/src | grep linux@KERNEL_TYPE@-headers | grep common)
kbuild_name=$(shell ls /usr/src | grep linux@KERNEL_TYPE@-headers | grep amd64)
kversion=$(shell echo $(kbuild_name) | sed 's/linux@KERNEL_TYPE@-headers-//g')
pkg_common_name=bnxt-en-common
export KSRC_COMMON=/usr/src/$(kheaders_name)
# "dpkg --status mlnx-ofed-kernel-dev" prints a version line
# like the following:
# Version: 5.5-OFED.5.5.1.0.3.1.stx.5.kver.5.10.0-6-amd64
# Reduce this line to the version number substring "5.5" before
# the substring "-OFED".
ofed_version=$(shell dpkg --status mlnx-ofed-kernel-dev@KERNEL_TYPE@ | \
grep -e '^Version:' | sed -e 's@^Version: \([0-9]\+\.[0-9]\+\)-OFED.*@\1@')
ifeq ($(ofed_version),)
$(error "Error: Could not detect the OFED version")
endif
version=$(shell dpkg-parsechangelog | sed -n 's/^Version: *\([^-]\+\)-.\+/\1/p')
ifeq ($(WITH_MOD_SIGN),1)
pkg_name=bnxt-en@KERNEL_TYPE@
endif
_sysconfdir=/etc
ifeq ($(WITH_MOD_SIGN),1)
_keydir ?= /usr/src/kernels/$(kversion)/
privkey ?= $(_keydir)/signing_key.pem
pubkey ?= $(_keydir)/signing_key.x509
endif
override_dh_auto_install:
dh_install bnxt_en/bnxt_en.ko /lib/modules/$(kversion)/extra/bnxt_en/
dh_install bnxt_re/bnxt_re.ko /lib/modules/$(kversion)/extra/drivers/infiniband/hw/bnxt_re/
dh_install -p$(pkg_common_name) debian/extra/bnxt.conf $(_sysconfdir)/modprobe.d/
override_dh_strip:
dh_strip
find debian -name '*.ko' | xargs strip -g
ifeq ($(WITH_MOD_SIGN),1)
@echo "Sign the modules"
/usr/lib/linux@KERNEL_TYPE@-kbuild-*/scripts/sign-file sha256 $(privkey) $(pubkey) \
./debian/$(pkg_name)/lib/modules/$(kversion)/extra/bnxt_en/bnxt_en.ko
/usr/lib/linux@KERNEL_TYPE@-kbuild-*/scripts/sign-file sha256 $(privkey) $(pubkey) \
./debian/$(pkg_name)/lib/modules/$(kversion)/extra/drivers/infiniband/hw/bnxt_re/bnxt_re.ko
endif
override_dh_auto_clean:
dh_auto_build -D ./bnxt_en -- clean KVER=$(kversion) EXTRA_CFLAGS+="-DVERSION='$(version)'"
dh_auto_build -D ./bnxt_re -- clean KVER=$(kversion) OFED_VERSION="$(ofed_version)"
override_dh_auto_build:
# Regenerate manifest hash
if [ -e bnxt_en/MANIFEST ]; then \
cd bnxt_en && sha512sum $$(cat MANIFEST | cut -c 131-) > MANIFEST; \
fi
dh_auto_build -D ./bnxt_en -- KVER=$(kversion) EXTRA_CFLAGS+="-DVERSION='$(version)'"
dh_auto_build -D ./bnxt_re -- KVER=$(kversion) OFED_VERSION="$(ofed_version)"