From 3f1b213716bb690365ff0bdc1ced02d4a8e59e53 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?=
<2031761+viniciusferrao@users.noreply.github.com>
Date: Sat, 11 Apr 2026 18:24:46 -0300
Subject: [PATCH 01/10] Add DOCA OFED provider compatibility overlay
---
.github/workflows/verify.yml | 29 +
.github/workflows/watch-upstream.yml | 80 --
README.md | 128 +--
build-docaofed-provider-compat.sh | 167 +++
patch-mlnxofed.sh | 1435 ------------------------
testing/libvirt/remote-doca-vm-test.sh | 122 ++
tests/check-upstream-releases.sh | 106 --
tests/upstream-release-ignore.txt | 5 -
tests/verify-doca-rpm-layout.sh | 88 ++
tests/verify-releases.sh | 434 -------
10 files changed, 463 insertions(+), 2131 deletions(-)
create mode 100644 .github/workflows/verify.yml
delete mode 100644 .github/workflows/watch-upstream.yml
create mode 100755 build-docaofed-provider-compat.sh
delete mode 100755 patch-mlnxofed.sh
create mode 100755 testing/libvirt/remote-doca-vm-test.sh
delete mode 100755 tests/check-upstream-releases.sh
delete mode 100644 tests/upstream-release-ignore.txt
create mode 100755 tests/verify-doca-rpm-layout.sh
delete mode 100755 tests/verify-releases.sh
diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml
new file mode 100644
index 0000000..a087f2f
--- /dev/null
+++ b/.github/workflows/verify.yml
@@ -0,0 +1,29 @@
+name: Verify
+
+on:
+ pull_request:
+ push:
+ branches:
+ - master
+ workflow_dispatch:
+
+jobs:
+ shell-and-layout:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Check out repository
+ uses: actions/checkout@v4
+
+ - name: Install verification tools
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y cpio rpm2cpio
+
+ - name: Check shell syntax
+ run: |
+ sh -n build-docaofed-provider-compat.sh
+ sh -n tests/verify-doca-rpm-layout.sh
+ sh -n testing/libvirt/remote-doca-vm-test.sh
+
+ - name: Verify public DOCA RPM layout
+ run: sh tests/verify-doca-rpm-layout.sh
diff --git a/.github/workflows/watch-upstream.yml b/.github/workflows/watch-upstream.yml
deleted file mode 100644
index 83b9574..0000000
--- a/.github/workflows/watch-upstream.yml
+++ /dev/null
@@ -1,80 +0,0 @@
-name: Watch upstream MLNX OFED releases
-
-on:
- schedule:
- - cron: "17 8 * * 1"
- workflow_dispatch:
-
-permissions:
- contents: read
- issues: write
-
-jobs:
- check-upstream:
- runs-on: ubuntu-latest
- steps:
- - name: Check out repository
- uses: actions/checkout@v4
-
- - name: Check NVIDIA upstream index
- env:
- GH_TOKEN: ${{ github.token }}
- ISSUE_TITLE: New MLNX_OFED upstream releases detected
- ISSUE_LABEL: upstream-update
- run: |
- set -eu
-
- missing_file="${RUNNER_TEMP}/missing-mlnxofed-releases.txt"
- body_file="${RUNNER_TEMP}/mlnxofed-upstream-issue.md"
-
- set +e
- sh tests/check-upstream-releases.sh > "$missing_file"
- status=$?
- set -e
-
- existing_issue=$(gh issue list \
- --state open \
- --search "\"${ISSUE_TITLE}\" in:title" \
- --json number \
- --jq '.[0].number // empty')
-
- if [ "$status" -eq 0 ]; then
- cat "$missing_file"
- if [ -n "$existing_issue" ]; then
- gh issue close "$existing_issue" \
- --comment "No unsupported Enterprise Linux MLNX_OFED releases are currently detected."
- fi
- exit 0
- fi
-
- if ! grep -E '^[0-9][0-9.]*-[0-9A-Za-z.-]+$' "$missing_file" >/dev/null; then
- cat "$missing_file"
- exit "$status"
- fi
-
- {
- echo "The NVIDIA upstream MLNX_OFED repository contains Enterprise Linux release directories that are not listed as supported here."
- echo
- echo "Missing releases:"
- sed 's/^/- `/' "$missing_file" | sed 's/$/`/'
- echo
- echo "Source index:"
- echo "https://linux.mellanox.com/public/repo/mlnx_ofed/"
- echo
- echo "Next step: add metadata for the new RPM-backed release, run the release verifier, and close this issue after merging support."
- } > "$body_file"
-
- gh label create "$ISSUE_LABEL" \
- --color f29513 \
- --description "Tracks upstream MLNX_OFED release changes" || true
-
- if [ -n "$existing_issue" ]; then
- gh issue edit "$existing_issue" --body-file "$body_file"
- else
- gh issue create \
- --title "$ISSUE_TITLE" \
- --body-file "$body_file" \
- --label "$ISSUE_LABEL"
- fi
-
- exit 1
diff --git a/README.md b/README.md
index 5354bd0..937986b 100644
--- a/README.md
+++ b/README.md
@@ -1,81 +1,67 @@
-# mlnxofed-patch
-
-Shell script to patch MLNX OFED to add back support for MLX4 and EFA
-
-## Use cases
-
-This script has proven to be useful if you're maintaining systems like:
-* HPC cluster with [OpenHPC](http://www.openhpc.community)
-* [Red Hat Virtualization](https://www.redhat.com/technologies/virtualization/enterprise-virtualization)
-and [oVirt](https://www.ovirt.org) with Openvswitch
-
-If you have an additional use case please update this documentation with a Pull Request.
-
-## Requirements:
-* Enterprise Linux 8 or 9
- * Red Hat Enterprise Linux (RHEL)
- * Oracle Linux
- * Rocky Linux
- * Alma Linux
- * CentOS
-
-* Enterprise Linux 8
- * CodeReady Builder / PowerTools repositories must be enabled
-* Enterprise Linux 9
- * CRB must be enabled
- * EPEL is required for `pandoc`
-* root privileges are needed for installation
-
-## Supported MLNX OFED releases
-
-| Series | Releases |
-| --- | --- |
-| 25.01 | `25.01-0.6.0.0` |
-| 24.10 | `24.10-4.1.4.0`
`24.10-3.2.5.0`
`24.10-2.1.8.0`
`24.10-1.1.4.0.105`
`24.10-1.1.4.0`
`24.10-0.7.0.0`
`24.10-0.6.8.1`
`24.10-0.6.8.0` |
-| 24.07 | `24.07-0.6.1.0`
`24.07-0.6.0.0` |
-| 24.04 | `24.04-0.7.0.0`
`24.04-0.6.6.0`
`24.04-0.6.5.0` |
-| 24.01 | `24.01-0.3.3.1` |
-| 23.10 | `23.10-6.1.6.1`
`23.10-4.0.9.1`
`23.10-3.2.2.0`
`23.10-2.1.3.1.201`
`23.10-2.1.3.1`
`23.10-1.1.9.0`
`23.10-0.5.5.0` |
-| 23.07 | `23.07-0.5.1.2`
`23.07-0.5.0.0` |
-| 23.04 | `23.04-1.1.3.0`
`23.04-0.5.3.3` |
-| 5.9 | `5.9-0.5.6.0.127`
`5.9-0.5.6.0.125`
`5.9-0.5.6.0` |
-| 5.8 | `5.8-7.0.6.1`
`5.8-6.0.4.2`
`5.8-5.1.1.2`
`5.8-4.1.5.0`
`5.8-3.0.7.0.101`
`5.8-3.0.7.0`
`5.8-2.0.3.0`
`5.8-1.1.2.1`
`5.8-1.0.1.1` |
-| 5.7 | `5.7-1.0.2.0` |
-| 5.6 | `5.6-2.0.9.0`
`5.6-1.0.3.3` |
-| 5.5 | `5.5-1.0.3.2` |
-| 5.4 | `5.4-3.7.5.0`
`5.4-3.6.8.1`
`5.4-3.5.8.0`
`5.4-3.4.0.0`
`5.4-3.2.7.2.3`
`5.4-3.1.0.0`
`5.4-3.0.3.0`
`5.4-2.4.1.3`
`5.4-1.0.3.0` |
-| 5.3 | `5.3-1.0.5.0`
`5.3-1.0.0.1` |
-| 5.2 | `5.2-2.2.0.0`
`5.2-1.0.4.0` |
-| 5.1 | `5.1-2.5.8.0`
`5.1-2.3.7.1`
`5.1-0.6.6.0` |
-| 5.0 | `5.0-2.1.8.0`
`5.0-1.0.0.0` |
-| 4.9 | `4.9-7.1.0.0`
`4.9-6.0.6.0`
`4.9-5.1.0.0`
`4.9-4.1.7.0`
`4.9-4.0.8.0`
`4.9-3.1.5.0`
`4.9-2.2.6.0`
`4.9-2.2.4.0`
`4.9-0.1.7.0` |
-| 4.7 | `4.7-3.2.9.0`
`4.7-1.0.0.1` |
-
-Debian-only, Ubuntu-only, SLES-only, and pre-Enterprise Linux 8 public drops are not listed because this script targets RPM source packages for Enterprise Linux 8 or 9.
-
-## Usage:
-
-Just run `patch-mlnxofed.sh` on a machine where MLNX OFED is already installed,
-and you should be fine.
-
-The script will execute `dnf` to install the new packages, but it's up to you to
-install it or not. The resulting RPMs will be available by default on
-`PATCHED-MLNX-OFED` directory inside `$HOME`
+# docaofed-patch
+
+Builds a small compatibility RPM for DOCA OFED that restores libibverbs provider
+registration for EFA and mlx4 on Enterprise Linux 9 and 10.
+
+DOCA OFED already ships the userspace libraries in `libibverbs`:
+
+* `/usr/lib64/libefa.so.1`
+* `/usr/lib64/libmlx4.so.1`
+
+The missing pieces are the provider registration files and provider ABI symlinks:
+
+* `/etc/libibverbs.d/efa.driver`
+* `/etc/libibverbs.d/mlx4.driver`
+* `/usr/lib64/libibverbs/libefa-rdmavNN.so`
+* `/usr/lib64/libibverbs/libmlx4-rdmavNN.so`
+
+This project intentionally does not repack NVIDIA RPMs. It generates a separate
+overlay package that can be installed after DOCA OFED userspace packages.
+
+## Requirements
+
+* Enterprise Linux 9 or 10
+* DOCA OFED `rdma-core` and `libibverbs` already installed
+* `rpmbuild`
+* root privileges only if installing the generated RPM
+
+## Usage
+
+Build the compatibility RPM:
+
+```sh
+./build-docaofed-provider-compat.sh
+```
+
+Build and install it:
+
+```sh
+INSTALL_AFTER_BUILD=1 ./build-docaofed-provider-compat.sh
+```
+
+The built RPM is written to `$HOME/PATCHED-DOCA-OFED` by default.
+
+The generated package is tied to the installed DOCA OFED `libibverbs` and
+`rdma-core` package EVRs. Rebuild the compatibility RPM after updating DOCA
+OFED.
## Verification
-You can verify expected source markers and patched output lines against upstream
-`rdma-core` source RPMs with:
+Check the current public DOCA repository layout for EL9 and EL10:
-`tests/verify-releases.sh 25.01-0.6.0.0 24.10-4.1.4.0 24.04-0.6.5.0 23.04-0.5.3.3 5.8-7.0.6.1 5.3-1.0.5.0 4.7-3.2.9.0`
+```sh
+tests/verify-doca-rpm-layout.sh
+```
-You can check for new upstream Enterprise Linux MLNX OFED releases with:
+The `testing/libvirt/remote-doca-vm-test.sh` harness can be copied to a libvirt
+host and used with Rocky cloud images to run end-to-end EL9 and EL10 build and
+install validation.
-`tests/check-upstream-releases.sh`
+Validated against the public DOCA `latest` repository on 2026-04-11:
-The scheduled GitHub Actions workflow runs the same check weekly. If NVIDIA
-publishes a new RPM-backed Enterprise Linux release, it opens or updates one
-`upstream-update` issue.
+* EL9: `libibverbs-2601.0.7-1.el9.x86_64.rpm`
+* EL10: `libibverbs-2601.0.7-1.el10.x86_64.rpm`
+* Provider ABI: `rdmav59`
# Open Source Apache License
diff --git a/build-docaofed-provider-compat.sh b/build-docaofed-provider-compat.sh
new file mode 100755
index 0000000..31abfa5
--- /dev/null
+++ b/build-docaofed-provider-compat.sh
@@ -0,0 +1,167 @@
+#!/bin/sh
+#
+# Build a small compatibility RPM for DOCA OFED that restores libibverbs
+# provider registration for EFA and mlx4.
+
+set -eu
+
+if [ -n "${HOME:-}" ]; then
+ default_home=$HOME
+elif [ "$(id -u)" -eq 0 ]; then
+ default_home=/root
+else
+ default_home=$(pwd)
+fi
+
+PACKAGE_NAME=${PACKAGE_NAME:-docaofed-provider-compat}
+OUTPUT_DIR=${OUTPUT_DIR:-"$default_home/PATCHED-DOCA-OFED"}
+RPM_BUILD_ROOT=${RPM_BUILD_ROOT:-"$default_home/.cache/docaofed-provider-compat/rpmbuild"}
+RELEASE_TAG=${RELEASE_TAG:-versatushpc}
+INSTALL_AFTER_BUILD=${INSTALL_AFTER_BUILD:-0}
+
+die() {
+ echo "$*" >&2
+ exit 1
+}
+
+need_cmd() {
+ if ! command -v "$1" >/dev/null 2>&1; then
+ die "Missing required tool: $1"
+ fi
+}
+
+rpm_evr() {
+ package=$1
+ rpm -q --qf '%{EPOCH}:%{VERSION}-%{RELEASE}' "$package" |
+ sed 's/^(none)://'
+}
+
+for tool in rpm rpmbuild find sed mkdir ln cp basename rm; do
+ need_cmd "$tool"
+done
+
+el_major=$(rpm -E '%{?rhel}')
+case "$el_major" in
+9|10)
+ ;;
+*)
+ die "Only Enterprise Linux 9 and 10 are supported"
+ ;;
+esac
+
+libdir=$(rpm -E '%{_libdir}')
+arch=$(rpm -E '%{_arch}')
+
+if ! rpm -q --quiet libibverbs; then
+ die "libibverbs is not installed. Install DOCA OFED userspace first."
+fi
+
+if ! rpm -q --quiet rdma-core; then
+ die "rdma-core is not installed. Install DOCA OFED userspace first."
+fi
+
+if [ ! -e "$libdir/libefa.so.1" ]; then
+ die "Missing $libdir/libefa.so.1. This DOCA OFED build does not ship EFA userspace support."
+fi
+
+if [ ! -e "$libdir/libmlx4.so.1" ]; then
+ die "Missing $libdir/libmlx4.so.1. This DOCA OFED build does not ship mlx4 userspace support."
+fi
+
+if [ ! -d "$libdir/libibverbs" ]; then
+ die "Missing $libdir/libibverbs provider directory."
+fi
+
+rdmav_link=$(find "$libdir/libibverbs" -maxdepth 1 -type l -name 'libmlx5-rdmav*.so' | sed -n '1p')
+if [ -z "$rdmav_link" ]; then
+ die "Unable to detect libibverbs provider ABI from $libdir/libibverbs/libmlx5-rdmav*.so"
+fi
+
+rdmav_abi=$(basename "$rdmav_link" | sed -n 's/^libmlx5-\(rdmav[0-9][0-9]*\)\.so$/\1/p')
+if [ -z "$rdmav_abi" ]; then
+ die "Unable to parse provider ABI from $rdmav_link"
+fi
+
+if [ -e "/etc/libibverbs.d/efa.driver" ] || [ -e "$libdir/libibverbs/libefa-$rdmav_abi.so" ]; then
+ die "EFA provider registration already exists. No compatibility RPM is needed."
+fi
+
+if [ -e "/etc/libibverbs.d/mlx4.driver" ] || [ -e "$libdir/libibverbs/libmlx4-$rdmav_abi.so" ]; then
+ die "mlx4 provider registration already exists. No compatibility RPM is needed."
+fi
+
+libibverbs_version=$(rpm -q --qf '%{VERSION}' libibverbs)
+libibverbs_evr=$(rpm_evr libibverbs)
+rdma_core_evr=$(rpm_evr rdma-core)
+case "$libibverbs_version" in
+*-*)
+ die "Unexpected libibverbs version contains a dash: $libibverbs_version"
+ ;;
+esac
+
+case "$RELEASE_TAG" in
+*[!A-Za-z0-9._]*|'')
+ die "RELEASE_TAG must contain only letters, numbers, dots, and underscores"
+ ;;
+esac
+
+rpm_topdir=$RPM_BUILD_ROOT
+spec_dir=$rpm_topdir/SPECS
+rpm_dir=$rpm_topdir/RPMS
+spec_path=$spec_dir/$PACKAGE_NAME.spec
+
+rm -rf "$rpm_topdir"
+mkdir -p "$rpm_topdir/BUILD" "$rpm_dir" "$rpm_topdir/SOURCES" "$spec_dir" "$rpm_topdir/SRPMS" "$OUTPUT_DIR"
+
+cat > "$spec_path" << EOF
+Name: $PACKAGE_NAME
+Version: $libibverbs_version
+Release: 1.$RELEASE_TAG%{?dist}
+Summary: Restore EFA and mlx4 libibverbs provider registration for DOCA OFED
+License: Apache-2.0
+
+Requires: libibverbs%{?_isa} = $libibverbs_evr
+Requires: rdma-core%{?_isa} = $rdma_core_evr
+
+%description
+DOCA OFED ships the EFA and mlx4 userspace libraries but leaves their
+libibverbs provider registration files and provider ABI symlinks out of the
+libibverbs RPM payload. This package restores those registration files without
+repacking the vendor RPMs.
+
+%prep
+
+%build
+
+%install
+rm -rf %{buildroot}
+mkdir -p %{buildroot}%{_sysconfdir}/libibverbs.d
+printf 'driver efa\\n' > %{buildroot}%{_sysconfdir}/libibverbs.d/efa.driver
+printf 'driver mlx4\\n' > %{buildroot}%{_sysconfdir}/libibverbs.d/mlx4.driver
+mkdir -p %{buildroot}%{_libdir}/libibverbs
+ln -s ../libefa.so.1 %{buildroot}%{_libdir}/libibverbs/libefa-$rdmav_abi.so
+ln -s ../libmlx4.so.1 %{buildroot}%{_libdir}/libibverbs/libmlx4-$rdmav_abi.so
+
+%files
+%config(noreplace) %{_sysconfdir}/libibverbs.d/efa.driver
+%config(noreplace) %{_sysconfdir}/libibverbs.d/mlx4.driver
+%{_libdir}/libibverbs/libefa-$rdmav_abi.so
+%{_libdir}/libibverbs/libmlx4-$rdmav_abi.so
+EOF
+
+rpmbuild -bb --define "_topdir $rpm_topdir" "$spec_path"
+
+rpm_path=$(find "$rpm_dir/$arch" -maxdepth 1 -type f -name "$PACKAGE_NAME-$libibverbs_version-*.rpm" | sed -n '1p')
+if [ -z "$rpm_path" ]; then
+ die "Unable to find built RPM under $rpm_dir/$arch"
+fi
+
+cp "$rpm_path" "$OUTPUT_DIR/"
+output_rpm=$OUTPUT_DIR/$(basename "$rpm_path")
+
+if [ "$INSTALL_AFTER_BUILD" = 1 ]; then
+ need_cmd dnf
+ dnf install -y "$output_rpm"
+fi
+
+echo "Built: $output_rpm"
diff --git a/patch-mlnxofed.sh b/patch-mlnxofed.sh
deleted file mode 100755
index e02c1d6..0000000
--- a/patch-mlnxofed.sh
+++ /dev/null
@@ -1,1435 +0,0 @@
-#!/bin/sh
-# Patch to add back support for MLX4 and EFA on MLNX OFED
-# This script is tested against Enterprise Linux 8 and 9
-#
-# vinicius {\a\t} ferrao.net.br
-# ferrao {\a\t} versatushpc.com.br
-
-# Stop execution in case of any error (add x for debugging)
-set -e
-
-# Output directory for the new RPMS
-RPMS_OUTPUT_DIR=$HOME/PATCHED-MLNX-OFED
-# rpmbuild root directory
-RPM_BUILD_ROOT=~/dd90dbfa-8d9f-43dd-a7ac-89f73e80e40f
-# Work directory to patch the files
-WORK_DIR=~/0995edb8-df4b-49f0-a144-fc6fa8835b71
-
-# perl is being too verbose without hardcoding locales
-LC_ALL=en_US.UTF-8
-LC_CTYPE=en_US.UTF-8
-
-patch_checked() {
- patch_target=$1
- patch_file=$2
-
- if ! patch -u "$patch_target" -i "$patch_file"; then
- return 1
- fi
- if [ -f "$patch_target.rej" ]; then
- echo "Patch rejected for $patch_target" >&2
- cat "$patch_target.rej" >&2
- return 1
- fi
-}
-
-find_rdma_core_archive() {
- find . -maxdepth 1 \( -name "rdma-core-$RDMA_CORE_VERSION.tgz" -o -name "rdma-core-$RDMA_CORE_VERSION.tar.gz" \) | sed -n '1p'
-}
-
-enable_mlx4_modprobe_install() {
- install_dest=$1
- cmake_file=providers/mlx4/CMakeLists.txt
- install_line="install(FILES \"mlx4.conf\" DESTINATION \"$install_dest\")"
-
- if ! grep -F "$install_line" "$cmake_file" >/dev/null; then
- echo "Missing mlx4 modprobe install line" >&2
- return 1
- fi
-
- if ! awk -v install_line="$install_line" '
- $0 == "if (0)" {
- if ((getline next_line) <= 0) {
- print
- next
- }
- if (next_line == install_line) {
- print next_line
- if ((getline end_line) > 0 && end_line != "endif()") {
- print end_line
- }
- next
- }
- print
- print next_line
- next
- }
- { print }
- ' "$cmake_file" > "$cmake_file.tmp"; then
- rm -f "$cmake_file.tmp"
- return 1
- fi
-
- mv "$cmake_file.tmp" "$cmake_file"
-}
-
-insert_line_before_regex() {
- patch_target=$1
- marker_regex=$2
- insert_line=$3
-
- if grep -F -- "$insert_line" "$patch_target" >/dev/null; then
- return 0
- fi
-
- if ! awk -v marker_regex="$marker_regex" -v insert_line="$insert_line" '
- $0 ~ marker_regex && !done {
- print insert_line
- done = 1
- }
- { print }
- END {
- if (!done) {
- exit 1
- }
- }
- ' "$patch_target" > "$patch_target.tmp"; then
- rm -f "$patch_target.tmp"
- echo "Missing marker in $patch_target: $marker_regex" >&2
- return 1
- fi
-
- mv "$patch_target.tmp" "$patch_target"
-}
-
-insert_line_after_regex() {
- patch_target=$1
- marker_regex=$2
- insert_line=$3
-
- if grep -F -- "$insert_line" "$patch_target" >/dev/null; then
- return 0
- fi
-
- if ! awk -v marker_regex="$marker_regex" -v insert_line="$insert_line" '
- $0 ~ marker_regex && !done {
- print
- print insert_line
- done = 1
- next
- }
- { print }
- END {
- if (!done) {
- exit 1
- }
- }
- ' "$patch_target" > "$patch_target.tmp"; then
- rm -f "$patch_target.tmp"
- echo "Missing marker in $patch_target: $marker_regex" >&2
- return 1
- fi
-
- mv "$patch_target.tmp" "$patch_target"
-}
-
-enable_legacy_modprobe_config() {
- patch_target=$1
- mlx4_config='%config(noreplace) %{_sysconfdir}/modprobe.d/mlx4.conf'
- truescale_config='%config(noreplace) %{_sysconfdir}/modprobe.d/truescale.conf'
-
- if ! awk -v mlx4_config="$mlx4_config" -v truescale_config="$truescale_config" '
- $0 == "%if 0" {
- if ((getline first_line) > 0 && first_line == mlx4_config) {
- if ((getline second_line) > 0 && second_line == truescale_config) {
- print "%dir %{_sysconfdir}/modprobe.d"
- print mlx4_config
- print "%if 0"
- print truescale_config
- done = 1
- next
- }
- print
- print first_line
- if (second_line != "") {
- print second_line
- }
- next
- }
- print
- if (first_line != "") {
- print first_line
- }
- next
- }
- { print }
- END {
- if (!done) {
- exit 1
- }
- }
- ' "$patch_target" > "$patch_target.tmp"; then
- rm -f "$patch_target.tmp"
- echo "Missing legacy modprobe block in $patch_target" >&2
- return 1
- fi
-
- mv "$patch_target.tmp" "$patch_target"
-}
-
-patch_legacy_51to53_spec() {
- spec_file=rdma-core.spec
-
- insert_line_before_regex "$spec_file" '^- libmlx5:' '- libmlx4: Mellanox ConnectX-3 InfiniBand HCA' || return 1
- insert_line_before_regex "$spec_file" '^- libmlx4:' '- libefa: Amazon Elastic Fabric Adapter' || return 1
- enable_legacy_modprobe_config "$spec_file" || return 1
- insert_line_before_regex "$spec_file" '^%\\{_mandir\\}/man3/ibv_\\*' '%{_mandir}/man3/efadv*' || return 1
- insert_line_before_regex "$spec_file" '^%\\{_mandir\\}/man7/rdma_cm\\.\\*' '%{_mandir}/man7/efadv*' || return 1
- insert_line_after_regex "$spec_file" '^%\\{_mandir\\}/man3/mlx5dv\\*' '%{_mandir}/man3/mlx4dv*' || return 1
- insert_line_after_regex "$spec_file" '^%\\{_mandir\\}/man7/mlx5dv\\*' '%{_mandir}/man7/mlx4dv*' || return 1
- insert_line_before_regex "$spec_file" '^%\\{_libdir\\}/libibverbs\\*\\.so\\.\\*' '%{_libdir}/libefa.so.*' || return 1
- insert_line_after_regex "$spec_file" '^%\\{_libdir\\}/libmlx5\\.so\\.\\*' '%{_libdir}/libmlx4.so.*' || return 1
-}
-
-download_source_bundle() {
- version=$1
- source_bundle_name=MLNX_OFED_SRC-$version.tgz
-
- if curl -fL "https://linux.mellanox.com/public/repo/mlnx_ofed/$version/$source_bundle_name" -o "$source_bundle_name" 2>/dev/null; then
- return 0
- fi
-
- curl -fL "https://content.mellanox.com/ofed/MLNX_OFED-$version/$source_bundle_name" -o "$source_bundle_name"
-}
-
-dnf_install_args() {
- el_major=$(rpm -E '%{?rhel}')
-
- if [ "$el_major" = 9 ]; then
- echo "-y --nobest"
- else
- echo "-y"
- fi
-}
-
-install_required_dependencies() {
- el_major=$(rpm -E '%{?rhel}')
- cmake_package=
- dnf_args=$(dnf_install_args)
-
- case "$el_major" in
- 8)
- cmake_package=cmake3
- ;;
- 9)
- cmake_package=cmake
- ;;
- *)
- cmake_package=cmake
- ;;
- esac
-
- if ! rpm -q --quiet pandoc 2>/dev/null && ! dnf -q list --available pandoc >/dev/null 2>&1; then
- echo "Unable to find pandoc in enabled repositories" >&2
- echo "On Enterprise Linux 9, enable EPEL before running this script" >&2
- return 1
- fi
-
- dnf install $dnf_args curl cpio kernel-rpm-macros rpm-build patch pandoc "$cmake_package" systemd-devel python3-devel libnl3-devel python3-Cython perl-generators
-}
-
-# Patches
-patch_mlnx_ofed56plus() {
-# CMakeLists.txt
-cat > CMakeLists.txt.patch << 'EOF'
---- CMakeLists.txt 2022-10-18 12:38:59.000000000 -0300
-+++ CMakeLists.txt.patched 2023-03-06 17:36:22.118634715 -0300
-@@ -695,13 +695,15 @@
- if (HAVE_COHERENT_DMA)
- if (0)
- add_subdirectory(providers/bnxt_re)
- add_subdirectory(providers/cxgb4) # NO SPARSE
-+endif()
- add_subdirectory(providers/efa)
- add_subdirectory(providers/efa/man)
-+if (0)
- add_subdirectory(providers/hns)
- add_subdirectory(providers/irdma)
-+endif()
- add_subdirectory(providers/mlx4)
- add_subdirectory(providers/mlx4/man)
--endif()
- add_subdirectory(providers/mlx5)
- add_subdirectory(providers/mlx5/man)
-EOF
-
-patch_checked CMakeLists.txt CMakeLists.txt.patch || return 1
-rm -f CMakeLists.txt.patch
-echo Patched: CMakeLists.txt
-echo
-
-# providers/mlx4/CMakeLists.txt
-enable_mlx4_modprobe_install '${CMAKE_INSTALL_MODPROBEDIR}/' || return 1
-echo Patched: providers/mlx4/CMakeLists.txt
-echo
-
-# pyverbs/CMakeLists.txt
-cat > CMakeLists.txt.patch << 'EOF'
---- CMakeLists.txt 2022-10-18 12:39:00.000000000 -0300
-+++ CMakeLists.txt.patched 2023-03-06 17:48:48.929234132 -0300
-@@ -51,7 +51,5 @@
- # mlx5 and efa providers are not built without coherent DMA, e.g. ARM32 build.
- if (HAVE_COHERENT_DMA)
- add_subdirectory(providers/mlx5)
--if (0)
- add_subdirectory(providers/efa)
- endif()
--endif()
-EOF
-
-patch_checked pyverbs/CMakeLists.txt CMakeLists.txt.patch || return 1
-rm -f CMakeLists.txt.patch
-echo Patched: pyverbs/CMakeLists.txt
-echo
-
-# rdma-core.spec
-cat > rdma-core.spec.patch << 'EOF'
---- rdma-core.spec 2022-10-18 12:39:00.000000000 -0300
-+++ rdma-core.spec.patched 2023-03-06 17:53:38.182443528 -0300
-@@ -254,6 +254,8 @@
- Device-specific plug-in ibverbs userspace drivers are included:
-
- - libirdma: Intel Ethernet Connection RDMA
-+- libefa: Amazon Elastic Fabric Adapter
-+- libmlx4: Mellanox ConnectX-3 InfiniBand HCA
- - libmlx5: Mellanox ConnectX-4+ InfiniBand HCA
-
- %package -n libibverbs-utils
-@@ -480,9 +482,9 @@
- %doc installed_docs/tag_matching.md
- %config(noreplace) %{_sysconfdir}/rdma/mlx4.conf
- %config(noreplace) %{_sysconfdir}/rdma/modules/rdma.conf
--%if 0
- %dir %{_sysconfdir}/modprobe.d
- %config(noreplace) %{_sysconfdir}/modprobe.d/mlx4.conf
-+%if 0
- %config(noreplace) %{_sysconfdir}/modprobe.d/truescale.conf
- %endif
- %dir %{dracutlibdir}
-@@ -520,16 +522,20 @@
- %endif
- %{_libdir}/lib*.so
- %{_libdir}/pkgconfig/*.pc
-+%{_mandir}/man3/efadv*
- %{_mandir}/man3/ibv_*
- %{_mandir}/man3/rdma*
- %{_mandir}/man3/umad*
- %{_mandir}/man3/*_to_ibv_rate.*
-+%{_mandir}/man7/efadv*
- %{_mandir}/man7/rdma_cm.*
- %ifnarch s390x s390
- %{_mandir}/man3/mlx5dv*
-+%{_mandir}/man3/mlx4dv*
- %endif
- %ifnarch s390x s390
- %{_mandir}/man7/mlx5dv*
-+%{_mandir}/man7/mlx4dv*
- %endif
- %{_mandir}/man3/ibnd_*
-
-@@ -648,10 +654,12 @@
- %files -n libibverbs
- %dir %{_sysconfdir}/libibverbs.d
- %dir %{_libdir}/libibverbs
-+%{_libdir}/libefa.so.*
- %{_libdir}/libibverbs*.so.*
- %{_libdir}/libibverbs/*.so
- %ifnarch s390x s390
- %{_libdir}/libmlx5.so.*
-+%{_libdir}/libmlx4.so.*
- %endif
- %config(noreplace) %{_sysconfdir}/libibverbs.d/*.driver
- %doc installed_docs/libibverbs.md
-EOF
-
-patch_checked rdma-core.spec rdma-core.spec.patch || return 1
-rm -f rdma-core.spec.patch
-echo Patched: rdma-core.spec
-echo
-}
-
-patch_mlnx_ofed59() {
-# CMakeLists.txt
-cat > CMakeLists.txt.patch << 'EOF'
---- CMakeLists.txt 2022-12-29 13:02:19.000000000 -0300
-+++ CMakeLists.txt.patched 2026-04-10 02:48:41.000000000 -0300
-@@ -717,16 +717,18 @@
- if (0)
- add_subdirectory(providers/bnxt_re)
- add_subdirectory(providers/cxgb4) # NO SPARSE
-+endif()
- add_subdirectory(providers/efa)
- add_subdirectory(providers/efa/man)
-+if (0)
- add_subdirectory(providers/erdma)
- add_subdirectory(providers/hns)
- add_subdirectory(providers/irdma)
- add_subdirectory(providers/mana)
- add_subdirectory(providers/mana/man)
-+endif()
- add_subdirectory(providers/mlx4)
- add_subdirectory(providers/mlx4/man)
--endif()
- add_subdirectory(providers/mlx5)
- add_subdirectory(providers/mlx5/man)
- if (0)
-EOF
-
-patch_checked CMakeLists.txt CMakeLists.txt.patch || return 1
-rm -f CMakeLists.txt.patch
-echo Patched: CMakeLists.txt
-echo
-
-# providers/mlx4/CMakeLists.txt
-enable_mlx4_modprobe_install '${CMAKE_INSTALL_MODPROBEDIR}/' || return 1
-echo Patched: providers/mlx4/CMakeLists.txt
-echo
-
-# pyverbs/CMakeLists.txt
-cat > CMakeLists.txt.patch << 'EOF'
---- CMakeLists.txt 2022-10-18 12:39:00.000000000 -0300
-+++ CMakeLists.txt.patched 2023-03-06 17:48:48.929234132 -0300
-@@ -51,7 +51,5 @@
- # mlx5 and efa providers are not built without coherent DMA, e.g. ARM32 build.
- if (HAVE_COHERENT_DMA)
- add_subdirectory(providers/mlx5)
--if (0)
- add_subdirectory(providers/efa)
- endif()
--endif()
-EOF
-
-patch_checked pyverbs/CMakeLists.txt CMakeLists.txt.patch || return 1
-rm -f CMakeLists.txt.patch
-echo Patched: pyverbs/CMakeLists.txt
-echo
-
-# rdma-core.spec
-cat > rdma-core.spec.patch << 'EOF'
---- rdma-core.spec 2022-12-29 13:02:20.000000000 -0300
-+++ rdma-core.spec.patched 2026-04-10 02:48:41.000000000 -0300
-@@ -260,8 +260,10 @@
- Device-specific plug-in ibverbs userspace drivers are included:
-
- - liberdma: Alibaba Elastic RDMA (iWarp) Adapter
-+- libefa: Amazon Elastic Fabric Adapter
- - libirdma: Intel Ethernet Connection RDMA
- - libmana: Microsoft Azure Network Adapter
-+- libmlx4: Mellanox ConnectX-3 InfiniBand HCA
- - libmlx5: Mellanox ConnectX-4+ InfiniBand HCA
-
- %package -n libibverbs-utils
-@@ -489,9 +491,9 @@
- %doc installed_docs/tag_matching.md
- %config(noreplace) %{_sysconfdir}/rdma/mlx4.conf
- %config(noreplace) %{_sysconfdir}/rdma/modules/rdma.conf
--%if 0
- %dir %{_sysconfdir}/modprobe.d
- %config(noreplace) %{_sysconfdir}/modprobe.d/mlx4.conf
-+%if 0
- %config(noreplace) %{_sysconfdir}/modprobe.d/truescale.conf
- %endif
- %dir %{dracutlibdir}
-@@ -527,15 +529,19 @@
- %endif
- %{_libdir}/lib*.so
- %{_libdir}/pkgconfig/*.pc
-+%{_mandir}/man3/efadv*
- %{_mandir}/man3/ibv_*
- %{_mandir}/man3/rdma*
- %{_mandir}/man3/umad*
- %{_mandir}/man3/*_to_ibv_rate.*
-+%{_mandir}/man7/efadv*
- %{_mandir}/man7/rdma_cm.*
- %ifnarch s390x s390
-+%{_mandir}/man3/mlx4dv*
- %{_mandir}/man3/mlx5dv*
- %endif
- %ifnarch s390x s390
-+%{_mandir}/man7/mlx4dv*
- %{_mandir}/man7/mlx5dv*
- %endif
- %{_mandir}/man3/ibnd_*
-@@ -655,9 +661,11 @@
- %files -n libibverbs
- %dir %{_sysconfdir}/libibverbs.d
- %dir %{_libdir}/libibverbs
-+%{_libdir}/libefa.so.*
- %{_libdir}/libibverbs*.so.*
- %{_libdir}/libibverbs/*.so
- %ifnarch s390x s390
-+%{_libdir}/libmlx4.so.*
- %{_libdir}/libmlx5.so.*
- %endif
- %config(noreplace) %{_sysconfdir}/libibverbs.d/*.driver
-EOF
-
-patch_checked rdma-core.spec rdma-core.spec.patch || return 1
-rm -f rdma-core.spec.patch
- echo Patched: rdma-core.spec
- echo
-}
-
-patch_mlnx_ofed2404plus() {
-# providers/mlx4/CMakeLists.txt
-enable_mlx4_modprobe_install '${CMAKE_INSTALL_MODPROBEDIR}/' || return 1
-echo Patched: providers/mlx4/CMakeLists.txt
-echo
-
-# rdma-core.spec
-cat > rdma-core.spec.patch << 'EOF'
---- rdma-core.spec 2024-04-22 17:41:21.000000000 -0300
-+++ rdma-core.spec.patched 2026-04-11 12:00:00.000000000 -0300
-@@ -467,10 +467,4 @@
- rm -rf %{buildroot}/%{_initrddir}/
- %endif
--
--rm -f %{buildroot}%{_sysconfdir}/libibverbs.d/efa.driver
--rm -f %{buildroot}%{_sysconfdir}/libibverbs.d/mlx4.driver
--rm -f %{buildroot}%{_libdir}/libibverbs/libefa-rdmav*.so
--rm -f %{buildroot}%{_libdir}/libibverbs/libmlx4-rdmav*.so
--
- %post -n rdma-core
- if [ -x /sbin/udevadm ]; then
-@@ -515,9 +511,9 @@
- %doc installed_docs/70-persistent-ipoib.rules
- %config(noreplace) %{_sysconfdir}/rdma/mlx4.conf
- %config(noreplace) %{_sysconfdir}/rdma/modules/rdma.conf
--%if 0
- %dir %{_sysconfdir}/modprobe.d
- %config(noreplace) %{_sysconfdir}/modprobe.d/mlx4.conf
-+%if 0
- %config(noreplace) %{_sysconfdir}/modprobe.d/truescale.conf
- %endif
- %dir %{dracutlibdir}
-@@ -689,6 +685,8 @@
- %{_libdir}/libmlx4.so.*
- %{_libdir}/libmlx5.so.*
- %endif
-+%config(noreplace) %{_sysconfdir}/libibverbs.d/efa.driver
-+%config(noreplace) %{_sysconfdir}/libibverbs.d/mlx4.driver
- %config(noreplace) %{_sysconfdir}/libibverbs.d/mlx5.driver
- %doc installed_docs/libibverbs.md
-EOF
-
-patch_checked rdma-core.spec rdma-core.spec.patch || return 1
-rm -f rdma-core.spec.patch
-echo Patched: rdma-core.spec
-echo
-}
-
-patch_mlnx_ofed55() {
-# CMakeLists.txt
-cat > CMakeLists.txt.patch << 'EOF'
---- CMakeLists.txt 2021-11-16 12:47:39.000000000 -0300
-+++ CMakeLists.txt.patched 2022-02-08 00:19:07.699078760 -0300
-@@ -674,13 +674,15 @@
- if (0)
- add_subdirectory(providers/bnxt_re)
- add_subdirectory(providers/cxgb4) # NO SPARSE
-+endif()
- add_subdirectory(providers/efa)
- add_subdirectory(providers/efa/man)
-+if (0)
- add_subdirectory(providers/hns)
- add_subdirectory(providers/irdma)
-+endif()
- add_subdirectory(providers/mlx4)
- add_subdirectory(providers/mlx4/man)
--endif()
- add_subdirectory(providers/mlx5)
- add_subdirectory(providers/mlx5/man)
- if (0)
-EOF
-
-patch_checked CMakeLists.txt CMakeLists.txt.patch || return 1
-rm -f CMakeLists.txt.patch
-echo Patched: CMakeLists.txt
-echo
-
-# providers/mlx4/CMakeLists.txt
-enable_mlx4_modprobe_install '${CMAKE_INSTALL_SYSCONFDIR}/modprobe.d/' || return 1
-echo Patched: providers/mlx4/CMakeLists.txt
-echo
-
-# pyverbs/CMakeLists.txt
-cat > CMakeLists.txt.patch << 'EOF'
---- CMakeLists.txt 2021-11-16 12:47:39.000000000 -0300
-+++ CMakeLists.txt.patched 2022-02-08 00:17:22.662412580 -0300
-@@ -50,7 +50,5 @@
- # mlx5 and efa providers are not built without coherent DMA, e.g. ARM32 build.
- if (HAVE_COHERENT_DMA)
- add_subdirectory(providers/mlx5)
--if (0)
- add_subdirectory(providers/efa)
- endif()
--endif()
-EOF
-
-patch_checked pyverbs/CMakeLists.txt CMakeLists.txt.patch || return 1
-rm -f CMakeLists.txt.patch
-echo Patched: pyverbs/CMakeLists.txt
-echo
-
-# rdma-core.spec
-cat > rdma-core.spec.patch << 'EOF'
---- rdma-core.spec 2021-11-16 12:47:39.000000000 -0300
-+++ rdma-core.spec.patched 2022-02-08 00:39:25.862231222 -0300
-@@ -250,6 +250,8 @@
- Device-specific plug-in ibverbs userspace drivers are included:
-
- - libirdma: Intel Ethernet Connection RDMA
-+- libefa: Amazon Elastic Fabric Adapter
-+- libmlx4: Mellanox ConnectX-3 InfiniBand HCA
- - libmlx5: Mellanox ConnectX-4+ InfiniBand HCA
-
- %package -n libibverbs-utils
-@@ -475,9 +477,9 @@
- %doc installed_docs/tag_matching.md
- %config(noreplace) %{_sysconfdir}/rdma/mlx4.conf
- %config(noreplace) %{_sysconfdir}/rdma/modules/rdma.conf
--%if 0
- %dir %{_sysconfdir}/modprobe.d
- %config(noreplace) %{_sysconfdir}/modprobe.d/mlx4.conf
-+%if 0
- %config(noreplace) %{_sysconfdir}/modprobe.d/truescale.conf
- %endif
- %dir %{dracutlibdir}
-@@ -515,16 +517,20 @@
- %endif
- %{_libdir}/lib*.so
- %{_libdir}/pkgconfig/*.pc
-+%{_mandir}/man3/efadv*
- %{_mandir}/man3/ibv_*
- %{_mandir}/man3/rdma*
- %{_mandir}/man3/umad*
- %{_mandir}/man3/*_to_ibv_rate.*
-+%{_mandir}/man7/efadv*
- %{_mandir}/man7/rdma_cm.*
- %ifnarch s390x s390
- %{_mandir}/man3/mlx5dv*
-+%{_mandir}/man3/mlx4dv*
- %endif
- %ifnarch s390x s390
- %{_mandir}/man7/mlx5dv*
-+%{_mandir}/man7/mlx4dv*
- %endif
- %{_mandir}/man3/ibnd_*
-
-@@ -611,10 +617,12 @@
- %files -n libibverbs
- %dir %{_sysconfdir}/libibverbs.d
- %dir %{_libdir}/libibverbs
-+%{_libdir}/libefa.so.*
- %{_libdir}/libibverbs*.so.*
- %{_libdir}/libibverbs/*.so
- %ifnarch s390x s390
- %{_libdir}/libmlx5.so.*
-+%{_libdir}/libmlx4.so.*
- %endif
- %config(noreplace) %{_sysconfdir}/libibverbs.d/*.driver
- %doc installed_docs/libibverbs.md
-EOF
-
-patch_checked rdma-core.spec rdma-core.spec.patch || return 1
-rm -f rdma-core.spec.patch
-echo Patched: rdma-core.spec
-echo
-}
-
-patch_mlnx_ofed54() {
-# CMakeLists.txt
-cat > CMakeLists.txt.patch << 'EOF'
---- CMakeLists.txt 2021-06-24 14:52:47.000000000 -0300
-+++ CMakeLists.txt.patched 2022-02-08 01:28:53.495956917 -0300
-@@ -675,13 +675,15 @@
- if (0)
- add_subdirectory(providers/bnxt_re)
- add_subdirectory(providers/cxgb4) # NO SPARSE
-+endif()
- add_subdirectory(providers/efa)
- add_subdirectory(providers/efa/man)
-+if (0)
- add_subdirectory(providers/hns)
- add_subdirectory(providers/i40iw) # NO SPARSE
-+endif()
- add_subdirectory(providers/mlx4)
- add_subdirectory(providers/mlx4/man)
--endif()
- add_subdirectory(providers/mlx5)
- add_subdirectory(providers/mlx5/man)
- if (0)
-EOF
-
-patch_checked CMakeLists.txt CMakeLists.txt.patch || return 1
-rm -f CMakeLists.txt.patch
-echo Patched: CMakeLists.txt
-echo
-
-# providers/mlx4/CMakeLists.txt
-enable_mlx4_modprobe_install '${CMAKE_INSTALL_SYSCONFDIR}/modprobe.d/' || return 1
-echo Patched: providers/mlx4/CMakeLists.txt
-echo
-
-# pyverbs/CMakeLists.txt
-cat > CMakeLists.txt.patch << 'EOF'
---- CMakeLists.txt 2021-06-24 14:52:48.000000000 -0300
-+++ CMakeLists.txt.patched 2022-02-08 01:32:32.705686167 -0300
-@@ -42,7 +42,5 @@
- # mlx5 and efa providers are not built without coherent DMA, e.g. ARM32 build.
- if (HAVE_COHERENT_DMA)
- add_subdirectory(providers/mlx5)
--if (0)
- add_subdirectory(providers/efa)
- endif()
--endif()
-EOF
-
-patch_checked pyverbs/CMakeLists.txt CMakeLists.txt.patch || return 1
-rm -f CMakeLists.txt.patch
-echo Patched: pyverbs/CMakeLists.txt
-echo
-
-# rdma-core.spec
-cat > rdma-core.spec.patch << 'EOF'
---- rdma-core.spec 2021-06-24 14:52:48.000000000 -0300
-+++ rdma-core.spec.patched 2022-02-08 01:39:22.703883240 -0300
-@@ -238,6 +238,8 @@
-
- Device-specific plug-in ibverbs userspace drivers are included:
-
-+- libefa: Amazon Elastic Fabric Adapter
-+- libmlx4: Mellanox ConnectX-3 InfiniBand HCA
- - libmlx5: Mellanox ConnectX-4+ InfiniBand HCA
-
- %package -n libibverbs-utils
-@@ -463,9 +465,9 @@
- %doc installed_docs/tag_matching.md
- %config(noreplace) %{_sysconfdir}/rdma/mlx4.conf
- %config(noreplace) %{_sysconfdir}/rdma/modules/rdma.conf
--%if 0
- %dir %{_sysconfdir}/modprobe.d
- %config(noreplace) %{_sysconfdir}/modprobe.d/mlx4.conf
-+%if 0
- %config(noreplace) %{_sysconfdir}/modprobe.d/truescale.conf
- %endif
- %dir %{dracutlibdir}
-@@ -503,16 +505,20 @@
- %endif
- %{_libdir}/lib*.so
- %{_libdir}/pkgconfig/*.pc
-+%{_mandir}/man3/efadv*
- %{_mandir}/man3/ibv_*
- %{_mandir}/man3/rdma*
- %{_mandir}/man3/umad*
- %{_mandir}/man3/*_to_ibv_rate.*
-+%{_mandir}/man7/efadv*
- %{_mandir}/man7/rdma_cm.*
- %ifnarch s390x s390
- %{_mandir}/man3/mlx5dv*
-+%{_mandir}/man3/mlx4dv*
- %endif
- %ifnarch s390x s390
- %{_mandir}/man7/mlx5dv*
-+%{_mandir}/man7/mlx4dv*
- %endif
- %{_mandir}/man3/ibnd_*
-
-@@ -599,10 +605,12 @@
- %files -n libibverbs
- %dir %{_sysconfdir}/libibverbs.d
- %dir %{_libdir}/libibverbs
-+%{_libdir}/libefa.so.*
- %{_libdir}/libibverbs*.so.*
- %{_libdir}/libibverbs/*.so
- %ifnarch s390x s390
- %{_libdir}/libmlx5.so.*
-+%{_libdir}/libmlx4.so.*
- %endif
- %config(noreplace) %{_sysconfdir}/libibverbs.d/*.driver
- %doc installed_docs/libibverbs.md
-EOF
-
-patch_checked rdma-core.spec rdma-core.spec.patch || return 1
-rm -f rdma-core.spec.patch
-echo Patched: rdma-core.spec
-echo
-}
-
-patch_mlnx_ofed51to53() {
-# CMakeLists.txt
-cat > CMakeLists.txt.patch << 'EOF'
---- CMakeLists.txt 2020-11-12 12:00:00.000000000 -0300
-+++ CMakeLists.txt.patched 2026-04-11 12:00:00.000000000 -0300
-@@ -675,13 +675,15 @@
- if (0)
- add_subdirectory(providers/bnxt_re)
- add_subdirectory(providers/cxgb4) # NO SPARSE
-+endif()
- add_subdirectory(providers/efa)
- add_subdirectory(providers/efa/man)
-+if (0)
- add_subdirectory(providers/hns)
- add_subdirectory(providers/i40iw) # NO SPARSE
-+endif()
- add_subdirectory(providers/mlx4)
- add_subdirectory(providers/mlx4/man)
--endif()
- add_subdirectory(providers/mlx5)
- add_subdirectory(providers/mlx5/man)
- if (0)
-EOF
-
-patch_checked CMakeLists.txt CMakeLists.txt.patch || return 1
-rm -f CMakeLists.txt.patch
-echo Patched: CMakeLists.txt
-echo
-
-# providers/mlx4/CMakeLists.txt
-enable_mlx4_modprobe_install '${CMAKE_INSTALL_SYSCONFDIR}/modprobe.d/' || return 1
-echo Patched: providers/mlx4/CMakeLists.txt
-echo
-
-# pyverbs/CMakeLists.txt
-cat > CMakeLists.txt.patch << 'EOF'
---- CMakeLists.txt 2020-11-12 12:00:00.000000000 -0300
-+++ CMakeLists.txt.patched 2026-04-11 12:00:00.000000000 -0300
-@@ -42,7 +42,5 @@
- # mlx5 and efa providers are not built without coherent DMA, e.g. ARM32 build.
- if (HAVE_COHERENT_DMA)
- add_subdirectory(providers/mlx5)
--if (0)
- add_subdirectory(providers/efa)
- endif()
--endif()
-EOF
-
-patch_checked pyverbs/CMakeLists.txt CMakeLists.txt.patch || return 1
-rm -f CMakeLists.txt.patch
-echo Patched: pyverbs/CMakeLists.txt
-echo
-
-# rdma-core.spec
-patch_legacy_51to53_spec || return 1
-echo Patched: rdma-core.spec
-echo
-}
-
-patch_mlnx_ofed49() {
-# CMakeLists.txt
-cat > CMakeLists.txt.patch << 'EOF'
---- CMakeLists.txt 2021-04-23 07:31:00.000000000 -0300
-+++ CMakeLists.txt.patched 2022-03-19 00:11:01.247634859 -0300
-@@ -624,8 +624,10 @@
- if (0)
- add_subdirectory(providers/bnxt_re)
- add_subdirectory(providers/cxgb4) # NO SPARSE
-+endif()
- add_subdirectory(providers/efa)
- add_subdirectory(providers/efa/man)
-+if (0)
- add_subdirectory(providers/hns)
- add_subdirectory(providers/i40iw) # NO SPARSE
- endif()
-EOF
-
-patch_checked CMakeLists.txt CMakeLists.txt.patch || return 1
-rm -f CMakeLists.txt.patch
-echo Patched: CMakeLists.txt
-echo
-
-# rdma-core.spec
-cat > rdma-core.spec.patch << 'EOF'
---- rdma-core.spec 2021-04-23 07:31:00.000000000 -0300
-+++ rdma-core.spec.patched 2022-03-19 00:27:13.436049287 -0300
-@@ -263,6 +263,7 @@
-
- Device-specific plug-in ibverbs userspace drivers are included:
-
-+- libefa: Amazon Elastic Fabric Adapter
- - libmlx4: Mellanox ConnectX-3 InfiniBand HCA
- - libmlx5: Mellanox Connect-IB/X-4+ InfiniBand HCA
-
-@@ -540,10 +541,12 @@
- %endif
- %{_libdir}/lib*.so
- %{_libdir}/pkgconfig/*.pc
-+%{_mandir}/man3/efadv*
- %{_mandir}/man3/ibv_*
- %{_mandir}/man3/rdma*
- %{_mandir}/man3/umad*
- %{_mandir}/man3/*_to_ibv_rate.*
-+%{_mandir}/man7/efadv*
- %{_mandir}/man7/rdma_cm.*
- %ifnarch s390x s390
- %{_mandir}/man3/mlx5dv*
-@@ -638,6 +641,7 @@
- %files -n libibverbs
- %dir %{_sysconfdir}/libibverbs.d
- %dir %{_libdir}/libibverbs
-+%{_libdir}/libefa.so.*
- %{_libdir}/libibverbs*.so.*
- %{_libdir}/libibverbs/*.so
- %ifnarch s390x s390
-EOF
-
-patch_checked rdma-core.spec rdma-core.spec.patch || return 1
-rm -f rdma-core.spec.patch
-echo Patched: rdma-core.spec
-echo
-}
-
-detect_mlnx_ofed_version() {
- if [ -n "${MLNX_OFED_VERSION_OVERRIDE:-}" ]; then
- MLNX_OFED_VERSION=$MLNX_OFED_VERSION_OVERRIDE
- else
- MLNX_OFED_VERSION=`ofed_info -s | cut -f 2- -d- | cut -f 1 -d:`
- fi
-}
-
-set_release_metadata() {
- RDMA_CORE_VERSION=$1
- RDMA_CORE_MINOR_VERSION=$2
- RDMA_CORE_NEW_VERSION=$3
- PATCH_FAMILY=$4
-}
-
-load_release_metadata() {
- case $MLNX_OFED_VERSION in
- 25.01-0.6.0.0)
- # MLNX OFED 25.01-0.6.0.0 version info
- # https://linux.mellanox.com/public/repo/mlnx_ofed/25.01-0.6.0.0/MLNX_OFED_SRC-25.01-0.6.0.0.tgz
- set_release_metadata "2501mlnx56" "1.2501060" "2501061.versatushpc" "2404plus"
- ;;
- 24.10-0.6.8.0|24.10-0.6.8.1|24.10-0.7.0.0|24.10-1.1.4.0|24.10-1.1.4.0.105|24.10-2.1.8.0|24.10-3.2.5.0|24.10-4.1.4.0)
- # MLNX OFED 24.10 version info
- # https://linux.mellanox.com/public/repo/mlnx_ofed/latest-24.10/
- set_release_metadata "2410mlnx54" "1.2410068" "2410069.versatushpc" "2404plus"
- ;;
- 24.07-0.6.1.0)
- # MLNX OFED 24.07-0.6.1.0 version info
- # https://linux.mellanox.com/public/repo/mlnx_ofed/24.07-0.6.1.0/
- set_release_metadata "2407mlnx52" "1.2407061" "2407062.versatushpc" "2404plus"
- ;;
- 24.07-0.6.0.0)
- # MLNX OFED 24.07-0.6.0.0 version info
- # https://linux.mellanox.com/public/repo/mlnx_ofed/24.07-0.6.0.0/MLNX_OFED_SRC-24.07-0.6.0.0.tgz
- set_release_metadata "2407mlnx52" "1.2407060" "2407061.versatushpc" "2404plus"
- ;;
- 24.04-0.6.6.0|24.04-0.7.0.0)
- # MLNX OFED 24.04 version info
- # https://linux.mellanox.com/public/repo/mlnx_ofed/latest-24.04/
- set_release_metadata "2404mlnx51" "1.2404066" "2404067.versatushpc" "2404plus"
- ;;
- 24.04-0.6.5.0)
- # MLNX OFED 24.04-0.6.5.0 version info
- # https://linux.mellanox.com/public/repo/mlnx_ofed/24.04-0.6.5.0/MLNX_OFED_SRC-24.04-0.6.5.0.tgz
- set_release_metadata "2404mlnx51" "1.2404065" "2404066.versatushpc" "2404plus"
- ;;
- 24.01-0.3.3.1)
- # MLNX OFED 24.01-0.3.3.1 version info
- # https://linux.mellanox.com/public/repo/mlnx_ofed/24.01-0.3.3.1/
- set_release_metadata "2307mlnx47" "1.2401033" "2401034.versatushpc" "59"
- ;;
- 23.10-4.0.9.1|23.10-6.1.6.1)
- # MLNX OFED 23.10 version info
- # https://linux.mellanox.com/public/repo/mlnx_ofed/latest-23.10/
- set_release_metadata "2307mlnx47" "1.2310409" "2310410.versatushpc" "59"
- ;;
- 23.10-3.2.2.0)
- # MLNX OFED 23.10-3.2.2.0 version info
- # https://linux.mellanox.com/public/repo/mlnx_ofed/23.10-3.2.2.0/
- set_release_metadata "2307mlnx47" "1.2310322" "2310323.versatushpc" "59"
- ;;
- 23.10-2.1.3.1|23.10-2.1.3.1.201)
- # MLNX OFED 23.10 version info
- # https://linux.mellanox.com/public/repo/mlnx_ofed/23.10-2.1.3.1/
- set_release_metadata "2307mlnx47" "1.2310213" "2310214.versatushpc" "59"
- ;;
- 23.10-1.1.9.0)
- # MLNX OFED 23.10-1.1.9.0 version info
- # https://linux.mellanox.com/public/repo/mlnx_ofed/23.10-1.1.9.0/
- set_release_metadata "2307mlnx47" "1.2310119" "2310120.versatushpc" "59"
- ;;
- 23.10-0.5.5.0)
- # MLNX OFED 23.10-0.5.5.0 version info
- # https://linux.mellanox.com/public/repo/mlnx_ofed/23.10-0.5.5.0/
- set_release_metadata "2307mlnx47" "1.2310055" "2310056.versatushpc" "59"
- ;;
- 23.07-0.5.0.0|23.07-0.5.1.2)
- # MLNX OFED 23.07 version info
- # https://linux.mellanox.com/public/repo/mlnx_ofed/latest-23.07/
- set_release_metadata "2307mlnx47" "1.2307050" "2307051.versatushpc" "59"
- ;;
- 23.04-1.1.3.0)
- # MLNX OFED 23.04-1.1.3.0 version info
- # https://linux.mellanox.com/public/repo/mlnx_ofed/23.04-1.1.3.0/
- set_release_metadata "2304mlnx44" "1.2304113" "2304114.versatushpc" "59"
- ;;
- 23.04-0.5.3.3)
- # MLNX OFED 23.04-0.5.3.3 version info
- # https://linux.mellanox.com/public/repo/mlnx_ofed/23.04-0.5.3.3/
- set_release_metadata "2304mlnx44" "1.2304053" "2304054.versatushpc" "59"
- ;;
- 5.9-0.5.6.0.127)
- # MLNX OFED 5.9-0.5.6.0.127 version info
- # https://content.mellanox.com/ofed/MLNX_OFED-5.9-0.5.6.0.127/MLNX_OFED_SRC-5.9-0.5.6.0.127.tgz
- RDMA_CORE_VERSION="59mlnx44"
- RDMA_CORE_MINOR_VERSION="1.59056.0127"
- RDMA_CORE_NEW_VERSION="59056.0128.versatushpc"
- PATCH_FAMILY="59"
- ;;
- 5.9-0.5.6.0.125)
- # MLNX OFED 5.9-0.5.6.0.125 version info
- # https://content.mellanox.com/ofed/MLNX_OFED-5.9-0.5.6.0.125/MLNX_OFED_SRC-5.9-0.5.6.0.125.tgz
- RDMA_CORE_VERSION="59mlnx44"
- RDMA_CORE_MINOR_VERSION="1.59056.0125"
- RDMA_CORE_NEW_VERSION="59056.0126.versatushpc"
- PATCH_FAMILY="59"
- ;;
- 5.9-0.5.6.0)
- # MLNX OFED 5.9-0.5.6.0 version info
- # https://content.mellanox.com/ofed/MLNX_OFED-5.9-0.5.6.0/MLNX_OFED_SRC-5.9-0.5.6.0.tgz
- RDMA_CORE_VERSION="59mlnx44"
- RDMA_CORE_MINOR_VERSION="1.59056"
- RDMA_CORE_NEW_VERSION="59057.versatushpc"
- PATCH_FAMILY="59"
- ;;
- 5.8-6.0.4.2)
- # MLNX OFED 5.8-6.0.4.2 version info
- # https://content.mellanox.com/ofed/MLNX_OFED-5.8-6.0.4.2/MLNX_OFED_SRC-5.8-6.0.4.2.tgz
- RDMA_CORE_VERSION="58mlnx43"
- RDMA_CORE_MINOR_VERSION="1.58604"
- RDMA_CORE_NEW_VERSION="58605.versatushpc"
- PATCH_FAMILY="56plus"
- ;;
- 5.8-7.0.6.1)
- # MLNX OFED 5.8-7.0.6.1 version info
- # https://content.mellanox.com/ofed/MLNX_OFED-5.8-7.0.6.1/MLNX_OFED_SRC-5.8-7.0.6.1.tgz
- RDMA_CORE_VERSION="58mlnx43"
- RDMA_CORE_MINOR_VERSION="1.58706"
- RDMA_CORE_NEW_VERSION="58707.versatushpc"
- PATCH_FAMILY="56plus"
- ;;
- 5.8-5.1.1.2)
- # MLNX OFED 5.8-5.1.1.2 version info
- # https://content.mellanox.com/ofed/MLNX_OFED-5.8-5.1.1.2/MLNX_OFED_SRC-5.8-5.1.1.2.tgz
- RDMA_CORE_VERSION="58mlnx43"
- RDMA_CORE_MINOR_VERSION="1.58511"
- RDMA_CORE_NEW_VERSION="58512.versatushpc"
- PATCH_FAMILY="56plus"
- ;;
- 5.8-4.1.5.0)
- # MLNX OFED 5.8-4.1.5.0 version info
- # https://content.mellanox.com/ofed/MLNX_OFED-5.8-4.1.5.0/MLNX_OFED_SRC-5.8-4.1.5.0.tgz
- RDMA_CORE_VERSION="58mlnx43"
- RDMA_CORE_MINOR_VERSION="1.58415"
- RDMA_CORE_NEW_VERSION="58416.versatushpc"
- PATCH_FAMILY="56plus"
- ;;
- 5.8-3.0.7.0.101)
- # MLNX OFED 5.8-3.0.7.0.101 version info
- # https://content.mellanox.com/ofed/MLNX_OFED-5.8-3.0.7.0.101/MLNX_OFED_SRC-5.8-3.0.7.0.101.tgz
- RDMA_CORE_VERSION="58mlnx43"
- RDMA_CORE_MINOR_VERSION="1.58307.0101"
- RDMA_CORE_NEW_VERSION="58307.0102.versatushpc"
- PATCH_FAMILY="56plus"
- ;;
- 5.8-3.0.7.0)
- # MLNX OFED 5.8-3.0.7.0 version info
- # https://content.mellanox.com/ofed/MLNX_OFED-5.8-3.0.7.0/MLNX_OFED_SRC-5.8-3.0.7.0.tgz
- RDMA_CORE_VERSION="58mlnx43"
- RDMA_CORE_MINOR_VERSION="1.58307"
- RDMA_CORE_NEW_VERSION="58308.versatushpc"
- PATCH_FAMILY="56plus"
- ;;
- 5.8-2.0.3.0)
- # MLNX OFED 5.8-2.0.3.0 version info
- # https://content.mellanox.com/ofed/MLNX_OFED-5.8-2.0.3.0/MLNX_OFED_SRC-5.8-2.0.3.0.tgz
- RDMA_CORE_VERSION="58mlnx43"
- RDMA_CORE_MINOR_VERSION="1.58203"
- RDMA_CORE_NEW_VERSION="58204.versatushpc"
- PATCH_FAMILY="56plus"
- ;;
- 5.8-1.1.2.1)
- # MLNX OFED 5.8-1.1.2.1 version info
- # https://content.mellanox.com/ofed/MLNX_OFED-5.8-1.1.2.1/MLNX_OFED_SRC-5.8-1.1.2.1.tgz
- RDMA_CORE_VERSION="58mlnx43"
- RDMA_CORE_MINOR_VERSION="1.58112"
- RDMA_CORE_NEW_VERSION="58113.versatushpc"
- PATCH_FAMILY="56plus"
- ;;
- 5.8-1.0.1.1)
- # MLNX OFED 5.8-1.0.1.1 version info
- # https://content.mellanox.com/ofed/MLNX_OFED-5.8-1.0.1.1/MLNX_OFED_SRC-5.8-1.0.1.1.tgz
- RDMA_CORE_VERSION="58mlnx43"
- RDMA_CORE_MINOR_VERSION="1.58101"
- RDMA_CORE_NEW_VERSION="58102.versatushpc"
- PATCH_FAMILY="56plus"
- ;;
- 5.7-1.0.2.0)
- # MLNX OFED 5.7-1.0.2.0 version info
- # https://content.mellanox.com/ofed/MLNX_OFED-5.7-1.0.2.0/MLNX_OFED_SRC-5.7-1.0.2.0.tgz
- RDMA_CORE_VERSION="56mlnx40"
- RDMA_CORE_MINOR_VERSION="1.57102"
- RDMA_CORE_NEW_VERSION="57103.versatushpc"
- PATCH_FAMILY="56plus"
- ;;
- 5.6-2.0.9.0)
- # MLNX OFED 5.6-2.0.9.0 version info
- # https://content.mellanox.com/ofed/MLNX_OFED-5.6-2.0.9.0/MLNX_OFED_SRC-5.6-2.0.9.0.tgz
- RDMA_CORE_VERSION="56mlnx40"
- RDMA_CORE_MINOR_VERSION="1.56209"
- RDMA_CORE_NEW_VERSION="56210.versatushpc"
- PATCH_FAMILY="56plus"
- ;;
- 5.6-1.0.3.3)
- # MLNX OFED 5.6-1.0.3.3 version info
- # https://content.mellanox.com/ofed/MLNX_OFED-5.6-1.0.3.3/MLNX_OFED_SRC-5.6-1.0.3.3.tgz
- RDMA_CORE_VERSION="56mlnx40"
- RDMA_CORE_MINOR_VERSION="1.56103"
- RDMA_CORE_NEW_VERSION="56104.versatushpc"
- PATCH_FAMILY="56plus"
- ;;
- 5.5-1.0.3.2)
- # MLNX OFED 5.5-1.0.3.2 version info
- # https://content.mellanox.com/ofed/MLNX_OFED-5.5-1.0.3.2/MLNX_OFED_SRC-5.5-1.0.3.2.tgz
- RDMA_CORE_VERSION="55mlnx37"
- RDMA_CORE_MINOR_VERSION="1.55103"
- RDMA_CORE_NEW_VERSION="55104.versatushpc"
- PATCH_FAMILY="55"
- ;;
- 5.4-3.7.5.0)
- # MLNX OFED 5.4-3.7.5.0 version info
- # https://content.mellanox.com/ofed/MLNX_OFED-5.4-3.7.5.0/MLNX_OFED_SRC-5.4-3.7.5.0.tgz
- RDMA_CORE_VERSION="54mlnx1"
- RDMA_CORE_MINOR_VERSION="1.54375"
- RDMA_CORE_NEW_VERSION="54376.versatushpc"
- PATCH_FAMILY="54"
- ;;
- 5.4-3.6.8.1)
- # MLNX OFED 5.4-3.6.8.1 version info
- # https://content.mellanox.com/ofed/MLNX_OFED-5.4-3.6.8.1/MLNX_OFED_SRC-5.4-3.6.8.1.tgz
- RDMA_CORE_VERSION="54mlnx1"
- RDMA_CORE_MINOR_VERSION="1.54368"
- RDMA_CORE_NEW_VERSION="54369.versatushpc"
- PATCH_FAMILY="54"
- ;;
- 5.4-3.5.8.0)
- # MLNX OFED 5.4-3.5.8.0 version info
- # https://content.mellanox.com/ofed/MLNX_OFED-5.4-3.5.8.0/MLNX_OFED_SRC-5.4-3.5.8.0.tgz
- RDMA_CORE_VERSION="54mlnx1"
- RDMA_CORE_MINOR_VERSION="1.54358"
- RDMA_CORE_NEW_VERSION="54359.versatushpc"
- PATCH_FAMILY="54"
- ;;
- 5.4-3.4.0.0)
- # MLNX OFED 5.4-3.4.0.0 version info
- # https://content.mellanox.com/ofed/MLNX_OFED-5.4-3.4.0.0/MLNX_OFED_SRC-5.4-3.4.0.0.tgz
- RDMA_CORE_VERSION="54mlnx1"
- RDMA_CORE_MINOR_VERSION="1.54340"
- RDMA_CORE_NEW_VERSION="54341.versatushpc"
- PATCH_FAMILY="54"
- ;;
- 5.4-3.2.7.2.3)
- # MLNX OFED 5.4-3.2.7.2.3 version info
- # https://content.mellanox.com/ofed/MLNX_OFED-5.4-3.2.7.2.3/MLNX_OFED_SRC-5.4-3.2.7.2.3.tgz
- RDMA_CORE_VERSION="54mlnx1"
- RDMA_CORE_MINOR_VERSION="1.54327.23"
- RDMA_CORE_NEW_VERSION="54327.24.versatushpc"
- PATCH_FAMILY="54"
- ;;
- 5.4-3.1.0.0)
- # MLNX OFED 5.4-3.1.0.0 version info
- # https://content.mellanox.com/ofed/MLNX_OFED-5.4-3.1.0.0/MLNX_OFED_SRC-5.4-3.1.0.0.tgz
- RDMA_CORE_VERSION="54mlnx1"
- RDMA_CORE_MINOR_VERSION="1.54310"
- RDMA_CORE_NEW_VERSION="54311.versatushpc"
- PATCH_FAMILY="54"
- ;;
- 5.4-3.0.3.0)
- # MLNX OFED 5.4-3.0.3.0 version info
- # https://content.mellanox.com/ofed/MLNX_OFED-5.4-3.0.3.0/MLNX_OFED_SRC-5.4-3.0.3.0.tgz
- RDMA_CORE_VERSION="54mlnx1"
- RDMA_CORE_MINOR_VERSION="1.54303"
- RDMA_CORE_NEW_VERSION="54304.versatushpc"
- PATCH_FAMILY="54"
- ;;
- 5.4-2.4.1.3)
- # MLNX OFED 5.4-2.4.1.3 version info
- # https://content.mellanox.com/ofed/MLNX_OFED-5.4-2.4.1.3/MLNX_OFED_SRC-5.4-2.4.1.3.tgz
- RDMA_CORE_VERSION="54mlnx1"
- RDMA_CORE_MINOR_VERSION="1.54241"
- RDMA_CORE_NEW_VERSION="54242.versatushpc"
- PATCH_FAMILY="54"
- ;;
- 5.4-1.0.3.0)
- # MLNX OFED 5.4-1.0.3.0 version info
- # https://content.mellanox.com/ofed/MLNX_OFED-5.4-1.0.3.0/MLNX_OFED_SRC-5.4-1.0.3.0.tgz
- RDMA_CORE_VERSION="54mlnx1"
- RDMA_CORE_MINOR_VERSION="1.54103"
- RDMA_CORE_NEW_VERSION="54104.versatushpc"
- PATCH_FAMILY="54"
- ;;
- 5.3-1.0.5.0)
- # MLNX OFED 5.3-1.0.5.0 version info
- # https://linux.mellanox.com/public/repo/mlnx_ofed/5.3-1.0.5.0/
- set_release_metadata "52mlnx1" "1.53105" "53106.versatushpc" "51to53"
- ;;
- 5.3-1.0.0.1)
- # MLNX OFED 5.3-1.0.0.1 version info
- # https://linux.mellanox.com/public/repo/mlnx_ofed/5.3-1.0.0.1/
- set_release_metadata "52mlnx1" "1.53100" "53101.versatushpc" "51to53"
- ;;
- 5.2-2.2.0.0)
- # MLNX OFED 5.2-2.2.0.0 version info
- # https://linux.mellanox.com/public/repo/mlnx_ofed/5.2-2.2.0.0/
- set_release_metadata "52mlnx1" "1.52220" "52221.versatushpc" "51to53"
- ;;
- 5.2-1.0.4.0)
- # MLNX OFED 5.2-1.0.4.0 version info
- # https://linux.mellanox.com/public/repo/mlnx_ofed/5.2-1.0.4.0/
- set_release_metadata "52mlnx1" "1.52104" "52105.versatushpc" "51to53"
- ;;
- 5.1-2.5.8.0)
- # MLNX OFED 5.1-2.5.8.0 version info
- # https://linux.mellanox.com/public/repo/mlnx_ofed/5.1-2.5.8.0/
- set_release_metadata "51mlnx1" "1.51258" "51259.versatushpc" "51to53"
- ;;
- 5.1-2.3.7.1)
- # MLNX OFED 5.1-2.3.7.1 version info
- # https://linux.mellanox.com/public/repo/mlnx_ofed/5.1-2.3.7.1/
- set_release_metadata "51mlnx1" "1.51237" "51238.versatushpc" "51to53"
- ;;
- 5.1-0.6.6.0)
- # MLNX OFED 5.1-0.6.6.0 version info
- # https://linux.mellanox.com/public/repo/mlnx_ofed/5.1-0.6.6.0/
- set_release_metadata "51mlnx1" "1.51066" "51067.versatushpc" "51to53"
- ;;
- 5.0-2.1.8.0)
- # MLNX OFED 5.0-2.1.8.0 version info
- # https://linux.mellanox.com/public/repo/mlnx_ofed/5.0-2.1.8.0/
- set_release_metadata "50mlnx1" "1.50218" "50219.versatushpc" "49"
- ;;
- 5.0-1.0.0.0)
- # MLNX OFED 5.0-1.0.0.0 version info
- # https://linux.mellanox.com/public/repo/mlnx_ofed/5.0-1.0.0.0/
- set_release_metadata "50mlnx1" "1.50100.0" "50100.1.versatushpc" "49"
- ;;
- 4.9-7.1.0.0)
- # MLNX OFED 4.9-7.1.0.0 version info
- # https://content.mellanox.com/ofed/MLNX_OFED-4.9-7.1.0.0/MLNX_OFED_SRC-4.9-7.1.0.0.tgz
- RDMA_CORE_VERSION="50mlnx1"
- RDMA_CORE_MINOR_VERSION="1.49710"
- RDMA_CORE_NEW_VERSION="49711.versatushpc"
- PATCH_FAMILY="49"
- ;;
- 4.9-6.0.6.0)
- # MLNX OFED 4.9-6.0.6.0 version info
- # https://content.mellanox.com/ofed/MLNX_OFED-4.9-6.0.6.0/MLNX_OFED_SRC-4.9-6.0.6.0.tgz
- RDMA_CORE_VERSION="50mlnx1"
- RDMA_CORE_MINOR_VERSION="1.49606"
- RDMA_CORE_NEW_VERSION="49607.versatushpc"
- PATCH_FAMILY="49"
- ;;
- 4.9-5.1.0.0)
- # MLNX OFED 4.9-5.1.0.0 version info
- # https://content.mellanox.com/ofed/MLNX_OFED-4.9-5.1.0.0/MLNX_OFED_SRC-4.9-5.1.0.0.tgz
- RDMA_CORE_VERSION="50mlnx1"
- RDMA_CORE_MINOR_VERSION="1.49510"
- RDMA_CORE_NEW_VERSION="49510.versatushpc"
- PATCH_FAMILY="49"
- ;;
- 4.9-4.1.7.0)
- # MLNX OFED 4.9-4.1.7.0 version info
- # https://content.mellanox.com/ofed/MLNX_OFED-4.9-4.1.7.0/MLNX_OFED_SRC-4.9-4.1.7.0.tgz
- RDMA_CORE_VERSION="50mlnx1"
- RDMA_CORE_MINOR_VERSION="1.49417"
- RDMA_CORE_NEW_VERSION="49418.versatushpc"
- PATCH_FAMILY="49"
- ;;
- 4.9-4.0.8.0)
- # MLNX OFED 4.9-4.0.8.0 version info
- # https://content.mellanox.com/ofed/MLNX_OFED-4.9-4.0.8.0/MLNX_OFED_SRC-4.9-4.0.8.0.tgz
- RDMA_CORE_VERSION="50mlnx1"
- RDMA_CORE_MINOR_VERSION="1.49408"
- RDMA_CORE_NEW_VERSION="49409.versatushpc"
- PATCH_FAMILY="49"
- ;;
- 4.9-3.1.5.0)
- # MLNX OFED 4.9-3.1.5.0 version info
- # https://content.mellanox.com/ofed/MLNX_OFED-4.9-3.1.5.0/MLNX_OFED_SRC-4.9-3.1.5.0.tgz
- RDMA_CORE_VERSION="50mlnx1"
- RDMA_CORE_MINOR_VERSION="1.49315"
- RDMA_CORE_NEW_VERSION="49316.versatushpc"
- PATCH_FAMILY="49"
- ;;
- 4.9-2.2.6.0)
- # MLNX OFED 4.9-2.2.6.0 version info
- # https://content.mellanox.com/ofed/MLNX_OFED-4.9-2.2.6.0/MLNX_OFED_SRC-4.9-2.2.6.0.tgz
- RDMA_CORE_VERSION="50mlnx1"
- RDMA_CORE_MINOR_VERSION="1.49226"
- RDMA_CORE_NEW_VERSION="49227.versatushpc"
- PATCH_FAMILY="49"
- ;;
- 4.9-2.2.4.0)
- # MLNX OFED 4.9-2.2.4.0 version info
- # https://content.mellanox.com/ofed/MLNX_OFED-4.9-2.2.4.0/MLNX_OFED_SRC-4.9-2.2.4.0.tgz
- RDMA_CORE_VERSION="50mlnx1"
- RDMA_CORE_MINOR_VERSION="1.49224"
- RDMA_CORE_NEW_VERSION="49225.versatushpc"
- PATCH_FAMILY="49"
- ;;
- 4.9-0.1.7.0)
- # MLNX OFED 4.9-0.1.7.0 version info
- # https://content.mellanox.com/ofed/MLNX_OFED-4.9-0.1.7.0/MLNX_OFED_SRC-4.9-0.1.7.0.tgz
- RDMA_CORE_VERSION="50mlnx1"
- RDMA_CORE_MINOR_VERSION="1.49017"
- RDMA_CORE_NEW_VERSION="49018.versatushpc"
- PATCH_FAMILY="49"
- ;;
- 4.7-3.2.9.0)
- # MLNX OFED 4.7-3.2.9.0 version info
- # https://linux.mellanox.com/public/repo/mlnx_ofed/4.7-3.2.9.0/
- set_release_metadata "47mlnx1" "1.47329" "47330.versatushpc" "49"
- ;;
- 4.7-1.0.0.1)
- # MLNX OFED 4.7-1.0.0.1 version info
- # https://linux.mellanox.com/public/repo/mlnx_ofed/4.7-1.0.0.1/
- set_release_metadata "47mlnx1" "1.47100" "47101.versatushpc" "49"
- ;;
- *)
- return 1
- ;;
- esac
- return 0
-}
-
-apply_release_patch() {
- case $PATCH_FAMILY in
- 59)
- patch_mlnx_ofed59
- ;;
- 2404plus)
- patch_mlnx_ofed2404plus
- ;;
- 56plus)
- patch_mlnx_ofed56plus
- ;;
- 55)
- patch_mlnx_ofed55
- ;;
- 54)
- patch_mlnx_ofed54
- ;;
- 51to53)
- patch_mlnx_ofed51to53
- ;;
- 49)
- patch_mlnx_ofed49
- ;;
- *)
- echo "Unsupported MLNX OFED release: $MLNX_OFED_VERSION"
- return 1
- ;;
- esac
-}
-
-main() {
- detect_mlnx_ofed_version
-
- if [ -z "$MLNX_OFED_VERSION" ]; then
- echo Cannot detect MLNX OFED, is it installed?
- exit 1
- else
- echo Detected MLNX OFED release: $MLNX_OFED_VERSION
- fi
-
- if ! load_release_metadata; then
- echo "Unsupported MLNX OFED release: $MLNX_OFED_VERSION"
- exit 1
- fi
-
- mkdir -p $RPM_BUILD_ROOT/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
- mkdir -p $WORK_DIR
- cd $WORK_DIR
-
- echo Installing required dependencies...
- if rpm -q --quiet python3-Cython-ohpc ; then
- dnf remove -y python3-Cython-ohpc
- fi
- install_required_dependencies
- echo
-
- if [ ! -f MLNX_OFED_SRC-$MLNX_OFED_VERSION.tgz ] ; then
- echo Downloading MLNX OFED $MLNX_OFED_VERSION sources...
- download_source_bundle "$MLNX_OFED_VERSION"
- fi
- echo
-
- tar zxf MLNX_OFED_SRC-$MLNX_OFED_VERSION.tgz
- echo Extracting files from SRPMS...
- rpm2cpio MLNX_OFED_SRC-$MLNX_OFED_VERSION/SRPMS/rdma-core-$RDMA_CORE_VERSION-$RDMA_CORE_MINOR_VERSION.src.rpm | cpio -i
- echo
-
- rdma_core_archive=$(find_rdma_core_archive)
- if [ -z "$rdma_core_archive" ]; then
- echo "Cannot find rdma-core-$RDMA_CORE_VERSION source archive" >&2
- exit 1
- fi
- tar zxf "$rdma_core_archive"
- cd rdma-core-$RDMA_CORE_VERSION
-
- echo Patching MLNX OFED to add back support for MLX4 and EFA...
- echo
- sleep 1
-
- apply_release_patch
-
- cp -f rdma-core.spec ..
- cd ..
-
- sed -i s/Release:.*/Release:\ $RDMA_CORE_NEW_VERSION/g rdma-core.spec
- sed -i s/Source:.*/Source:\ rdma-core-%{version}-%{release}.tgz/g rdma-core.spec
-
- dnf_args=$(dnf_install_args)
- if ! rpm -q --quiet 'dnf-command(builddep)' && ! rpm -q --quiet dnf-plugins-core; then
- dnf install $dnf_args dnf-plugins-core
- fi
- dnf builddep $dnf_args rdma-core.spec
-
- tar czf rdma-core-$RDMA_CORE_VERSION-$RDMA_CORE_NEW_VERSION.tgz rdma-core-$RDMA_CORE_VERSION
- cp rdma-core-$RDMA_CORE_VERSION-$RDMA_CORE_NEW_VERSION.tgz $RPM_BUILD_ROOT/SOURCES
-
- echo Building RPMS... it may take a while
- rpmbuild --nodebuginfo --define "_topdir $RPM_BUILD_ROOT" -ba rdma-core.spec 2>/dev/null >/dev/null
-
- mkdir -p $RPMS_OUTPUT_DIR
- mv $RPM_BUILD_ROOT/RPMS/x86_64/* $RPMS_OUTPUT_DIR
-
- cd $RPMS_OUTPUT_DIR
- dnf install -y *
-
- rm -rf $WORK_DIR
- rm -rf $RPM_BUILD_ROOT
-
- echo
- echo Mellanox OFED installation has been patched for EFA \(libefa.so\) and MLX4 \(libmlx4.so\) support
- echo RPM packages are available at $RPMS_OUTPUT_DIR
- echo
- echo Done
-}
-
-if [ "${PATCH_MLNXOFED_LIBRARY_MODE:-0}" != "1" ]; then
- main "$@"
-fi
diff --git a/testing/libvirt/remote-doca-vm-test.sh b/testing/libvirt/remote-doca-vm-test.sh
new file mode 100755
index 0000000..c843458
--- /dev/null
+++ b/testing/libvirt/remote-doca-vm-test.sh
@@ -0,0 +1,122 @@
+#!/bin/sh
+
+set -eu
+
+if [ "$#" -ne 4 ]; then
+ echo "Usage: $0 " >&2
+ exit 1
+fi
+
+work_dir=$1
+vm_name=$2
+el_major=$3
+base_image=$4
+builder_script=$work_dir/build-docaofed-provider-compat.sh
+
+case "$el_major" in
+9)
+ osinfo=rocky9
+ ;;
+10)
+ osinfo=generic
+ ;;
+*)
+ echo "Only EL9 and EL10 are supported" >&2
+ exit 1
+ ;;
+esac
+
+if [ ! -f "$builder_script" ]; then
+ echo "Missing builder script: $builder_script" >&2
+ exit 1
+fi
+
+mkdir -p "$work_dir"
+
+cat > "$work_dir/user-data.yaml" < /etc/yum.repos.d/doca.repo <&1 | tee -a /var/log/doca-compat-test.log /dev/ttyS0' ]
+final_message: "DOCA compatibility test finished"
+EOF_YAML
+
+qemu-img create -f qcow2 -F qcow2 -b "$base_image" "$work_dir/disk.qcow2" 30G >/dev/null
+rm -f "$work_dir/serial.log"
+
+virt-install \
+ --connect qemu:///session \
+ --name "$vm_name" \
+ --memory 4096 \
+ --vcpus 4 \
+ --cpu host-passthrough \
+ --import \
+ --boot uefi \
+ --disk "$work_dir/disk.qcow2" \
+ --osinfo detect=on,name="$osinfo" \
+ --graphics none \
+ --console pty,target_type=serial \
+ --serial file,path="$work_dir/serial.log" \
+ --network user,model=virtio \
+ --cloud-init user-data="$work_dir/user-data.yaml",disable=on \
+ --noautoconsole >/dev/null
+
+printf 'VM_NAME=%s\nWORK_DIR=%s\nSERIAL_LOG=%s\n' "$vm_name" "$work_dir" "$work_dir/serial.log"
diff --git a/tests/check-upstream-releases.sh b/tests/check-upstream-releases.sh
deleted file mode 100755
index 32f8859..0000000
--- a/tests/check-upstream-releases.sh
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/bin/sh
-
-set -eu
-
-case $0 in
- */*)
- self_path=$0
- ;;
- *)
- self_path=$(command -v "$0" 2>/dev/null || printf '%s\n' "$0")
- ;;
-esac
-
-script_dir=$(CDPATH= cd "$(dirname "$self_path")" && pwd)
-repo_root=$(CDPATH= cd "$script_dir/.." && pwd)
-upstream_url=${MLNX_OFED_UPSTREAM_URL:-https://linux.mellanox.com/public/repo/mlnx_ofed}
-upstream_url=${upstream_url%/}
-
-for tool in curl comm grep sed sort tr; do
- if ! command -v "$tool" >/dev/null 2>&1; then
- echo "Missing required tool: $tool" >&2
- exit 2
- fi
-done
-
-work_root=$(mktemp -d)
-trap 'rm -rf "$work_root"' 0
-
-upstream_versions=$work_root/upstream
-known_versions=$work_root/known
-ignored_versions=$work_root/ignored
-candidate_versions=$work_root/candidates
-missing_versions=$work_root/missing
-skipped_versions=$work_root/skipped
-
-curl -fsSL "$upstream_url/" |
- sed -n 's/.*href="\([0-9][^"/]*\)\/".*/\1/p' |
- LC_ALL=C sort -u > "$upstream_versions"
-
-tr '`' '\n' < "$repo_root/README.md" |
- sed -n '/^[0-9][0-9.]*-[0-9A-Za-z.-][0-9A-Za-z.-]*$/p' |
- LC_ALL=C sort -u > "$known_versions"
-
-if [ -f "$repo_root/tests/upstream-release-ignore.txt" ]; then
- sed 's/#.*//; s/^[ ]*//; s/[ ]*$//; /^[ ]*$/d' "$repo_root/tests/upstream-release-ignore.txt" |
- LC_ALL=C sort -u > "$ignored_versions"
-else
- : > "$ignored_versions"
-fi
-
-comm -23 "$upstream_versions" "$known_versions" |
- comm -23 - "$ignored_versions" > "$candidate_versions"
-: > "$missing_versions"
-: > "$skipped_versions"
-
-has_enterprise_linux_payload() {
- release_index=$1
-
- sed -n 's/.*href="\([^"]*\)".*/\1/p' "$release_index" |
- grep -E '^(rhel|rocky|almalinux|ol|centos)(8|9|10)([./-]|/|$)' >/dev/null
-}
-
-has_source_rpm_payload() {
- version=$1
- release_index=$2
-
- if curl -fsSL "$upstream_url/$version/SRPMS/" >/dev/null 2>&1; then
- return 0
- fi
-
- grep -F "MLNX_OFED_SRC-$version.tgz" "$release_index" >/dev/null
-}
-
-while IFS= read -r version; do
- [ -n "$version" ] || continue
-
- release_index=$work_root/$version.index
- if ! curl -fsSL "$upstream_url/$version/" -o "$release_index"; then
- echo "$version: unable to read release index" >> "$skipped_versions"
- continue
- fi
-
- if ! has_enterprise_linux_payload "$release_index"; then
- echo "$version: no Enterprise Linux 8/9/10 payload" >> "$skipped_versions"
- continue
- fi
-
- if ! has_source_rpm_payload "$version" "$release_index"; then
- echo "$version: no SRPMS or standard source bundle" >> "$skipped_versions"
- continue
- fi
-
- echo "$version" >> "$missing_versions"
-done < "$candidate_versions"
-
-if [ -s "$missing_versions" ]; then
- cat "$missing_versions"
- exit 1
-fi
-
-if [ "${CHECK_UPSTREAM_VERBOSE:-0}" = 1 ] && [ -s "$skipped_versions" ]; then
- echo "Ignored upstream release directories:" >&2
- cat "$skipped_versions" >&2
-fi
-
-echo "No unsupported Enterprise Linux MLNX_OFED releases detected."
diff --git a/tests/upstream-release-ignore.txt b/tests/upstream-release-ignore.txt
deleted file mode 100644
index 09dafec..0000000
--- a/tests/upstream-release-ignore.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-# Public upstream directories that are intentionally outside this patcher's scope.
-#
-# MLNX_OFED 4.6 has an Enterprise Linux 8 payload, but its rdma-core tree does
-# not include the EFA provider this script re-enables in later releases.
-4.6-1.0.1.1
diff --git a/tests/verify-doca-rpm-layout.sh b/tests/verify-doca-rpm-layout.sh
new file mode 100755
index 0000000..ab0277a
--- /dev/null
+++ b/tests/verify-doca-rpm-layout.sh
@@ -0,0 +1,88 @@
+#!/bin/sh
+
+set -eu
+
+DOCA_REPO_ROOT=${DOCA_REPO_ROOT:-https://linux.mellanox.com/public/repo/doca/latest}
+CACHE_DIR=${CACHE_DIR:-"${XDG_CACHE_HOME:-$HOME/.cache}/docaofed-patch/verify"}
+
+die() {
+ echo "$*" >&2
+ exit 1
+}
+
+need_cmd() {
+ if ! command -v "$1" >/dev/null 2>&1; then
+ die "Missing required tool: $1"
+ fi
+}
+
+for tool in curl rpm2cpio cpio find grep sed sort basename; do
+ need_cmd "$tool"
+done
+
+find_libibverbs_rpm() {
+ el=$1
+ curl -fsSL "$DOCA_REPO_ROOT/rhel$el/x86_64/" |
+ sed -n 's/.*href="\([^"]*libibverbs-[^"]*\.rpm\)".*/\1/p' |
+ sed -n '1p'
+}
+
+extract_abi() {
+ file=$1
+ basename "$file" | sed -n 's/^libmlx5-\(rdmav[0-9][0-9]*\)\.so$/\1/p'
+}
+
+verify_el() {
+ el=$1
+ rpm_name=$(find_libibverbs_rpm "$el")
+ if [ -z "$rpm_name" ]; then
+ die "Unable to find libibverbs RPM for rhel$el under $DOCA_REPO_ROOT"
+ fi
+
+ mkdir -p "$CACHE_DIR"
+ rpm_path=$CACHE_DIR/$rpm_name
+ if [ ! -f "$rpm_path" ]; then
+ curl -fsSL "$DOCA_REPO_ROOT/rhel$el/x86_64/$rpm_name" -o "$rpm_path"
+ fi
+
+ work_dir=$(mktemp -d)
+ trap 'rm -rf "$work_dir"' EXIT HUP INT TERM
+
+ (
+ cd "$work_dir"
+ rpm2cpio "$rpm_path" | cpio -idm --quiet
+ )
+
+ [ -e "$work_dir/usr/lib64/libefa.so.1" ] || die "rhel$el: missing libefa.so.1"
+ [ -e "$work_dir/usr/lib64/libmlx4.so.1" ] || die "rhel$el: missing libmlx4.so.1"
+ [ -f "$work_dir/etc/libibverbs.d/mlx5.driver" ] || die "rhel$el: missing mlx5.driver"
+ if [ "$(sed -n '1p' "$work_dir/etc/libibverbs.d/mlx5.driver")" != "driver mlx5" ]; then
+ die "rhel$el: unexpected mlx5.driver contents"
+ fi
+
+ mlx5_provider=$(find "$work_dir/usr/lib64/libibverbs" -maxdepth 1 -name 'libmlx5-rdmav*.so' | sort | sed -n '1p')
+ if [ -z "$mlx5_provider" ]; then
+ die "rhel$el: missing mlx5 provider ABI symlink"
+ fi
+
+ abi=$(extract_abi "$mlx5_provider")
+ if [ -z "$abi" ]; then
+ die "rhel$el: unable to parse provider ABI from $mlx5_provider"
+ fi
+
+ if find "$work_dir/usr/lib64/libibverbs" -maxdepth 1 -name 'libefa-rdmav*.so' | sed -n '1p' | grep . >/dev/null 2>&1; then
+ die "rhel$el: libefa provider symlink is already present"
+ fi
+ if find "$work_dir/usr/lib64/libibverbs" -maxdepth 1 -name 'libmlx4-rdmav*.so' | sed -n '1p' | grep . >/dev/null 2>&1; then
+ die "rhel$el: libmlx4 provider symlink is already present"
+ fi
+ [ ! -e "$work_dir/etc/libibverbs.d/efa.driver" ] || die "rhel$el: efa.driver is already present"
+ [ ! -e "$work_dir/etc/libibverbs.d/mlx4.driver" ] || die "rhel$el: mlx4.driver is already present"
+
+ rm -rf "$work_dir"
+ trap - EXIT HUP INT TERM
+ echo "PASS rhel$el $rpm_name $abi"
+}
+
+verify_el 9
+verify_el 10
diff --git a/tests/verify-releases.sh b/tests/verify-releases.sh
deleted file mode 100755
index 04a586e..0000000
--- a/tests/verify-releases.sh
+++ /dev/null
@@ -1,434 +0,0 @@
-#!/bin/sh
-
-set -eu
-
-case $0 in
- */*)
- self_path=$0
- ;;
- *)
- self_path=$(command -v "$0" 2>/dev/null || printf '%s\n' "$0")
- ;;
-esac
-
-script_dir=$(CDPATH= cd "$(dirname "$self_path")" && pwd)
-repo_root=$(CDPATH= cd "$script_dir/.." && pwd)
-cache_dir=${VERIFY_RELEASES_CACHE_DIR:-"${XDG_CACHE_HOME:-$HOME/.cache}/mlnxofed-patch/verify-releases"}
-
-if [ "$#" -eq 0 ]; then
- echo "Usage: $0 [ ...]" >&2
- exit 1
-fi
-
-for tool in curl rpm2cpio cpio tar patch rg; do
- if ! command -v "$tool" >/dev/null 2>&1; then
- echo "Missing required tool: $tool" >&2
- exit 1
- fi
-done
-
-mkdir -p "$cache_dir"
-work_root=$(mktemp -d)
-trap 'rm -rf "$work_root"' 0
-
-PATCH_MLNXOFED_LIBRARY_MODE=1 . "$repo_root/patch-mlnxofed.sh"
-
-download_source_rpm() {
- version=$1
- rpm_name=$2
- release_root=$3
- rpm_path=$4
- source_bundle_name="MLNX_OFED_SRC-$version.tgz"
- source_bundle_cache_path="$cache_dir/$source_bundle_name"
-
- if curl -fsSL "https://linux.mellanox.com/public/repo/mlnx_ofed/$version/SRPMS/$rpm_name" -o "$rpm_path" 2>/dev/null; then
- return 0
- fi
-
- if [ ! -f "$source_bundle_cache_path" ]; then
- if ! curl -fsSL "https://linux.mellanox.com/public/repo/mlnx_ofed/$version/$source_bundle_name" -o "$source_bundle_cache_path" 2>/dev/null; then
- curl -fsSL "https://content.mellanox.com/ofed/MLNX_OFED-$version/$source_bundle_name" -o "$source_bundle_cache_path"
- fi
- fi
-
- tar zxf "$source_bundle_cache_path" -C "$release_root"
- cp "$release_root/MLNX_OFED_SRC-$version/SRPMS/$rpm_name" "$rpm_path"
-}
-
-assert_contains() {
- file=$1
- text=$2
-
- if ! rg -F -- "$text" "$file" >/dev/null; then
- echo "Missing expected line in $file: $text" >&2
- return 1
- fi
-}
-
-assert_not_contains() {
- file=$1
- text=$2
-
- if rg -F -- "$text" "$file" >/dev/null; then
- echo "Unexpected line in $file: $text" >&2
- return 1
- fi
-}
-
-assert_multiline_contains() {
- file=$1
- text=$2
-
- if ! perl -e 'my ($pattern, $file) = @ARGV; local $/; open my $fh, "<", $file or die $!; my $content = <$fh>; exit(index($content, $pattern) >= 0 ? 0 : 1);' -- "$text" "$file"; then
- echo "Missing expected block in $file" >&2
- return 1
- fi
-}
-
-find_rdma_core_archive() {
- find . -maxdepth 1 \( -name "rdma-core-$RDMA_CORE_VERSION.tgz" -o -name "rdma-core-$RDMA_CORE_VERSION.tar.gz" \) | sed -n '1p'
-}
-
-verify_modern_source_markers() {
- install_dest=$1
-
- assert_contains CMakeLists.txt 'add_subdirectory(providers/efa)'
- assert_contains CMakeLists.txt 'add_subdirectory(providers/efa/man)'
- assert_contains CMakeLists.txt 'add_subdirectory(providers/mlx4)'
- assert_contains CMakeLists.txt 'add_subdirectory(providers/mlx4/man)'
- assert_contains providers/mlx4/CMakeLists.txt 'if (0)'
- assert_contains providers/mlx4/CMakeLists.txt "install(FILES \"mlx4.conf\" DESTINATION \"$install_dest\")"
- assert_contains pyverbs/CMakeLists.txt 'if (0)'
- assert_contains pyverbs/CMakeLists.txt 'add_subdirectory(providers/efa)'
- assert_multiline_contains rdma-core.spec '%config(noreplace) %{_sysconfdir}/rdma/mlx4.conf
-%config(noreplace) %{_sysconfdir}/rdma/modules/rdma.conf
-%if 0
-%dir %{_sysconfdir}/modprobe.d
-%config(noreplace) %{_sysconfdir}/modprobe.d/mlx4.conf
-%config(noreplace) %{_sysconfdir}/modprobe.d/truescale.conf
-%endif'
- assert_not_contains rdma-core.spec '%{_libdir}/libefa.so.*'
-}
-
-verify_modern_patched_tree() {
- install_dest=$1
-
- assert_contains CMakeLists.txt 'add_subdirectory(providers/efa)'
- assert_contains CMakeLists.txt 'add_subdirectory(providers/efa/man)'
- assert_contains CMakeLists.txt 'add_subdirectory(providers/mlx4)'
- assert_contains CMakeLists.txt 'add_subdirectory(providers/mlx4/man)'
- assert_contains providers/mlx4/CMakeLists.txt "install(FILES \"mlx4.conf\" DESTINATION \"$install_dest\")"
- assert_not_contains providers/mlx4/CMakeLists.txt 'if (0)'
- assert_contains pyverbs/CMakeLists.txt 'add_subdirectory(providers/efa)'
- assert_not_contains pyverbs/CMakeLists.txt 'if (0)'
- assert_contains rdma-core.spec '- libefa: Amazon Elastic Fabric Adapter'
- assert_contains rdma-core.spec '- libmlx4: Mellanox ConnectX-3 InfiniBand HCA'
- assert_multiline_contains rdma-core.spec '%config(noreplace) %{_sysconfdir}/rdma/mlx4.conf
-%config(noreplace) %{_sysconfdir}/rdma/modules/rdma.conf
-%dir %{_sysconfdir}/modprobe.d
-%config(noreplace) %{_sysconfdir}/modprobe.d/mlx4.conf
-%if 0
-%config(noreplace) %{_sysconfdir}/modprobe.d/truescale.conf
-%endif'
- assert_contains rdma-core.spec '%config(noreplace) %{_sysconfdir}/modprobe.d/mlx4.conf'
- assert_contains rdma-core.spec '%{_mandir}/man3/efadv*'
- assert_contains rdma-core.spec '%{_mandir}/man7/efadv*'
- assert_contains rdma-core.spec '%{_mandir}/man3/mlx4dv*'
- assert_contains rdma-core.spec '%{_mandir}/man7/mlx4dv*'
- assert_contains rdma-core.spec '%{_libdir}/libefa.so.*'
- assert_contains rdma-core.spec '%{_libdir}/libmlx4.so.*'
-}
-
-verify_2404plus_source_markers() {
- assert_contains CMakeLists.txt 'add_subdirectory(providers/efa)'
- assert_contains CMakeLists.txt 'add_subdirectory(providers/mlx4)'
- assert_contains providers/mlx4/CMakeLists.txt 'if (0)'
- assert_contains providers/mlx4/CMakeLists.txt 'install(FILES "mlx4.conf" DESTINATION "${CMAKE_INSTALL_MODPROBEDIR}/")'
- assert_contains rdma-core.spec 'rm -f %{buildroot}%{_sysconfdir}/libibverbs.d/efa.driver'
- assert_contains rdma-core.spec 'rm -f %{buildroot}%{_sysconfdir}/libibverbs.d/mlx4.driver'
- assert_contains rdma-core.spec 'rm -f %{buildroot}%{_libdir}/libibverbs/libefa-rdmav*.so'
- assert_contains rdma-core.spec 'rm -f %{buildroot}%{_libdir}/libibverbs/libmlx4-rdmav*.so'
- assert_multiline_contains rdma-core.spec '%config(noreplace) %{_sysconfdir}/rdma/mlx4.conf
-%config(noreplace) %{_sysconfdir}/rdma/modules/rdma.conf
-%if 0
-%dir %{_sysconfdir}/modprobe.d
-%config(noreplace) %{_sysconfdir}/modprobe.d/mlx4.conf
-%config(noreplace) %{_sysconfdir}/modprobe.d/truescale.conf
-%endif'
- assert_contains rdma-core.spec '%{_libdir}/libefa.so.*'
- assert_contains rdma-core.spec '%{_libdir}/libmlx4.so.*'
- assert_not_contains rdma-core.spec '%config(noreplace) %{_sysconfdir}/libibverbs.d/efa.driver'
- assert_not_contains rdma-core.spec '%config(noreplace) %{_sysconfdir}/libibverbs.d/mlx4.driver'
-}
-
-verify_2404plus_patched_tree() {
- assert_contains CMakeLists.txt 'add_subdirectory(providers/efa)'
- assert_contains CMakeLists.txt 'add_subdirectory(providers/mlx4)'
- assert_contains providers/mlx4/CMakeLists.txt 'install(FILES "mlx4.conf" DESTINATION "${CMAKE_INSTALL_MODPROBEDIR}/")'
- assert_not_contains providers/mlx4/CMakeLists.txt 'if (0)'
- assert_not_contains rdma-core.spec 'rm -f %{buildroot}%{_sysconfdir}/libibverbs.d/efa.driver'
- assert_not_contains rdma-core.spec 'rm -f %{buildroot}%{_sysconfdir}/libibverbs.d/mlx4.driver'
- assert_not_contains rdma-core.spec 'rm -f %{buildroot}%{_libdir}/libibverbs/libefa-rdmav*.so'
- assert_not_contains rdma-core.spec 'rm -f %{buildroot}%{_libdir}/libibverbs/libmlx4-rdmav*.so'
- assert_multiline_contains rdma-core.spec '%config(noreplace) %{_sysconfdir}/rdma/mlx4.conf
-%config(noreplace) %{_sysconfdir}/rdma/modules/rdma.conf
-%dir %{_sysconfdir}/modprobe.d
-%config(noreplace) %{_sysconfdir}/modprobe.d/mlx4.conf
-%if 0
-%config(noreplace) %{_sysconfdir}/modprobe.d/truescale.conf
-%endif'
- assert_contains rdma-core.spec '%{_libdir}/libefa.so.*'
- assert_contains rdma-core.spec '%{_libdir}/libmlx4.so.*'
- assert_contains rdma-core.spec '%config(noreplace) %{_sysconfdir}/libibverbs.d/efa.driver'
- assert_contains rdma-core.spec '%config(noreplace) %{_sysconfdir}/libibverbs.d/mlx4.driver'
- assert_contains rdma-core.spec '%config(noreplace) %{_sysconfdir}/libibverbs.d/mlx5.driver'
-}
-
-verify_56plus_source_markers() {
- install_dest=$1
-
- assert_multiline_contains CMakeLists.txt 'if (HAVE_COHERENT_DMA)
-if (0)
-add_subdirectory(providers/bnxt_re)
-add_subdirectory(providers/cxgb4) # NO SPARSE
-add_subdirectory(providers/efa)
-add_subdirectory(providers/efa/man)
-add_subdirectory(providers/hns)
-add_subdirectory(providers/irdma)
-add_subdirectory(providers/mlx4)
-add_subdirectory(providers/mlx4/man)
-endif()
-add_subdirectory(providers/mlx5)
-add_subdirectory(providers/mlx5/man)'
- assert_contains providers/mlx4/CMakeLists.txt 'if (0)'
- assert_contains providers/mlx4/CMakeLists.txt "install(FILES \"mlx4.conf\" DESTINATION \"$install_dest\")"
- assert_contains pyverbs/CMakeLists.txt 'if (0)'
- assert_contains pyverbs/CMakeLists.txt 'add_subdirectory(providers/efa)'
- assert_multiline_contains rdma-core.spec '%config(noreplace) %{_sysconfdir}/rdma/mlx4.conf
-%config(noreplace) %{_sysconfdir}/rdma/modules/rdma.conf
-%if 0
-%dir %{_sysconfdir}/modprobe.d
-%config(noreplace) %{_sysconfdir}/modprobe.d/mlx4.conf
-%config(noreplace) %{_sysconfdir}/modprobe.d/truescale.conf
-%endif'
- assert_contains rdma-core.spec '%{sysmodprobedir}/libmlx4.conf'
- assert_not_contains rdma-core.spec '%{_libdir}/libefa.so.*'
-}
-
-verify_56plus_patched_tree() {
- install_dest=$1
-
-assert_multiline_contains CMakeLists.txt 'if (HAVE_COHERENT_DMA)
-if (0)
-add_subdirectory(providers/bnxt_re)
-add_subdirectory(providers/cxgb4) # NO SPARSE
-endif()
-add_subdirectory(providers/efa)
-add_subdirectory(providers/efa/man)
-if (0)
-add_subdirectory(providers/hns)
-add_subdirectory(providers/irdma)
-endif()
-add_subdirectory(providers/mlx4)
-add_subdirectory(providers/mlx4/man)
-add_subdirectory(providers/mlx5)
-add_subdirectory(providers/mlx5/man)'
- assert_contains providers/mlx4/CMakeLists.txt "install(FILES \"mlx4.conf\" DESTINATION \"$install_dest\")"
- assert_not_contains providers/mlx4/CMakeLists.txt 'if (0)'
- assert_contains pyverbs/CMakeLists.txt 'add_subdirectory(providers/efa)'
- assert_not_contains pyverbs/CMakeLists.txt 'if (0)'
- assert_contains rdma-core.spec '- libefa: Amazon Elastic Fabric Adapter'
- assert_contains rdma-core.spec '- libmlx4: Mellanox ConnectX-3 InfiniBand HCA'
- assert_multiline_contains rdma-core.spec '%config(noreplace) %{_sysconfdir}/rdma/mlx4.conf
-%config(noreplace) %{_sysconfdir}/rdma/modules/rdma.conf
-%dir %{_sysconfdir}/modprobe.d
-%config(noreplace) %{_sysconfdir}/modprobe.d/mlx4.conf
-%if 0
-%config(noreplace) %{_sysconfdir}/modprobe.d/truescale.conf
-%endif'
- assert_contains rdma-core.spec '%{sysmodprobedir}/libmlx4.conf'
- assert_contains rdma-core.spec '%{_mandir}/man3/efadv*'
- assert_contains rdma-core.spec '%{_mandir}/man7/efadv*'
- assert_contains rdma-core.spec '%{_mandir}/man3/mlx4dv*'
- assert_contains rdma-core.spec '%{_mandir}/man7/mlx4dv*'
- assert_contains rdma-core.spec '%{_libdir}/libefa.so.*'
- assert_contains rdma-core.spec '%{_libdir}/libmlx4.so.*'
-}
-
-verify_49_source_markers() {
- assert_contains CMakeLists.txt 'add_subdirectory(providers/efa)'
- assert_contains CMakeLists.txt 'add_subdirectory(providers/efa/man)'
- assert_not_contains rdma-core.spec '%{_libdir}/libefa.so.*'
-}
-
-verify_49_patched_tree() {
- assert_contains CMakeLists.txt 'add_subdirectory(providers/efa)'
- assert_contains CMakeLists.txt 'add_subdirectory(providers/efa/man)'
- assert_contains rdma-core.spec '- libefa: Amazon Elastic Fabric Adapter'
- assert_contains rdma-core.spec '%{_mandir}/man3/efadv*'
- assert_contains rdma-core.spec '%{_mandir}/man7/efadv*'
- assert_contains rdma-core.spec '%{_libdir}/libefa.so.*'
-}
-
-verify_51to53_source_markers() {
- assert_multiline_contains CMakeLists.txt 'if (0)
-add_subdirectory(providers/bnxt_re)
-add_subdirectory(providers/cxgb4) # NO SPARSE
-add_subdirectory(providers/efa)
-add_subdirectory(providers/efa/man)
-add_subdirectory(providers/hns)
-add_subdirectory(providers/i40iw) # NO SPARSE
-add_subdirectory(providers/mlx4)
-add_subdirectory(providers/mlx4/man)
-endif()
-add_subdirectory(providers/mlx5)
-add_subdirectory(providers/mlx5/man)'
- assert_contains providers/mlx4/CMakeLists.txt 'if (0)'
- assert_contains providers/mlx4/CMakeLists.txt 'install(FILES "mlx4.conf" DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/modprobe.d/")'
- assert_contains pyverbs/CMakeLists.txt 'if (0)'
- assert_contains pyverbs/CMakeLists.txt 'add_subdirectory(providers/efa)'
- assert_multiline_contains rdma-core.spec '%config(noreplace) %{_sysconfdir}/rdma/mlx4.conf
-%config(noreplace) %{_sysconfdir}/rdma/rdma.conf
-%config(noreplace) %{_sysconfdir}/rdma/sriov-vfs
-%if 0
-%config(noreplace) %{_sysconfdir}/modprobe.d/mlx4.conf
-%config(noreplace) %{_sysconfdir}/modprobe.d/truescale.conf
-%endif'
- assert_not_contains rdma-core.spec '- libefa: Amazon Elastic Fabric Adapter'
- assert_not_contains rdma-core.spec '%{_libdir}/libefa.so.*'
-}
-
-verify_51to53_patched_tree() {
- assert_multiline_contains CMakeLists.txt 'if (0)
-add_subdirectory(providers/bnxt_re)
-add_subdirectory(providers/cxgb4) # NO SPARSE
-endif()
-add_subdirectory(providers/efa)
-add_subdirectory(providers/efa/man)
-if (0)
-add_subdirectory(providers/hns)
-add_subdirectory(providers/i40iw) # NO SPARSE
-endif()
-add_subdirectory(providers/mlx4)
-add_subdirectory(providers/mlx4/man)
-add_subdirectory(providers/mlx5)
-add_subdirectory(providers/mlx5/man)'
- assert_contains providers/mlx4/CMakeLists.txt 'install(FILES "mlx4.conf" DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/modprobe.d/")'
- assert_not_contains providers/mlx4/CMakeLists.txt 'if (0)'
- assert_contains pyverbs/CMakeLists.txt 'add_subdirectory(providers/efa)'
- assert_not_contains pyverbs/CMakeLists.txt 'if (0)'
- assert_contains rdma-core.spec '- libefa: Amazon Elastic Fabric Adapter'
- assert_contains rdma-core.spec '- libmlx4: Mellanox ConnectX-3 InfiniBand HCA'
- assert_multiline_contains rdma-core.spec '%config(noreplace) %{_sysconfdir}/rdma/mlx4.conf
-%config(noreplace) %{_sysconfdir}/rdma/rdma.conf
-%config(noreplace) %{_sysconfdir}/rdma/sriov-vfs
-%dir %{_sysconfdir}/modprobe.d
-%config(noreplace) %{_sysconfdir}/modprobe.d/mlx4.conf
-%if 0
-%config(noreplace) %{_sysconfdir}/modprobe.d/truescale.conf
-%endif'
- assert_contains rdma-core.spec '%{_mandir}/man3/efadv*'
- assert_contains rdma-core.spec '%{_mandir}/man7/efadv*'
- assert_contains rdma-core.spec '%{_mandir}/man3/mlx4dv*'
- assert_contains rdma-core.spec '%{_mandir}/man7/mlx4dv*'
- assert_contains rdma-core.spec '%{_libdir}/libefa.so.*'
- assert_contains rdma-core.spec '%{_libdir}/libmlx4.so.*'
-}
-
-verify_source_markers() {
- case $PATCH_FAMILY in
- 56plus)
- verify_56plus_source_markers '${CMAKE_INSTALL_MODPROBEDIR}/'
- ;;
- 59)
- verify_modern_source_markers '${CMAKE_INSTALL_MODPROBEDIR}/'
- ;;
- 2404plus)
- verify_2404plus_source_markers
- ;;
- 55|54)
- verify_modern_source_markers '${CMAKE_INSTALL_SYSCONFDIR}/modprobe.d/'
- ;;
- 49)
- verify_49_source_markers
- ;;
- 51to53)
- verify_51to53_source_markers
- ;;
- *)
- echo "FAIL $version unsupported patch family $PATCH_FAMILY" >&2
- return 1
- ;;
- esac
-}
-
-verify_patched_tree() {
- case $PATCH_FAMILY in
- 56plus)
- verify_56plus_patched_tree '${CMAKE_INSTALL_MODPROBEDIR}/'
- ;;
- 59)
- verify_modern_patched_tree '${CMAKE_INSTALL_MODPROBEDIR}/'
- ;;
- 2404plus)
- verify_2404plus_patched_tree
- ;;
- 55|54)
- verify_modern_patched_tree '${CMAKE_INSTALL_SYSCONFDIR}/modprobe.d/'
- ;;
- 49)
- verify_49_patched_tree
- ;;
- 51to53)
- verify_51to53_patched_tree
- ;;
- *)
- echo "FAIL $version unsupported patch family $PATCH_FAMILY" >&2
- return 1
- ;;
- esac
-}
-
-verify_release() {
- version=$1
-
- MLNX_OFED_VERSION="$version"
- if ! load_release_metadata; then
- echo "FAIL $version unsupported release metadata"
- return 1
- fi
-
- rpm_name="rdma-core-$RDMA_CORE_VERSION-$RDMA_CORE_MINOR_VERSION.src.rpm"
- rpm_cache_path="$cache_dir/$rpm_name"
- release_root="$work_root/$version"
-
- if [ ! -f "$rpm_cache_path" ]; then
- download_source_rpm "$version" "$rpm_name" "$work_root" "$rpm_cache_path"
- fi
-
- mkdir -p "$release_root"
- cp "$rpm_cache_path" "$release_root/"
-
- cd "$release_root"
- rpm2cpio "$rpm_name" | cpio -idm >/dev/null 2>&1
- rdma_core_archive=$(find_rdma_core_archive)
- if [ -z "$rdma_core_archive" ]; then
- echo "FAIL $version missing rdma-core-$RDMA_CORE_VERSION source archive" >&2
- return 1
- fi
- tar zxf "$rdma_core_archive"
- cd "rdma-core-$RDMA_CORE_VERSION"
-
- verify_source_markers
- if ! apply_release_patch >"$release_root/patch.log" 2>&1; then
- cat "$release_root/patch.log" >&2
- return 1
- fi
- verify_patched_tree
-
- echo "PASS $version"
-}
-
-for version in "$@"; do
- verify_release "$version"
-done
From 58a77f70b08ce437e2d42e97e99f2c8a39c479a5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?=
<2031761+viniciusferrao@users.noreply.github.com>
Date: Sat, 11 Apr 2026 19:13:23 -0300
Subject: [PATCH 02/10] Add ppc64le DOCA validation support
---
README.md | 11 ++--
testing/libvirt/remote-doca-vm-test.sh | 70 ++++++++++++++++++++++----
tests/verify-doca-rpm-layout.sh | 40 ++++++++-------
3 files changed, 89 insertions(+), 32 deletions(-)
diff --git a/README.md b/README.md
index 937986b..a1fdc5f 100644
--- a/README.md
+++ b/README.md
@@ -20,7 +20,7 @@ overlay package that can be installed after DOCA OFED userspace packages.
## Requirements
-* Enterprise Linux 9 or 10
+* Enterprise Linux 9 or 10 on `x86_64` or `ppc64le`
* DOCA OFED `rdma-core` and `libibverbs` already installed
* `rpmbuild`
* root privileges only if installing the generated RPM
@@ -47,7 +47,8 @@ OFED.
## Verification
-Check the current public DOCA repository layout for EL9 and EL10:
+Check the current public DOCA repository layout for EL9 and EL10 on `x86_64`
+and `ppc64le`:
```sh
tests/verify-doca-rpm-layout.sh
@@ -59,8 +60,10 @@ install validation.
Validated against the public DOCA `latest` repository on 2026-04-11:
-* EL9: `libibverbs-2601.0.7-1.el9.x86_64.rpm`
-* EL10: `libibverbs-2601.0.7-1.el10.x86_64.rpm`
+* EL9 x86_64: `libibverbs-2601.0.7-1.el9.x86_64.rpm`
+* EL9 ppc64le: `libibverbs-2601.0.7-1.el9.ppc64le.rpm`
+* EL10 x86_64: `libibverbs-2601.0.7-1.el10.x86_64.rpm`
+* EL10 ppc64le: `libibverbs-2601.0.7-1.el10.ppc64le.rpm`
* Provider ABI: `rdmav59`
# Open Source Apache License
diff --git a/testing/libvirt/remote-doca-vm-test.sh b/testing/libvirt/remote-doca-vm-test.sh
index c843458..5ec24e3 100755
--- a/testing/libvirt/remote-doca-vm-test.sh
+++ b/testing/libvirt/remote-doca-vm-test.sh
@@ -12,6 +12,8 @@ vm_name=$2
el_major=$3
base_image=$4
builder_script=$work_dir/build-docaofed-provider-compat.sh
+host_arch=$(uname -m)
+libvirt_connect=${LIBVIRT_CONNECT:-qemu:///session}
case "$el_major" in
9)
@@ -26,6 +28,23 @@ case "$el_major" in
;;
esac
+case "$host_arch" in
+x86_64)
+ doca_arch=$host_arch
+ guest_console=/dev/ttyS0
+ console_args="--console pty,target_type=serial"
+ ;;
+ppc64le)
+ doca_arch=$host_arch
+ guest_console=/dev/hvc0
+ console_args="--console pty"
+ ;;
+*)
+ echo "Unsupported host architecture: $host_arch" >&2
+ exit 1
+ ;;
+esac
+
if [ ! -f "$builder_script" ]; then
echo "Missing builder script: $builder_script" >&2
exit 1
@@ -46,11 +65,12 @@ $(sed 's/^/ /' "$builder_script")
#!/bin/sh
set -eu
el_major='$el_major'
- repo_url="https://linux.mellanox.com/public/repo/doca/latest/rhel\${el_major}/x86_64/"
+ doca_arch='$doca_arch'
+ repo_url="https://linux.mellanox.com/public/repo/doca/latest/rhel\${el_major}/\${doca_arch}/"
cat > /etc/yum.repos.d/doca.repo <&1 | tee -a /var/log/doca-compat-test.log /dev/ttyS0' ]
+ - [ /bin/sh, -c, 'console_device=$guest_console; if [ ! -e "\$console_device" ]; then console_device=/dev/console; fi; /root/run-doca-compat-test.sh > /var/log/doca-compat-test.log 2>&1; status=\$?; cat /var/log/doca-compat-test.log > "\$console_device" || true; sync; shutdown -h now || poweroff -f || true; exit "\$status"' ]
final_message: "DOCA compatibility test finished"
EOF_YAML
qemu-img create -f qcow2 -F qcow2 -b "$base_image" "$work_dir/disk.qcow2" 30G >/dev/null
rm -f "$work_dir/serial.log"
+: > "$work_dir/serial.log"
+
+if [ "$libvirt_connect" = qemu:///system ]; then
+ chmod 755 "$work_dir"
+ chmod 666 "$work_dir/disk.qcow2"
+fi
+
+boot_args=
+if [ "$host_arch" = x86_64 ]; then
+ boot_args="--boot uefi"
+fi
+
+if [ "$libvirt_connect" = qemu:///system ]; then
+ serial_args="--serial pty"
+else
+ serial_args="--serial file,path=$work_dir/serial.log"
+fi
virt-install \
- --connect qemu:///session \
+ --connect "$libvirt_connect" \
--name "$vm_name" \
--memory 4096 \
--vcpus 4 \
--cpu host-passthrough \
--import \
- --boot uefi \
+ $boot_args \
--disk "$work_dir/disk.qcow2" \
--osinfo detect=on,name="$osinfo" \
--graphics none \
- --console pty,target_type=serial \
- --serial file,path="$work_dir/serial.log" \
+ $console_args \
+ $serial_args \
--network user,model=virtio \
--cloud-init user-data="$work_dir/user-data.yaml",disable=on \
--noautoconsole >/dev/null
+if [ "$libvirt_connect" = qemu:///system ]; then
+ if command -v timeout >/dev/null 2>&1; then
+ console_cmd="timeout 900 virsh --connect '$libvirt_connect' console '$vm_name' --force"
+ else
+ console_cmd="virsh --connect '$libvirt_connect' console '$vm_name' --force"
+ fi
+ if command -v script >/dev/null 2>&1; then
+ nohup script -q -c "$console_cmd" "$work_dir/serial.log" >/dev/null 2>&1 &
+ else
+ nohup sh -c "$console_cmd" > "$work_dir/serial.log" 2>&1 &
+ fi
+fi
+
printf 'VM_NAME=%s\nWORK_DIR=%s\nSERIAL_LOG=%s\n' "$vm_name" "$work_dir" "$work_dir/serial.log"
diff --git a/tests/verify-doca-rpm-layout.sh b/tests/verify-doca-rpm-layout.sh
index ab0277a..29abc4c 100755
--- a/tests/verify-doca-rpm-layout.sh
+++ b/tests/verify-doca-rpm-layout.sh
@@ -22,7 +22,9 @@ done
find_libibverbs_rpm() {
el=$1
- curl -fsSL "$DOCA_REPO_ROOT/rhel$el/x86_64/" |
+ arch=$2
+
+ curl -fsSL "$DOCA_REPO_ROOT/rhel$el/$arch/" |
sed -n 's/.*href="\([^"]*libibverbs-[^"]*\.rpm\)".*/\1/p' |
sed -n '1p'
}
@@ -34,15 +36,16 @@ extract_abi() {
verify_el() {
el=$1
- rpm_name=$(find_libibverbs_rpm "$el")
+ arch=$2
+ rpm_name=$(find_libibverbs_rpm "$el" "$arch")
if [ -z "$rpm_name" ]; then
- die "Unable to find libibverbs RPM for rhel$el under $DOCA_REPO_ROOT"
+ die "Unable to find libibverbs RPM for rhel$el/$arch under $DOCA_REPO_ROOT"
fi
mkdir -p "$CACHE_DIR"
rpm_path=$CACHE_DIR/$rpm_name
if [ ! -f "$rpm_path" ]; then
- curl -fsSL "$DOCA_REPO_ROOT/rhel$el/x86_64/$rpm_name" -o "$rpm_path"
+ curl -fsSL "$DOCA_REPO_ROOT/rhel$el/$arch/$rpm_name" -o "$rpm_path"
fi
work_dir=$(mktemp -d)
@@ -53,36 +56,39 @@ verify_el() {
rpm2cpio "$rpm_path" | cpio -idm --quiet
)
- [ -e "$work_dir/usr/lib64/libefa.so.1" ] || die "rhel$el: missing libefa.so.1"
- [ -e "$work_dir/usr/lib64/libmlx4.so.1" ] || die "rhel$el: missing libmlx4.so.1"
- [ -f "$work_dir/etc/libibverbs.d/mlx5.driver" ] || die "rhel$el: missing mlx5.driver"
+ [ -e "$work_dir/usr/lib64/libefa.so.1" ] || die "rhel$el/$arch: missing libefa.so.1"
+ [ -e "$work_dir/usr/lib64/libmlx4.so.1" ] || die "rhel$el/$arch: missing libmlx4.so.1"
+ [ -f "$work_dir/etc/libibverbs.d/mlx5.driver" ] || die "rhel$el/$arch: missing mlx5.driver"
if [ "$(sed -n '1p' "$work_dir/etc/libibverbs.d/mlx5.driver")" != "driver mlx5" ]; then
- die "rhel$el: unexpected mlx5.driver contents"
+ die "rhel$el/$arch: unexpected mlx5.driver contents"
fi
mlx5_provider=$(find "$work_dir/usr/lib64/libibverbs" -maxdepth 1 -name 'libmlx5-rdmav*.so' | sort | sed -n '1p')
if [ -z "$mlx5_provider" ]; then
- die "rhel$el: missing mlx5 provider ABI symlink"
+ die "rhel$el/$arch: missing mlx5 provider ABI symlink"
fi
abi=$(extract_abi "$mlx5_provider")
if [ -z "$abi" ]; then
- die "rhel$el: unable to parse provider ABI from $mlx5_provider"
+ die "rhel$el/$arch: unable to parse provider ABI from $mlx5_provider"
fi
if find "$work_dir/usr/lib64/libibverbs" -maxdepth 1 -name 'libefa-rdmav*.so' | sed -n '1p' | grep . >/dev/null 2>&1; then
- die "rhel$el: libefa provider symlink is already present"
+ die "rhel$el/$arch: libefa provider symlink is already present"
fi
if find "$work_dir/usr/lib64/libibverbs" -maxdepth 1 -name 'libmlx4-rdmav*.so' | sed -n '1p' | grep . >/dev/null 2>&1; then
- die "rhel$el: libmlx4 provider symlink is already present"
+ die "rhel$el/$arch: libmlx4 provider symlink is already present"
fi
- [ ! -e "$work_dir/etc/libibverbs.d/efa.driver" ] || die "rhel$el: efa.driver is already present"
- [ ! -e "$work_dir/etc/libibverbs.d/mlx4.driver" ] || die "rhel$el: mlx4.driver is already present"
+ [ ! -e "$work_dir/etc/libibverbs.d/efa.driver" ] || die "rhel$el/$arch: efa.driver is already present"
+ [ ! -e "$work_dir/etc/libibverbs.d/mlx4.driver" ] || die "rhel$el/$arch: mlx4.driver is already present"
rm -rf "$work_dir"
trap - EXIT HUP INT TERM
- echo "PASS rhel$el $rpm_name $abi"
+ echo "PASS rhel$el/$arch $rpm_name $abi"
}
-verify_el 9
-verify_el 10
+for el in 9 10; do
+ for arch in x86_64 ppc64le; do
+ verify_el "$el" "$arch"
+ done
+done
From 60446ad6b526ed219513a2b5710000d8e450b341 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?=
<2031761+viniciusferrao@users.noreply.github.com>
Date: Sat, 11 Apr 2026 20:38:34 -0300
Subject: [PATCH 03/10] Discover DOCA repository architectures
---
README.md | 25 ++++++++++++++---
testing/libvirt/remote-doca-vm-test.sh | 9 ++++++-
tests/verify-doca-rpm-layout.sh | 37 +++++++++++++++++++++++---
3 files changed, 63 insertions(+), 8 deletions(-)
diff --git a/README.md b/README.md
index a1fdc5f..43c1233 100644
--- a/README.md
+++ b/README.md
@@ -20,7 +20,8 @@ overlay package that can be installed after DOCA OFED userspace packages.
## Requirements
-* Enterprise Linux 9 or 10 on `x86_64` or `ppc64le`
+* Enterprise Linux 9 or 10 on an architecture shipped by the DOCA OFED
+ repository
* DOCA OFED `rdma-core` and `libibverbs` already installed
* `rpmbuild`
* root privileges only if installing the generated RPM
@@ -47,25 +48,41 @@ OFED.
## Verification
-Check the current public DOCA repository layout for EL9 and EL10 on `x86_64`
-and `ppc64le`:
+Check the current public DOCA repository layout for EL9 and EL10 on every
+architecture directory published by NVIDIA:
```sh
tests/verify-doca-rpm-layout.sh
```
+Set `DOCA_ARCHES` to restrict the layout check to specific repository
+directories:
+
+```sh
+DOCA_ARCHES="x86_64 ppc64le" tests/verify-doca-rpm-layout.sh
+```
+
The `testing/libvirt/remote-doca-vm-test.sh` harness can be copied to a libvirt
host and used with Rocky cloud images to run end-to-end EL9 and EL10 build and
-install validation.
+install validation. It supports `x86_64` and `ppc64le`, and has best-effort
+`aarch64` support through the DOCA `arm64-sbsa` repository directory. Set
+`DOCA_REPO_ARCH` to override the repository directory if needed.
Validated against the public DOCA `latest` repository on 2026-04-11:
+* EL9 arm64-sbsa: `libibverbs-2601.0.7-1.el9.aarch64.rpm`
+* EL9 sbsa-arm64: `libibverbs-2601.0.7-1.el9.aarch64.rpm`
* EL9 x86_64: `libibverbs-2601.0.7-1.el9.x86_64.rpm`
* EL9 ppc64le: `libibverbs-2601.0.7-1.el9.ppc64le.rpm`
+* EL10 arm64-sbsa: `libibverbs-2601.0.7-1.el10.aarch64.rpm`
+* EL10 sbsa-arm64: `libibverbs-2601.0.7-1.el10.aarch64.rpm`
* EL10 x86_64: `libibverbs-2601.0.7-1.el10.x86_64.rpm`
* EL10 ppc64le: `libibverbs-2601.0.7-1.el10.ppc64le.rpm`
* Provider ABI: `rdmav59`
+End-to-end libvirt VM validation was performed on `x86_64` and `ppc64le`.
+Other architectures are covered by repository payload layout validation only.
+
# Open Source Apache License
This shell script is made available under the Apache License, Version 2.0:
diff --git a/testing/libvirt/remote-doca-vm-test.sh b/testing/libvirt/remote-doca-vm-test.sh
index 5ec24e3..6bb0b44 100755
--- a/testing/libvirt/remote-doca-vm-test.sh
+++ b/testing/libvirt/remote-doca-vm-test.sh
@@ -34,6 +34,11 @@ x86_64)
guest_console=/dev/ttyS0
console_args="--console pty,target_type=serial"
;;
+aarch64)
+ doca_arch=arm64-sbsa
+ guest_console=/dev/ttyAMA0
+ console_args="--console pty,target_type=serial"
+ ;;
ppc64le)
doca_arch=$host_arch
guest_console=/dev/hvc0
@@ -45,6 +50,8 @@ ppc64le)
;;
esac
+doca_arch=${DOCA_REPO_ARCH:-$doca_arch}
+
if [ ! -f "$builder_script" ]; then
echo "Missing builder script: $builder_script" >&2
exit 1
@@ -127,7 +134,7 @@ if [ "$libvirt_connect" = qemu:///system ]; then
fi
boot_args=
-if [ "$host_arch" = x86_64 ]; then
+if [ "$host_arch" = x86_64 ] || [ "$host_arch" = aarch64 ]; then
boot_args="--boot uefi"
fi
diff --git a/tests/verify-doca-rpm-layout.sh b/tests/verify-doca-rpm-layout.sh
index 29abc4c..a70e52e 100755
--- a/tests/verify-doca-rpm-layout.sh
+++ b/tests/verify-doca-rpm-layout.sh
@@ -4,6 +4,8 @@ set -eu
DOCA_REPO_ROOT=${DOCA_REPO_ROOT:-https://linux.mellanox.com/public/repo/doca/latest}
CACHE_DIR=${CACHE_DIR:-"${XDG_CACHE_HOME:-$HOME/.cache}/docaofed-patch/verify"}
+DOCA_RHEL_RELEASES=${DOCA_RHEL_RELEASES:-"9 10"}
+DOCA_ARCHES=${DOCA_ARCHES:-}
die() {
echo "$*" >&2
@@ -16,10 +18,26 @@ need_cmd() {
fi
}
-for tool in curl rpm2cpio cpio find grep sed sort basename; do
+for tool in curl rpm2cpio cpio find grep mktemp rm sed sort basename; do
need_cmd "$tool"
done
+list_repo_arches() {
+ el=$1
+
+ if [ -n "$DOCA_ARCHES" ]; then
+ # Allow targeted checks, for example: DOCA_ARCHES="x86_64 ppc64le".
+ printf '%s\n' $DOCA_ARCHES
+ return
+ fi
+
+ curl -fsSL "$DOCA_REPO_ROOT/rhel$el/" |
+ sed -n 's/.*href="\([^"/][^"]*\/\)".*/\1/p' |
+ sed 's:/$::' |
+ grep -v '^\.\.$' |
+ sort -u
+}
+
find_libibverbs_rpm() {
el=$1
arch=$2
@@ -87,8 +105,21 @@ verify_el() {
echo "PASS rhel$el/$arch $rpm_name $abi"
}
-for el in 9 10; do
- for arch in x86_64 ppc64le; do
+for el in $DOCA_RHEL_RELEASES; do
+ case "$el" in
+ 9|10)
+ ;;
+ *)
+ die "Unsupported RHEL major in DOCA_RHEL_RELEASES: $el"
+ ;;
+ esac
+
+ arches=$(list_repo_arches "$el")
+ if [ -z "$arches" ]; then
+ die "Unable to find architecture directories for rhel$el under $DOCA_REPO_ROOT"
+ fi
+
+ for arch in $arches; do
verify_el "$el" "$arch"
done
done
From c8ee514d45d1aaff731a98e4a141ead19e458a4b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?=
<2031761+viniciusferrao@users.noreply.github.com>
Date: Sat, 11 Apr 2026 20:59:17 -0300
Subject: [PATCH 04/10] Add EL8 DOCA compatibility support
---
README.md | 44 ++++++++++++++++----------
build-docaofed-provider-compat.sh | 4 +--
testing/libvirt/remote-doca-vm-test.sh | 5 ++-
tests/verify-doca-rpm-layout.sh | 4 +--
4 files changed, 35 insertions(+), 22 deletions(-)
diff --git a/README.md b/README.md
index 43c1233..0bb51fd 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
# docaofed-patch
Builds a small compatibility RPM for DOCA OFED that restores libibverbs provider
-registration for EFA and mlx4 on Enterprise Linux 9 and 10.
+registration for EFA and mlx4 on Enterprise Linux 8, 9, and 10.
DOCA OFED already ships the userspace libraries in `libibverbs`:
@@ -20,7 +20,7 @@ overlay package that can be installed after DOCA OFED userspace packages.
## Requirements
-* Enterprise Linux 9 or 10 on an architecture shipped by the DOCA OFED
+* Enterprise Linux 8, 9, or 10 on an architecture shipped by the DOCA OFED
repository
* DOCA OFED `rdma-core` and `libibverbs` already installed
* `rpmbuild`
@@ -48,7 +48,7 @@ OFED.
## Verification
-Check the current public DOCA repository layout for EL9 and EL10 on every
+Check the current public DOCA repository layout for EL8, EL9, and EL10 on every
architecture directory published by NVIDIA:
```sh
@@ -63,25 +63,35 @@ DOCA_ARCHES="x86_64 ppc64le" tests/verify-doca-rpm-layout.sh
```
The `testing/libvirt/remote-doca-vm-test.sh` harness can be copied to a libvirt
-host and used with Rocky cloud images to run end-to-end EL9 and EL10 build and
-install validation. It supports `x86_64` and `ppc64le`, and has best-effort
+host and used with Rocky cloud images to run end-to-end EL8, EL9, and EL10 build
+and install validation. It supports `x86_64` and `ppc64le`, and has best-effort
`aarch64` support through the DOCA `arm64-sbsa` repository directory. Set
`DOCA_REPO_ARCH` to override the repository directory if needed.
Validated against the public DOCA `latest` repository on 2026-04-11:
-* EL9 arm64-sbsa: `libibverbs-2601.0.7-1.el9.aarch64.rpm`
-* EL9 sbsa-arm64: `libibverbs-2601.0.7-1.el9.aarch64.rpm`
-* EL9 x86_64: `libibverbs-2601.0.7-1.el9.x86_64.rpm`
-* EL9 ppc64le: `libibverbs-2601.0.7-1.el9.ppc64le.rpm`
-* EL10 arm64-sbsa: `libibverbs-2601.0.7-1.el10.aarch64.rpm`
-* EL10 sbsa-arm64: `libibverbs-2601.0.7-1.el10.aarch64.rpm`
-* EL10 x86_64: `libibverbs-2601.0.7-1.el10.x86_64.rpm`
-* EL10 ppc64le: `libibverbs-2601.0.7-1.el10.ppc64le.rpm`
-* Provider ABI: `rdmav59`
-
-End-to-end libvirt VM validation was performed on `x86_64` and `ppc64le`.
-Other architectures are covered by repository payload layout validation only.
+| Target | Repository directory | `libibverbs` RPM | Provider ABI |
+| --- | --- | --- | --- |
+| EL8 aarch64 | `arm64-sbsa` | `libibverbs-2601.0.7-1.el8.aarch64.rpm` | `rdmav59` |
+| EL8 aarch64 | `sbsa-arm64` | `libibverbs-2601.0.7-1.el8.aarch64.rpm` | `rdmav59` |
+| EL8 ppc64le | `ppc64le` | `libibverbs-2601.0.7-1.el8.ppc64le.rpm` | `rdmav59` |
+| EL8 x86_64 | `x86_64` | `libibverbs-2601.0.7-1.el8.x86_64.rpm` | `rdmav59` |
+| EL9 aarch64 | `arm64-sbsa` | `libibverbs-2601.0.7-1.el9.aarch64.rpm` | `rdmav59` |
+| EL9 aarch64 | `sbsa-arm64` | `libibverbs-2601.0.7-1.el9.aarch64.rpm` | `rdmav59` |
+| EL9 ppc64le | `ppc64le` | `libibverbs-2601.0.7-1.el9.ppc64le.rpm` | `rdmav59` |
+| EL9 x86_64 | `x86_64` | `libibverbs-2601.0.7-1.el9.x86_64.rpm` | `rdmav59` |
+| EL10 aarch64 | `arm64-sbsa` | `libibverbs-2601.0.7-1.el10.aarch64.rpm` | `rdmav59` |
+| EL10 aarch64 | `sbsa-arm64` | `libibverbs-2601.0.7-1.el10.aarch64.rpm` | `rdmav59` |
+| EL10 ppc64le | `ppc64le` | `libibverbs-2601.0.7-1.el10.ppc64le.rpm` | `rdmav59` |
+| EL10 x86_64 | `x86_64` | `libibverbs-2601.0.7-1.el10.x86_64.rpm` | `rdmav59` |
+
+The `arm64-sbsa` and `sbsa-arm64` repository directories currently contain the
+same aarch64 package payloads. Both are validated because NVIDIA publishes both
+names.
+
+End-to-end libvirt VM validation was performed for EL8, EL9, and EL10 on
+`x86_64` and `ppc64le`. Other architectures are covered by repository payload
+layout validation only.
# Open Source Apache License
diff --git a/build-docaofed-provider-compat.sh b/build-docaofed-provider-compat.sh
index 31abfa5..3076e4b 100755
--- a/build-docaofed-provider-compat.sh
+++ b/build-docaofed-provider-compat.sh
@@ -42,10 +42,10 @@ done
el_major=$(rpm -E '%{?rhel}')
case "$el_major" in
-9|10)
+8|9|10)
;;
*)
- die "Only Enterprise Linux 9 and 10 are supported"
+ die "Only Enterprise Linux 8, 9, and 10 are supported"
;;
esac
diff --git a/testing/libvirt/remote-doca-vm-test.sh b/testing/libvirt/remote-doca-vm-test.sh
index 6bb0b44..bd315f8 100755
--- a/testing/libvirt/remote-doca-vm-test.sh
+++ b/testing/libvirt/remote-doca-vm-test.sh
@@ -16,6 +16,9 @@ host_arch=$(uname -m)
libvirt_connect=${LIBVIRT_CONNECT:-qemu:///session}
case "$el_major" in
+8)
+ osinfo=rocky8
+ ;;
9)
osinfo=rocky9
;;
@@ -23,7 +26,7 @@ case "$el_major" in
osinfo=generic
;;
*)
- echo "Only EL9 and EL10 are supported" >&2
+ echo "Only EL8, EL9, and EL10 are supported" >&2
exit 1
;;
esac
diff --git a/tests/verify-doca-rpm-layout.sh b/tests/verify-doca-rpm-layout.sh
index a70e52e..8f6e6ba 100755
--- a/tests/verify-doca-rpm-layout.sh
+++ b/tests/verify-doca-rpm-layout.sh
@@ -4,7 +4,7 @@ set -eu
DOCA_REPO_ROOT=${DOCA_REPO_ROOT:-https://linux.mellanox.com/public/repo/doca/latest}
CACHE_DIR=${CACHE_DIR:-"${XDG_CACHE_HOME:-$HOME/.cache}/docaofed-patch/verify"}
-DOCA_RHEL_RELEASES=${DOCA_RHEL_RELEASES:-"9 10"}
+DOCA_RHEL_RELEASES=${DOCA_RHEL_RELEASES:-"8 9 10"}
DOCA_ARCHES=${DOCA_ARCHES:-}
die() {
@@ -107,7 +107,7 @@ verify_el() {
for el in $DOCA_RHEL_RELEASES; do
case "$el" in
- 9|10)
+ 8|9|10)
;;
*)
die "Unsupported RHEL major in DOCA_RHEL_RELEASES: $el"
From fd9169efe4f33ad647890b33614537a0ee1b814e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?=
<2031761+viniciusferrao@users.noreply.github.com>
Date: Sat, 11 Apr 2026 21:08:47 -0300
Subject: [PATCH 05/10] Restore DOCA upstream watcher and osinfo probing
---
.github/workflows/verify.yml | 4 ++
.github/workflows/watch-upstream.yml | 83 ++++++++++++++++++++++++++
README.md | 4 ++
testing/libvirt/remote-doca-vm-test.sh | 33 +++++++++-
tests/check-upstream-doca-layout.sh | 58 ++++++++++++++++++
tests/doca-latest-supported.tsv | 13 ++++
6 files changed, 192 insertions(+), 3 deletions(-)
create mode 100644 .github/workflows/watch-upstream.yml
create mode 100755 tests/check-upstream-doca-layout.sh
create mode 100644 tests/doca-latest-supported.tsv
diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml
index a087f2f..bce75b0 100644
--- a/.github/workflows/verify.yml
+++ b/.github/workflows/verify.yml
@@ -22,8 +22,12 @@ jobs:
- name: Check shell syntax
run: |
sh -n build-docaofed-provider-compat.sh
+ sh -n tests/check-upstream-doca-layout.sh
sh -n tests/verify-doca-rpm-layout.sh
sh -n testing/libvirt/remote-doca-vm-test.sh
- name: Verify public DOCA RPM layout
run: sh tests/verify-doca-rpm-layout.sh
+
+ - name: Check supported DOCA latest baseline
+ run: sh tests/check-upstream-doca-layout.sh
diff --git a/.github/workflows/watch-upstream.yml b/.github/workflows/watch-upstream.yml
new file mode 100644
index 0000000..a882a9b
--- /dev/null
+++ b/.github/workflows/watch-upstream.yml
@@ -0,0 +1,83 @@
+name: Watch upstream DOCA OFED layout
+
+on:
+ schedule:
+ - cron: "17 8 * * 1"
+ workflow_dispatch:
+
+permissions:
+ contents: read
+ issues: write
+
+jobs:
+ check-upstream:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Check out repository
+ uses: actions/checkout@v4
+
+ - name: Install verification tools
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y cpio rpm2cpio
+
+ - name: Check NVIDIA DOCA latest layout
+ env:
+ GH_TOKEN: ${{ github.token }}
+ ISSUE_TITLE: New DOCA OFED upstream layout detected
+ ISSUE_LABEL: upstream-update
+ run: |
+ set -eu
+
+ report_file="${RUNNER_TEMP}/doca-upstream-report.txt"
+ body_file="${RUNNER_TEMP}/doca-upstream-issue.md"
+
+ set +e
+ sh tests/check-upstream-doca-layout.sh > "$report_file" 2>&1
+ status=$?
+ set -e
+
+ existing_issue=$(gh issue list \
+ --state open \
+ --search "\"${ISSUE_TITLE}\" in:title" \
+ --json number \
+ --jq '.[0].number // empty')
+
+ if [ "$status" -eq 0 ]; then
+ cat "$report_file"
+ if [ -n "$existing_issue" ]; then
+ gh issue close "$existing_issue" \
+ --comment "The DOCA latest repository layout matches the supported baseline again."
+ fi
+ exit 0
+ fi
+
+ {
+ echo "The NVIDIA DOCA latest repository no longer matches the supported baseline."
+ echo
+ echo '```text'
+ cat "$report_file"
+ echo '```'
+ echo
+ echo "Source indexes:"
+ echo "- https://linux.mellanox.com/public/repo/doca/latest/rhel8/"
+ echo "- https://linux.mellanox.com/public/repo/doca/latest/rhel9/"
+ echo "- https://linux.mellanox.com/public/repo/doca/latest/rhel10/"
+ echo
+ echo "Next step: update the supported baseline, rerun the repository layout verifier, and rerun VM validation where hardware is available."
+ } > "$body_file"
+
+ gh label create "$ISSUE_LABEL" \
+ --color f29513 \
+ --description "Tracks upstream DOCA OFED layout changes" || true
+
+ if [ -n "$existing_issue" ]; then
+ gh issue edit "$existing_issue" --body-file "$body_file"
+ else
+ gh issue create \
+ --title "$ISSUE_TITLE" \
+ --body-file "$body_file" \
+ --label "$ISSUE_LABEL"
+ fi
+
+ exit 1
diff --git a/README.md b/README.md
index 0bb51fd..b7502d6 100644
--- a/README.md
+++ b/README.md
@@ -62,6 +62,10 @@ directories:
DOCA_ARCHES="x86_64 ppc64le" tests/verify-doca-rpm-layout.sh
```
+The scheduled upstream watcher compares the current DOCA `latest` repository
+layout against `tests/doca-latest-supported.tsv` and opens a GitHub issue when
+NVIDIA changes the supported baseline.
+
The `testing/libvirt/remote-doca-vm-test.sh` harness can be copied to a libvirt
host and used with Rocky cloud images to run end-to-end EL8, EL9, and EL10 build
and install validation. It supports `x86_64` and `ppc64le`, and has best-effort
diff --git a/testing/libvirt/remote-doca-vm-test.sh b/testing/libvirt/remote-doca-vm-test.sh
index bd315f8..93d70b7 100755
--- a/testing/libvirt/remote-doca-vm-test.sh
+++ b/testing/libvirt/remote-doca-vm-test.sh
@@ -15,15 +15,42 @@ builder_script=$work_dir/build-docaofed-provider-compat.sh
host_arch=$(uname -m)
libvirt_connect=${LIBVIRT_CONNECT:-qemu:///session}
+has_osinfo() {
+ candidate=$1
+
+ if command -v osinfo-query >/dev/null 2>&1; then
+ if osinfo-query os 2>/dev/null | awk '{print $1}' | grep -Fx "$candidate" >/dev/null 2>&1; then
+ return 0
+ fi
+ fi
+
+ if virt-install --osinfo list 2>/dev/null | grep -Fx "$candidate" >/dev/null 2>&1; then
+ return 0
+ fi
+
+ return 1
+}
+
+pick_osinfo() {
+ for candidate in "$@"; do
+ if [ "$candidate" = generic ] || has_osinfo "$candidate"; then
+ printf '%s\n' "$candidate"
+ return
+ fi
+ done
+
+ printf '%s\n' generic
+}
+
case "$el_major" in
8)
- osinfo=rocky8
+ osinfo=$(pick_osinfo rhel8.10 rocky8 rhel8-unknown generic)
;;
9)
- osinfo=rocky9
+ osinfo=$(pick_osinfo rhel9.7 rocky9 rhel9-unknown generic)
;;
10)
- osinfo=generic
+ osinfo=$(pick_osinfo rhel10.1 rhel10.0 rhel10 rocky10.1 rocky10.0 rocky10 rhel10-unknown rocky10-unknown generic)
;;
*)
echo "Only EL8, EL9, and EL10 are supported" >&2
diff --git a/tests/check-upstream-doca-layout.sh b/tests/check-upstream-doca-layout.sh
new file mode 100755
index 0000000..78ef78b
--- /dev/null
+++ b/tests/check-upstream-doca-layout.sh
@@ -0,0 +1,58 @@
+#!/bin/sh
+
+set -eu
+
+EXPECTED_LAYOUT=${EXPECTED_LAYOUT:-tests/doca-latest-supported.tsv}
+VERIFY_SCRIPT=${VERIFY_SCRIPT:-tests/verify-doca-rpm-layout.sh}
+
+die() {
+ echo "$*" >&2
+ exit 1
+}
+
+need_cmd() {
+ if ! command -v "$1" >/dev/null 2>&1; then
+ die "Missing required tool: $1"
+ fi
+}
+
+for tool in awk diff grep mktemp rm sed sort; do
+ need_cmd "$tool"
+done
+
+[ -f "$EXPECTED_LAYOUT" ] || die "Missing expected layout file: $EXPECTED_LAYOUT"
+[ -x "$VERIFY_SCRIPT" ] || die "Missing executable verifier: $VERIFY_SCRIPT"
+
+work_dir=$(mktemp -d)
+trap 'rm -rf "$work_dir"' EXIT HUP INT TERM
+
+expected=$work_dir/expected.tsv
+actual=$work_dir/actual.tsv
+verify_output=$work_dir/verify-output.txt
+
+grep -v '^#' "$EXPECTED_LAYOUT" | grep . | sort > "$expected"
+
+set +e
+"$VERIFY_SCRIPT" > "$verify_output" 2>&1
+status=$?
+set -e
+
+if [ "$status" -ne 0 ]; then
+ echo "DOCA latest repository layout verification failed."
+ echo
+ cat "$verify_output"
+ exit "$status"
+fi
+
+sed -n 's/^PASS rhel\([0-9][0-9]*\)\/\([^ ]*\) \([^ ]*\) \(rdmav[0-9][0-9]*\)$/\1 \2 \3 \4/p' "$verify_output" |
+ sort > "$actual"
+
+if ! diff -u "$expected" "$actual"; then
+ echo
+ echo "DOCA latest repository layout differs from the supported baseline."
+ echo "Update $EXPECTED_LAYOUT and rerun VM validation where hardware is available."
+ exit 1
+fi
+
+cat "$verify_output"
+echo "DOCA latest repository layout matches the supported baseline."
diff --git a/tests/doca-latest-supported.tsv b/tests/doca-latest-supported.tsv
new file mode 100644
index 0000000..61e36cf
--- /dev/null
+++ b/tests/doca-latest-supported.tsv
@@ -0,0 +1,13 @@
+# rhel repo_arch libibverbs_rpm provider_abi
+8 arm64-sbsa libibverbs-2601.0.7-1.el8.aarch64.rpm rdmav59
+8 ppc64le libibverbs-2601.0.7-1.el8.ppc64le.rpm rdmav59
+8 sbsa-arm64 libibverbs-2601.0.7-1.el8.aarch64.rpm rdmav59
+8 x86_64 libibverbs-2601.0.7-1.el8.x86_64.rpm rdmav59
+9 arm64-sbsa libibverbs-2601.0.7-1.el9.aarch64.rpm rdmav59
+9 ppc64le libibverbs-2601.0.7-1.el9.ppc64le.rpm rdmav59
+9 sbsa-arm64 libibverbs-2601.0.7-1.el9.aarch64.rpm rdmav59
+9 x86_64 libibverbs-2601.0.7-1.el9.x86_64.rpm rdmav59
+10 arm64-sbsa libibverbs-2601.0.7-1.el10.aarch64.rpm rdmav59
+10 ppc64le libibverbs-2601.0.7-1.el10.ppc64le.rpm rdmav59
+10 sbsa-arm64 libibverbs-2601.0.7-1.el10.aarch64.rpm rdmav59
+10 x86_64 libibverbs-2601.0.7-1.el10.x86_64.rpm rdmav59
From 67883845bc01d4c3507fbb99b4044297d264249d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?=
<2031761+viniciusferrao@users.noreply.github.com>
Date: Sat, 11 Apr 2026 21:13:56 -0300
Subject: [PATCH 06/10] Clarify DOCA version support policy
---
README.md | 13 +++++++++++++
testing/libvirt/remote-doca-vm-test.sh | 4 +++-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index b7502d6..23fb948 100644
--- a/README.md
+++ b/README.md
@@ -46,6 +46,19 @@ The generated package is tied to the installed DOCA OFED `libibverbs` and
`rdma-core` package EVRs. Rebuild the compatibility RPM after updating DOCA
OFED.
+## Support Policy
+
+Validated support is for the public DOCA `latest` repository baseline listed
+below. The builder is intentionally version-adaptive: it reads the installed
+DOCA OFED `libibverbs` provider ABI and requires the exact installed
+`libibverbs` and `rdma-core` EVRs. That means older or pinned DOCA repositories
+may work if they have the same missing EFA/mlx4 registration layout, but they
+are not claimed as supported until their repository layout and VM install path
+are validated.
+
+Use `DOCA_REPO_ROOT` to point the layout verifier or libvirt test harness at a
+specific published DOCA repository when validating a non-`latest` release.
+
## Verification
Check the current public DOCA repository layout for EL8, EL9, and EL10 on every
diff --git a/testing/libvirt/remote-doca-vm-test.sh b/testing/libvirt/remote-doca-vm-test.sh
index 93d70b7..d5e0025 100755
--- a/testing/libvirt/remote-doca-vm-test.sh
+++ b/testing/libvirt/remote-doca-vm-test.sh
@@ -14,6 +14,7 @@ base_image=$4
builder_script=$work_dir/build-docaofed-provider-compat.sh
host_arch=$(uname -m)
libvirt_connect=${LIBVIRT_CONNECT:-qemu:///session}
+doca_repo_root=${DOCA_REPO_ROOT:-https://linux.mellanox.com/public/repo/doca/latest}
has_osinfo() {
candidate=$1
@@ -103,7 +104,8 @@ $(sed 's/^/ /' "$builder_script")
set -eu
el_major='$el_major'
doca_arch='$doca_arch'
- repo_url="https://linux.mellanox.com/public/repo/doca/latest/rhel\${el_major}/\${doca_arch}/"
+ doca_repo_root='$doca_repo_root'
+ repo_url="\${doca_repo_root}/rhel\${el_major}/\${doca_arch}/"
cat > /etc/yum.repos.d/doca.repo <
Date: Sat, 11 Apr 2026 21:23:39 -0300
Subject: [PATCH 07/10] Make VM validation version adaptive
---
testing/libvirt/remote-doca-vm-test.sh | 27 +++++++++++++++-----------
1 file changed, 16 insertions(+), 11 deletions(-)
diff --git a/testing/libvirt/remote-doca-vm-test.sh b/testing/libvirt/remote-doca-vm-test.sh
index d5e0025..a179ccf 100755
--- a/testing/libvirt/remote-doca-vm-test.sh
+++ b/testing/libvirt/remote-doca-vm-test.sh
@@ -120,35 +120,40 @@ $(sed 's/^/ /' "$builder_script")
dnf -y install rpm-build rdma-core libibverbs
rpm -q rdma-core libibverbs
- rpm -q libibverbs | grep '^libibverbs-2601\\.0\\.7-1\\.el'
+ libibverbs_evr=\$(rpm -q --qf '%{EPOCH}:%{VERSION}-%{RELEASE}' libibverbs | sed 's/^(none)://')
+ rdma_core_evr=\$(rpm -q --qf '%{EPOCH}:%{VERSION}-%{RELEASE}' rdma-core | sed 's/^(none)://')
+ mlx5_provider=\$(find /usr/lib64/libibverbs -maxdepth 1 -name 'libmlx5-rdmav*.so' | sort | sed -n '1p')
+ test -n "\$mlx5_provider"
+ rdmav_abi=\$(basename "\$mlx5_provider" | sed -n 's/^libmlx5-\\(rdmav[0-9][0-9]*\\)\\.so$/\\1/p')
+ test -n "\$rdmav_abi"
test -e /usr/lib64/libefa.so.1
test -e /usr/lib64/libmlx4.so.1
- test -e /usr/lib64/libibverbs/libmlx5-rdmav59.so
+ test -e "/usr/lib64/libibverbs/libmlx5-\$rdmav_abi.so"
test -e /etc/libibverbs.d/mlx5.driver
test ! -e /etc/libibverbs.d/efa.driver
test ! -e /etc/libibverbs.d/mlx4.driver
- test ! -e /usr/lib64/libibverbs/libefa-rdmav59.so
- test ! -e /usr/lib64/libibverbs/libmlx4-rdmav59.so
+ test ! -e "/usr/lib64/libibverbs/libefa-\$rdmav_abi.so"
+ test ! -e "/usr/lib64/libibverbs/libmlx4-\$rdmav_abi.so"
/bin/sh /root/build-docaofed-provider-compat.sh
rpm_path=\$(find /root/PATCHED-DOCA-OFED -maxdepth 1 -type f -name 'docaofed-provider-compat-*.rpm' | sed -n '1p')
test -n "\$rpm_path"
rpm -qpl "\$rpm_path" | grep -F '/etc/libibverbs.d/efa.driver'
rpm -qpl "\$rpm_path" | grep -F '/etc/libibverbs.d/mlx4.driver'
- rpm -qpl "\$rpm_path" | grep -F '/usr/lib64/libibverbs/libefa-rdmav59.so'
- rpm -qpl "\$rpm_path" | grep -F '/usr/lib64/libibverbs/libmlx4-rdmav59.so'
- rpm -qpR "\$rpm_path" | grep -E '^libibverbs(\\([^)]*\\))? = 2601\\.0\\.7-1\\.el'
- rpm -qpR "\$rpm_path" | grep -E '^rdma-core(\\([^)]*\\))? = 2601\\.0\\.7-1\\.el'
+ rpm -qpl "\$rpm_path" | grep -F "/usr/lib64/libibverbs/libefa-\$rdmav_abi.so"
+ rpm -qpl "\$rpm_path" | grep -F "/usr/lib64/libibverbs/libmlx4-\$rdmav_abi.so"
+ rpm -qpR "\$rpm_path" | awk -v evr="\$libibverbs_evr" '\$1 ~ /^libibverbs(\\([^)]*\\))?$/ && \$2 == "=" && \$3 == evr { found=1 } END { exit !found }'
+ rpm -qpR "\$rpm_path" | awk -v evr="\$rdma_core_evr" '\$1 ~ /^rdma-core(\\([^)]*\\))?$/ && \$2 == "=" && \$3 == evr { found=1 } END { exit !found }'
dnf -y install "\$rpm_path"
rpm -q docaofed-provider-compat
test "\$(sed -n '1p' /etc/libibverbs.d/efa.driver)" = 'driver efa'
test "\$(sed -n '1p' /etc/libibverbs.d/mlx4.driver)" = 'driver mlx4'
- test "\$(readlink /usr/lib64/libibverbs/libefa-rdmav59.so)" = '../libefa.so.1'
- test "\$(readlink /usr/lib64/libibverbs/libmlx4-rdmav59.so)" = '../libmlx4.so.1'
+ test "\$(readlink /usr/lib64/libibverbs/libefa-\$rdmav_abi.so)" = '../libefa.so.1'
+ test "\$(readlink /usr/lib64/libibverbs/libmlx4-\$rdmav_abi.so)" = '../libmlx4.so.1'
rpm -qf /etc/libibverbs.d/efa.driver /etc/libibverbs.d/mlx4.driver
- rpm -qf /usr/lib64/libibverbs/libefa-rdmav59.so /usr/lib64/libibverbs/libmlx4-rdmav59.so
+ rpm -qf "/usr/lib64/libibverbs/libefa-\$rdmav_abi.so" "/usr/lib64/libibverbs/libmlx4-\$rdmav_abi.so"
echo "DOCA_COMPAT_TEST_RESULT PASS el\${el_major}"
runcmd:
From c0a84bd520cdeaeaec6596e82d0420721c6dd371 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?=
<2031761+viniciusferrao@users.noreply.github.com>
Date: Sat, 11 Apr 2026 22:20:09 -0300
Subject: [PATCH 08/10] Add DOCA 3.2 LTS support baseline
---
.github/workflows/verify.yml | 13 +++++++-
.github/workflows/watch-upstream.yml | 31 ++++++++++++++-----
README.md | 45 ++++++++++++++++++++--------
tests/check-upstream-doca-layout.sh | 7 +++--
tests/doca-3.2-lts-supported.tsv | 13 ++++++++
5 files changed, 85 insertions(+), 24 deletions(-)
create mode 100644 tests/doca-3.2-lts-supported.tsv
diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml
index bce75b0..8c48e4a 100644
--- a/.github/workflows/verify.yml
+++ b/.github/workflows/verify.yml
@@ -30,4 +30,15 @@ jobs:
run: sh tests/verify-doca-rpm-layout.sh
- name: Check supported DOCA latest baseline
- run: sh tests/check-upstream-doca-layout.sh
+ run: |
+ REPOSITORY_LABEL="DOCA latest" \
+ DOCA_REPO_ROOT="https://linux.mellanox.com/public/repo/doca/latest" \
+ EXPECTED_LAYOUT="tests/doca-latest-supported.tsv" \
+ sh tests/check-upstream-doca-layout.sh
+
+ - name: Check supported DOCA 3.2 LTS baseline
+ run: |
+ REPOSITORY_LABEL="DOCA 3.2 LTS" \
+ DOCA_REPO_ROOT="https://linux.mellanox.com/public/repo/doca/latest-3.2-LTS" \
+ EXPECTED_LAYOUT="tests/doca-3.2-lts-supported.tsv" \
+ sh tests/check-upstream-doca-layout.sh
diff --git a/.github/workflows/watch-upstream.yml b/.github/workflows/watch-upstream.yml
index a882a9b..0d9de8e 100644
--- a/.github/workflows/watch-upstream.yml
+++ b/.github/workflows/watch-upstream.yml
@@ -12,6 +12,18 @@ permissions:
jobs:
check-upstream:
runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - label: DOCA latest
+ repo_root: https://linux.mellanox.com/public/repo/doca/latest
+ expected_layout: tests/doca-latest-supported.tsv
+ issue_title: New DOCA OFED latest layout detected
+ - label: DOCA 3.2 LTS
+ repo_root: https://linux.mellanox.com/public/repo/doca/latest-3.2-LTS
+ expected_layout: tests/doca-3.2-lts-supported.tsv
+ issue_title: New DOCA OFED 3.2 LTS layout detected
steps:
- name: Check out repository
uses: actions/checkout@v4
@@ -21,10 +33,13 @@ jobs:
sudo apt-get update
sudo apt-get install -y cpio rpm2cpio
- - name: Check NVIDIA DOCA latest layout
+ - name: Check NVIDIA DOCA layout
env:
GH_TOKEN: ${{ github.token }}
- ISSUE_TITLE: New DOCA OFED upstream layout detected
+ DOCA_LABEL: ${{ matrix.label }}
+ DOCA_REPO_ROOT: ${{ matrix.repo_root }}
+ EXPECTED_LAYOUT: ${{ matrix.expected_layout }}
+ ISSUE_TITLE: ${{ matrix.issue_title }}
ISSUE_LABEL: upstream-update
run: |
set -eu
@@ -33,7 +48,7 @@ jobs:
body_file="${RUNNER_TEMP}/doca-upstream-issue.md"
set +e
- sh tests/check-upstream-doca-layout.sh > "$report_file" 2>&1
+ REPOSITORY_LABEL="$DOCA_LABEL" sh tests/check-upstream-doca-layout.sh > "$report_file" 2>&1
status=$?
set -e
@@ -47,22 +62,22 @@ jobs:
cat "$report_file"
if [ -n "$existing_issue" ]; then
gh issue close "$existing_issue" \
- --comment "The DOCA latest repository layout matches the supported baseline again."
+ --comment "The ${DOCA_LABEL} repository layout matches the supported baseline again."
fi
exit 0
fi
{
- echo "The NVIDIA DOCA latest repository no longer matches the supported baseline."
+ echo "The NVIDIA ${DOCA_LABEL} repository no longer matches the supported baseline."
echo
echo '```text'
cat "$report_file"
echo '```'
echo
echo "Source indexes:"
- echo "- https://linux.mellanox.com/public/repo/doca/latest/rhel8/"
- echo "- https://linux.mellanox.com/public/repo/doca/latest/rhel9/"
- echo "- https://linux.mellanox.com/public/repo/doca/latest/rhel10/"
+ echo "- ${DOCA_REPO_ROOT}/rhel8/"
+ echo "- ${DOCA_REPO_ROOT}/rhel9/"
+ echo "- ${DOCA_REPO_ROOT}/rhel10/"
echo
echo "Next step: update the supported baseline, rerun the repository layout verifier, and rerun VM validation where hardware is available."
} > "$body_file"
diff --git a/README.md b/README.md
index 23fb948..577c907 100644
--- a/README.md
+++ b/README.md
@@ -48,13 +48,17 @@ OFED.
## Support Policy
-Validated support is for the public DOCA `latest` repository baseline listed
-below. The builder is intentionally version-adaptive: it reads the installed
-DOCA OFED `libibverbs` provider ABI and requires the exact installed
-`libibverbs` and `rdma-core` EVRs. That means older or pinned DOCA repositories
-may work if they have the same missing EFA/mlx4 registration layout, but they
-are not claimed as supported until their repository layout and VM install path
-are validated.
+Validated support is for the public DOCA repositories listed below. The builder
+is intentionally version-adaptive: it reads the installed DOCA OFED
+`libibverbs` provider ABI and requires the exact installed `libibverbs` and
+`rdma-core` EVRs. Other DOCA repositories may work if they have the same missing
+EFA/mlx4 registration layout, but they are not claimed as supported until their
+repository layout and VM install path are validated.
+
+| DOCA repository | Baseline file | EL targets | Provider ABI |
+| --- | --- | --- | --- |
+| `latest` | `tests/doca-latest-supported.tsv` | EL8, EL9, EL10 | `rdmav59` |
+| `latest-3.2-LTS` | `tests/doca-3.2-lts-supported.tsv` | EL8, EL9, EL10 | `rdmav57` |
Use `DOCA_REPO_ROOT` to point the layout verifier or libvirt test harness at a
specific published DOCA repository when validating a non-`latest` release.
@@ -75,9 +79,9 @@ directories:
DOCA_ARCHES="x86_64 ppc64le" tests/verify-doca-rpm-layout.sh
```
-The scheduled upstream watcher compares the current DOCA `latest` repository
-layout against `tests/doca-latest-supported.tsv` and opens a GitHub issue when
-NVIDIA changes the supported baseline.
+The scheduled upstream watcher compares each supported DOCA repository layout
+against its baseline file and opens a GitHub issue when NVIDIA changes a
+supported baseline.
The `testing/libvirt/remote-doca-vm-test.sh` harness can be copied to a libvirt
host and used with Rocky cloud images to run end-to-end EL8, EL9, and EL10 build
@@ -102,13 +106,30 @@ Validated against the public DOCA `latest` repository on 2026-04-11:
| EL10 ppc64le | `ppc64le` | `libibverbs-2601.0.7-1.el10.ppc64le.rpm` | `rdmav59` |
| EL10 x86_64 | `x86_64` | `libibverbs-2601.0.7-1.el10.x86_64.rpm` | `rdmav59` |
+Validated against the public DOCA `latest-3.2-LTS` repository on 2026-04-11:
+
+| Target | Repository directory | `libibverbs` RPM | Provider ABI |
+| --- | --- | --- | --- |
+| EL8 aarch64 | `arm64-sbsa` | `libibverbs-2510.0.11-1.el8.aarch64.rpm` | `rdmav57` |
+| EL8 aarch64 | `sbsa-arm64` | `libibverbs-2510.0.11-1.el8.aarch64.rpm` | `rdmav57` |
+| EL8 ppc64le | `ppc64le` | `libibverbs-2510.0.11-1.el8.ppc64le.rpm` | `rdmav57` |
+| EL8 x86_64 | `x86_64` | `libibverbs-2510.0.11-1.el8.x86_64.rpm` | `rdmav57` |
+| EL9 aarch64 | `arm64-sbsa` | `libibverbs-2510.0.11-1.el9.aarch64.rpm` | `rdmav57` |
+| EL9 aarch64 | `sbsa-arm64` | `libibverbs-2510.0.11-1.el9.aarch64.rpm` | `rdmav57` |
+| EL9 ppc64le | `ppc64le` | `libibverbs-2510.0.11-1.el9.ppc64le.rpm` | `rdmav57` |
+| EL9 x86_64 | `x86_64` | `libibverbs-2510.0.11-1.el9.x86_64.rpm` | `rdmav57` |
+| EL10 aarch64 | `arm64-sbsa` | `libibverbs-2510.0.11-1.el10.aarch64.rpm` | `rdmav57` |
+| EL10 aarch64 | `sbsa-arm64` | `libibverbs-2510.0.11-1.el10.aarch64.rpm` | `rdmav57` |
+| EL10 ppc64le | `ppc64le` | `libibverbs-2510.0.11-1.el10.ppc64le.rpm` | `rdmav57` |
+| EL10 x86_64 | `x86_64` | `libibverbs-2510.0.11-1.el10.x86_64.rpm` | `rdmav57` |
+
The `arm64-sbsa` and `sbsa-arm64` repository directories currently contain the
same aarch64 package payloads. Both are validated because NVIDIA publishes both
names.
End-to-end libvirt VM validation was performed for EL8, EL9, and EL10 on
-`x86_64` and `ppc64le`. Other architectures are covered by repository payload
-layout validation only.
+`x86_64` and `ppc64le` for DOCA `latest` and DOCA `latest-3.2-LTS`. Other
+architectures are covered by repository payload layout validation only.
# Open Source Apache License
diff --git a/tests/check-upstream-doca-layout.sh b/tests/check-upstream-doca-layout.sh
index 78ef78b..842ddb3 100755
--- a/tests/check-upstream-doca-layout.sh
+++ b/tests/check-upstream-doca-layout.sh
@@ -3,6 +3,7 @@
set -eu
EXPECTED_LAYOUT=${EXPECTED_LAYOUT:-tests/doca-latest-supported.tsv}
+REPOSITORY_LABEL=${REPOSITORY_LABEL:-DOCA latest}
VERIFY_SCRIPT=${VERIFY_SCRIPT:-tests/verify-doca-rpm-layout.sh}
die() {
@@ -38,7 +39,7 @@ status=$?
set -e
if [ "$status" -ne 0 ]; then
- echo "DOCA latest repository layout verification failed."
+ echo "$REPOSITORY_LABEL repository layout verification failed."
echo
cat "$verify_output"
exit "$status"
@@ -49,10 +50,10 @@ sed -n 's/^PASS rhel\([0-9][0-9]*\)\/\([^ ]*\) \([^ ]*\) \(rdmav[0-9][0-9]*\)$/\
if ! diff -u "$expected" "$actual"; then
echo
- echo "DOCA latest repository layout differs from the supported baseline."
+ echo "$REPOSITORY_LABEL repository layout differs from the supported baseline."
echo "Update $EXPECTED_LAYOUT and rerun VM validation where hardware is available."
exit 1
fi
cat "$verify_output"
-echo "DOCA latest repository layout matches the supported baseline."
+echo "$REPOSITORY_LABEL repository layout matches the supported baseline."
diff --git a/tests/doca-3.2-lts-supported.tsv b/tests/doca-3.2-lts-supported.tsv
new file mode 100644
index 0000000..86593d9
--- /dev/null
+++ b/tests/doca-3.2-lts-supported.tsv
@@ -0,0 +1,13 @@
+# rhel repo_arch libibverbs_rpm provider_abi
+8 arm64-sbsa libibverbs-2510.0.11-1.el8.aarch64.rpm rdmav57
+8 ppc64le libibverbs-2510.0.11-1.el8.ppc64le.rpm rdmav57
+8 sbsa-arm64 libibverbs-2510.0.11-1.el8.aarch64.rpm rdmav57
+8 x86_64 libibverbs-2510.0.11-1.el8.x86_64.rpm rdmav57
+9 arm64-sbsa libibverbs-2510.0.11-1.el9.aarch64.rpm rdmav57
+9 ppc64le libibverbs-2510.0.11-1.el9.ppc64le.rpm rdmav57
+9 sbsa-arm64 libibverbs-2510.0.11-1.el9.aarch64.rpm rdmav57
+9 x86_64 libibverbs-2510.0.11-1.el9.x86_64.rpm rdmav57
+10 arm64-sbsa libibverbs-2510.0.11-1.el10.aarch64.rpm rdmav57
+10 ppc64le libibverbs-2510.0.11-1.el10.ppc64le.rpm rdmav57
+10 sbsa-arm64 libibverbs-2510.0.11-1.el10.aarch64.rpm rdmav57
+10 x86_64 libibverbs-2510.0.11-1.el10.x86_64.rpm rdmav57
From 1b82b98bc448c0da6b65f2ae0f67111f880d13eb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?=
<2031761+viniciusferrao@users.noreply.github.com>
Date: Sat, 11 Apr 2026 22:30:03 -0300
Subject: [PATCH 09/10] Watch DOCA latest repository index
---
.github/workflows/verify.yml | 6 +-
.github/workflows/watch-upstream.yml | 72 ++++++++++++++++++++++-
README.md | 6 +-
tests/check-upstream-doca-repositories.sh | 50 ++++++++++++++++
tests/doca-latest-repositories.txt | 6 ++
5 files changed, 136 insertions(+), 4 deletions(-)
create mode 100755 tests/check-upstream-doca-repositories.sh
create mode 100644 tests/doca-latest-repositories.txt
diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml
index 8c48e4a..2be0a1b 100644
--- a/.github/workflows/verify.yml
+++ b/.github/workflows/verify.yml
@@ -17,15 +17,19 @@ jobs:
- name: Install verification tools
run: |
sudo apt-get update
- sudo apt-get install -y cpio rpm2cpio
+ sudo apt-get install -y cpio curl rpm2cpio
- name: Check shell syntax
run: |
sh -n build-docaofed-provider-compat.sh
sh -n tests/check-upstream-doca-layout.sh
+ sh -n tests/check-upstream-doca-repositories.sh
sh -n tests/verify-doca-rpm-layout.sh
sh -n testing/libvirt/remote-doca-vm-test.sh
+ - name: Check DOCA latest repository index
+ run: sh tests/check-upstream-doca-repositories.sh
+
- name: Verify public DOCA RPM layout
run: sh tests/verify-doca-rpm-layout.sh
diff --git a/.github/workflows/watch-upstream.yml b/.github/workflows/watch-upstream.yml
index 0d9de8e..e1472fc 100644
--- a/.github/workflows/watch-upstream.yml
+++ b/.github/workflows/watch-upstream.yml
@@ -10,6 +10,76 @@ permissions:
issues: write
jobs:
+ check-repository-index:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Check out repository
+ uses: actions/checkout@v4
+
+ - name: Install verification tools
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y curl
+
+ - name: Check NVIDIA DOCA latest repository index
+ env:
+ GH_TOKEN: ${{ github.token }}
+ ISSUE_TITLE: DOCA OFED latest repository index changed
+ ISSUE_LABEL: upstream-update
+ run: |
+ set -eu
+
+ report_file="${RUNNER_TEMP}/doca-repository-index-report.txt"
+ body_file="${RUNNER_TEMP}/doca-repository-index-issue.md"
+
+ set +e
+ sh tests/check-upstream-doca-repositories.sh > "$report_file" 2>&1
+ status=$?
+ set -e
+
+ existing_issue=$(gh issue list \
+ --state open \
+ --search "\"${ISSUE_TITLE}\" in:title" \
+ --json number \
+ --jq '.[0].number // empty')
+
+ if [ "$status" -eq 0 ]; then
+ cat "$report_file"
+ if [ -n "$existing_issue" ]; then
+ gh issue close "$existing_issue" \
+ --comment "The DOCA latest* repository index matches the known baseline again."
+ fi
+ exit 0
+ fi
+
+ {
+ echo "The NVIDIA DOCA latest* repository index no longer matches the known baseline."
+ echo
+ echo '```text'
+ cat "$report_file"
+ echo '```'
+ echo
+ echo "Source index:"
+ echo "- https://linux.mellanox.com/public/repo/doca/"
+ echo
+ echo "Next step: inspect the new latest* repository, run layout verification, run VM validation where hardware is available, and decide whether to add it as a supported baseline."
+ } > "$body_file"
+
+ gh label create "$ISSUE_LABEL" \
+ --color f29513 \
+ --description "Tracks upstream DOCA OFED layout changes" || true
+
+ if [ -n "$existing_issue" ]; then
+ gh issue edit "$existing_issue" --body-file "$body_file"
+ else
+ gh issue create \
+ --title "$ISSUE_TITLE" \
+ --body-file "$body_file" \
+ --label "$ISSUE_LABEL"
+ fi
+
+ exit 1
+
check-upstream:
runs-on: ubuntu-latest
strategy:
@@ -31,7 +101,7 @@ jobs:
- name: Install verification tools
run: |
sudo apt-get update
- sudo apt-get install -y cpio rpm2cpio
+ sudo apt-get install -y cpio curl rpm2cpio
- name: Check NVIDIA DOCA layout
env:
diff --git a/README.md b/README.md
index 577c907..08664bb 100644
--- a/README.md
+++ b/README.md
@@ -79,8 +79,10 @@ directories:
DOCA_ARCHES="x86_64 ppc64le" tests/verify-doca-rpm-layout.sh
```
-The scheduled upstream watcher compares each supported DOCA repository layout
-against its baseline file and opens a GitHub issue when NVIDIA changes a
+The scheduled upstream watcher checks the public DOCA root index for every
+repository directory beginning with `latest` and opens a GitHub issue when
+NVIDIA adds or removes one. It also compares each supported DOCA repository
+layout against its baseline file and opens a GitHub issue when NVIDIA changes a
supported baseline.
The `testing/libvirt/remote-doca-vm-test.sh` harness can be copied to a libvirt
diff --git a/tests/check-upstream-doca-repositories.sh b/tests/check-upstream-doca-repositories.sh
new file mode 100755
index 0000000..c73c0c3
--- /dev/null
+++ b/tests/check-upstream-doca-repositories.sh
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+set -eu
+
+DOCA_REPO_INDEX=${DOCA_REPO_INDEX:-https://linux.mellanox.com/public/repo/doca/}
+EXPECTED_REPOSITORIES=${EXPECTED_REPOSITORIES:-tests/doca-latest-repositories.txt}
+
+die() {
+ echo "$*" >&2
+ exit 1
+}
+
+need_cmd() {
+ if ! command -v "$1" >/dev/null 2>&1; then
+ die "Missing required tool: $1"
+ fi
+}
+
+for tool in curl diff grep mktemp rm sed sort; do
+ need_cmd "$tool"
+done
+
+[ -f "$EXPECTED_REPOSITORIES" ] || die "Missing expected repository file: $EXPECTED_REPOSITORIES"
+
+work_dir=$(mktemp -d)
+trap 'rm -rf "$work_dir"' EXIT HUP INT TERM
+
+index_html=$work_dir/doca-index.html
+expected=$work_dir/expected.txt
+actual=$work_dir/actual.txt
+
+curl -fsSL "$DOCA_REPO_INDEX" > "$index_html"
+
+grep -v '^#' "$EXPECTED_REPOSITORIES" | grep . | sort > "$expected"
+sed -n 's/.*href="\([^"/][^"]*\/\)".*/\1/p' "$index_html" |
+ sed 's:/$::' |
+ grep '^latest' |
+ sort -u > "$actual"
+
+[ -s "$actual" ] || die "Unable to find latest* DOCA repository directories under $DOCA_REPO_INDEX"
+
+if ! diff -u "$expected" "$actual"; then
+ echo
+ echo "DOCA repository index latest* entries differ from the known baseline."
+ echo "Update $EXPECTED_REPOSITORIES and validate any newly published repositories before adding support."
+ exit 1
+fi
+
+echo "DOCA repository index latest* entries match the known baseline:"
+cat "$actual"
diff --git a/tests/doca-latest-repositories.txt b/tests/doca-latest-repositories.txt
new file mode 100644
index 0000000..07bda9b
--- /dev/null
+++ b/tests/doca-latest-repositories.txt
@@ -0,0 +1,6 @@
+# DOCA repository directories whose names begin with "latest".
+latest
+latest-1.5-LTS
+latest-2.5-LTS
+latest-2.9-LTS
+latest-3.2-LTS
From 05640a8393bf9902c88a888e49445ca2dbf8e828 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?=
<2031761+viniciusferrao@users.noreply.github.com>
Date: Sat, 11 Apr 2026 23:02:17 -0300
Subject: [PATCH 10/10] Auto-verify new DOCA latest repositories
---
.github/workflows/verify.yml | 2 +-
.github/workflows/watch-upstream.yml | 35 +++++++++-
README.md | 9 ++-
tests/check-upstream-doca-repositories.sh | 79 +++++++++++++++++++++--
4 files changed, 113 insertions(+), 12 deletions(-)
diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml
index 2be0a1b..e504fec 100644
--- a/.github/workflows/verify.yml
+++ b/.github/workflows/verify.yml
@@ -28,7 +28,7 @@ jobs:
sh -n testing/libvirt/remote-doca-vm-test.sh
- name: Check DOCA latest repository index
- run: sh tests/check-upstream-doca-repositories.sh
+ run: VERIFY_NEW_REPOSITORIES=1 sh tests/check-upstream-doca-repositories.sh
- name: Verify public DOCA RPM layout
run: sh tests/verify-doca-rpm-layout.sh
diff --git a/.github/workflows/watch-upstream.yml b/.github/workflows/watch-upstream.yml
index e1472fc..1b124da 100644
--- a/.github/workflows/watch-upstream.yml
+++ b/.github/workflows/watch-upstream.yml
@@ -19,7 +19,7 @@ jobs:
- name: Install verification tools
run: |
sudo apt-get update
- sudo apt-get install -y curl
+ sudo apt-get install -y cpio curl rpm2cpio
- name: Check NVIDIA DOCA latest repository index
env:
@@ -33,6 +33,8 @@ jobs:
body_file="${RUNNER_TEMP}/doca-repository-index-issue.md"
set +e
+ VERIFY_NEW_REPOSITORIES=1 \
+ COMPATIBLE_ADDITIONS_EXIT_CODE=10 \
sh tests/check-upstream-doca-repositories.sh > "$report_file" 2>&1
status=$?
set -e
@@ -52,6 +54,37 @@ jobs:
exit 0
fi
+ if [ "$status" -eq 10 ]; then
+ cat "$report_file"
+ {
+ echo "NVIDIA published one or more new DOCA latest* repositories, and the repository layout verifier passed."
+ echo
+ echo '```text'
+ cat "$report_file"
+ echo '```'
+ echo
+ echo "Source index:"
+ echo "- https://linux.mellanox.com/public/repo/doca/"
+ echo
+ echo "The compatibility overlay preconditions still hold. Next step: run VM validation where hardware is available, then add a supported baseline if this release should be claimed as supported."
+ } > "$body_file"
+
+ gh label create "$ISSUE_LABEL" \
+ --color f29513 \
+ --description "Tracks upstream DOCA OFED layout changes" || true
+
+ if [ -n "$existing_issue" ]; then
+ gh issue edit "$existing_issue" --body-file "$body_file"
+ else
+ gh issue create \
+ --title "$ISSUE_TITLE" \
+ --body-file "$body_file" \
+ --label "$ISSUE_LABEL"
+ fi
+
+ exit 0
+ fi
+
{
echo "The NVIDIA DOCA latest* repository index no longer matches the known baseline."
echo
diff --git a/README.md b/README.md
index 08664bb..c4f30f8 100644
--- a/README.md
+++ b/README.md
@@ -81,9 +81,12 @@ DOCA_ARCHES="x86_64 ppc64le" tests/verify-doca-rpm-layout.sh
The scheduled upstream watcher checks the public DOCA root index for every
repository directory beginning with `latest` and opens a GitHub issue when
-NVIDIA adds or removes one. It also compares each supported DOCA repository
-layout against its baseline file and opens a GitHub issue when NVIDIA changes a
-supported baseline.
+NVIDIA adds or removes one. Newly published `latest*` repositories are
+automatically layout-verified before the issue is opened; the workflow stays
+green when the compatibility preconditions still hold and fails only when the
+new repository cannot be validated or a known repository disappears. The watcher
+also compares each supported DOCA repository layout against its baseline file
+and opens a GitHub issue when NVIDIA changes a supported baseline.
The `testing/libvirt/remote-doca-vm-test.sh` harness can be copied to a libvirt
host and used with Rocky cloud images to run end-to-end EL8, EL9, and EL10 build
diff --git a/tests/check-upstream-doca-repositories.sh b/tests/check-upstream-doca-repositories.sh
index c73c0c3..10281eb 100755
--- a/tests/check-upstream-doca-repositories.sh
+++ b/tests/check-upstream-doca-repositories.sh
@@ -4,6 +4,9 @@ set -eu
DOCA_REPO_INDEX=${DOCA_REPO_INDEX:-https://linux.mellanox.com/public/repo/doca/}
EXPECTED_REPOSITORIES=${EXPECTED_REPOSITORIES:-tests/doca-latest-repositories.txt}
+VERIFY_NEW_REPOSITORIES=${VERIFY_NEW_REPOSITORIES:-0}
+VERIFY_SCRIPT=${VERIFY_SCRIPT:-tests/verify-doca-rpm-layout.sh}
+COMPATIBLE_ADDITIONS_EXIT_CODE=${COMPATIBLE_ADDITIONS_EXIT_CODE:-0}
die() {
echo "$*" >&2
@@ -16,7 +19,7 @@ need_cmd() {
fi
}
-for tool in curl diff grep mktemp rm sed sort; do
+for tool in comm curl diff grep mktemp rm sed sort; do
need_cmd "$tool"
done
@@ -28,6 +31,8 @@ trap 'rm -rf "$work_dir"' EXIT HUP INT TERM
index_html=$work_dir/doca-index.html
expected=$work_dir/expected.txt
actual=$work_dir/actual.txt
+added=$work_dir/added.txt
+missing=$work_dir/missing.txt
curl -fsSL "$DOCA_REPO_INDEX" > "$index_html"
@@ -35,16 +40,76 @@ grep -v '^#' "$EXPECTED_REPOSITORIES" | grep . | sort > "$expected"
sed -n 's/.*href="\([^"/][^"]*\/\)".*/\1/p' "$index_html" |
sed 's:/$::' |
grep '^latest' |
- sort -u > "$actual"
+ sort -u > "$actual" || true
[ -s "$actual" ] || die "Unable to find latest* DOCA repository directories under $DOCA_REPO_INDEX"
-if ! diff -u "$expected" "$actual"; then
+if diff -u "$expected" "$actual"; then
+ echo "DOCA repository index latest* entries match the known baseline:"
+ cat "$actual"
+ exit 0
+fi
+
+comm -13 "$expected" "$actual" > "$added"
+comm -23 "$expected" "$actual" > "$missing"
+
+echo
+echo "DOCA repository index latest* entries differ from the known baseline."
+
+if [ -s "$missing" ]; then
+ echo
+ echo "Missing latest* repositories:"
+ cat "$missing"
+ echo
+ echo "A known latest* repository disappeared. Inspect the upstream index before updating $EXPECTED_REPOSITORIES."
+ exit 1
+fi
+
+if [ ! -s "$added" ]; then
+ echo "No new latest* repositories were found, but the index differs from the baseline."
+ exit 1
+fi
+
+echo
+echo "New latest* repositories:"
+cat "$added"
+
+if [ "$VERIFY_NEW_REPOSITORIES" != 1 ]; then
+ echo
+ echo "Set VERIFY_NEW_REPOSITORIES=1 to automatically verify newly published repository layouts."
+ exit 1
+fi
+
+[ -x "$VERIFY_SCRIPT" ] || die "Missing executable verifier: $VERIFY_SCRIPT"
+
+failed=0
+while IFS= read -r repo; do
+ [ -n "$repo" ] || continue
+ repo_root=${DOCA_REPO_INDEX%/}/$repo
+ echo
+ echo "Verifying new repository layout: $repo_root"
+
+ set +e
+ DOCA_REPO_ROOT=$repo_root "$VERIFY_SCRIPT"
+ status=$?
+ set -e
+
+ if [ "$status" -ne 0 ]; then
+ echo "New repository layout verification failed: $repo"
+ failed=1
+ else
+ echo "AUTO_VERIFIED_REPOSITORY $repo"
+ fi
+done < "$added"
+
+if [ "$failed" -ne 0 ]; then
echo
- echo "DOCA repository index latest* entries differ from the known baseline."
- echo "Update $EXPECTED_REPOSITORIES and validate any newly published repositories before adding support."
+ echo "At least one new latest* repository does not match the compatibility overlay preconditions."
exit 1
fi
-echo "DOCA repository index latest* entries match the known baseline:"
-cat "$actual"
+echo
+echo "AUTO_VERIFIED_NEW_REPOSITORIES=1"
+echo "New latest* repositories are layout-compatible with the compatibility overlay."
+echo "Update $EXPECTED_REPOSITORIES and add support baselines after VM validation where hardware is available."
+exit "$COMPATIBLE_ADDITIONS_EXIT_CODE"