Merge pull request #66250 from magenbluten/dpdk
dpdk update and dpdk 17.11 lts init
This commit is contained in:
commit
1f4295927f
@ -8,11 +8,11 @@ let
|
|||||||
|
|
||||||
in stdenv.mkDerivation rec {
|
in stdenv.mkDerivation rec {
|
||||||
name = "dpdk-${version}" + lib.optionalString mod "-${kernel.version}";
|
name = "dpdk-${version}" + lib.optionalString mod "-${kernel.version}";
|
||||||
version = "17.11.2";
|
version = "19.05";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://fast.dpdk.org/rel/dpdk-${version}.tar.xz";
|
url = "https://fast.dpdk.org/rel/dpdk-${version}.tar.xz";
|
||||||
sha256 = "19m5l3jkrns8r1zbjb6ry18w50ff36kbl5b5g6pfcp9p57sfisd2";
|
sha256 = "1pvxyjx2fpsf15fi8vz7zfkaywihck2yd4ck525w76fl15irw3f8";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgconfig ];
|
nativeBuildInputs = [ pkgconfig ];
|
||||||
@ -59,6 +59,6 @@ EOF
|
|||||||
homepage = http://dpdk.org/;
|
homepage = http://dpdk.org/;
|
||||||
license = with licenses; [ lgpl21 gpl2 bsd2 ];
|
license = with licenses; [ lgpl21 gpl2 bsd2 ];
|
||||||
platforms = [ "x86_64-linux" ];
|
platforms = [ "x86_64-linux" ];
|
||||||
maintainers = with maintainers; [ domenkozar orivej ];
|
maintainers = with maintainers; [ domenkozar magenbluten orivej ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,16 @@
|
|||||||
{ stdenv, fetchurl, autoreconfHook, pkgconfig
|
{ stdenv, fetchurl, autoreconfHook, pkgconfig
|
||||||
, dpdk, libconfig, libpcap, numactl, openssl
|
, dpdk, libconfig, libpcap, numactl, openssl
|
||||||
}:
|
}: let
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
dpdk_17_11 = dpdk.overrideAttrs (old: rec {
|
||||||
|
version = "17.11.6";
|
||||||
|
src = fetchurl {
|
||||||
|
url = "https://fast.dpdk.org/rel/dpdk-${version}.tar.xz";
|
||||||
|
sha256 = "0g4l6yjcn17n18c7q1pxkmnj4fg2kiv0krz7n2vjjsb8s6gmbps2";
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
in stdenv.mkDerivation rec {
|
||||||
pname = "odp-dpdk";
|
pname = "odp-dpdk";
|
||||||
version = "1.19.0.0_DPDK_17.11";
|
version = "1.19.0.0_DPDK_17.11";
|
||||||
|
|
||||||
@ -12,16 +20,16 @@ stdenv.mkDerivation rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ autoreconfHook pkgconfig ];
|
nativeBuildInputs = [ autoreconfHook pkgconfig ];
|
||||||
buildInputs = [ dpdk libconfig libpcap numactl openssl ];
|
buildInputs = [ dpdk_17_11 libconfig libpcap numactl openssl ];
|
||||||
|
|
||||||
RTE_SDK = "${dpdk}/share/dpdk";
|
RTE_SDK = "${dpdk_17_11}/share/dpdk";
|
||||||
RTE_TARGET = "x86_64-native-linuxapp-gcc";
|
RTE_TARGET = "x86_64-native-linuxapp-gcc";
|
||||||
|
|
||||||
dontDisableStatic = true;
|
dontDisableStatic = true;
|
||||||
|
|
||||||
configureFlags = [
|
configureFlags = [
|
||||||
"--disable-shared"
|
"--disable-shared"
|
||||||
"--with-dpdk-path=${dpdk}"
|
"--with-dpdk-path=${dpdk_17_11}"
|
||||||
];
|
];
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
|
@ -1,33 +1,23 @@
|
|||||||
{ stdenv, lib, fetchurl, pkgconfig
|
{ stdenv, lib, fetchurl, pkgconfig
|
||||||
, dpdk, libpcap, numactl, utillinux
|
, dpdk, libpcap, lua5_3, numactl, utillinux
|
||||||
, gtk2, withGtk ? false
|
, gtk2, which, withGtk ? false
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
# pktgen needs a specific version of lua to apply its patch (see lib/lua/Makefile).
|
|
||||||
lua = rec {
|
|
||||||
name = "lua-5.3.4";
|
|
||||||
basename = name + ".tar.gz";
|
|
||||||
src = fetchurl {
|
|
||||||
url = "https://www.lua.org/ftp/${basename}";
|
|
||||||
sha256 = "0320a8dg3aci4hxla380dx1ifkw8gj4gbw5c4dz41g1kh98sm0gn";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
in stdenv.mkDerivation rec {
|
in stdenv.mkDerivation rec {
|
||||||
pname = "pktgen";
|
pname = "pktgen";
|
||||||
version = "3.5.0";
|
version = "3.7.2";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "http://dpdk.org/browse/apps/pktgen-dpdk/snapshot/pktgen-${version}.tar.xz";
|
url = "http://dpdk.org/browse/apps/pktgen-dpdk/snapshot/${pname}-${version}.tar.xz";
|
||||||
sha256 = "1gy99jr9dbwzi9pd3w5k673h3pfnbkz6rbzmrkwcyis72pnphy5z";
|
sha256 = "03k7h4j2lsrh6b7477hgn87ljrjh2673ncffx9v261bx1ns54y7w";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = stdenv.lib.optionals withGtk [ pkgconfig ];
|
nativeBuildInputs = [ pkgconfig ];
|
||||||
|
|
||||||
buildInputs =
|
buildInputs =
|
||||||
[ dpdk libpcap numactl ]
|
[ dpdk libpcap lua5_3 numactl which ]
|
||||||
++ stdenv.lib.optionals withGtk [gtk2];
|
++ stdenv.lib.optionals withGtk [gtk2];
|
||||||
|
|
||||||
RTE_SDK = "${dpdk}/share/dpdk";
|
RTE_SDK = "${dpdk}/share/dpdk";
|
||||||
@ -37,19 +27,13 @@ in stdenv.mkDerivation rec {
|
|||||||
NIX_CFLAGS_COMPILE = [ "-msse3" ];
|
NIX_CFLAGS_COMPILE = [ "-msse3" ];
|
||||||
|
|
||||||
postPatch = let dpdkMajor = lib.versions.major dpdk.version; in ''
|
postPatch = let dpdkMajor = lib.versions.major dpdk.version; in ''
|
||||||
substituteInPlace app/Makefile --replace 'yy :=' 'yy := ${dpdkMajor} #'
|
|
||||||
substituteInPlace lib/common/lscpu.h --replace /usr/bin/lscpu ${utillinux}/bin/lscpu
|
substituteInPlace lib/common/lscpu.h --replace /usr/bin/lscpu ${utillinux}/bin/lscpu
|
||||||
|
|
||||||
ln -s ${lua.src} lib/lua/${lua.basename}
|
|
||||||
make -C lib/lua get_tarball # unpack and patch
|
|
||||||
substituteInPlace lib/lua/${lua.name}/src/luaconf.h --replace /usr/local $out
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
install -d $out/bin
|
install -d $out/bin
|
||||||
install -m 0755 app/${RTE_TARGET}/pktgen $out/bin
|
install -m 0755 app/${RTE_TARGET}/pktgen $out/bin
|
||||||
install -d $out/lib/lua/5.3
|
install -m 0644 Pktgen.lua $out/bin
|
||||||
install -m 0644 Pktgen.lua $out/lib/lua/5.3
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user