From eec486f23090dccf6ff4f215e30ae09c3b8f9796 Mon Sep 17 00:00:00 2001 From: cl Date: Thu, 30 Jul 2026 00:10:00 +0800 Subject: [PATCH] fix(kv-offload): support LLVM 22 RDMA bindings rdma-mummy-sys 0.2.4 uses bindgen 0.66, which emits opaque ibverbs structs with LLVM 22. Require 0.2.5, whose bindgen 0.72 update restores the generated fields. Add a compile regression test for representative ibv_context and ibv_mr fields. --- Cargo.lock | 101 ++++---------------- openinfer-kv-offload/Cargo.toml | 3 + openinfer-kv-offload/tests/rdma_bindings.rs | 8 ++ 3 files changed, 30 insertions(+), 82 deletions(-) create mode 100644 openinfer-kv-offload/tests/rdma_bindings.rs diff --git a/Cargo.lock b/Cargo.lock index 01cc37556..964830185 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -151,7 +151,7 @@ dependencies = [ "futures-lite", "parking", "polling", - "rustix 1.1.4", + "rustix", "slab", "windows-sys 0.61.2", ] @@ -365,25 +365,22 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.66.1" +version = "0.72.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b84e06fc203107bfbad243f4aba2af864eb7db3b1cf46ea0a023b0b433d2a7" +checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895" dependencies = [ "bitflags 2.11.1", "cexpr", "clang-sys", - "lazy_static", - "lazycell", + "itertools 0.10.5", "log", - "peeking_take_while", "prettyplease", "proc-macro2", "quote", "regex", - "rustc-hash 1.1.0", + "rustc-hash 2.1.2", "shlex", "syn 2.0.117", - "which", ] [[package]] @@ -728,7 +725,7 @@ version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "faf9468729b8cbcea668e36183cb69d317348c2e08e994829fb56ebfdfbaac34" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -973,7 +970,7 @@ dependencies = [ "crossterm_winapi", "document-features", "parking_lot", - "rustix 1.1.4", + "rustix", "winapi", ] @@ -1419,7 +1416,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -1952,15 +1949,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "home" -version = "0.5.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc627f471c528ff0c4a49e1d5e60450c8f6461dd6d10ba9dcd3a61d3dff7728d" -dependencies = [ - "windows-sys 0.61.2", -] - [[package]] name = "hound" version = "3.5.1" @@ -2354,7 +2342,7 @@ checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" dependencies = [ "hermit-abi", "libc", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -2408,7 +2396,7 @@ dependencies = [ "portable-atomic", "portable-atomic-util", "serde_core", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -2498,12 +2486,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - [[package]] name = "leb128fmt" version = "0.1.0" @@ -2551,12 +2533,6 @@ dependencies = [ "libc", ] -[[package]] -name = "linux-raw-sys" -version = "0.4.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" - [[package]] name = "linux-raw-sys" version = "0.12.1" @@ -3290,6 +3266,7 @@ dependencies = [ "log", "openinfer-kv-cache", "pegaflow-core", + "rdma-mummy-sys", "tokio", "tokio-stream", "xxhash-rust", @@ -3671,12 +3648,6 @@ dependencies = [ "pkg-config", ] -[[package]] -name = "peeking_take_while" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" - [[package]] name = "pegaflow-common" version = "0.23.3" @@ -3864,7 +3835,7 @@ dependencies = [ "concurrent-queue", "hermit-abi", "pin-project-lite", - "rustix 1.1.4", + "rustix", "windows-sys 0.61.2", ] @@ -4358,9 +4329,9 @@ dependencies = [ [[package]] name = "rdma-mummy-sys" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f8ead4d7835190d761b9365d9e53906a226d7699007b35bdca49d7edb89a15" +checksum = "7366fa21da4b5cb28f6301888f126770e87cbf8ec6400fe4b7c5d7ee7c5faa5c" dependencies = [ "bindgen", "cmake", @@ -4636,19 +4607,6 @@ dependencies = [ "transpose", ] -[[package]] -name = "rustix" -version = "0.38.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" -dependencies = [ - "bitflags 2.11.1", - "errno", - "libc", - "linux-raw-sys 0.4.15", - "windows-sys 0.59.0", -] - [[package]] name = "rustix" version = "1.1.4" @@ -4658,8 +4616,8 @@ dependencies = [ "bitflags 2.11.1", "errno", "libc", - "linux-raw-sys 0.12.1", - "windows-sys 0.61.2", + "linux-raw-sys", + "windows-sys 0.52.0", ] [[package]] @@ -5463,8 +5421,8 @@ dependencies = [ "fastrand", "getrandom 0.4.2", "once_cell", - "rustix 1.1.4", - "windows-sys 0.61.2", + "rustix", + "windows-sys 0.52.0", ] [[package]] @@ -6744,18 +6702,6 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88" -[[package]] -name = "which" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" -dependencies = [ - "either", - "home", - "once_cell", - "rustix 0.38.44", -] - [[package]] name = "win-sys" version = "0.3.1" @@ -6798,7 +6744,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -6899,15 +6845,6 @@ dependencies = [ "windows-targets", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets", -] - [[package]] name = "windows-sys" version = "0.61.2" diff --git a/openinfer-kv-offload/Cargo.toml b/openinfer-kv-offload/Cargo.toml index 0997cd005..07134b0af 100644 --- a/openinfer-kv-offload/Cargo.toml +++ b/openinfer-kv-offload/Cargo.toml @@ -25,6 +25,9 @@ openinfer-kv-cache = { workspace = true } pegaflow-core = { git = "https://github.com/novitalabs/pegaflow.git", rev = "1473c5355d879b4fea23101760cb2a0074642ada", default-features = false, features = [ "rdma", ] } +# pegaflow accepts rdma-mummy-sys 0.2.4, whose bindgen version emits opaque +# ibverbs structs with LLVM 22. Require 0.2.5 until pegaflow raises its floor. +rdma-mummy-sys = "0.2.5" tokio = { workspace = true } tokio-stream = { workspace = true, features = ["net"] } xxhash-rust = { workspace = true } diff --git a/openinfer-kv-offload/tests/rdma_bindings.rs b/openinfer-kv-offload/tests/rdma_bindings.rs new file mode 100644 index 000000000..af204e766 --- /dev/null +++ b/openinfer-kv-offload/tests/rdma_bindings.rs @@ -0,0 +1,8 @@ +use rdma_mummy_sys::ibv_context; +use rdma_mummy_sys::ibv_mr; + +#[test] +fn generated_verbs_structs_are_not_opaque() { + assert!(std::mem::offset_of!(ibv_context, ops) < std::mem::size_of::()); + assert!(std::mem::offset_of!(ibv_mr, lkey) < std::mem::size_of::()); +}