nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix

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.

+8 -3
+8 -3
pkgs/os-specific/linux/dpdk/default.nix
··· 5 5 , libbsd, numactl, libbpf, zlib, libelf, jansson, openssl, libpcap, rdma-core 6 6 , doxygen, python3, pciutils 7 7 , withExamples ? [] 8 - , shared ? false }: 8 + , shared ? false 9 + , machine ? ( 10 + if stdenv.isx86_64 then "nehalem" 11 + else if stdenv.isAarch64 then "generic" 12 + else null 13 + ) 14 + }: 9 15 10 16 let 11 17 mod = kernel != null; ··· 69 63 # kni kernel driver is currently not compatble with 5.11 70 64 ++ lib.optional (mod && kernel.kernelOlder "5.11") "-Ddisable_drivers=kni" 71 65 ++ lib.optional (!shared) "-Ddefault_library=static" 72 - ++ lib.optional stdenv.isx86_64 "-Dmachine=nehalem" 73 - ++ lib.optional stdenv.isAarch64 "-Dmachine=generic" 66 + ++ lib.optional (machine != null) "-Dmachine=${machine}" 74 67 ++ lib.optional mod "-Dkernel_dir=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" 75 68 ++ lib.optional (withExamples != []) "-Dexamples=${builtins.concatStringsSep "," withExamples}"; 76 69