dpdk: 25.07 -> 26.03 (#534604)
This commit is contained in:
@@ -19,7 +19,6 @@
|
||||
doxygen,
|
||||
python3,
|
||||
pciutils,
|
||||
fetchpatch,
|
||||
withExamples ? [ ],
|
||||
shared ? false,
|
||||
machine ? (
|
||||
@@ -32,15 +31,18 @@
|
||||
),
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "dpdk";
|
||||
version = "25.07";
|
||||
version = "26.03";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://fast.dpdk.org/rel/dpdk-${version}.tar.xz";
|
||||
sha256 = "sha256-aIbL7cNQu4y+80fRA2fWJZ42Q1Yn+7J9V4rb3A07QQ0=";
|
||||
url = "https://fast.dpdk.org/rel/dpdk-${finalAttrs.version}.tar.xz";
|
||||
hash = "sha256-hJiSArvg+67rYvj9xj9pGICsC2bNDcZMFnhDxZ2ynSw=";
|
||||
};
|
||||
|
||||
__structuredAttrs = true;
|
||||
strictDeps = true;
|
||||
|
||||
nativeBuildInputs = [
|
||||
makeWrapper
|
||||
doxygen
|
||||
@@ -55,12 +57,14 @@ stdenv.mkDerivation rec {
|
||||
jansson
|
||||
libbpf
|
||||
elfutils
|
||||
intel-ipsec-mb
|
||||
libpcap
|
||||
numactl
|
||||
openssl.dev
|
||||
zlib
|
||||
python3
|
||||
]
|
||||
++ lib.optionals stdenv.hostPlatform.isx86_64 [
|
||||
intel-ipsec-mb
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
@@ -76,13 +80,15 @@ stdenv.mkDerivation rec {
|
||||
'';
|
||||
|
||||
mesonFlags = [
|
||||
"-Dtests=false"
|
||||
"-Denable_docs=true"
|
||||
"-Ddeveloper_mode=disabled"
|
||||
(lib.mesonBool "tests" false)
|
||||
(lib.mesonBool "enable_docs" true)
|
||||
(lib.mesonEnable "developer_mode" false)
|
||||
(lib.mesonOption "default_library" (if shared then "shared" else "static"))
|
||||
]
|
||||
++ [ (if shared then "-Ddefault_library=shared" else "-Ddefault_library=static") ]
|
||||
++ lib.optional (machine != null) "-Dmachine=${machine}"
|
||||
++ lib.optional (withExamples != [ ]) "-Dexamples=${builtins.concatStringsSep "," withExamples}";
|
||||
++ lib.optionals (machine != null) [ (lib.mesonOption "machine" machine) ]
|
||||
++ lib.optionals (withExamples != [ ]) [
|
||||
(lib.mesonOption "examples" (lib.concatStringsSep "," withExamples))
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
# Remove Sphinx cache files. Not only are they not useful, but they also
|
||||
@@ -114,7 +120,8 @@ stdenv.mkDerivation rec {
|
||||
platforms = lib.platforms.linux;
|
||||
maintainers = with lib.maintainers; [
|
||||
mic92
|
||||
stepbrobd
|
||||
zhaofengli
|
||||
];
|
||||
};
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
diff --git a/lib/eal/include/rte_bitops.h b/lib/eal/include/rte_bitops.h
|
||||
index deb1fd43f2..0f63ebe1d5 100644
|
||||
--- a/lib/eal/include/rte_bitops.h
|
||||
+++ b/lib/eal/include/rte_bitops.h
|
||||
@@ -525,10 +525,12 @@ __rte_bit_ ## variant ## flip ## size(qualifier uint ## size ## _t *addr, unsign
|
||||
__RTE_GEN_BIT_OPS(,, size) \
|
||||
__RTE_GEN_BIT_OPS(v_, volatile, size)
|
||||
|
||||
+#ifndef __cplusplus
|
||||
#ifdef ALLOW_EXPERIMENTAL_API
|
||||
__RTE_GEN_BIT_OPS_SIZE(32)
|
||||
__RTE_GEN_BIT_OPS_SIZE(64)
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
#define __RTE_GEN_BIT_ATOMIC_TEST(variant, qualifier, size) \
|
||||
__rte_experimental \
|
||||
@@ -653,10 +655,12 @@ __rte_bit_atomic_ ## variant ## test_and_assign ## size( \
|
||||
__RTE_GEN_BIT_ATOMIC_OPS(,, size) \
|
||||
__RTE_GEN_BIT_ATOMIC_OPS(v_, volatile, size)
|
||||
|
||||
+#ifndef __cplusplus
|
||||
#ifdef ALLOW_EXPERIMENTAL_API
|
||||
__RTE_GEN_BIT_ATOMIC_OPS_SIZE(32)
|
||||
__RTE_GEN_BIT_ATOMIC_OPS_SIZE(64)
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
/*------------------------ 32-bit relaxed operations ------------------------*/
|
||||
|
||||
@@ -1485,6 +1489,7 @@ rte_bit_ ## family ## fun(qualifier uint ## size ## _t *addr, arg1_type arg1_nam
|
||||
__RTE_BIT_OVERLOAD_SZ_4R(family, fun, qualifier, 64, ret_type, arg1_type, arg1_name, \
|
||||
arg2_type, arg2_name, arg3_type, arg3_name)
|
||||
|
||||
+#ifndef __cplusplus
|
||||
#ifdef ALLOW_EXPERIMENTAL_API
|
||||
__RTE_BIT_OVERLOAD_2R(, test, const, bool, unsigned int, nr)
|
||||
__RTE_BIT_OVERLOAD_2(, set,, unsigned int, nr)
|
||||
@@ -1502,6 +1507,7 @@ __RTE_BIT_OVERLOAD_3R(atomic_, test_and_clear,, bool, unsigned int, nr, int, mem
|
||||
__RTE_BIT_OVERLOAD_4R(atomic_, test_and_assign,, bool, unsigned int, nr, bool, value,
|
||||
int, memory_order)
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
diff --git a/platform/linux-dpdk/odp_packet_dpdk.c b/platform/linux-dpdk/odp_packet_dpdk.c
|
||||
index cd95ba0f9..7e8b7e3f1 100644
|
||||
--- a/platform/linux-dpdk/odp_packet_dpdk.c
|
||||
+++ b/platform/linux-dpdk/odp_packet_dpdk.c
|
||||
@@ -372,13 +372,18 @@ static void prepare_rss_conf(pktio_entry_t *pktio_entry,
|
||||
uint64_t rss_hf_capa;
|
||||
pkt_dpdk_t *pkt_dpdk = pkt_priv(pktio_entry);
|
||||
uint16_t port_id = pkt_dpdk->port_id;
|
||||
+ int ret;
|
||||
|
||||
memset(&pkt_dpdk->rss_conf, 0, sizeof(struct rte_eth_rss_conf));
|
||||
|
||||
if (!p->hash_enable)
|
||||
return;
|
||||
|
||||
- rte_eth_dev_info_get(port_id, &dev_info);
|
||||
+ ret = rte_eth_dev_info_get(port_id, &dev_info);
|
||||
+ if (ret) {
|
||||
+ _ODP_ERR("Failed to read device info: %d\n", ret);
|
||||
+ return;
|
||||
+ }
|
||||
rss_hf_capa = dev_info.flow_type_rss_offloads;
|
||||
|
||||
/* Print debug info about unsupported hash protocols */
|
||||
@@ -842,7 +847,11 @@ static int dpdk_start(pktio_entry_t *pktio_entry)
|
||||
pktio_entry->state == PKTIO_STATE_STOP_PENDING)
|
||||
rte_eth_dev_stop(pkt_dpdk->port_id);
|
||||
|
||||
- rte_eth_dev_info_get(port_id, &dev_info);
|
||||
+ ret = rte_eth_dev_info_get(port_id, &dev_info);
|
||||
+ if (ret) {
|
||||
+ _ODP_ERR("Failed to read device info: %d\n", ret);
|
||||
+ return -1;
|
||||
+ }
|
||||
|
||||
/* Pcap driver reconfiguration may fail if number of rx/tx queues is set to zero */
|
||||
if (!strncmp(dev_info.driver_name, PCAP_DRV_NAME, strlen(PCAP_DRV_NAME))) {
|
||||
@@ -1258,7 +1267,11 @@ static uint32_t _dpdk_vdev_mtu(uint16_t port_id)
|
||||
int ret;
|
||||
int sockfd;
|
||||
|
||||
- rte_eth_dev_info_get(port_id, &dev_info);
|
||||
+ ret = rte_eth_dev_info_get(port_id, &dev_info);
|
||||
+ if (ret) {
|
||||
+ _ODP_ERR("Failed to read device info: %d\n", ret);
|
||||
+ return 0;
|
||||
+ }
|
||||
if_indextoname(dev_info.if_index, ifr.ifr_name);
|
||||
sockfd = socket(AF_INET, SOCK_DGRAM, 0);
|
||||
ret = ioctl(sockfd, SIOCGIFMTU, &ifr);
|
||||
@@ -2,7 +2,6 @@
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
fetchpatch2,
|
||||
autoreconfHook,
|
||||
pkg-config,
|
||||
dpdk,
|
||||
@@ -18,39 +17,30 @@
|
||||
elfutils,
|
||||
jansson,
|
||||
libnl,
|
||||
nix-update-script,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "odp-dpdk";
|
||||
version = "1.46.0.0_DPDK_22.11";
|
||||
version = "1.50.0.0_DPDK_24.11";
|
||||
|
||||
__structuredAttrs = true;
|
||||
strictDeps = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "OpenDataPlane";
|
||||
repo = "odp-dpdk";
|
||||
rev = "v${finalAttrs.version}";
|
||||
hash = "sha256-9stWGupRSQwUXOdPEQ9Rhkim22p5BBA5Z+2JCYS7Za0=";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-Q1xJ5JCrR/RH5Mxnrs6+gR3D7I2BpmPDki0yJ+5N/UE=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./odp-dpdk_25.03.patch
|
||||
# Fix gcc 15 -Wunterminated-string-initialization errors in test code.
|
||||
(fetchpatch2 {
|
||||
url = "https://github.com/OpenDataPlane/odp-dpdk/commit/56c6bdbe8fe9db4c0441162ec269ef4e1ebd1a6a.patch";
|
||||
hash = "sha256-aj4HuGb0BUxsKtFS3X3gXqBoRVRnKEBNxa/4heWhBlE=";
|
||||
})
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
autoreconfHook
|
||||
pkg-config
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
(dpdk.overrideAttrs {
|
||||
patches = [
|
||||
./dpdk_25.03.patch
|
||||
];
|
||||
})
|
||||
dpdk
|
||||
intel-ipsec-mb
|
||||
libconfig
|
||||
libpcap
|
||||
@@ -70,11 +60,16 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
passthru.updateScript = nix-update-script { };
|
||||
|
||||
meta = {
|
||||
description = "Open Data Plane optimized for DPDK";
|
||||
homepage = "https://www.opendataplane.org";
|
||||
license = lib.licenses.bsd3;
|
||||
platforms = lib.platforms.linux;
|
||||
maintainers = [ lib.maintainers.abuibrahim ];
|
||||
maintainers = with lib.maintainers; [
|
||||
abuibrahim
|
||||
stepbrobd
|
||||
];
|
||||
};
|
||||
})
|
||||
|
||||
@@ -14,17 +14,21 @@
|
||||
gtk2,
|
||||
which,
|
||||
withGtk ? false,
|
||||
nix-update-script,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "pktgen";
|
||||
version = "24.10.3";
|
||||
version = "26.03.0";
|
||||
|
||||
__structuredAttrs = true;
|
||||
strictDeps = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "pktgen";
|
||||
repo = "Pktgen-DPDK";
|
||||
rev = "pktgen-${finalAttrs.version}";
|
||||
sha256 = "sha256-6KC1k+LWNSU/mdwcUKjCaq8pGOcO+dFzeXX4PJm0QgE=";
|
||||
tag = "pktgen-${finalAttrs.version}";
|
||||
hash = "sha256-GNBo0WsHevoge97gUgDdNygCHSA5fQ/73ibsTvDvVYI=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
@@ -57,7 +61,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace lib/common/lscpu.h --replace /usr/bin/lscpu ${util-linux}/bin/lscpu
|
||||
substituteInPlace lib/common/lscpu.h --replace /usr/bin/lscpu ${lib.getExe' util-linux "lscpu"}
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
@@ -66,11 +70,16 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
rm -rf $out/include $out/lib
|
||||
'';
|
||||
|
||||
passthru.updateScript = nix-update-script { };
|
||||
|
||||
meta = {
|
||||
description = "Traffic generator powered by DPDK";
|
||||
homepage = "http://dpdk.org/";
|
||||
license = lib.licenses.bsdOriginal;
|
||||
platforms = lib.platforms.linux;
|
||||
maintainers = [ lib.maintainers.abuibrahim ];
|
||||
maintainers = with lib.maintainers; [
|
||||
abuibrahim
|
||||
stepbrobd
|
||||
];
|
||||
};
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user