mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-11 04:02:55 +03:00
dpdk: simplify optimization for CPU family
Make it easier optimize DPDK for a CPU family. The conservative default remains (e.g. nehalem for x86_64), but a user may override it for better utilization of recent CPU models, e.g. `{ machine = "x86-64-v4"; }` for AVX512 support.
This commit is contained in:
parent
118290c00a
commit
203e5461b2
@ -5,7 +5,13 @@
|
||||
, 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;
|
||||
@ -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}";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user