From 280ec9c65cac8a96c83f78335b054a8fdf3f34b3 Mon Sep 17 00:00:00 2001 From: Md Safiyat Reza Date: Fri, 23 Oct 2026 15:48:06 +0530 Subject: [PATCH 1/8] Support DPDK 23.11: bump bindgen and blacklist rte_crc_generic bindgen 0.47 panics on the _Complex _Float16 builtin that clang 15+ exposes, so bump it to 0.73 (and the clang crate to 2.x so both share clang-sys 1.x). rustfmt_bindings was removed upstream; rustfmt is now the default formatter. DPDK 23.11 ships rte_crc_generic.h next to rte_crc_x86.h; including both in the all-in-one header redefines the CRC functions, so skip it. Co-Authored-By: Claude Opus 5.5 --- Cargo.lock | 377 +++++++++++++---------------------- bindings/dpdk-sys/Cargo.toml | 4 +- bindings/dpdk-sys/build.rs | 5 +- 3 files changed, 145 insertions(+), 241 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 485b609..b515553 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,25 +1,12 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -[[package]] -name = "addr2line" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a55f82cfe485775d02112886f4169bde0c5894d75e79ead7eafe7e40a25e45f7" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +version = 4 [[package]] name = "aho-corasick" -version = "0.7.15" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5" +checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba" dependencies = [ "memchr", ] @@ -62,40 +49,23 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" -[[package]] -name = "backtrace" -version = "0.3.56" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d117600f438b1707d4e4ae15d3595657288f8235a0eb593e80ecc98ab34e1bc" -dependencies = [ - "addr2line", - "cfg-if 1.0.0", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - [[package]] name = "bindgen" -version = "0.47.3" +version = "0.73.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df683a55b54b41d5ea8ebfaebb5aa7e6b84e3f3006a78f010dadc9ca88469260" +checksum = "787ef8ef523575546b106a58213d6e6b06198a05c2f757258c68a74273670cfa" dependencies = [ - "bitflags 1.2.1", + "bitflags 2.13.2", "cexpr", - "cfg-if 0.1.10", "clang-sys", - "clap", - "env_logger", - "hashbrown", - "lazy_static", "log 0.4.14", - "peeking_take_while", - "proc-macro2 0.4.30", - "quote 0.6.13", + "prettyplease", + "proc-macro2", + "quote", "regex", - "which", + "rustc-hash", + "shlex", + "syn 3.0.9", ] [[package]] @@ -110,6 +80,12 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +[[package]] +name = "bitflags" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06" + [[package]] name = "bstr" version = "0.2.15" @@ -118,7 +94,7 @@ checksum = "a40b47ad93e1a5404e6c18dec46b628214fee441c70f4ab5d6942142cc268a3d" dependencies = [ "lazy_static", "memchr", - "regex-automata", + "regex-automata 0.1.9", "serde", ] @@ -151,19 +127,13 @@ checksum = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd" [[package]] name = "cexpr" -version = "0.3.6" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fce5b5fb86b0c57c20c834c1b412fd09c77c8a59b9473f86272709e78874cd1d" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" dependencies = [ "nom", ] -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -185,9 +155,9 @@ dependencies = [ [[package]] name = "clang" -version = "0.21.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8266bf0bdde7b6e30a3e5a5d98906c4f5b08e8c94bcdd46c9f1091b0cc635bd" +checksum = "b2ed30b30e1e17966b55ddd0b9dd2758fd824f0a6da6875c8abb17e6aba47c28" dependencies = [ "clang-sys", "libc", @@ -195,11 +165,11 @@ dependencies = [ [[package]] name = "clang-sys" -version = "0.26.4" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef0c1bcf2e99c649104bd7a7012d8f8802684400e03db0ec0af48583c6fa0e4" +checksum = "157a8ba7b480713b56f4c09fd13fc3e0a22a5dfab8097ba61cbc5feef950788a" dependencies = [ - "glob", + "glob 0.3.4", "libc", "libloading", ] @@ -272,7 +242,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", ] @@ -282,7 +252,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] @@ -293,11 +263,11 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2584f639eb95fea8c798496315b297cf81b9b58b6d30ab066a75455333cf4b12" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", "lazy_static", "memoffset", - "scopeguard 1.1.0", + "scopeguard", ] [[package]] @@ -307,7 +277,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7e9d99fa91428effe99c5c6d4634cdeba32b8cf784fc428a2a687f61a952c49" dependencies = [ "autocfg", - "cfg-if 1.0.0", + "cfg-if", "lazy_static", ] @@ -364,19 +334,6 @@ version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" -[[package]] -name = "env_logger" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3" -dependencies = [ - "atty", - "humantime", - "log 0.4.14", - "regex", - "termcolor", -] - [[package]] name = "etherparse" version = "0.9.0" @@ -393,25 +350,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f17311e68ea07046ee809b8513f6c259518bc10173681d98c21f8c3926f56f40" [[package]] -name = "failure" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" -dependencies = [ - "backtrace", -] - -[[package]] -name = "gimli" -version = "0.23.0" +name = "glob" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" +checksum = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" [[package]] name = "glob" -version = "0.2.11" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" +checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b" [[package]] name = "half" @@ -419,16 +367,6 @@ version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62aca2aba2d62b4a7f5b33f3712cb1b0692779a56fb510499d5c0aa594daeaf3" -[[package]] -name = "hashbrown" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bae29b6653b3412c2e71e9d486db9f9df5d701941d86683005efb9f2d28e3da" -dependencies = [ - "byteorder", - "scopeguard 0.3.3", -] - [[package]] name = "heck" version = "0.3.2" @@ -447,15 +385,6 @@ dependencies = [ "libc", ] -[[package]] -name = "humantime" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" -dependencies = [ - "quick-error", -] - [[package]] name = "ipnetwork" version = "0.17.0" @@ -535,12 +464,12 @@ checksum = "9385f66bf6105b241aa65a61cb923ef20efc665cb9f9bb50ac2f0c4b7f378d41" [[package]] name = "libloading" -version = "0.5.2" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" +checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" dependencies = [ - "cc", - "winapi 0.3.9", + "cfg-if", + "windows-link", ] [[package]] @@ -558,7 +487,7 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -569,9 +498,9 @@ checksum = "c75de51135344a4f8ed3cfe2720dc27736f7711989703a0b43aadf3753c55577" [[package]] name = "memchr" -version = "2.3.4" +version = "2.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" [[package]] name = "memoffset" @@ -583,23 +512,19 @@ dependencies = [ ] [[package]] -name = "miniz_oxide" -version = "0.4.4" +name = "minimal-lexical" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" -dependencies = [ - "adler", - "autocfg", -] +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "nom" -version = "4.2.3" +version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ "memchr", - "version_check 0.1.5", + "minimal-lexical", ] [[package]] @@ -631,24 +556,12 @@ dependencies = [ "libc", ] -[[package]] -name = "object" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a7ab5d64814df0fe4a4b5ead45ed6c5f181ee3ff04ba344313a6c80446c5d4" - [[package]] name = "oorandom" version = "11.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" -[[package]] -name = "peeking_take_while" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" - [[package]] name = "pkt_perf" version = "0.1.0" @@ -747,7 +660,7 @@ version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33f8238f4eb897a55ca06510cd71afb5b5ca7b4ff2d7188f1ca855fc1710133e" dependencies = [ - "glob", + "glob 0.2.11", "pnet_base", "pnet_macros", "pnet_macros_support", @@ -776,6 +689,16 @@ dependencies = [ "pnet_sys", ] +[[package]] +name = "prettyplease" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bfe0f4c752e450fc2faf62654f1c134747922825d5b04ca717b8874f41a40c0" +dependencies = [ + "proc-macro2", + "syn 3.0.9", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -783,10 +706,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.26", - "quote 1.0.9", - "syn", - "version_check 0.9.3", + "proc-macro2", + "quote", + "syn 1.0.69", + "version_check", ] [[package]] @@ -795,51 +718,27 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2 1.0.26", - "quote 1.0.9", - "version_check 0.9.3", + "proc-macro2", + "quote", + "version_check", ] [[package]] name = "proc-macro2" -version = "0.4.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" -dependencies = [ - "unicode-xid 0.1.0", -] - -[[package]] -name = "proc-macro2" -version = "1.0.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152013215dca273577e18d2bf00fa862b89b24169fb78c4c95aeb07992c9cec" -dependencies = [ - "unicode-xid 0.2.1", -] - -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - -[[package]] -name = "quote" -version = "0.6.13" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" dependencies = [ - "proc-macro2 0.4.30", + "unicode-ident", ] [[package]] name = "quote" -version = "1.0.9" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" dependencies = [ - "proc-macro2 1.0.26", + "proc-macro2", ] [[package]] @@ -869,12 +768,13 @@ dependencies = [ [[package]] name = "regex" -version = "1.4.5" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957056ecddbeba1b26965114e191d2e8589ce74db242b6ea25fc4062427a5c19" +checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d" dependencies = [ "aho-corasick", "memchr", + "regex-automata 0.4.18", "regex-syntax", ] @@ -887,17 +787,28 @@ dependencies = [ "byteorder", ] +[[package]] +name = "regex-automata" +version = "0.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + [[package]] name = "regex-syntax" -version = "0.6.23" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5f089152e60f62d28b835fbff2cd2e8dc0baf1ac13343bef92ab7eed84548" +checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" [[package]] -name = "rustc-demangle" -version = "0.1.18" +name = "rustc-hash" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e3bad0ee36814ca07d7968269dd4b7ec89ec2da10c4bb613928d3077083c232" +checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d" [[package]] name = "rustc-serialize" @@ -929,12 +840,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "scopeguard" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27" - [[package]] name = "scopeguard" version = "1.1.0" @@ -978,9 +883,9 @@ version = "1.0.125" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b093b7a2bb58203b5da3056c05b4ec1fed827dcfdb37347a8841695263b3d06d" dependencies = [ - "proc-macro2 1.0.26", - "quote 1.0.9", - "syn", + "proc-macro2", + "quote", + "syn 1.0.69", ] [[package]] @@ -994,6 +899,12 @@ dependencies = [ "serde", ] +[[package]] +name = "shlex" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" + [[package]] name = "simple_logger" version = "1.11.0" @@ -1045,9 +956,9 @@ checksum = "5ba9cdfda491b814720b6b06e0cac513d922fc407582032e8706e9f137976f90" dependencies = [ "heck", "proc-macro-error", - "proc-macro2 1.0.26", - "quote 1.0.9", - "syn", + "proc-macro2", + "quote", + "syn 1.0.69", ] [[package]] @@ -1056,11 +967,22 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48fe99c6bd8b1cc636890bcc071842de909d902c81ac7dab53ba33c421ab8ffb" dependencies = [ - "proc-macro2 1.0.26", - "quote 1.0.9", + "proc-macro2", + "quote", "unicode-xid 0.2.1", ] +[[package]] +name = "syn" +version = "3.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "syntex" version = "0.42.2" @@ -1120,15 +1042,6 @@ dependencies = [ "winapi 0.2.8", ] -[[package]] -name = "termcolor" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" -dependencies = [ - "winapi-util", -] - [[package]] name = "textwrap" version = "0.11.0" @@ -1153,9 +1066,9 @@ version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7765189610d8241a44529806d6fd1f2e0a08734313a35d5b3a556f92b381f3c0" dependencies = [ - "proc-macro2 1.0.26", - "quote 1.0.9", - "syn", + "proc-macro2", + "quote", + "syn 1.0.69", ] [[package]] @@ -1179,6 +1092,12 @@ dependencies = [ "serde_json", ] +[[package]] +name = "unicode-ident" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563" + [[package]] name = "unicode-segmentation" version = "1.7.1" @@ -1197,12 +1116,6 @@ version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "36dff09cafb4ec7c8cf0023eb0b686cb6ce65499116a12201c9e11840ca01beb" -[[package]] -name = "unicode-xid" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" - [[package]] name = "unicode-xid" version = "0.2.1" @@ -1215,12 +1128,6 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" -[[package]] -name = "version_check" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" - [[package]] name = "version_check" version = "0.9.3" @@ -1250,7 +1157,7 @@ version = "0.2.73" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83240549659d187488f91f33c0f8547cbfef0b2088bc470c116d1d260ef623d9" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen-macro", ] @@ -1263,9 +1170,9 @@ dependencies = [ "bumpalo", "lazy_static", "log 0.4.14", - "proc-macro2 1.0.26", - "quote 1.0.9", - "syn", + "proc-macro2", + "quote", + "syn 1.0.69", "wasm-bindgen-shared", ] @@ -1275,7 +1182,7 @@ version = "0.2.73" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e734d91443f177bfdb41969de821e15c516931c3c3db3d318fa1b68975d0f6f" dependencies = [ - "quote 1.0.9", + "quote", "wasm-bindgen-macro-support", ] @@ -1285,9 +1192,9 @@ version = "0.2.73" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d53739ff08c8a68b0fdbcd54c372b8ab800b1449ab3c9d706503bc7dd1621b2c" dependencies = [ - "proc-macro2 1.0.26", - "quote 1.0.9", - "syn", + "proc-macro2", + "quote", + "syn 1.0.69", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -1308,16 +1215,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "which" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b57acb10231b9493c8472b20cb57317d0679a49e0bdbee44b3b803a6473af164" -dependencies = [ - "failure", - "libc", -] - [[package]] name = "winapi" version = "0.2.8" @@ -1360,3 +1257,9 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" diff --git a/bindings/dpdk-sys/Cargo.toml b/bindings/dpdk-sys/Cargo.toml index b19dec0..06621ba 100644 --- a/bindings/dpdk-sys/Cargo.toml +++ b/bindings/dpdk-sys/Cargo.toml @@ -15,9 +15,9 @@ Rust binding for Intel DPDK. """ [build-dependencies] -bindgen = "= 0.47.3" +bindgen = "0.73" regex = "1" -clang = { version = "0.21.0", features = ["runtime", "clang_6_0"] } +clang = { version = "2", features = ["runtime", "clang_10_0"] } cc = "1" etrace = "1" itertools = "0.10" diff --git a/bindings/dpdk-sys/build.rs b/bindings/dpdk-sys/build.rs index f7ba10d..6c104fe 100644 --- a/bindings/dpdk-sys/build.rs +++ b/bindings/dpdk-sys/build.rs @@ -292,7 +292,9 @@ impl State { fn make_all_in_one_header(&mut self) { let dpdk_config = self.dpdk_config.as_ref().unwrap(); // dlb drivers have duplicated enum definitions. - let blacklist = vec!["rte_pmd_dlb", "rte_pmd_dlb2"]; + // rte_crc_generic is an arch fallback that rte_hash_crc includes itself; + // pulling it in directly redefines the arch-specific CRC functions. + let blacklist = vec!["rte_pmd_dlb", "rte_pmd_dlb2", "rte_crc_generic"]; let mut headers = vec![]; for entry in self .include_path @@ -775,7 +777,6 @@ impl State { .clang_arg(dpdk_config_path.to_str().unwrap()) .clang_arg("-march=native") .clang_arg("-Wno-everything") - .rustfmt_bindings(true) .opaque_type("max_align_t") .opaque_type("rte_event.*") .generate() From ae42791bae1e4d363d80bfc294ede8c5f194a197 Mon Sep 17 00:00:00 2001 From: Md Safiyat Reza Date: Fri, 23 Oct 2026 15:57:17 +0530 Subject: [PATCH 2/8] Detect rte_get_main_lcore in bindgen output Since DPDK 21.x rte_get_main_lcore is an exported function rather than static inline, so it is absent from the generated lib.rs. Also look in dpdk.rs, and declare main_lcore_name for check-cfg. Co-Authored-By: Claude Opus 5.5 --- bindings/dpdk-sys/build.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bindings/dpdk-sys/build.rs b/bindings/dpdk-sys/build.rs index 6c104fe..dc2b38f 100644 --- a/bindings/dpdk-sys/build.rs +++ b/bindings/dpdk-sys/build.rs @@ -837,9 +837,14 @@ impl State { .join("\n"), ); - if formatted_string.contains("rte_get_main_lcore") { + // Since DPDK 21.x rte_get_main_lcore is an exported (not static inline) + // function, so it only shows up in the bindgen output. + let bindings = std::fs::read_to_string(self.out_path.join("dpdk.rs")).unwrap_or_default(); + let defines = |name: &str| formatted_string.contains(name) || bindings.contains(name); + println!(r#"cargo:rustc-check-cfg=cfg(main_lcore_name, values("main", "master"))"#); + if defines("rte_get_main_lcore") { println!(r#"cargo:rustc-cfg=main_lcore_name="main""#); - } else if formatted_string.contains("rte_get_master_lcore") { + } else if defines("rte_get_master_lcore") { println!(r#"cargo:rustc-cfg=main_lcore_name="master""#); } else { panic!("neither rte_get_main_lcore nor rte_get_master_lcore found"); From f87dd776645485a5085d0f81e51c53393d5f300d Mon Sep 17 00:00:00 2001 From: Md Safiyat Reza Date: Fri, 23 Oct 2026 16:01:26 +0530 Subject: [PATCH 3/8] Build static wrappers with -mrtm on x86_64 dpdk-sys wraps every static inline, including the TSX helpers (rte_xbegin, rte_try_tm, ...). With -march=native on a CPU without RTM, GCC refuses to inline _xbegin. DPDK gates these paths on rte_rtm_supported() at runtime, so enabling RTM codegen is safe. Co-Authored-By: Claude Opus 5.5 --- bindings/dpdk-sys/build.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bindings/dpdk-sys/build.rs b/bindings/dpdk-sys/build.rs index dc2b38f..1feeaab 100644 --- a/bindings/dpdk-sys/build.rs +++ b/bindings/dpdk-sys/build.rs @@ -860,7 +860,8 @@ impl State { let source_path = self.out_path.join("static.c"); let lib_path = self.library_path.as_ref().unwrap(); - cc::Build::new() + let mut build = cc::Build::new(); + build .file(source_path) .static_flag(true) .shared_flag(false) @@ -868,7 +869,14 @@ impl State { .includes(&self.include_path) .include(&self.out_path) .flag("-w") // hide warnings - .flag("-march=native") + .flag("-march=native"); + // Every static inline gets a wrapper, including the TSX ones (rte_xbegin, + // rte_try_tm, ...). They fail to build on CPUs without RTM; DPDK only calls + // them after a runtime rte_rtm_supported() check, so enabling RTM is safe. + if self.machine_string.as_deref().map_or(false, |m| m.starts_with("x86_64")) { + build.flag("-mrtm"); + } + build .flag("-imacros") .flag(dpdk_config.to_str().unwrap()) .flag(&format!("-L{}", lib_path.to_str().unwrap())) From 093451cbaf6f4a8ec363e7b4d891beeba81e6b5f Mon Sep 17 00:00:00 2001 From: Md Safiyat Reza Date: Fri, 23 Oct 2026 16:06:08 +0530 Subject: [PATCH 4/8] Make Rust-incompatible packed/aligned types opaque bindgen emits packed+align reprs for __tile1024i_str and rte_avp_desc, and packed structs containing the aligned rte_ether_addr for rte_arp_ipv4/rte_arp_hdr; rustc rejects both. Make them opaque. Also skip Debug for rte_flow_item_gtp_psc, whose packed field has none. Co-Authored-By: Claude Opus 5.5 --- bindings/dpdk-sys/build.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bindings/dpdk-sys/build.rs b/bindings/dpdk-sys/build.rs index 1feeaab..ff81869 100644 --- a/bindings/dpdk-sys/build.rs +++ b/bindings/dpdk-sys/build.rs @@ -779,6 +779,14 @@ impl State { .clang_arg("-Wno-everything") .opaque_type("max_align_t") .opaque_type("rte_event.*") + // Packed + aligned, or packed containing an aligned type (rte_ether_addr): + // neither can be expressed in Rust. + .opaque_type("__tile1024i_str") + .opaque_type("rte_avp_desc") + .opaque_type("rte_arp_ipv4") + .opaque_type("rte_arp_hdr") + // Its packed rte_gtp_psc_generic_hdr field cannot derive Debug. + .no_debug("rte_flow_item_gtp_psc") .generate() .unwrap() .write_to_file(target_path) From 22fe35fca282d9d746c9e5b19019a45a1ceed8e0 Mon Sep 17 00:00:00 2001 From: Md Safiyat Reza Date: Fri, 23 Oct 2026 16:10:16 +0530 Subject: [PATCH 5/8] Port dpdk crate to DPDK 21.11+ ethdev API - Define _GNU_SOURCE for bindgen, clang and the wrapper build, so RTE_HAS_CPUSET is set and rte_lcore_cpuset/rte_thread_set_affinity are declared. - Use the RTE_ETH_* names (link status, MQ modes). - Read link_status through the new anonymous union in rte_eth_link. - Replace rxmode.max_rx_pkt_len with rxmode.mtu. - Build rss_hf from RTE_ETH_FLOW_* bits, since RTE_ETH_RSS_* are RTE_BIT64() macros bindgen cannot expand. Co-Authored-By: Claude Opus 5.5 --- bindings/dpdk-sys/build.rs | 7 +++++-- bindings/dpdk/src/eal.rs | 23 +++++++++++++++-------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/bindings/dpdk-sys/build.rs b/bindings/dpdk-sys/build.rs index ff81869..37eb670 100644 --- a/bindings/dpdk-sys/build.rs +++ b/bindings/dpdk-sys/build.rs @@ -109,7 +109,8 @@ impl State { index: &'a clang::Index, header_path: &Path, ) -> clang::TranslationUnit<'a> { - let mut argument = vec!["-march=native".into()]; + // DPDK only declares rte_cpuset_t APIs (RTE_HAS_CPUSET) under _GNU_SOURCE. + let mut argument = vec!["-march=native".into(), "-D_GNU_SOURCE".into()]; argument.extend( self.include_path .iter() @@ -776,6 +777,7 @@ impl State { .clang_arg("-imacros") .clang_arg(dpdk_config_path.to_str().unwrap()) .clang_arg("-march=native") + .clang_arg("-D_GNU_SOURCE") .clang_arg("-Wno-everything") .opaque_type("max_align_t") .opaque_type("rte_event.*") @@ -877,7 +879,8 @@ impl State { .includes(&self.include_path) .include(&self.out_path) .flag("-w") // hide warnings - .flag("-march=native"); + .flag("-march=native") + .flag("-D_GNU_SOURCE"); // Every static inline gets a wrapper, including the TSX ones (rte_xbegin, // rte_try_tm, ...). They fail to build on CPUs without RTM; DPDK only calls // them after a runtime rte_rtm_supported() check, so enabling RTM is safe. diff --git a/bindings/dpdk/src/eal.rs b/bindings/dpdk/src/eal.rs index 43226c0..999b237 100644 --- a/bindings/dpdk/src/eal.rs +++ b/bindings/dpdk/src/eal.rs @@ -337,7 +337,10 @@ impl Port { /// Returns true if link is up (connected), false if down. #[inline] pub fn is_link_up(&self) -> bool { - self.get_link().link_status() == dpdk_sys::ETH_LINK_UP as u16 + let link = self.get_link(); + // Safety: both union variants are plain integers. + let status = unsafe { link.__bindgen_anon_1.__bindgen_anon_1.link_status() }; + status == dpdk_sys::RTE_ETH_LINK_UP as u16 } } @@ -448,15 +451,19 @@ impl UninitPort { some_port_conf } else { let mut port_conf = RteEthConf::new(); - port_conf.data.rxmode.max_rx_pkt_len = dpdk_sys::RTE_ETHER_MAX_LEN; - port_conf.data.rxmode.mq_mode = dpdk_sys::rte_eth_rx_mq_mode_ETH_MQ_RX_NONE; - port_conf.data.txmode.mq_mode = dpdk_sys::rte_eth_tx_mq_mode_ETH_MQ_TX_NONE; + // DPDK 21.11 replaced max_rx_pkt_len with mtu. + port_conf.data.rxmode.mtu = dpdk_sys::RTE_ETHER_MAX_LEN + - dpdk_sys::RTE_ETHER_HDR_LEN + - dpdk_sys::RTE_ETHER_CRC_LEN; + port_conf.data.rxmode.mq_mode = dpdk_sys::rte_eth_rx_mq_mode_RTE_ETH_MQ_RX_NONE; + port_conf.data.txmode.mq_mode = dpdk_sys::rte_eth_tx_mq_mode_RTE_ETH_MQ_TX_NONE; if rx_queue_count > 1 { // Enable RSS. - port_conf.data.rxmode.mq_mode = dpdk_sys::rte_eth_rx_mq_mode_ETH_MQ_RX_RSS; - port_conf.data.rx_adv_conf.rss_conf.rss_hf = (dpdk_sys::ETH_RSS_NONFRAG_IPV4_UDP - | dpdk_sys::ETH_RSS_NONFRAG_IPV4_TCP) - .into(); + port_conf.data.rxmode.mq_mode = dpdk_sys::rte_eth_rx_mq_mode_RTE_ETH_MQ_RX_RSS; + // RTE_ETH_RSS_* are RTE_BIT64() macros, which bindgen cannot expand. + port_conf.data.rx_adv_conf.rss_conf.rss_hf = (1u64 + << dpdk_sys::RTE_ETH_FLOW_NONFRAG_IPV4_UDP) + | (1u64 << dpdk_sys::RTE_ETH_FLOW_NONFRAG_IPV4_TCP); // TODO set symmetric RSS for TCP/IP } port_conf From 6976777473cf94fb7e4e76925e5819846e4c7954 Mon Sep 17 00:00:00 2001 From: Md Safiyat Reza Date: Sun, 25 Oct 2026 05:38:32 +0530 Subject: [PATCH 6/8] Link DPDK libraries whole-archive so drivers register Signed-off-by: Md Safiyat Reza --- bindings/dpdk-sys/build.rs | 51 ++++++++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 10 deletions(-) diff --git a/bindings/dpdk-sys/build.rs b/bindings/dpdk-sys/build.rs index 37eb670..74500ce 100644 --- a/bindings/dpdk-sys/build.rs +++ b/bindings/dpdk-sys/build.rs @@ -673,10 +673,10 @@ impl State { let mut linkable_whitelist: Vec<_> = vec![ "rte_pmd_ixgbe_set_all_queues_drop_en", // ixgbe "rte_pmd_i40e_ping_vfs", // i40e - "e1000_igb_init_log", // e1000 + "igb_dev_free_queues", // e1000 "ice_release_vsi", // ice "vmxnet3_dev_tx_queue_release", // vmxnet3 - "virtio_dev_pause", // virtio + "virtio_dev_close", // virtio "softnic_thread_free", // softnic // "ipn3ke_hw_tm_init", // ipn3ke (currently not enabled) // "mlx4_fd_set_non_blocking", // mlx4 (currently not enabled) @@ -690,10 +690,10 @@ impl State { // List of non-static PMD-specific functions used to create symbolic dependencies to PMDs. let mut linkable_extern_def_list: Vec<_> = vec![ - "void e1000_igb_init_log(void)", // e1000 + "void igb_dev_free_queues(struct rte_eth_dev *dev)", // e1000 "int ice_release_vsi(struct ice_vsi *vsi)", // ice "void vmxnet3_dev_tx_queue_release(void *txq)", // vmxnet3 - "int virtio_dev_pause(struct rte_eth_dev *dev)", // virtio + "int virtio_dev_close(struct rte_eth_dev *dev)", // virtio "void softnic_thread_free(struct pmd_internals *softnic)", // softnic // "int ipn3ke_hw_tm_init(struct ipn3ke_hw *hw)", // ipn3ke (currently not enabled) // "int mlx4_fd_set_non_blocking(int fd)", // mlx4 (currently not enabled) @@ -899,7 +899,11 @@ impl State { lib_path.to_str().unwrap() ); - // Legacy mode: Rust cargo cannot recognize library groups (libdpdk.a). + // Link every DPDK library whole, as DPDK's own static pkg-config does + // for drivers: buses and PMDs register themselves from constructors in + // objects nothing references (e.g. virtio's PCI driver), so a plain + // static link drops them and EAL cannot even parse a PCI address. + // --gc-sections still removes unused code; constructors are roots. let format = Regex::new(r"lib(.*)\.(a)").unwrap(); for link in &self.dpdk_links { let lib_name = link.file_name().unwrap().to_str().unwrap(); @@ -908,18 +912,45 @@ impl State { let link_name = &capture[1]; if link_name == "dpdk" { continue; - } else if link_name == "rte_pmd_mlx5" { - // MLX5 PMD requires additional liniking of two libraries - println!("cargo:rustc-link-lib=ibverbs"); - println!("cargo:rustc-link-lib=mlx5"); } - println!("cargo:rustc-link-lib=static={}", link_name); + println!("cargo:rustc-link-lib=static:+whole-archive={}", link_name); } } + + // System libraries the whole-archived objects need (zlib, libcrypto, + // ibverbs, ...), from DPDK's own static link line when available + for lib in dpdk_system_libs() { + println!("cargo:rustc-link-lib={}", lib); + } println!("cargo:rustc-link-lib=numa"); } } +/// System (non-DPDK) libraries from `pkg-config --static --libs libdpdk` +fn dpdk_system_libs() -> Vec { + println!("cargo:rerun-if-env-changed=PKG_CONFIG_PATH"); + let output = match Command::new("pkg-config").args(["--static", "--libs", "libdpdk"]).output() { + Ok(output) if output.status.success() => output, + _ => { + println!("cargo:warning=pkg-config libdpdk unavailable; linking without DPDK's system library list"); + return vec![]; + } + }; + let mut libs: Vec = Vec::new(); + for token in String::from_utf8_lossy(&output.stdout).split_whitespace() { + if let Some(name) = token.strip_prefix("-l") { + // ":librte_*.a" entries and rte_* libraries are linked above + if name.starts_with(':') || name.starts_with("rte_") || name == "dpdk" { + continue; + } + if !libs.iter().any(|l| l == name) { + libs.push(name.to_string()); + } + } + } + libs +} + fn main() { let mut state = State::new(); let dpdk_install_path = env::var("DPDK_INSTALL_PATH").ok(); From 4842c64e26f6d03fb9d6503ebd561ccea803cb1a Mon Sep 17 00:00:00 2001 From: Md Safiyat Reza Date: Sun, 25 Oct 2026 11:32:24 +0530 Subject: [PATCH 7/8] Link only DPDK's direct system libraries, dynamically. Signed-off-by: Md Safiyat Reza --- .gitignore | 1 + bindings/dpdk-sys/build.rs | 51 ++++++++++++++++++++++++++++++++------ 2 files changed, 44 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index ea8c4bf..0592392 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /target +.DS_Store diff --git a/bindings/dpdk-sys/build.rs b/bindings/dpdk-sys/build.rs index 74500ce..6640d03 100644 --- a/bindings/dpdk-sys/build.rs +++ b/bindings/dpdk-sys/build.rs @@ -917,8 +917,8 @@ impl State { } } - // System libraries the whole-archived objects need (zlib, libcrypto, - // ibverbs, ...), from DPDK's own static link line when available + // System libraries the whole-archived objects need (libcrypto, ibverbs, + // libpcap, ...), linked dynamically for lib in dpdk_system_libs() { println!("cargo:rustc-link-lib={}", lib); } @@ -926,19 +926,54 @@ impl State { } } -/// System (non-DPDK) libraries from `pkg-config --static --libs libdpdk` +/// System libraries DPDK's static libraries call into, linked dynamically. +/// +/// `pkg-config --static --libs libdpdk` is too broad: it also pulls the +/// static-only dependencies of DPDK's dependencies (e.g. libpcap's dbus and +/// systemd, libibverbs' RDMA providers), which a dynamic link doesn't need. +/// Instead take the plain -l flags in DPDK's own .pc files, plus the dynamic +/// `--libs` of each package they require. fn dpdk_system_libs() -> Vec { println!("cargo:rerun-if-env-changed=PKG_CONFIG_PATH"); - let output = match Command::new("pkg-config").args(["--static", "--libs", "libdpdk"]).output() { - Ok(output) if output.status.success() => output, - _ => { + let pkg_config = |args: &[&str]| -> Option { + let output = Command::new("pkg-config").args(args).output().ok()?; + output.status.success().then(|| String::from_utf8_lossy(&output.stdout).into_owned()) + }; + let pc_dir = match pkg_config(&["--variable=pcfiledir", "libdpdk"]) { + Some(dir) => PathBuf::from(dir.trim()), + None => { println!("cargo:warning=pkg-config libdpdk unavailable; linking without DPDK's system library list"); return vec![]; } }; + + let mut flags: Vec = Vec::new(); + for pc in ["libdpdk.pc", "libdpdk-libs.pc"] { + let text = std::fs::read_to_string(pc_dir.join(pc)).unwrap_or_default(); + for line in text.lines() { + if let Some(libs) = line.strip_prefix("Libs.private:") { + flags.extend(libs.split_whitespace().map(String::from)); + } else if let Some(reqs) = line + .strip_prefix("Requires.private:") + .or_else(|| line.strip_prefix("Requires:")) + { + for req in reqs.split(',') { + // "libpcap >= 1.0" -> "libpcap"; DPDK's own packages are linked above + let name = match req.split_whitespace().next() { + Some(name) if !name.starts_with("libdpdk") => name, + _ => continue, + }; + if let Some(libs) = pkg_config(&["--libs", name]) { + flags.extend(libs.split_whitespace().map(String::from)); + } + } + } + } + } + let mut libs: Vec = Vec::new(); - for token in String::from_utf8_lossy(&output.stdout).split_whitespace() { - if let Some(name) = token.strip_prefix("-l") { + for flag in flags { + if let Some(name) = flag.strip_prefix("-l") { // ":librte_*.a" entries and rte_* libraries are linked above if name.starts_with(':') || name.starts_with("rte_") || name == "dpdk" { continue; From 40fe298435b041a9f6bf16d1ea829d443c6a84a7 Mon Sep 17 00:00:00 2001 From: Md Safiyat Reza Date: Mon, 26 Oct 2026 16:41:18 +0530 Subject: [PATCH 8/8] Handle ports without a NUMA node; mask RSS hash types to the device's Port::socket_id() panicked when rte_eth_dev_socket_id() returned SOCKET_ID_ANY (-1), as it does for a VF passed through to a VM. It now returns Option, and UninitPort::init places RX pools and rings on SOCKET_ID_ANY when the node is unknown. Requested RSS hash types are masked with flow_type_rss_offloads, since VFs often support fewer and rte_eth_dev_configure rejects the rest. Signed-off-by: Md Safiyat Reza --- bindings/dpdk/src/eal.rs | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/bindings/dpdk/src/eal.rs b/bindings/dpdk/src/eal.rs index 999b237..579bcd5 100644 --- a/bindings/dpdk/src/eal.rs +++ b/bindings/dpdk/src/eal.rs @@ -197,14 +197,13 @@ impl Port { self.inner.port_id } - /// Returns NUMA node of current port. + /// Returns NUMA node of current port, or `None` when DPDK doesn't know it + /// (`SOCKET_ID_ANY`, e.g. a VF passed through to a VM without NUMA info). #[inline] - pub fn socket_id(&self) -> SocketId { - SocketId::new(unsafe { - dpdk_sys::rte_eth_dev_socket_id(self.inner.port_id) - .try_into() - .unwrap() - }) + pub fn socket_id(&self) -> Option { + // Safety: foreign function. + let id = unsafe { dpdk_sys::rte_eth_dev_socket_id(self.inner.port_id) }; + u32::try_from(id).ok().map(SocketId::new) } /// Returns NUMA node of current port. @@ -464,6 +463,9 @@ impl UninitPort { port_conf.data.rx_adv_conf.rss_conf.rss_hf = (1u64 << dpdk_sys::RTE_ETH_FLOW_NONFRAG_IPV4_UDP) | (1u64 << dpdk_sys::RTE_ETH_FLOW_NONFRAG_IPV4_TCP); + // Only the hash types the device supports (many VFs hash fewer + // fields); rte_eth_dev_configure rejects anything else + port_conf.data.rx_adv_conf.rss_conf.rss_hf &= dev_info.flow_type_rss_offloads; // TODO set symmetric RSS for TCP/IP } port_conf @@ -480,6 +482,10 @@ impl UninitPort { }; assert_eq!(ret, 0); + // Rings and RX pools go on the port's socket, or any socket when it's unknown + let socket = port.socket_id(); + let ring_socket: u32 = socket.map_or(dpdk_sys::SOCKET_ID_ANY as u32, Into::into); + let rxq = (0..rx_queue_count) .map(|queue_id| { let mpool = port.inner.eal.create_mpool( @@ -487,14 +493,14 @@ impl UninitPort { DEFAULT_RX_POOL_SIZE, DEFAULT_RX_PER_CORE_CACHE, DEFAULT_PACKET_DATA_LENGTH, - Some(port.socket_id()), + socket, ); let ret = unsafe { dpdk_sys::rte_eth_rx_queue_setup( port.inner.port_id, queue_id, DEFAULT_RX_DESC, - port.socket_id().into(), + ring_socket, &dev_info.default_rxconf, mpool.inner.ptr.as_ptr(), ) @@ -516,7 +522,7 @@ impl UninitPort { port.inner.port_id, queue_id, DEFAULT_RX_DESC, - port.socket_id().into(), + ring_socket, &dev_info.default_txconf, ) };