Merge pull request #212027 from panicgh/dpdk

dpdk: 22.07 -> 22.11.1
This commit is contained in:
Jörg Thalheim 2023-01-22 22:53:52 +00:00 committed by GitHub
commit 4228679d5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 10 deletions

View file

@ -5,18 +5,24 @@
, libbsd, numactl, libbpf, zlib, libelf, jansson, openssl, libpcap, rdma-core
, doxygen, python3, pciutils
, withExamples ? []
, shared ? false }:
, shared ? false
, machine ? (
if stdenv.isx86_64 then "nehalem"
else if stdenv.isAarch64 then "generic"
else null
)
}:
let
mod = kernel != null;
dpdkVersion = "22.07";
dpdkVersion = "22.11.1";
in stdenv.mkDerivation rec {
pname = "dpdk";
version = "${dpdkVersion}" + lib.optionalString mod "-${kernel.version}";
src = fetchurl {
url = "https://fast.dpdk.org/rel/dpdk-${dpdkVersion}.tar.xz";
sha256 = "sha256-n2Tf3gdf21cIy2Leg4uP+4kVdf7R4dKusma6yj38m+o=";
sha256 = "sha256-3gdkZfcXSg1ScUuQcuSDenJrqsgtj+fcZEytXIz3TUw=";
};
nativeBuildInputs = [
@ -63,8 +69,7 @@ in stdenv.mkDerivation rec {
# kni kernel driver is currently not compatble with 5.11
++ lib.optional (mod && kernel.kernelOlder "5.11") "-Ddisable_drivers=kni"
++ lib.optional (!shared) "-Ddefault_library=static"
++ lib.optional stdenv.isx86_64 "-Dmachine=nehalem"
++ lib.optional stdenv.isAarch64 "-Dmachine=generic"
++ 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}";

View file

@ -1,19 +1,40 @@
{ stdenv, lib, fetchFromGitHub, meson, ninja, pkg-config
, dpdk, libbsd, libpcap, lua5_3, numactl, util-linux
, gtk2, which, withGtk ? false
{ stdenv
, lib
, fetchFromGitHub
, fetchpatch
, meson
, ninja
, pkg-config
, dpdk
, libbsd
, libpcap
, lua5_3
, numactl
, util-linux
, gtk2
, which
, withGtk ? false
}:
stdenv.mkDerivation rec {
pname = "pktgen";
version = "22.04.1";
version = "22.07.1";
src = fetchFromGitHub {
owner = "pktgen";
repo = "Pktgen-DPDK";
rev = "pktgen-${version}";
sha256 = "0gbag98i2jq0p2hpvfgc3fiqy2sark1dm72hla4sxmn3gljy3p70";
sha256 = "sha256-wBLGwVdn3ymUTVv7J/kbQYz4WNIgV246PHg51+FStUo=";
};
patches = [
(fetchpatch {
# Ealier DPDK deprecated some macros, which were finally removed in >= 22.11
url = "https://github.com/pktgen/Pktgen-DPDK/commit/089ef94ac04629f7380f5e618443bcacb2cef5ab.patch";
sha256 = "sha256-ITU/dIfu7QPpdIVYuCuDhDG9rVF+n8i1YYn9bFmQUME=";
})
];
nativeBuildInputs = [ meson ninja pkg-config ];
buildInputs = [