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.
This commit is contained in:
2026-11-15 16:23:06 +00:00
parent 08c0ebf9e8
commit b02948d826
+9
View File
@@ -25,6 +25,15 @@ let
spdk = pkgs.spdk.overrideAttrs (o: { spdk = pkgs.spdk.overrideAttrs (o: {
configureFlags = o.configureFlags ++ (map (withFeature true) [ "rdma" "ublk" ]); configureFlags = o.configureFlags ++ (map (withFeature true) [ "rdma" "ublk" ]);
buildInputs = o.buildInputs ++ (with pkgs; [ liburing ]); 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" '' spdk-rpc = (pkgs.writeShellScriptBin "spdk-rpc" ''
exec ${pkgs.python3}/bin/python3 ${spdk.src}/scripts/rpc.py "$@" exec ${pkgs.python3}/bin/python3 ${spdk.src}/scripts/rpc.py "$@"