diff --git a/lib/maintainers.nix b/lib/maintainers.nix index 198bb93c6be3..55b09925b5f6 100644 --- a/lib/maintainers.nix +++ b/lib/maintainers.nix @@ -11,6 +11,7 @@ abaldeau = "Andreas Baldeau "; abbradar = "Nikolay Amiantov "; aboseley = "Adam Boseley "; + abuibrahim = "Ruslan Babayev "; adev = "Adrien Devresse "; Adjective-Object = "Maxwell Huang-Hobbs "; adnelson = "Allen Nelson "; diff --git a/pkgs/os-specific/linux/dpdk/default.nix b/pkgs/os-specific/linux/dpdk/default.nix index 479188b365f2..b346554c9c65 100644 --- a/pkgs/os-specific/linux/dpdk/default.nix +++ b/pkgs/os-specific/linux/dpdk/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, kernel, fetchurl }: +{ stdenv, lib, kernel, fetchurl, pkgconfig, libvirt }: assert lib.versionAtLeast kernel.version "3.18"; @@ -11,6 +11,8 @@ stdenv.mkDerivation rec { sha256 = "0yrz3nnhv65v2jzz726bjswkn8ffqc1sr699qypc9m78qrdljcfn"; }; + buildInputs = [ pkgconfig libvirt ]; + RTE_KERNELDIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"; RTE_TARGET = "x86_64-native-linuxapp-gcc"; @@ -18,7 +20,7 @@ stdenv.mkDerivation rec { NIX_CFLAGS_COMPILE = [ "-march=core2" ]; enableParallelBuilding = true; - outputs = [ "out" "examples" ]; + outputs = [ "out" "kmod" "examples" ]; buildPhase = '' make T=x86_64-native-linuxapp-gcc config @@ -27,11 +29,31 @@ stdenv.mkDerivation rec { ''; installPhase = '' - mkdir $out - cp -pr x86_64-native-linuxapp-gcc/{app,lib,include,kmod} $out/ + install -m 0755 -d $out/lib + install -m 0644 ${RTE_TARGET}/lib/*.a $out/lib - mkdir $examples - cp -pr examples/* $examples/ + install -m 0755 -d $out/include + install -m 0644 ${RTE_TARGET}/include/*.h $out/include + + install -m 0755 -d $out/include/generic + install -m 0644 ${RTE_TARGET}/include/generic/*.h $out/include/generic + + install -m 0755 -d $out/include/exec-env + install -m 0644 ${RTE_TARGET}/include/exec-env/*.h $out/include/exec-env + + install -m 0755 -d $out/${RTE_TARGET} + install -m 0644 ${RTE_TARGET}/.config $out/${RTE_TARGET} + + install -m 0755 -d $out/${RTE_TARGET}/include + install -m 0644 ${RTE_TARGET}/include/rte_config.h $out/${RTE_TARGET}/include + + cp -pr mk scripts $out/ + + mkdir -p $kmod/lib/modules/${kernel.modDirVersion}/kernel/drivers/net + cp ${RTE_TARGET}/kmod/*.ko $kmod/lib/modules/${kernel.modDirVersion}/kernel/drivers/net + + mkdir -p $examples/bin + find examples ${RTE_TARGET}/app -type f -executable -exec cp {} $examples/bin \; ''; meta = with stdenv.lib; { diff --git a/pkgs/os-specific/linux/pktgen/default.nix b/pkgs/os-specific/linux/pktgen/default.nix new file mode 100644 index 000000000000..56ef935920b8 --- /dev/null +++ b/pkgs/os-specific/linux/pktgen/default.nix @@ -0,0 +1,38 @@ +{ stdenv, fetchurl, dpdk, libpcap, utillinux }: + +stdenv.mkDerivation rec { + name = "pktgen-${version}"; + version = "3.0.00"; + + src = fetchurl { + url = "http://dpdk.org/browse/apps/pktgen-dpdk/snapshot/pktgen-${version}.tar.gz"; + sha256 = "703f8bd615aa4ae3a3085055483f9889dda09d082abb58afd33c1ba7c766ea65"; + }; + + buildInputs = [ dpdk libpcap ]; + + RTE_SDK = "${dpdk}"; + RTE_TARGET = "x86_64-native-linuxapp-gcc"; + + enableParallelBuilding = true; + + patchPhase = '' + sed -i -e s:/usr/local:$out:g lib/lua/src/luaconf.h + sed -i -e s:/usr/bin/lscpu:${utillinux}/bin/lscpu:g lib/common/wr_lscpu.h + ''; + + installPhase = '' + install -d $out/bin + install -m 0755 app/app/${RTE_TARGET}/app/pktgen $out/bin + install -d $out/lib/lua/5.3 + install -m 0644 Pktgen.lua $out/lib/lua/5.3 + ''; + + meta = with stdenv.lib; { + description = "Traffic generator powered by DPDK"; + homepage = http://dpdk.org/; + license = licenses.bsdOriginal; + platforms = [ "x86_64-linux" ]; + maintainers = [ maintainers.abuibrahim ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 098f416fac74..061ee0f550c4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10848,6 +10848,8 @@ in dpdk = callPackage ../os-specific/linux/dpdk { }; + pktgen = callPackage ../os-specific/linux/pktgen { }; + e1000e = callPackage ../os-specific/linux/e1000e {}; v4l2loopback = callPackage ../os-specific/linux/v4l2loopback { };