dpdk: 23.07 -> 23.11

This commit is contained in:
Wim de With 2024-03-21 15:54:46 +01:00
parent 064bba6fdf
commit 24730b0338
3 changed files with 8 additions and 23 deletions

View File

@ -1,5 +1,4 @@
{ stdenv, lib { stdenv, lib
, kernel
, fetchurl , fetchurl
, pkg-config, meson, ninja, makeWrapper , pkg-config, meson, ninja, makeWrapper
, libbsd, numactl, libbpf, zlib, elfutils, jansson, openssl, libpcap, rdma-core , libbsd, numactl, libbpf, zlib, elfutils, jansson, openssl, libpcap, rdma-core
@ -13,16 +12,13 @@
) )
}: }:
let stdenv.mkDerivation rec {
mod = kernel != null;
dpdkVersion = "23.07";
in stdenv.mkDerivation {
pname = "dpdk"; pname = "dpdk";
version = "${dpdkVersion}" + lib.optionalString mod "-${kernel.version}"; version = "23.11";
src = fetchurl { src = fetchurl {
url = "https://fast.dpdk.org/rel/dpdk-${dpdkVersion}.tar.xz"; url = "https://fast.dpdk.org/rel/dpdk-${version}.tar.xz";
sha256 = "sha256-4IYU6K65KUB9c9cWmZKJpE70A0NSJx8JOX7vkysjs9Y="; sha256 = "sha256-ZPpY/fyelRDo5BTjvt0WW9PUykZaIxsoAyP4PNU/2GU=";
}; };
nativeBuildInputs = [ nativeBuildInputs = [
@ -44,7 +40,7 @@ in stdenv.mkDerivation {
openssl.dev openssl.dev
zlib zlib
python3 python3
] ++ lib.optionals mod kernel.moduleBuildDependencies; ];
propagatedBuildInputs = [ propagatedBuildInputs = [
# Propagated to support current DPDK users in nixpkgs which statically link # Propagated to support current DPDK users in nixpkgs which statically link
@ -56,21 +52,15 @@ in stdenv.mkDerivation {
postPatch = '' postPatch = ''
patchShebangs config/arm buildtools patchShebangs config/arm buildtools
'' + lib.optionalString mod ''
# kernel_install_dir is hardcoded to `/lib/modules`; patch that.
sed -i "s,kernel_install_dir *= *['\"].*,kernel_install_dir = '$kmod/lib/modules/${kernel.modDirVersion}'," kernel/linux/meson.build
''; '';
mesonFlags = [ mesonFlags = [
"-Dtests=false" "-Dtests=false"
"-Denable_docs=true" "-Denable_docs=true"
"-Denable_kmods=${lib.boolToString mod}" "-Ddeveloper_mode=disabled"
] ]
# kni kernel driver is currently not compatble with 5.11
++ lib.optional (mod && kernel.kernelOlder "5.11") "-Ddisable_drivers=kni"
++ [(if shared then "-Ddefault_library=shared" else "-Ddefault_library=static")] ++ [(if shared then "-Ddefault_library=shared" else "-Ddefault_library=static")]
++ lib.optional (machine != null) "-Dmachine=${machine}" ++ lib.optional (machine != null) "-Dmachine=${machine}"
++ lib.optional mod "-Dkernel_dir=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
++ lib.optional (withExamples != []) "-Dexamples=${builtins.concatStringsSep "," withExamples}"; ++ lib.optional (withExamples != []) "-Dexamples=${builtins.concatStringsSep "," withExamples}";
postInstall = '' postInstall = ''
@ -87,7 +77,6 @@ in stdenv.mkDerivation {
outputs = outputs =
[ "out" "doc" ] [ "out" "doc" ]
++ lib.optional mod "kmod"
++ lib.optional (withExamples != []) "examples"; ++ lib.optional (withExamples != []) "examples";
meta = with lib; { meta = with lib; {
@ -96,6 +85,5 @@ in stdenv.mkDerivation {
license = with licenses; [ lgpl21 gpl2 bsd2 ]; license = with licenses; [ lgpl21 gpl2 bsd2 ];
platforms = platforms.linux; platforms = platforms.linux;
maintainers = with maintainers; [ magenbluten orivej mic92 zhaofengli ]; maintainers = with maintainers; [ magenbluten orivej mic92 zhaofengli ];
broken = mod && kernel.isHardened;
}; };
} }

View File

@ -27683,9 +27683,7 @@ with pkgs;
cryptodev = linuxPackages.cryptodev; cryptodev = linuxPackages.cryptodev;
dpdk = callPackage ../os-specific/linux/dpdk { dpdk = callPackage ../os-specific/linux/dpdk { };
kernel = null; # dpdk modules are in linuxPackages.dpdk.kmod
};
keyutils = callPackage ../os-specific/linux/keyutils { }; keyutils = callPackage ../os-specific/linux/keyutils { };

View File

@ -309,6 +309,7 @@ in {
inherit (pkgs) odp-dpdk pktgen; # added 2018-05 inherit (pkgs) odp-dpdk pktgen; # added 2018-05
inherit (pkgs) bcc bpftrace; # added 2021-12 inherit (pkgs) bcc bpftrace; # added 2021-12
inherit (pkgs) oci-seccomp-bpf-hook; # added 2022-11 inherit (pkgs) oci-seccomp-bpf-hook; # added 2022-11
inherit (pkgs) dpdk; # added 2024-03
acpi_call = callPackage ../os-specific/linux/acpi-call {}; acpi_call = callPackage ../os-specific/linux/acpi-call {};
@ -345,8 +346,6 @@ in {
dpdk-kmods = callPackage ../os-specific/linux/dpdk-kmods { }; dpdk-kmods = callPackage ../os-specific/linux/dpdk-kmods { };
dpdk = pkgs.dpdk.override { inherit kernel; };
exfat-nofuse = if lib.versionOlder kernel.version "5.8" then callPackage ../os-specific/linux/exfat { } else null; exfat-nofuse = if lib.versionOlder kernel.version "5.8" then callPackage ../os-specific/linux/exfat { } else null;
evdi = callPackage ../os-specific/linux/evdi { }; evdi = callPackage ../os-specific/linux/evdi { };