From b02948d82659b8f63fbaff354cc3db17f9ce42d9 Mon Sep 17 00:00:00 2001 From: Jack O'Sullivan Date: Sun, 15 Nov 2026 14:25:57 +0000 Subject: [PATCH] nixos/spdk: Handle released DPDK 26.03 Use the supported PCI layout for released DPDK 26.03, matching the upstream fix in SPDK 26.05. Otherwise SPDK 26.01 selects an older layout and crashes during PCI scanning. --- nixos/modules/spdk.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nixos/modules/spdk.nix b/nixos/modules/spdk.nix index 3e495f1..57546ce 100644 --- a/nixos/modules/spdk.nix +++ b/nixos/modules/spdk.nix @@ -25,6 +25,15 @@ let spdk = pkgs.spdk.overrideAttrs (o: { configureFlags = o.configureFlags ++ (map (withFeature true) [ "rdma" "ublk" ]); buildInputs = o.buildInputs ++ (with pkgs; [ liburing ]); + # SPDK 26.01 recognizes prerelease DPDK 26.03, but selects the old PCI ABI for its release. + # TODO: Remove after upgrading to SPDK >= 26.05, which handles released DPDK 26.03: + # https://github.com/spdk/spdk/blob/v26.05/lib/env_dpdk/pci_dpdk.c + # nixos-unstable still packages 26.01 without this fix (checked 2026-11-15). + postPatch = (o.postPatch or "") + lib.optionalString (o.version == "26.01") '' + substituteInPlace lib/env_dpdk/pci_dpdk.c \ + --replace-fail 'else if (year == 25) {' \ + 'else if (year == 25 || (year == 26 && month == 3 && minor == 0)) {' + ''; }); spdk-rpc = (pkgs.writeShellScriptBin "spdk-rpc" '' exec ${pkgs.python3}/bin/python3 ${spdk.src}/scripts/rpc.py "$@"