Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dpdk: 20.05 -> 21.02 #122588

Merged
merged 4 commits into from May 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 5 additions & 18 deletions pkgs/development/libraries/spdk/default.nix
Expand Up @@ -13,31 +13,17 @@
, openssl
}:

let
dpdk-compat-patch = fetchurl {
url = "https://review.spdk.io/gerrit/plugins/gitiles/spdk/spdk/+/6acb9a58755856fb9316baf9dbbb7239dc6b9446%5E%21/?format=TEXT";
sha256 = "18q0956fkjw19r29hp16x4pygkfv01alj9cld2wlqqyfgp41nhn0";
};
in stdenv.mkDerivation rec {
stdenv.mkDerivation rec {
pname = "spdk";
version = "20.04.1";
version = "21.04";

src = fetchFromGitHub {
owner = "spdk";
repo = "spdk";
rev = "v${version}";
sha256 = "ApMyGamPrMalzZLbVkJlcwatiB8dOJmoxesdjkWZElk=";
sha256 = "sha256-Xmmgojgtt1HwTqG/1ZOJVo1BcdAH0sheu40d73OJ68w=";
};

patches = [
./spdk-dpdk-meson.patch
# https://review.spdk.io/gerrit/c/spdk/spdk/+/3134
(fetchpatch {
url = "https://github.com/spdk/spdk/commit/c954b5b722c5c163774d3598458ff726c48852ab.patch";
sha256 = "1n149hva5qxmpr0nmav10nya7zklafxi136f809clv8pag84g698";
})
];

nativeBuildInputs = [
python3
];
Expand All @@ -48,12 +34,13 @@ in stdenv.mkDerivation rec {

postPatch = ''
patchShebangs .
base64 -d ${dpdk-compat-patch} | patch -p1
'';

configureFlags = [ "--with-dpdk=${dpdk}" ];

NIX_CFLAGS_COMPILE = "-mssse3"; # Necessary to compile.
# otherwise does not find strncpy when compiling
NIX_LDFLAGS = "-lbsd";

enableParallelBuilding = true;

Expand Down
14 changes: 9 additions & 5 deletions pkgs/os-specific/linux/dpdk/default.nix
Expand Up @@ -8,14 +8,14 @@

let
mod = kernel != null;

dpdkVersion = "21.02";
in stdenv.mkDerivation rec {
name = "dpdk-${version}" + lib.optionalString mod "-${kernel.version}";
version = "20.05";
pname = "dpdk";
version = "${dpdkVersion}" + lib.optionalString mod "-${kernel.version}";

src = fetchurl {
url = "https://fast.dpdk.org/rel/dpdk-${version}.tar.xz";
sha256 = "0h0xv2zwb91b9n29afg5ihn06a8q28in64hag2f112kc19f79jj8";
url = "https://fast.dpdk.org/rel/dpdk-${dpdkVersion}.tar.xz";
sha256 = "sha256-CZJKKoJVGqKZeKNoYYT4oQX1L1ZAsb4of1QLLJHpSJs==";
};

nativeBuildInputs = [
Expand All @@ -25,6 +25,7 @@ in stdenv.mkDerivation rec {
pkg-config
python3
python3.pkgs.sphinx
python3.pkgs.pyelftools
];
buildInputs = [
jansson
Expand All @@ -42,9 +43,12 @@ in stdenv.mkDerivation rec {
'';

mesonFlags = [
"-Dtests=false"
"-Denable_docs=true"
"-Denable_kmods=${lib.boolToString mod}"
]
# 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 mod "-Dkernel_dir=${placeholder "kmod"}/lib/modules/${kernel.modDirVersion}";
Expand Down
26 changes: 8 additions & 18 deletions pkgs/os-specific/linux/odp-dpdk/default.nix
@@ -1,29 +1,29 @@
{ lib, stdenv, fetchurl, autoreconfHook, pkg-config
, dpdk, libconfig, libpcap, numactl, openssl, zlib, libbsd, libelf, jansson
, dpdk, libbpf, libconfig, libpcap, numactl, openssl, zlib, libbsd, libelf, jansson
}: let
dpdk_18_11 = dpdk.overrideAttrs (old: rec {
version = "18.11.5";
dpdk_19_11 = dpdk.overrideAttrs (old: rec {
version = "19.11";
src = fetchurl {
url = "https://fast.dpdk.org/rel/dpdk-${version}.tar.xz";
sha256 = "1n6nfaj7703l19jcw540lm8avni48hj9q1rq4mfp8b8gd4zjprj0";
sha256 = "sha256-RnEzlohDZ3uxwna7dKNFiqfAAswh4pXFHjvWVJexEqs=";
};
});

in stdenv.mkDerivation rec {
pname = "odp-dpdk";
version = "1.22.0.0_DPDK_18.11";
version = "1.27.0.0_DPDK_19.11";

src = fetchurl {
url = "https://git.linaro.org/lng/odp-dpdk.git/snapshot/${pname}-${version}.tar.gz";
sha256 = "1m8xhmfjqlj2gkkigq5ka3yh0xgzrcpfpaxp1pnh8d1g99094vbx";
sha256 = "sha256-/4m2NqnEXyenNUrCq3c2ozJzPWFFs/Qp7MAVm9B2biA=";
};

nativeBuildInputs = [
autoreconfHook
pkg-config
];
buildInputs = [
dpdk_18_11
dpdk_19_11
libconfig
libpcap
numactl
Expand All @@ -32,19 +32,9 @@ in stdenv.mkDerivation rec {
libbsd
libelf
jansson
libbpf
];

NIX_CFLAGS_COMPILE = [ "-Wno-error=address-of-packed-member" ];

# for some reason, /build/odp-dpdk-1.22.0.0_DPDK_18.11/lib/.libs ends up in all binaries,
# while it should be $out/lib instead.
# prepend rpath with the proper location, the /build will get removed during rpath shrinking
preFixup = ''
for prog in $out/bin/*; do
patchelf --set-rpath $out/lib:`patchelf --print-rpath $prog` $prog
done
'';

# binaries will segfault otherwise
dontStrip = true;

Expand Down
17 changes: 0 additions & 17 deletions pkgs/os-specific/linux/pktgen/configure.patch

This file was deleted.

24 changes: 14 additions & 10 deletions pkgs/os-specific/linux/pktgen/default.nix
@@ -1,29 +1,33 @@
{ stdenv, lib, fetchurl, meson, ninja, pkg-config
{ stdenv, lib, fetchFromGitHub, meson, ninja, pkg-config
, dpdk, libbsd, libpcap, lua5_3, numactl, util-linux
, gtk2, which, withGtk ? false
}:

stdenv.mkDerivation rec {
pname = "pktgen";
version = "19.12.0";
version = "21.05.0";

src = fetchurl {
url = "http://dpdk.org/browse/apps/pktgen-dpdk/snapshot/${pname}-${version}.tar.xz";
sha256 = "1clfviz1qa4hysslcg6i29vsxwl9f6j1y7zf9wwx9br3yq08x956";
src = fetchFromGitHub {
owner = "pktgen";
repo = "Pktgen-DPDK";
rev = "pktgen-${version}";
sha256 = "sha256-7lLDtbd14olEHO+1BuI6KTEUNRM/zAyRXau/OZbYbGA=";
};

nativeBuildInputs = [ meson ninja pkg-config ];

buildInputs =
[ dpdk libbsd libpcap lua5_3 numactl which ]
++ lib.optionals withGtk [gtk2];
buildInputs = [
dpdk libbsd libpcap lua5_3 numactl which
] ++ lib.optionals withGtk [
gtk2
];

RTE_SDK = dpdk;
GUI = lib.optionalString withGtk "true";

NIX_CFLAGS_COMPILE = "-msse3";

patches = [ ./configure.patch ];
# requires symbols from this file
NIX_LDFLAGS = "-lrte_net_bond";

postPatch = ''
substituteInPlace lib/common/lscpu.h --replace /usr/bin/lscpu ${util-linux}/bin/lscpu
Expand Down