Merge pull request #149759 from delroth/dpdk-updates

dpdk: 21.04 -> 21.11 + various small updates
This commit is contained in:
Jörg Thalheim 2021-12-09 10:22:08 +00:00 committed by GitHub
commit a8b036717f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 11 deletions

View file

@ -1,5 +1,5 @@
{ lib, stdenv
, fetchurl
, fetchpatch
, fetchFromGitHub
, ncurses
, python3
@ -14,19 +14,25 @@
stdenv.mkDerivation rec {
pname = "spdk";
version = "21.07";
version = "21.10";
src = fetchFromGitHub {
owner = "spdk";
repo = "spdk";
rev = "v${version}";
sha256 = "sha256-/hynuYVdzIfiHUUfuuOY8SBJ18DqJr2Fos2JjQQVvbg=";
sha256 = "sha256-pFynTbbSF1g58VD9bOhe3c4oCozeqE+35kECTQwDBDM=";
};
patches = [
# Backport of upstream patch for ncurses-6.3 support.
# Will be in next release after 21.10.
./ncurses-6.3.patch
# DPDK 21.11 compatibility.
(fetchpatch {
url = "https://github.com/spdk/spdk/commit/f72cab94dd35d7b45ec5a4f35967adf3184ca616.patch";
sha256 = "sha256-sSetvyNjlM/hSOUsUO3/dmPzAliVcteNDvy34yM5d4A=";
})
];
nativeBuildInputs = [

View file

@ -2,21 +2,21 @@
, kernel
, fetchurl
, pkg-config, meson, ninja
, libbsd, numactl, libbpf, zlib, libelf, jansson, openssl, libpcap
, libbsd, numactl, libbpf, zlib, libelf, jansson, openssl, libpcap, rdma-core
, doxygen, python3
, withExamples ? []
, shared ? false }:
let
mod = kernel != null;
dpdkVersion = "21.05";
dpdkVersion = "21.11";
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-HhJJm0xfzbV8g+X+GE6mvs3ffPCSiTwsXvLvsO7BLws=";
sha256 = "sha256-Mkbj7WjuKzaaXYviwGzxCKZp4Vf01Bxby7sha/Wr06E=";
};
nativeBuildInputs = [
@ -39,6 +39,12 @@ in stdenv.mkDerivation rec {
zlib
] ++ lib.optionals mod kernel.moduleBuildDependencies;
# Propagated to support current DPDK users in nixpkgs which statically link
# with the framework (e.g. odp-dpdk).
propagatedBuildInputs = [
rdma-core
];
postPatch = ''
patchShebangs config/arm buildtools
'';
@ -52,6 +58,7 @@ in stdenv.mkDerivation rec {
++ 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 mod "-Dkernel_dir=${placeholder "kmod"}/lib/modules/${kernel.modDirVersion}"
++ lib.optional (withExamples != []) "-Dexamples=${builtins.concatStringsSep "," withExamples}";
@ -67,7 +74,11 @@ in stdenv.mkDerivation rec {
rm -f $kmod/lib/modules/${kernel.modDirVersion}/build
'';
postInstall = lib.optionalString (withExamples != []) ''
postInstall = ''
# Remove Sphinx cache files. Not only are they not useful, but they also
# contain store paths causing spurious dependencies.
rm -rf $out/share/doc/dpdk/html/.doctrees
'' + lib.optionalString (withExamples != []) ''
find examples -type f -executable -exec install {} $out/bin \;
'';

View file

@ -5,13 +5,13 @@
stdenv.mkDerivation rec {
pname = "pktgen";
version = "21.05.0";
version = "21.11.0";
src = fetchFromGitHub {
owner = "pktgen";
repo = "Pktgen-DPDK";
rev = "pktgen-${version}";
sha256 = "sha256-7lLDtbd14olEHO+1BuI6KTEUNRM/zAyRXau/OZbYbGA=";
sha256 = "sha256-3z5DSkggHTwjzsRzRG5zzZTcNsn/5YankJT8CKSN8b4=";
};
nativeBuildInputs = [ meson ninja pkg-config ];
@ -25,7 +25,6 @@ stdenv.mkDerivation rec {
RTE_SDK = dpdk;
GUI = lib.optionalString withGtk "true";
NIX_CFLAGS_COMPILE = "-msse3";
# requires symbols from this file
NIX_LDFLAGS = "-lrte_net_bond";
@ -43,7 +42,7 @@ stdenv.mkDerivation rec {
description = "Traffic generator powered by DPDK";
homepage = "http://dpdk.org/";
license = licenses.bsdOriginal;
platforms = [ "x86_64-linux" ];
platforms = platforms.linux;
maintainers = [ maintainers.abuibrahim ];
};
}