diff --git a/.cargo/config.toml b/.cargo/config.toml index 5cafed729..33ead06f2 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,12 +1,15 @@ [env] -COMPILE_ENV = { value = "compile-env", relative = true, force = false } -PATH = { value = "compile-env/bin", relative = true, force = true } -LIBCLANG_PATH = { value = "compile-env/lib", relative = true, force = true } -PKG_CONFIG_PATH = { value = "compile-env/sysroot/x86_64-unknown-linux-gnu/release/lib/pkgconfig", relative = true, force = true } +# COMPILE_ENV = { value = "sysroot", relative = true, force = false } +# PATH = { value = "compile-env/bin", relative = true, force = true } +LIBCLANG_PATH = { value = "compile-env/lib", relative = true, force = false } +PKG_CONFIG_PATH = { value = "compile-env/sysroot/x86_64-unknown-linux-gnu/release/lib/pkgconfig", relative = true, force = false } +LIBRARY_PATH = { value = "sysroot/lib", relative = true, force = false } +C_INCLUDE_PATH = { value = "sysroot/include", relative = true, force = false } +GW_CRD_PATH = { value = "devroot/src/gateway/config/crd/bases", relative = true, force = false } [build] target = "x86_64-unknown-linux-gnu" -rustc = "compile-env/bin/rustc" +# rustc = "compile-env/bin/rustc" rustflags = ["--cfg", "tokio_unstable"] [target.x86_64-unknown-linux-gnu] diff --git a/.clangd b/.clangd new file mode 120000 index 000000000..841886296 --- /dev/null +++ b/.clangd @@ -0,0 +1 @@ +./build-tools/.clangd \ No newline at end of file diff --git a/.envrc b/.envrc.old similarity index 100% rename from .envrc rename to .envrc.old diff --git a/Cargo.lock b/Cargo.lock index 9645aa407..bdbb45476 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -229,9 +229,9 @@ checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "aws-lc-rs" -version = "1.15.1" +version = "1.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b5ce75405893cd713f9ab8e297d8e438f624dde7d706108285f7e17a25a180f" +checksum = "6a88aab2464f1f25453baa7a07c84c5b7684e274054ba06817f382357f77a288" dependencies = [ "aws-lc-sys", "zeroize", @@ -239,9 +239,9 @@ dependencies = [ [[package]] name = "aws-lc-sys" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "179c3777a8b5e70e90ea426114ffc565b2c1a9f82f6c4a0c5a34aa6ef5e781b6" +checksum = "b45afffdee1e7c9126814751f88dddc747f41d91da16c9551a0f1e8a11e788a1" dependencies = [ "cc", "cmake", @@ -251,9 +251,9 @@ dependencies = [ [[package]] name = "axum" -version = "0.8.7" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b098575ebe77cb6d14fc7f32749631a6e44edbef6b796f89b020e99ba20d425" +checksum = "8b52af3cb4058c895d37317bb27508dccc8e5f2d39454016b297bf4a400597b8" dependencies = [ "axum-core", "bytes", @@ -335,7 +335,7 @@ dependencies = [ "miniz_oxide", "object", "rustc-demangle", - "windows-link 0.2.1", + "windows-link", ] [[package]] @@ -593,9 +593,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.19.0" +version = "3.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" +checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510" [[package]] name = "bytecheck" @@ -677,9 +677,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.49" +version = "1.2.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90583009037521a116abf44494efecd645ba48b6622457080f080b85544e2215" +checksum = "9f50d563227a1c37cc0a263f64eca3334388c01c5e4c4861a9def205c614383c" dependencies = [ "find-msvc-tools", "jobserver", @@ -719,7 +719,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-link 0.2.1", + "windows-link", ] [[package]] @@ -805,9 +805,9 @@ dependencies = [ [[package]] name = "cmake" -version = "0.1.56" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b042e5d8a74ae91bb0961acd039822472ec99f8ab0948cbf6d1369588f8be586" +checksum = "75443c44cd6b379beb8c5b45d85d0773baf31cce901fe7bb252f4eff3008ef7d" dependencies = [ "cc", ] @@ -1332,9 +1332,7 @@ dependencies = [ "dataplane-id", "dataplane-sysfs", "dataplane-test-utils", - "fixin", "hwlocality", - "n-vm", "num-derive", "num-traits", "pci-ids", @@ -1405,7 +1403,6 @@ dependencies = [ "dataplane-lpm", "dataplane-net", "dataplane-tracectl", - "dotenvy", "futures", "k8s-openapi", "kube", @@ -1418,7 +1415,6 @@ dependencies = [ "thiserror 2.0.17", "tokio", "tracing", - "ureq", ] [[package]] @@ -1653,7 +1649,6 @@ version = "0.7.0" dependencies = [ "dataplane-dpdk-sysroot-helper", "dataplane-id", - "n-vm", "nix 0.30.1", "procfs", "strum", @@ -1886,12 +1881,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "dotenvy" -version = "0.15.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" - [[package]] name = "downcast-rs" version = "2.0.2" @@ -2103,16 +2092,6 @@ dependencies = [ "syn 2.0.111", ] -[[package]] -name = "flate2" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfe33edd8e85a12a67454e37f8c75e730830d83e313556ab9ebf9ee7fbeb3bfb" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - [[package]] name = "fnv" version = "1.0.7" @@ -2142,9 +2121,9 @@ dependencies = [ [[package]] name = "fs-err" -version = "3.2.0" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62d91fd049c123429b018c47887d3f75a265540dd3c30ba9cb7bae9197edb03a" +checksum = "824f08d01d0f496b3eca4f001a13cf17690a6ee930043d20817f547455fd98f8" dependencies = [ "autocfg", "tokio", @@ -2302,21 +2281,22 @@ dependencies = [ "libc 0.2.178", "log", "rustversion", - "windows 0.48.0", + "windows", ] [[package]] name = "generator" -version = "0.8.7" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "605183a538e3e2a9c1038635cc5c2d194e2ee8fd0d1b66b8349fad7dbacce5a2" +checksum = "52f04ae4152da20c76fe800fa48659201d5cf627c5149ca0b707b69d7eef6cf9" dependencies = [ "cc", "cfg-if", "libc 0.2.178", "log", "rustversion", - "windows 0.61.3", + "windows-link", + "windows-result", ] [[package]] @@ -2462,7 +2442,7 @@ checksum = "617aaa3557aef3810a6369d0a99fac8a080891b68bd9f9812a1eeda0c0730cbd" dependencies = [ "cfg-if", "libc 0.2.178", - "windows-link 0.2.1", + "windows-link", ] [[package]] @@ -2669,7 +2649,7 @@ dependencies = [ "js-sys", "log", "wasm-bindgen", - "windows-core 0.62.2", + "windows-core", ] [[package]] @@ -2887,9 +2867,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" +checksum = "7ee5b5339afb4c41626dde77b7a611bd4f2c202b897852b4bcf5d03eddc61010" [[package]] name = "jobserver" @@ -3133,14 +3113,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" dependencies = [ "cfg-if", - "windows-link 0.2.1", + "windows-link", ] [[package]] name = "libredox" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "416f7e718bdb06000964960ffa43b4335ad4012ae8b99060261aa4a8088d5ccb" +checksum = "df15f6eac291ed1cf25865b1ee60399f57e7c227e7f51bdbd4c5270396a9ed50" dependencies = [ "bitflags 2.10.0", "libc 0.2.178", @@ -3222,7 +3202,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "419e0dc8046cb947daa77eb95ae174acfbddb7673b4151f56d1eed8e93fbfaca" dependencies = [ "cfg-if", - "generator 0.8.7", + "generator 0.8.8", "scoped-tls", "tracing", "tracing-subscriber", @@ -3381,7 +3361,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" dependencies = [ "adler2", - "simd-adler32", ] [[package]] @@ -3782,7 +3761,7 @@ dependencies = [ "libc 0.2.178", "redox_syscall", "smallvec", - "windows-link 0.2.1", + "windows-link", ] [[package]] @@ -3947,9 +3926,9 @@ checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "portable-atomic" -version = "1.11.1" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" +checksum = "f59e70c4aef1e55797c2e8fd94a4f2a973fc972cfde0e0b05f683667b0cd39dd" [[package]] name = "potential_utf" @@ -4321,9 +4300,9 @@ dependencies = [ [[package]] name = "rapidhash" -version = "4.1.1" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8e65c75143ce5d47c55b510297eeb1182f3c739b6043c537670e9fc18612dae" +checksum = "2988730ee014541157f48ce4dcc603940e00915edc3c7f9a8d78092256bb2493" dependencies = [ "rustversion", ] @@ -4437,9 +4416,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.12.25" +version = "0.12.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eff9328d40131d43bd911d42d79eb6a47312002a4daefc9e37f17e74a7701a" +checksum = "3b4c14b2d9afca6a60277086b0cc6a6ae0b568f6f7916c943a8cdc79f8be240f" dependencies = [ "base64 0.22.1", "bytes", @@ -4521,9 +4500,9 @@ checksum = "3582f63211428f83597b51b2ddb88e2a91a9d52d12831f9d08f5e624e8977422" [[package]] name = "roaring" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f08d6a905edb32d74a5d5737a0c9d7e950c312f3c46cb0ca0a2ca09ea11878a0" +checksum = "8ba9ce64a8f45d7fc86358410bb1a82e8c987504c0d4900e9141d69a9f26c885" [[package]] name = "rtnetlink" @@ -4585,7 +4564,6 @@ dependencies = [ "aws-lc-rs", "log", "once_cell", - "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -4615,9 +4593,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "708c0f9d5f54ba0272468c1d306a52c495b31fa155e91bc25371e6df7996908c" +checksum = "21e6f2ab2928ca4291b86736a8bd920a277a399bba1589409d72154ff87c1282" dependencies = [ "zeroize", ] @@ -4663,9 +4641,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" +checksum = "62049b2877bf12821e8f9ad256ee38fdc31db7387ec2d3b3f403024de2034aea" [[package]] name = "safemem" @@ -4999,7 +4977,7 @@ dependencies = [ "assoc", "bitvec", "cfg-if", - "generator 0.8.7", + "generator 0.8.8", "hex", "owo-colors 3.5.0", "rand 0.8.5", @@ -5019,12 +4997,6 @@ dependencies = [ "libc 0.2.178", ] -[[package]] -name = "simd-adler32" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" - [[package]] name = "simdutf8" version = "0.1.5" @@ -5164,9 +5136,9 @@ dependencies = [ [[package]] name = "supports-hyperlinks" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "804f44ed3c63152de6a9f90acbea1a110441de43006ea51bcce8f436196a288b" +checksum = "e396b6523b11ccb83120b115a0b7366de372751aa6edf19844dfb13a6af97e91" [[package]] name = "supports-unicode" @@ -5661,9 +5633,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.43" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d15d90a0b5c19378952d479dc858407149d7bb45a14de0142f6c534b16fc647" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" dependencies = [ "log", "pin-project-lite", @@ -5684,9 +5656,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.35" +version = "0.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a04e24fab5c89c6a36eb8558c9656f30d81de51dfa4d3b45f26b21d61fa0a6c" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" dependencies = [ "once_cell", "valuable", @@ -5832,35 +5804,6 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" -[[package]] -name = "ureq" -version = "3.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d39cb1dbab692d82a977c0392ffac19e188bd9186a9f32806f0aaa859d75585a" -dependencies = [ - "base64 0.22.1", - "flate2", - "log", - "percent-encoding", - "rustls", - "rustls-pki-types", - "ureq-proto", - "utf-8", - "webpki-roots", -] - -[[package]] -name = "ureq-proto" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d81f9efa9df032be5934a46a068815a10a042b494b6a58cb0a1a97bb5467ed6f" -dependencies = [ - "base64 0.22.1", - "http 1.4.0", - "httparse", - "log", -] - [[package]] name = "url" version = "2.5.7" @@ -5873,12 +5816,6 @@ dependencies = [ "serde", ] -[[package]] -name = "utf-8" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" - [[package]] name = "utf8_iter" version = "1.0.4" @@ -6045,15 +5982,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki-roots" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2878ef029c47c6e8cf779119f20fcf52bde7ad42a731b2a304bc221df17571e" -dependencies = [ - "rustls-pki-types", -] - [[package]] name = "winapi" version = "0.3.9" @@ -6085,41 +6013,6 @@ dependencies = [ "windows-targets 0.48.5", ] -[[package]] -name = "windows" -version = "0.61.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" -dependencies = [ - "windows-collections", - "windows-core 0.61.2", - "windows-future", - "windows-link 0.1.3", - "windows-numerics", -] - -[[package]] -name = "windows-collections" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" -dependencies = [ - "windows-core 0.61.2", -] - -[[package]] -name = "windows-core" -version = "0.61.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" -dependencies = [ - "windows-implement", - "windows-interface", - "windows-link 0.1.3", - "windows-result 0.3.4", - "windows-strings 0.4.2", -] - [[package]] name = "windows-core" version = "0.62.2" @@ -6128,20 +6021,9 @@ checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" dependencies = [ "windows-implement", "windows-interface", - "windows-link 0.2.1", - "windows-result 0.4.1", - "windows-strings 0.5.1", -] - -[[package]] -name = "windows-future" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" -dependencies = [ - "windows-core 0.61.2", - "windows-link 0.1.3", - "windows-threading", + "windows-link", + "windows-result", + "windows-strings", ] [[package]] @@ -6166,53 +6048,19 @@ dependencies = [ "syn 2.0.111", ] -[[package]] -name = "windows-link" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" - [[package]] name = "windows-link" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" -[[package]] -name = "windows-numerics" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" -dependencies = [ - "windows-core 0.61.2", - "windows-link 0.1.3", -] - -[[package]] -name = "windows-result" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" -dependencies = [ - "windows-link 0.1.3", -] - [[package]] name = "windows-result" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" dependencies = [ - "windows-link 0.2.1", -] - -[[package]] -name = "windows-strings" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" -dependencies = [ - "windows-link 0.1.3", + "windows-link", ] [[package]] @@ -6221,7 +6069,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" dependencies = [ - "windows-link 0.2.1", + "windows-link", ] [[package]] @@ -6257,7 +6105,7 @@ version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" dependencies = [ - "windows-link 0.2.1", + "windows-link", ] [[package]] @@ -6297,7 +6145,7 @@ version = "0.53.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" dependencies = [ - "windows-link 0.2.1", + "windows-link", "windows_aarch64_gnullvm 0.53.1", "windows_aarch64_msvc 0.53.1", "windows_i686_gnu 0.53.1", @@ -6308,15 +6156,6 @@ dependencies = [ "windows_x86_64_msvc 0.53.1", ] -[[package]] -name = "windows-threading" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6" -dependencies = [ - "windows-link 0.1.3", -] - [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" diff --git a/Cargo.toml b/Cargo.toml index df7f24b85..387171704 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -133,7 +133,7 @@ metrics-exporter-prometheus = { version = "0.18.1", default-features = false, fe miette = { version = "7.6.0", default-features = false, features = [] } mio = { version = "1.1.1", default-features = false, features = [] } multi_index_map = { version = "0.15.0", default-features = false, features = [] } -n-vm = { git = "https://github.com/githedgehog/testn.git", tag = "v0.0.9", default-features = false, features = [], package = "n-vm" } +n-vm = { git = "https://github.com/githedgehog/testn.git", tag = "v0.0.9", default-features = false, features = [] } netdev = { version = "0.39.0", default-features = false, features = [] } nix = { version = "0.30.1", default-features = false, features = [] } num-derive = { version = "0.4.2", default-features = false, features = [] } diff --git a/cli/build.rs b/cli/build.rs index 52f5b0197..1c30f3c66 100644 --- a/cli/build.rs +++ b/cli/build.rs @@ -2,7 +2,7 @@ // Copyright Open Network Fabric Authors fn main() { - let sysroot = dpdk_sysroot_helper::get_sysroot(); - println!("cargo:rustc-link-search=all={sysroot}/lib"); - println!("cargo:rustc-link-arg=--sysroot={sysroot}"); + // let sysroot = dpdk_sysroot_helper::get_sysroot(); + // println!("cargo:rustc-link-search=all={sysroot}/lib"); + // println!("cargo:rustc-link-arg=--sysroot={sysroot}"); } diff --git a/dataplane/build.rs b/dataplane/build.rs index 52f5b0197..1c30f3c66 100644 --- a/dataplane/build.rs +++ b/dataplane/build.rs @@ -2,7 +2,7 @@ // Copyright Open Network Fabric Authors fn main() { - let sysroot = dpdk_sysroot_helper::get_sysroot(); - println!("cargo:rustc-link-search=all={sysroot}/lib"); - println!("cargo:rustc-link-arg=--sysroot={sysroot}"); + // let sysroot = dpdk_sysroot_helper::get_sysroot(); + // println!("cargo:rustc-link-search=all={sysroot}/lib"); + // println!("cargo:rustc-link-arg=--sysroot={sysroot}"); } diff --git a/default.nix b/default.nix index 776d58bcf..7e15c105b 100644 --- a/default.nix +++ b/default.nix @@ -1,28 +1,266 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright Open Network Fabric Authors +{ + platform ? "x86-64-v3", + libc ? "gnu", + prof ? "debug", + instrumentation ? "none", + sanitize ? "", +}: let + lib = (import sources.nixpkgs { }).lib; + # helper method to work around nix's contrived builtin string split function. + split-str = + split: str: + if str == "" then [ ] else builtins.filter (elm: builtins.isString elm) (builtins.split split str); + sanitizers = split-str ",+" sanitize; sources = import ./npins; - profiles = import ./profiles.nix; - overlays.debug = import ./nix/overlays { - inherit sources; - env = profiles.debug; + platform' = import ./nix/platforms.nix { + inherit lib platform libc; + }; + profile = import ./nix/profiles.nix { + inherit prof sanitizers instrumentation; + arch = platform'.arch; }; - overlays.release = import ./nix/overlays { - inherit sources; - env = profiles.release; + overlays = import ./nix/overlays { + inherit + sources + sanitizers + profile + ; + platform = platform'; }; - pkgs.debug = import sources.nixpkgs { + dataplane-dev-pkgs = import sources.nixpkgs { overlays = [ - overlays.debug.dataplane + overlays.llvm + overlays.dataplane-dev ]; }; - pkgs.release = import sources.nixpkgs { - overlays = [ - overlays.release.dataplane + dataplane-pkgs = + (import sources.nixpkgs { + overlays = [ + overlays.llvm + overlays.dataplane + ]; + }).pkgsCross.${platform'.info.nixarch}; + sysroot = dataplane-pkgs.symlinkJoin { + name = "sysroot"; + paths = with dataplane-pkgs; [ + stdenv'.cc.libc.dev + stdenv'.cc.libc.out + libmd.dev + libmd.static + libbsd.dev + libbsd.static + libnl.dev + libnl.static + numactl.dev + numactl.static + rdma-core.dev + rdma-core.static + dpdk.dev + dpdk.static + dpdk-wrapper.dev + dpdk-wrapper.out + hwloc + ]; + }; + clangd-config = dataplane-pkgs.writeTextFile { + name = ".clangd"; + text = '' + CompileFlags: + Add: + - "-I${sysroot}/include" + - "-I${dataplane-pkgs.dpdk.dev}/include" + - "-Wno-deprecated-declarations" + ''; + executable = false; + destination = "/.clangd"; + }; + crane-base = import sources.crane { }; + crane = crane-base.craneLib.overrideToolchain dataplane-dev-pkgs.rust-toolchain; + dev-tools = dataplane-pkgs.symlinkJoin { + name = "dataplane-dev-shell"; + paths = [ + clangd-config + ] + ++ (with dataplane-pkgs.pkgsBuildHost.llvmPackages; [ + bintools + clang + libclang.lib + lld + ]) + ++ (with dataplane-dev-pkgs; [ + bash + cargo-bolero + cargo-deny + cargo-depgraph + cargo-llvm-cov + cargo-nextest + direnv + gateway-crd + just + npins + ]); + }; + dataplane-src = crane.cleanCargoSource ./.; + + # Common arguments can be set here to avoid repeating them later + commonArgs = { + src = dataplane-src; + strictDeps = true; + CARGO_PROFILE = "dev"; + + nativeBuildInputs = [ + dataplane-pkgs.pkg-config + # dataplane-pkgs.libclang.lib + ]; + buildInputs = [ + dataplane-pkgs.hwloc ]; + + env = { + LIBCLANG_PATH = "${dataplane-pkgs.llvmPackages.libclang.lib}/lib"; + C_INCLUDE_PATH = "${sysroot}/include"; + LIBRARY_PATH = "${sysroot}/lib"; + PKG_CONFIG_PATH = "${sysroot}/lib/pkgconfig"; + GW_CRD_PATH = "${dataplane-dev-pkgs.gateway-crd}/src/gateway/config/crd/bases"; + }; + + # Additional environment variables can be set directly + # MY_CUSTOM_VAR = "some value"; + }; + # Build *just* the cargo dependencies (of the entire workspace), + # so we can reuse all of that work (e.g. via cachix) when running in CI + # It is *highly* recommended to use something like cargo-hakari to avoid + # cache misses when building individual top-level-crates + cargoArtifacts = crane.buildDepsOnly commonArgs; + individualCrateArgs = commonArgs // { + inherit cargoArtifacts; + inherit (crane.crateNameFromCargoToml { src = dataplane-src; }) version; + # NB: we disable tests since we'll run them all via cargo-nextest + doCheck = false; }; + fileSetForCrate = + crate: + lib.fileset.toSource { + root = ./.; + fileset = lib.fileset.unions [ + ./. + ]; + }; + rekon = crane.buildPackage ( + individualCrateArgs + // { + pname = "dataplane-rekon"; + cargoExtraArgs = "--package dataplane-rekon"; + src = fileSetForCrate ./rekon; + } + ); + net = crane.buildPackage ( + individualCrateArgs + // { + pname = "dataplane-net"; + cargoExtraArgs = "--package dataplane-net"; + src = fileSetForCrate ./net; + } + ); + cli = crane.buildPackage ( + individualCrateArgs + // { + pname = "dataplane-cli"; + cargoExtraArgs = "--package dataplane-cli"; + src = fileSetForCrate ./cli; + } + ); + dataplane-dpdk-sysroot-helper = crane.buildPackage ( + individualCrateArgs + // { + pname = "dataplane-dpdk-sysroot-helper"; + cargoExtraArgs = "--package dataplane-dpdk-sysroot-helper"; + src = fileSetForCrate ./dpdk-sysroot-helper; + } + ); + dpdk-sys = crane.buildPackage ( + individualCrateArgs + // { + pname = "dataplane-dpdk-sys"; + cargoExtraArgs = "--package dataplane-dpdk-sys"; + src = fileSetForCrate ./dpdk-sys; + nativeBuildInputs = [ + dataplane-pkgs.pkg-config + dataplane-pkgs.llvmPackages.libclang.lib + dataplane-pkgs.llvmPackages.clang + dataplane-pkgs.llvmPackages.lld + ]; + buildInputs = [ + sysroot + ]; + } + ); + pdpdk = crane.buildPackage ( + individualCrateArgs + // { + pname = "dataplane-dpdk"; + cargoExtraArgs = "--package dataplane-dpdk"; + src = fileSetForCrate ./dpdk; + nativeBuildInputs = [ + dataplane-pkgs.pkg-config + dataplane-pkgs.llvmPackages.libclang.lib + dataplane-pkgs.llvmPackages.clang + dataplane-pkgs.llvmPackages.lld + ]; + buildInputs = [ + sysroot + ]; + } + ); + dataplane = crane.buildPackage ( + individualCrateArgs + // { + pname = "dataplane"; + cargoExtraArgs = "--package dataplane"; + src = fileSetForCrate ./dataplane; + nativeBuildInputs = [ + dataplane-pkgs.pkg-config + dataplane-pkgs.llvmPackages.libclang.lib + dataplane-pkgs.llvmPackages.clang + dataplane-pkgs.llvmPackages.lld + dataplane-dev-pkgs.kopium + ]; + buildInputs = [ + sysroot + ]; + } + ); + in { + inherit + dataplane-dev-pkgs + dataplane-pkgs + dev-tools + profile + sources + sysroot + crane + commonArgs + cargoArtifacts + rekon + net + cli + dataplane-dpdk-sysroot-helper + dpdk-sys + pdpdk + dataplane + ; + platform = platform'; + x = builtins.attrNames crane; + y = { + lib = { + x = (builtins.attrNames crane.craneLib); + }; + }; + # y = crane.buildPackage -}: -{ - inherit sources pkgs; } diff --git a/dpdk-sys/build.rs b/dpdk-sys/build.rs index 556af520a..8afec9363 100644 --- a/dpdk-sys/build.rs +++ b/dpdk-sys/build.rs @@ -20,11 +20,11 @@ impl ParseCallbacks for Cb { } } -fn bind(path: &Path, sysroot: &str) { +fn bind(path: &Path) { let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); let static_fn_path = out_path.join("generated.h"); bindgen::Builder::default() - .header(format!("{sysroot}/include/dpdk_wrapper.h")) + .header(format!("./dpdk_wrapper.h")) .anon_fields_prefix("annon") .use_core() .generate_comments(true) @@ -56,7 +56,7 @@ fn bind(path: &Path, sysroot: &str) { .opaque_type("rte_arp_ipv4") .opaque_type("rte_gtp_psc_generic_hdr") .opaque_type("rte_l2tpv2_combined_msg_hdr") - .clang_arg(format!("-I{sysroot}/include")) + // .clang_arg(format!("-I{sysroot}/include")) .clang_arg("-fretain-comments-from-system-headers") .clang_arg("-fparse-all-comments") .rust_edition(bindgen::RustEdition::Edition2024) @@ -69,14 +69,13 @@ fn bind(path: &Path, sysroot: &str) { fn main() { let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); - let sysroot = dpdk_sysroot_helper::get_sysroot(); + let library_path = env::var("LIBRARY_PATH").unwrap().to_string(); + // let sysroot = dpdk_sysroot_helper::get_sysroot(); - println!("cargo:rustc-link-arg=--sysroot={sysroot}"); - println!("cargo:rustc-link-search=all={sysroot}/lib"); + // println!("cargo:rustc-link-arg=--sysroot={sysroot}"); + // println!("cargo:rustc-link-search=all={sysroot}/lib"); + println!("cargo:rustc-link-search=all={library_path}"); - // NOTE: DPDK absolutely requires whole-archive in the linking command. - // While I find this very questionable, it is what it is. - // It is just more work for the LTO later on I suppose ¯\_(ツ)_/¯ let depends = [ "dpdk_wrapper", "rte_net_virtio", @@ -100,6 +99,7 @@ fn main() { "rte_rcu", "rte_ring", "rte_eal", + "rte_argparse", "rte_kvargs", "rte_telemetry", "rte_log", @@ -126,6 +126,9 @@ fn main() { "numa", ]; + // NOTE: DPDK absolutely requires whole-archive in the linking command. + // While I find this very questionable, it is what it is. + // It is just more work for the LTO later on I suppose ¯\_(ツ)_/¯ for dep in &depends { println!("cargo:rustc-link-lib=static:+whole-archive,+bundle={dep}"); } @@ -133,5 +136,5 @@ fn main() { for file in &rerun_if_changed { println!("cargo:rerun-if-changed={file}"); } - bind(&out_path, sysroot.as_str()); + bind(&out_path); } diff --git a/dpdk-sys/dpdk_wrapper.h b/dpdk-sys/dpdk_wrapper.h new file mode 100644 index 000000000..3ebfe21e7 --- /dev/null +++ b/dpdk-sys/dpdk_wrapper.h @@ -0,0 +1,1034 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright Open Network Fabric Authors + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +// #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Things which are either duplicated, totally inapplicable or not needed +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include // this is an internal header +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include + +// #include +// #include +// #include +// #include + +/** + * Thin wrapper to expose `rte_errno`. + * + * @return + * The last rte_errno value (thread local value). + */ +int rte_errno_get(); + +/** + * TX offloads to be set in [`rte_eth_tx_mode.offloads`]. + * + * This is a bitfield. Union these to enable multiple offloads. + * + * I wrapped these because the enum must be explicitly typed as 64 bit, but + * DPDK is not yet using the C23 standard (which would allow the inheritance + * notation with `uint64_t` seen here.). + */ +enum rte_eth_tx_offload : uint64_t { + TX_OFFLOAD_VLAN_INSERT = RTE_ETH_TX_OFFLOAD_VLAN_INSERT, + TX_OFFLOAD_IPV4_CKSUM = RTE_ETH_TX_OFFLOAD_IPV4_CKSUM, + TX_OFFLOAD_UDP_CKSUM = RTE_ETH_TX_OFFLOAD_UDP_CKSUM, + TX_OFFLOAD_TCP_CKSUM = RTE_ETH_TX_OFFLOAD_TCP_CKSUM, + TX_OFFLOAD_SCTP_CKSUM = RTE_ETH_TX_OFFLOAD_SCTP_CKSUM, + TX_OFFLOAD_TCP_TSO = RTE_ETH_TX_OFFLOAD_TCP_TSO, + TX_OFFLOAD_UDP_TSO = RTE_ETH_TX_OFFLOAD_UDP_TSO, + TX_OFFLOAD_OUTER_IPV4_CKSUM = RTE_ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM, + TX_OFFLOAD_QINQ_INSERT = RTE_ETH_TX_OFFLOAD_QINQ_INSERT, + TX_OFFLOAD_VXLAN_TNL_TSO = RTE_ETH_TX_OFFLOAD_VXLAN_TNL_TSO, + TX_OFFLOAD_GRE_TNL_TSO = RTE_ETH_TX_OFFLOAD_GRE_TNL_TSO, + TX_OFFLOAD_IPIP_TNL_TSO = RTE_ETH_TX_OFFLOAD_IPIP_TNL_TSO, + TX_OFFLOAD_GENEVE_TNL_TSO = RTE_ETH_TX_OFFLOAD_GENEVE_TNL_TSO, + TX_OFFLOAD_MACSEC_INSERT = RTE_ETH_TX_OFFLOAD_MACSEC_INSERT, + TX_OFFLOAD_MT_LOCKFREE = RTE_ETH_TX_OFFLOAD_MT_LOCKFREE, + TX_OFFLOAD_MULTI_SEGS = RTE_ETH_TX_OFFLOAD_MULTI_SEGS, + TX_OFFLOAD_MBUF_FAST_FREE = RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE, + TX_OFFLOAD_SECURITY = RTE_ETH_TX_OFFLOAD_SECURITY, + TX_OFFLOAD_UDP_TNL_TSO = RTE_ETH_TX_OFFLOAD_UDP_TNL_TSO, + TX_OFFLOAD_IP_TNL_TSO = RTE_ETH_TX_OFFLOAD_IP_TNL_TSO, + TX_OFFLOAD_OUTER_UDP_CKSUM = RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM, + TX_OFFLOAD_SEND_ON_TIMESTAMP = RTE_ETH_TX_OFFLOAD_SEND_ON_TIMESTAMP +}; + +/** + * RX offloads to be set in [`rte_eth_rx_mode.offloads`]. + * + * This is a bitfield. Union these to enable multiple offloads. + * + * I wrapped these because the enum must be explicitly typed as 64 bit, but + * DPDK is not yet using the C23 standard (which would allow the inheritance + * notation with `uint64_t` seen here.). + */ +enum rte_eth_rx_offload : uint64_t { + RX_OFFLOAD_VLAN_STRIP = RTE_ETH_RX_OFFLOAD_VLAN_STRIP, + RX_OFFLOAD_IPV4_CKSUM = RTE_ETH_RX_OFFLOAD_IPV4_CKSUM, + RX_OFFLOAD_UDP_CKSUM = RTE_ETH_RX_OFFLOAD_UDP_CKSUM, + RX_OFFLOAD_TCP_CKSUM = RTE_ETH_RX_OFFLOAD_TCP_CKSUM, + RX_OFFLOAD_TCP_LRO = RTE_ETH_RX_OFFLOAD_TCP_LRO, + RX_OFFLOAD_QINQ_STRIP = RTE_ETH_RX_OFFLOAD_QINQ_STRIP, + RX_OFFLOAD_OUTER_IPV4_CKSUM = RTE_ETH_RX_OFFLOAD_OUTER_IPV4_CKSUM, + RX_OFFLOAD_MACSEC_STRIP = RTE_ETH_RX_OFFLOAD_MACSEC_STRIP, + RX_OFFLOAD_VLAN_FILTER = RTE_ETH_RX_OFFLOAD_VLAN_FILTER, + RX_OFFLOAD_VLAN_EXTEND = RTE_ETH_RX_OFFLOAD_VLAN_EXTEND, + RX_OFFLOAD_SCATTER = RTE_ETH_RX_OFFLOAD_SCATTER, + RX_OFFLOAD_TIMESTAMP = RTE_ETH_RX_OFFLOAD_TIMESTAMP, + RX_OFFLOAD_SECURITY = RTE_ETH_RX_OFFLOAD_SECURITY, + RX_OFFLOAD_KEEP_CRC = RTE_ETH_RX_OFFLOAD_KEEP_CRC, + RX_OFFLOAD_SCTP_CKSUM = RTE_ETH_RX_OFFLOAD_SCTP_CKSUM, + RX_OFFLOAD_OUTER_UDP_CKSUM = RTE_ETH_RX_OFFLOAD_OUTER_UDP_CKSUM, + RX_OFFLOAD_RSS_HASH = RTE_ETH_RX_OFFLOAD_RSS_HASH, + RX_OFFLOAD_BUFFER_SPLIT = RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT, +}; + +int rte_errno_get(); + +// Static wrappers + +void rte_atomic_thread_fence_w(rte_memory_order memorder); +int rte_atomic16_cmpset_w(uint16_t *dst, uint16_t exp, uint16_t src); +uint16_t rte_atomic16_exchange_w(uint16_t *dst, uint16_t val); +void rte_atomic16_init_w(rte_atomic16_t *v); +int16_t rte_atomic16_read_w(const rte_atomic16_t *v); +void rte_atomic16_set_w(rte_atomic16_t *v, int16_t new_value); +void rte_atomic16_add_w(rte_atomic16_t *v, int16_t inc); +void rte_atomic16_sub_w(rte_atomic16_t *v, int16_t dec); +void rte_atomic16_inc_w(rte_atomic16_t *v); +void rte_atomic16_dec_w(rte_atomic16_t *v); +int16_t rte_atomic16_add_return_w(rte_atomic16_t *v, int16_t inc); +int16_t rte_atomic16_sub_return_w(rte_atomic16_t *v, int16_t dec); +int rte_atomic16_inc_and_test_w(rte_atomic16_t *v); +int rte_atomic16_dec_and_test_w(rte_atomic16_t *v); +int rte_atomic16_test_and_set_w(rte_atomic16_t *v); +void rte_atomic16_clear_w(rte_atomic16_t *v); +int rte_atomic32_cmpset_w(uint32_t *dst, uint32_t exp, uint32_t src); +uint32_t rte_atomic32_exchange_w(uint32_t *dst, uint32_t val); +void rte_atomic32_init_w(rte_atomic32_t *v); +int32_t rte_atomic32_read_w(const rte_atomic32_t *v); +void rte_atomic32_set_w(rte_atomic32_t *v, int32_t new_value); +void rte_atomic32_add_w(rte_atomic32_t *v, int32_t inc); +void rte_atomic32_sub_w(rte_atomic32_t *v, int32_t dec); +void rte_atomic32_inc_w(rte_atomic32_t *v); +void rte_atomic32_dec_w(rte_atomic32_t *v); +int32_t rte_atomic32_add_return_w(rte_atomic32_t *v, int32_t inc); +int32_t rte_atomic32_sub_return_w(rte_atomic32_t *v, int32_t dec); +int rte_atomic32_inc_and_test_w(rte_atomic32_t *v); +int rte_atomic32_dec_and_test_w(rte_atomic32_t *v); +int rte_atomic32_test_and_set_w(rte_atomic32_t *v); +void rte_atomic32_clear_w(rte_atomic32_t *v); +int rte_atomic64_cmpset_w(uint64_t *dst, uint64_t exp, uint64_t src); +uint64_t rte_atomic64_exchange_w(uint64_t *dst, uint64_t val); +void rte_atomic64_init_w(rte_atomic64_t *v); +int64_t rte_atomic64_read_w(rte_atomic64_t *v); +void rte_atomic64_set_w(rte_atomic64_t *v, int64_t new_value); +void rte_atomic64_add_w(rte_atomic64_t *v, int64_t inc); +void rte_atomic64_sub_w(rte_atomic64_t *v, int64_t dec); +void rte_atomic64_inc_w(rte_atomic64_t *v); +void rte_atomic64_dec_w(rte_atomic64_t *v); +int64_t rte_atomic64_add_return_w(rte_atomic64_t *v, int64_t inc); +int64_t rte_atomic64_sub_return_w(rte_atomic64_t *v, int64_t dec); +int rte_atomic64_inc_and_test_w(rte_atomic64_t *v); +int rte_atomic64_dec_and_test_w(rte_atomic64_t *v); +int rte_atomic64_test_and_set_w(rte_atomic64_t *v); +void rte_atomic64_clear_w(rte_atomic64_t *v); +void rte_smp_mb_w(void); +uint64_t rte_get_tsc_cycles_w(void); +uint64_t rte_get_timer_cycles_w(void); +uint64_t rte_get_timer_hz_w(void); +void rte_delay_ms_w(unsigned int ms); +uint64_t rte_rdtsc_w(void); +uint64_t rte_rdtsc_precise_w(void); +size_t rte_strlcpy_w(char *dst, const char *src, size_t size); +size_t rte_strlcat_w(char *dst, const char *src, size_t size); +const char *rte_str_skip_leading_spaces_w(const char *src); +void rte_uuid_copy_w(rte_uuid_t dst, const rte_uuid_t src); +int rte_gettid_w(void); +unsigned int rte_lcore_id_w(void); +void rte_pause_w(void); +void rte_wait_until_equal_16_w(uint16_t *addr, uint16_t expected, + rte_memory_order memorder); +void rte_wait_until_equal_32_w(uint32_t *addr, uint32_t expected, + rte_memory_order memorder); +void rte_wait_until_equal_64_w(uint64_t *addr, uint64_t expected, + rte_memory_order memorder); +void rte_spinlock_init_w(rte_spinlock_t *sl); +void rte_spinlock_lock_w(rte_spinlock_t *sl); +void rte_spinlock_unlock_w(rte_spinlock_t *sl); +int rte_spinlock_trylock_w(rte_spinlock_t *sl); +int rte_spinlock_is_locked_w(rte_spinlock_t *sl); +int rte_tm_supported_w(void); +void rte_spinlock_lock_tm_w(rte_spinlock_t *sl); +void rte_spinlock_unlock_tm_w(rte_spinlock_t *sl); +int rte_spinlock_trylock_tm_w(rte_spinlock_t *sl); +void rte_spinlock_recursive_init_w(rte_spinlock_recursive_t *slr); +void rte_spinlock_recursive_lock_w(rte_spinlock_recursive_t *slr); +void rte_spinlock_recursive_unlock_w(rte_spinlock_recursive_t *slr); +int rte_spinlock_recursive_trylock_w(rte_spinlock_recursive_t *slr); +void rte_spinlock_recursive_lock_tm_w(rte_spinlock_recursive_t *slr); +void rte_spinlock_recursive_unlock_tm_w(rte_spinlock_recursive_t *slr); +int rte_spinlock_recursive_trylock_tm_w(rte_spinlock_recursive_t *slr); +uint32_t rte_bit_relaxed_get32_w(unsigned int nr, uint32_t *addr); +void rte_bit_relaxed_set32_w(unsigned int nr, uint32_t *addr); +void rte_bit_relaxed_clear32_w(unsigned int nr, uint32_t *addr); +uint32_t rte_bit_relaxed_test_and_set32_w(unsigned int nr, uint32_t *addr); +uint32_t rte_bit_relaxed_test_and_clear32_w(unsigned int nr, uint32_t *addr); +uint64_t rte_bit_relaxed_get64_w(unsigned int nr, uint64_t *addr); +void rte_bit_relaxed_set64_w(unsigned int nr, uint64_t *addr); +void rte_bit_relaxed_clear64_w(unsigned int nr, uint64_t *addr); +uint64_t rte_bit_relaxed_test_and_set64_w(unsigned int nr, uint64_t *addr); +uint64_t rte_bit_relaxed_test_and_clear64_w(unsigned int nr, uint64_t *addr); +unsigned int rte_clz32_w(uint32_t v); +unsigned int rte_clz64_w(uint64_t v); +unsigned int rte_ctz32_w(uint32_t v); +unsigned int rte_ctz64_w(uint64_t v); +unsigned int rte_popcount32_w(uint32_t v); +unsigned int rte_popcount64_w(uint64_t v); +uint32_t rte_combine32ms1b_w(uint32_t x); +uint64_t rte_combine64ms1b_w(uint64_t v); +uint32_t rte_bsf32_w(uint32_t v); +int rte_bsf32_safe_w(uint32_t v, uint32_t *pos); +uint32_t rte_bsf64_w(uint64_t v); +int rte_bsf64_safe_w(uint64_t v, uint32_t *pos); +uint32_t rte_fls_u32_w(uint32_t x); +uint32_t rte_fls_u64_w(uint64_t x); +int rte_is_power_of_2_w(uint32_t n); +uint32_t rte_align32pow2_w(uint32_t x); +uint32_t rte_align32prevpow2_w(uint32_t x); +uint64_t rte_align64pow2_w(uint64_t v); +uint64_t rte_align64prevpow2_w(uint64_t v); +uint32_t rte_log2_u32_w(uint32_t v); +uint32_t rte_log2_u64_w(uint64_t v); +void rte_rwlock_init_w(rte_rwlock_t *rwl); +void rte_rwlock_read_lock_w(rte_rwlock_t *rwl); +int rte_rwlock_read_trylock_w(rte_rwlock_t *rwl); +void rte_rwlock_read_unlock_w(rte_rwlock_t *rwl); +int rte_rwlock_write_trylock_w(rte_rwlock_t *rwl); +void rte_rwlock_write_lock_w(rte_rwlock_t *rwl); +void rte_rwlock_write_unlock_w(rte_rwlock_t *rwl); +int rte_rwlock_write_is_locked_w(rte_rwlock_t *rwl); +void rte_rwlock_read_lock_tm_w(rte_rwlock_t *rwl); +void rte_rwlock_read_unlock_tm_w(rte_rwlock_t *rwl); +void rte_rwlock_write_lock_tm_w(rte_rwlock_t *rwl); +void rte_rwlock_write_unlock_tm_w(rte_rwlock_t *rwl); +unsigned int rte_ring_mp_enqueue_bulk_elem_w(struct rte_ring *r, + const void *obj_table, + unsigned int esize, unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_sp_enqueue_bulk_elem_w(struct rte_ring *r, + const void *obj_table, + unsigned int esize, unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_mp_hts_enqueue_bulk_elem_w(struct rte_ring *r, + const void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_mc_hts_dequeue_bulk_elem_w(struct rte_ring *r, + void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *available); +unsigned int rte_ring_mp_hts_enqueue_burst_elem_w(struct rte_ring *r, + const void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_mc_hts_dequeue_burst_elem_w(struct rte_ring *r, + void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *available); +unsigned int rte_ring_mp_hts_enqueue_bulk_w(struct rte_ring *r, + void *const *obj_table, + unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_mc_hts_dequeue_bulk_w(struct rte_ring *r, + void **obj_table, unsigned int n, + unsigned int *available); +unsigned int rte_ring_mp_hts_enqueue_burst_w(struct rte_ring *r, + void *const *obj_table, + unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_mc_hts_dequeue_burst_w(struct rte_ring *r, + void **obj_table, unsigned int n, + unsigned int *available); +unsigned int rte_ring_mp_rts_enqueue_bulk_elem_w(struct rte_ring *r, + const void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_mc_rts_dequeue_bulk_elem_w(struct rte_ring *r, + void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *available); +unsigned int rte_ring_mp_rts_enqueue_burst_elem_w(struct rte_ring *r, + const void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_mc_rts_dequeue_burst_elem_w(struct rte_ring *r, + void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *available); +unsigned int rte_ring_mp_rts_enqueue_bulk_w(struct rte_ring *r, + void *const *obj_table, + unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_mc_rts_dequeue_bulk_w(struct rte_ring *r, + void **obj_table, unsigned int n, + unsigned int *available); +unsigned int rte_ring_mp_rts_enqueue_burst_w(struct rte_ring *r, + void *const *obj_table, + unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_mc_rts_dequeue_burst_w(struct rte_ring *r, + void **obj_table, unsigned int n, + unsigned int *available); +uint32_t rte_ring_get_prod_htd_max_w(const struct rte_ring *r); +int rte_ring_set_prod_htd_max_w(struct rte_ring *r, uint32_t v); +uint32_t rte_ring_get_cons_htd_max_w(const struct rte_ring *r); +int rte_ring_set_cons_htd_max_w(struct rte_ring *r, uint32_t v); +unsigned int rte_ring_enqueue_bulk_elem_w(struct rte_ring *r, + const void *obj_table, + unsigned int esize, unsigned int n, + unsigned int *free_space); +int rte_ring_mp_enqueue_elem_w(struct rte_ring *r, void *obj, + unsigned int esize); +int rte_ring_sp_enqueue_elem_w(struct rte_ring *r, void *obj, + unsigned int esize); +int rte_ring_enqueue_elem_w(struct rte_ring *r, void *obj, unsigned int esize); +unsigned int rte_ring_mc_dequeue_bulk_elem_w(struct rte_ring *r, + void *obj_table, + unsigned int esize, unsigned int n, + unsigned int *available); +unsigned int rte_ring_sc_dequeue_bulk_elem_w(struct rte_ring *r, + void *obj_table, + unsigned int esize, unsigned int n, + unsigned int *available); +unsigned int rte_ring_dequeue_bulk_elem_w(struct rte_ring *r, void *obj_table, + unsigned int esize, unsigned int n, + unsigned int *available); +int rte_ring_mc_dequeue_elem_w(struct rte_ring *r, void *obj_p, + unsigned int esize); +int rte_ring_sc_dequeue_elem_w(struct rte_ring *r, void *obj_p, + unsigned int esize); +int rte_ring_dequeue_elem_w(struct rte_ring *r, void *obj_p, + unsigned int esize); +unsigned int rte_ring_mp_enqueue_burst_elem_w(struct rte_ring *r, + const void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_sp_enqueue_burst_elem_w(struct rte_ring *r, + const void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_enqueue_burst_elem_w(struct rte_ring *r, + const void *obj_table, + unsigned int esize, unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_mc_dequeue_burst_elem_w(struct rte_ring *r, + void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *available); +unsigned int rte_ring_sc_dequeue_burst_elem_w(struct rte_ring *r, + void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *available); +unsigned int rte_ring_dequeue_burst_elem_w(struct rte_ring *r, void *obj_table, + unsigned int esize, unsigned int n, + unsigned int *available); +unsigned int rte_ring_enqueue_bulk_elem_start_w(struct rte_ring *r, + unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_enqueue_bulk_start_w(struct rte_ring *r, unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_enqueue_burst_elem_start_w(struct rte_ring *r, + unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_enqueue_burst_start_w(struct rte_ring *r, unsigned int n, + unsigned int *free_space); +void rte_ring_enqueue_elem_finish_w(struct rte_ring *r, const void *obj_table, + unsigned int esize, unsigned int n); +void rte_ring_enqueue_finish_w(struct rte_ring *r, void *const *obj_table, + unsigned int n); +unsigned int rte_ring_dequeue_bulk_elem_start_w(struct rte_ring *r, + void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *available); +unsigned int rte_ring_dequeue_bulk_start_w(struct rte_ring *r, void **obj_table, + unsigned int n, + unsigned int *available); +unsigned int rte_ring_dequeue_burst_elem_start_w(struct rte_ring *r, + void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *available); +unsigned int rte_ring_dequeue_burst_start_w(struct rte_ring *r, + void **obj_table, unsigned int n, + unsigned int *available); +void rte_ring_dequeue_elem_finish_w(struct rte_ring *r, unsigned int n); +void rte_ring_dequeue_finish_w(struct rte_ring *r, unsigned int n); +unsigned int rte_ring_enqueue_zc_bulk_elem_start_w(struct rte_ring *r, + unsigned int esize, + unsigned int n, + struct rte_ring_zc_data *zcd, + unsigned int *free_space); +unsigned int rte_ring_enqueue_zc_bulk_start_w(struct rte_ring *r, + unsigned int n, + struct rte_ring_zc_data *zcd, + unsigned int *free_space); +unsigned int rte_ring_enqueue_zc_burst_elem_start_w( + struct rte_ring *r, unsigned int esize, unsigned int n, + struct rte_ring_zc_data *zcd, unsigned int *free_space); +unsigned int rte_ring_enqueue_zc_burst_start_w(struct rte_ring *r, + unsigned int n, + struct rte_ring_zc_data *zcd, + unsigned int *free_space); +void rte_ring_enqueue_zc_elem_finish_w(struct rte_ring *r, unsigned int n); +void rte_ring_enqueue_zc_finish_w(struct rte_ring *r, unsigned int n); +unsigned int rte_ring_dequeue_zc_bulk_elem_start_w(struct rte_ring *r, + unsigned int esize, + unsigned int n, + struct rte_ring_zc_data *zcd, + unsigned int *available); +unsigned int rte_ring_dequeue_zc_bulk_start_w(struct rte_ring *r, + unsigned int n, + struct rte_ring_zc_data *zcd, + unsigned int *available); +unsigned int rte_ring_dequeue_zc_burst_elem_start_w( + struct rte_ring *r, unsigned int esize, unsigned int n, + struct rte_ring_zc_data *zcd, unsigned int *available); +unsigned int rte_ring_dequeue_zc_burst_start_w(struct rte_ring *r, + unsigned int n, + struct rte_ring_zc_data *zcd, + unsigned int *available); +void rte_ring_dequeue_zc_elem_finish_w(struct rte_ring *r, unsigned int n); +void rte_ring_dequeue_zc_finish_w(struct rte_ring *r, unsigned int n); +unsigned int rte_ring_mp_enqueue_bulk_w(struct rte_ring *r, + void *const *obj_table, unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_sp_enqueue_bulk_w(struct rte_ring *r, + void *const *obj_table, unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_enqueue_bulk_w(struct rte_ring *r, void *const *obj_table, + unsigned int n, unsigned int *free_space); +int rte_ring_mp_enqueue_w(struct rte_ring *r, void *obj); +int rte_ring_sp_enqueue_w(struct rte_ring *r, void *obj); +int rte_ring_enqueue_w(struct rte_ring *r, void *obj); +unsigned int rte_ring_mc_dequeue_bulk_w(struct rte_ring *r, void **obj_table, + unsigned int n, + unsigned int *available); +unsigned int rte_ring_sc_dequeue_bulk_w(struct rte_ring *r, void **obj_table, + unsigned int n, + unsigned int *available); +unsigned int rte_ring_dequeue_bulk_w(struct rte_ring *r, void **obj_table, + unsigned int n, unsigned int *available); +int rte_ring_mc_dequeue_w(struct rte_ring *r, void **obj_p); +int rte_ring_sc_dequeue_w(struct rte_ring *r, void **obj_p); +int rte_ring_dequeue_w(struct rte_ring *r, void **obj_p); +unsigned int rte_ring_count_w(const struct rte_ring *r); +unsigned int rte_ring_free_count_w(const struct rte_ring *r); +int rte_ring_full_w(const struct rte_ring *r); +int rte_ring_empty_w(const struct rte_ring *r); +unsigned int rte_ring_get_size_w(const struct rte_ring *r); +unsigned int rte_ring_get_capacity_w(const struct rte_ring *r); +enum rte_ring_sync_type rte_ring_get_prod_sync_type_w(const struct rte_ring *r); +int rte_ring_is_prod_single_w(const struct rte_ring *r); +enum rte_ring_sync_type rte_ring_get_cons_sync_type_w(const struct rte_ring *r); +int rte_ring_is_cons_single_w(const struct rte_ring *r); +unsigned int rte_ring_mp_enqueue_burst_w(struct rte_ring *r, + void *const *obj_table, unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_sp_enqueue_burst_w(struct rte_ring *r, + void *const *obj_table, unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_enqueue_burst_w(struct rte_ring *r, + void *const *obj_table, unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_mc_dequeue_burst_w(struct rte_ring *r, void **obj_table, + unsigned int n, + unsigned int *available); +unsigned int rte_ring_sc_dequeue_burst_w(struct rte_ring *r, void **obj_table, + unsigned int n, + unsigned int *available); +unsigned int rte_ring_dequeue_burst_w(struct rte_ring *r, void **obj_table, + unsigned int n, unsigned int *available); +void *rte_memcpy_w(void *dst, const void *src, size_t n); +void rte_mov16_w(uint8_t *dst, const uint8_t *src); +void rte_mov32_w(uint8_t *dst, const uint8_t *src); +void rte_mov64_w(uint8_t *dst, const uint8_t *src); +void rte_mov256_w(uint8_t *dst, const uint8_t *src); +struct rte_mempool_objhdr *rte_mempool_get_header_w(void *obj); +struct rte_mempool *rte_mempool_from_obj_w(void *obj); +struct rte_mempool_objtlr *rte_mempool_get_trailer_w(void *obj); +struct rte_mempool_ops *rte_mempool_get_ops_w(int ops_index); +int rte_mempool_ops_dequeue_bulk_w(struct rte_mempool *mp, void **obj_table, + unsigned int n); +int rte_mempool_ops_dequeue_contig_blocks_w(struct rte_mempool *mp, + void **first_obj_table, + unsigned int n); +int rte_mempool_ops_enqueue_bulk_w(struct rte_mempool *mp, + void *const *obj_table, unsigned int n); +struct rte_mempool_cache *rte_mempool_default_cache_w(struct rte_mempool *mp, + unsigned int lcore_id); +void rte_mempool_cache_flush_w(struct rte_mempool_cache *cache, + struct rte_mempool *mp); +void rte_mempool_do_generic_put_w(struct rte_mempool *mp, + void *const *obj_table, unsigned int n, + struct rte_mempool_cache *cache); +void rte_mempool_generic_put_w(struct rte_mempool *mp, void *const *obj_table, + unsigned int n, struct rte_mempool_cache *cache); +void rte_mempool_put_bulk_w(struct rte_mempool *mp, void *const *obj_table, + unsigned int n); +void rte_mempool_put_w(struct rte_mempool *mp, void *obj); +int rte_mempool_do_generic_get_w(struct rte_mempool *mp, void **obj_table, + unsigned int n, + struct rte_mempool_cache *cache); +int rte_mempool_generic_get_w(struct rte_mempool *mp, void **obj_table, + unsigned int n, struct rte_mempool_cache *cache); +int rte_mempool_get_bulk_w(struct rte_mempool *mp, void **obj_table, + unsigned int n); +int rte_mempool_get_w(struct rte_mempool *mp, void **obj_p); +int rte_mempool_get_contig_blocks_w(struct rte_mempool *mp, + void **first_obj_table, unsigned int n); +int rte_mempool_full_w(const struct rte_mempool *mp); +int rte_mempool_empty_w(const struct rte_mempool *mp); +rte_iova_t rte_mempool_virt2iova_w(const void *elt); +void *rte_mempool_get_priv_w(struct rte_mempool *mp); +void rte_prefetch0_w(const void *p); +void rte_prefetch1_w(const void *p); +void rte_prefetch2_w(const void *p); +void rte_prefetch_non_temporal_w(const void *p); +void rte_prefetch0_write_w(const void *p); +void rte_prefetch1_write_w(const void *p); +void rte_prefetch2_write_w(const void *p); +void rte_cldemote_w(const void *p); +uint16_t rte_constant_bswap16_w(uint16_t x); +uint32_t rte_constant_bswap32_w(uint32_t x); +uint64_t rte_constant_bswap64_w(uint64_t x); +void rte_mbuf_prefetch_part1_w(struct rte_mbuf *m); +void rte_mbuf_prefetch_part2_w(struct rte_mbuf *m); +uint16_t rte_pktmbuf_priv_size_w(struct rte_mempool *mp); +rte_iova_t rte_mbuf_iova_get_w(const struct rte_mbuf *m); +void rte_mbuf_iova_set_w(struct rte_mbuf *m, rte_iova_t iova); +rte_iova_t rte_mbuf_data_iova_w(const struct rte_mbuf *mb); +rte_iova_t rte_mbuf_data_iova_default_w(const struct rte_mbuf *mb); +struct rte_mbuf *rte_mbuf_from_indirect_w(struct rte_mbuf *mi); +char *rte_mbuf_buf_addr_w(struct rte_mbuf *mb, struct rte_mempool *mp); +char *rte_mbuf_data_addr_default_w(struct rte_mbuf *mb); +char *rte_mbuf_to_baddr_w(struct rte_mbuf *md); +void *rte_mbuf_to_priv_w(struct rte_mbuf *m); +uint32_t rte_pktmbuf_priv_flags_w(struct rte_mempool *mp); +uint16_t rte_mbuf_refcnt_read_w(const struct rte_mbuf *m); +void rte_mbuf_refcnt_set_w(struct rte_mbuf *m, uint16_t new_value); +uint16_t rte_mbuf_refcnt_update_w(struct rte_mbuf *m, int16_t value); +uint16_t +rte_mbuf_ext_refcnt_read_w(const struct rte_mbuf_ext_shared_info *shinfo); +void rte_mbuf_ext_refcnt_set_w(struct rte_mbuf_ext_shared_info *shinfo, + uint16_t new_value); +uint16_t rte_mbuf_ext_refcnt_update_w(struct rte_mbuf_ext_shared_info *shinfo, + int16_t value); +struct rte_mbuf *rte_mbuf_raw_alloc_w(struct rte_mempool *mp); +void rte_mbuf_raw_free_w(struct rte_mbuf *m); +uint16_t rte_pktmbuf_data_room_size_w(struct rte_mempool *mp); +void rte_pktmbuf_reset_headroom_w(struct rte_mbuf *m); +void rte_pktmbuf_reset_w(struct rte_mbuf *m); +struct rte_mbuf *rte_pktmbuf_alloc_w(struct rte_mempool *mp); +int rte_pktmbuf_alloc_bulk_w(struct rte_mempool *pool, struct rte_mbuf **mbufs, + unsigned int count); +struct rte_mbuf_ext_shared_info * +rte_pktmbuf_ext_shinfo_init_helper_w(void *buf_addr, uint16_t *buf_len, + rte_mbuf_extbuf_free_callback_t free_cb, + void *fcb_opaque); +void rte_pktmbuf_attach_extbuf_w(struct rte_mbuf *m, void *buf_addr, + rte_iova_t buf_iova, uint16_t buf_len, + struct rte_mbuf_ext_shared_info *shinfo); +void rte_mbuf_dynfield_copy_w(struct rte_mbuf *mdst, + const struct rte_mbuf *msrc); +void rte_pktmbuf_attach_w(struct rte_mbuf *mi, struct rte_mbuf *m); +void rte_pktmbuf_detach_w(struct rte_mbuf *m); +struct rte_mbuf *rte_pktmbuf_prefree_seg_w(struct rte_mbuf *m); +void rte_pktmbuf_free_seg_w(struct rte_mbuf *m); +void rte_pktmbuf_free_w(struct rte_mbuf *m); +void rte_pktmbuf_refcnt_update_w(struct rte_mbuf *m, int16_t v); +uint16_t rte_pktmbuf_headroom_w(const struct rte_mbuf *m); +uint16_t rte_pktmbuf_tailroom_w(const struct rte_mbuf *m); +struct rte_mbuf *rte_pktmbuf_lastseg_w(struct rte_mbuf *m); +char *rte_pktmbuf_prepend_w(struct rte_mbuf *m, uint16_t len); +char *rte_pktmbuf_append_w(struct rte_mbuf *m, uint16_t len); +char *rte_pktmbuf_adj_w(struct rte_mbuf *m, uint16_t len); +int rte_pktmbuf_trim_w(struct rte_mbuf *m, uint16_t len); +int rte_pktmbuf_is_contiguous_w(const struct rte_mbuf *m); +const void *rte_pktmbuf_read_w(const struct rte_mbuf *m, uint32_t off, + uint32_t len, void *buf); +int rte_pktmbuf_chain_w(struct rte_mbuf *head, struct rte_mbuf *tail); +uint64_t rte_mbuf_tx_offload_w(uint64_t il2, uint64_t il3, uint64_t il4, + uint64_t tso, uint64_t ol3, uint64_t ol2, + uint64_t unused); +int rte_validate_tx_offload_w(const struct rte_mbuf *m); +int rte_pktmbuf_linearize_w(struct rte_mbuf *mbuf); +uint32_t rte_mbuf_sched_queue_get_w(const struct rte_mbuf *m); +uint8_t rte_mbuf_sched_traffic_class_get_w(const struct rte_mbuf *m); +uint8_t rte_mbuf_sched_color_get_w(const struct rte_mbuf *m); +void rte_mbuf_sched_get_w(const struct rte_mbuf *m, uint32_t *queue_id, + uint8_t *traffic_class, uint8_t *color); +void rte_mbuf_sched_queue_set_w(struct rte_mbuf *m, uint32_t queue_id); +void rte_mbuf_sched_traffic_class_set_w(struct rte_mbuf *m, + uint8_t traffic_class); +void rte_mbuf_sched_color_set_w(struct rte_mbuf *m, uint8_t color); +void rte_mbuf_sched_set_w(struct rte_mbuf *m, uint32_t queue_id, + uint8_t traffic_class, uint8_t color); +int rte_is_same_ether_addr_w(const struct rte_ether_addr *ea1, + const struct rte_ether_addr *ea2); +int rte_is_zero_ether_addr_w(const struct rte_ether_addr *ea); +int rte_is_unicast_ether_addr_w(const struct rte_ether_addr *ea); +int rte_is_multicast_ether_addr_w(const struct rte_ether_addr *ea); +int rte_is_broadcast_ether_addr_w(const struct rte_ether_addr *ea); +int rte_is_universal_ether_addr_w(const struct rte_ether_addr *ea); +int rte_is_local_admin_ether_addr_w(const struct rte_ether_addr *ea); +int rte_is_valid_assigned_ether_addr_w(const struct rte_ether_addr *ea); +void rte_ether_addr_copy_w(const struct rte_ether_addr *ea_from, + struct rte_ether_addr *ea_to); +int rte_vlan_strip_w(struct rte_mbuf *m); +int rte_vlan_insert_w(struct rte_mbuf **m); +uint32_t rte_bitmap_get_memory_footprint_w(uint32_t n_bits); +struct rte_bitmap *rte_bitmap_init_w(uint32_t n_bits, uint8_t *mem, + uint32_t mem_size); +struct rte_bitmap *rte_bitmap_init_with_all_set_w(uint32_t n_bits, uint8_t *mem, + uint32_t mem_size); +void rte_bitmap_free_w(struct rte_bitmap *bmp); +void rte_bitmap_reset_w(struct rte_bitmap *bmp); +void rte_bitmap_prefetch0_w(struct rte_bitmap *bmp, uint32_t pos); +uint64_t rte_bitmap_get_w(struct rte_bitmap *bmp, uint32_t pos); +void rte_bitmap_set_w(struct rte_bitmap *bmp, uint32_t pos); +void rte_bitmap_set_slab_w(struct rte_bitmap *bmp, uint32_t pos, uint64_t slab); +void rte_bitmap_clear_w(struct rte_bitmap *bmp, uint32_t pos); +int rte_bitmap_scan_w(struct rte_bitmap *bmp, uint32_t *pos, uint64_t *slab); +uint16_t rte_raw_cksum_w(const void *buf, size_t len); +int rte_raw_cksum_mbuf_w(const struct rte_mbuf *m, uint32_t off, uint32_t len, + uint16_t *cksum); +uint8_t rte_ipv4_hdr_len_w(const struct rte_ipv4_hdr *ipv4_hdr); +uint16_t rte_ipv4_cksum_w(const struct rte_ipv4_hdr *ipv4_hdr); +uint16_t rte_ipv4_cksum_simple_w(const struct rte_ipv4_hdr *ipv4_hdr); +uint16_t rte_ipv4_phdr_cksum_w(const struct rte_ipv4_hdr *ipv4_hdr, + uint64_t ol_flags); +uint16_t rte_ipv4_udptcp_cksum_w(const struct rte_ipv4_hdr *ipv4_hdr, + const void *l4_hdr); +uint16_t rte_ipv4_udptcp_cksum_mbuf_w(const struct rte_mbuf *m, + const struct rte_ipv4_hdr *ipv4_hdr, + uint16_t l4_off); +int rte_ipv4_udptcp_cksum_verify_w(const struct rte_ipv4_hdr *ipv4_hdr, + const void *l4_hdr); +int rte_ipv4_udptcp_cksum_mbuf_verify_w(const struct rte_mbuf *m, + const struct rte_ipv4_hdr *ipv4_hdr, + uint16_t l4_off); +bool rte_ipv6_addr_eq_w(const struct rte_ipv6_addr *a, + const struct rte_ipv6_addr *b); +void rte_ipv6_addr_mask_w(struct rte_ipv6_addr *ip, uint8_t depth); +bool rte_ipv6_addr_eq_prefix_w(const struct rte_ipv6_addr *a, + const struct rte_ipv6_addr *b, uint8_t depth); +uint8_t rte_ipv6_mask_depth_w(const struct rte_ipv6_addr *mask); +bool rte_ipv6_addr_is_unspec_w(const struct rte_ipv6_addr *ip); +bool rte_ipv6_addr_is_loopback_w(const struct rte_ipv6_addr *ip); +bool rte_ipv6_addr_is_linklocal_w(const struct rte_ipv6_addr *ip); +bool rte_ipv6_addr_is_sitelocal_w(const struct rte_ipv6_addr *ip); +bool rte_ipv6_addr_is_v4compat_w(const struct rte_ipv6_addr *ip); +bool rte_ipv6_addr_is_v4mapped_w(const struct rte_ipv6_addr *ip); +bool rte_ipv6_addr_is_mcast_w(const struct rte_ipv6_addr *ip); +enum rte_ipv6_mc_scope rte_ipv6_mc_scope_w(const struct rte_ipv6_addr *ip); +void rte_ipv6_llocal_from_ethernet_w(struct rte_ipv6_addr *ip, + const struct rte_ether_addr *mac); +void rte_ipv6_solnode_from_addr_w(struct rte_ipv6_addr *sol, + const struct rte_ipv6_addr *ip); +void rte_ether_mcast_from_ipv6_w(struct rte_ether_addr *mac, + const struct rte_ipv6_addr *ip); +int rte_ipv6_check_version_w(const struct rte_ipv6_hdr *ip); +uint16_t rte_ipv6_phdr_cksum_w(const struct rte_ipv6_hdr *ipv6_hdr, + uint64_t ol_flags); +uint16_t rte_ipv6_udptcp_cksum_w(const struct rte_ipv6_hdr *ipv6_hdr, + const void *l4_hdr); +uint16_t rte_ipv6_udptcp_cksum_mbuf_w(const struct rte_mbuf *m, + const struct rte_ipv6_hdr *ipv6_hdr, + uint16_t l4_off); +int rte_ipv6_udptcp_cksum_verify_w(const struct rte_ipv6_hdr *ipv6_hdr, + const void *l4_hdr); +int rte_ipv6_udptcp_cksum_mbuf_verify_w(const struct rte_mbuf *m, + const struct rte_ipv6_hdr *ipv6_hdr, + uint16_t l4_off); +int rte_ipv6_get_next_ext_w(const uint8_t *p, int proto, size_t *ext_len); +enum rte_color +rte_meter_srtcm_color_blind_check_w(struct rte_meter_srtcm *m, + struct rte_meter_srtcm_profile *p, + uint64_t time, uint32_t pkt_len); +enum rte_color rte_meter_srtcm_color_aware_check_w( + struct rte_meter_srtcm *m, struct rte_meter_srtcm_profile *p, uint64_t time, + uint32_t pkt_len, enum rte_color pkt_color); +enum rte_color +rte_meter_trtcm_color_blind_check_w(struct rte_meter_trtcm *m, + struct rte_meter_trtcm_profile *p, + uint64_t time, uint32_t pkt_len); +enum rte_color rte_meter_trtcm_color_aware_check_w( + struct rte_meter_trtcm *m, struct rte_meter_trtcm_profile *p, uint64_t time, + uint32_t pkt_len, enum rte_color pkt_color); +enum rte_color rte_meter_trtcm_rfc4115_color_blind_check_w( + struct rte_meter_trtcm_rfc4115 *m, + struct rte_meter_trtcm_rfc4115_profile *p, uint64_t time, uint32_t pkt_len); +enum rte_color rte_meter_trtcm_rfc4115_color_aware_check_w( + struct rte_meter_trtcm_rfc4115 *m, + struct rte_meter_trtcm_rfc4115_profile *p, uint64_t time, uint32_t pkt_len, + enum rte_color pkt_color); +uint64_t rte_eth_rss_hf_refine_w(uint64_t rss_hf); +uint16_t rte_eth_rx_burst_w(uint16_t port_id, uint16_t queue_id, + struct rte_mbuf **rx_pkts, const uint16_t nb_pkts); +int rte_eth_rx_queue_count_w(uint16_t port_id, uint16_t queue_id); +int rte_eth_rx_descriptor_status_w(uint16_t port_id, uint16_t queue_id, + uint16_t offset); +int rte_eth_tx_descriptor_status_w(uint16_t port_id, uint16_t queue_id, + uint16_t offset); +uint16_t rte_eth_tx_burst_w(uint16_t port_id, uint16_t queue_id, + struct rte_mbuf **tx_pkts, uint16_t nb_pkts); +uint16_t rte_eth_tx_prepare_w(uint16_t port_id, uint16_t queue_id, + struct rte_mbuf **tx_pkts, uint16_t nb_pkts); +uint16_t rte_eth_tx_buffer_flush_w(uint16_t port_id, uint16_t queue_id, + struct rte_eth_dev_tx_buffer *buffer); +uint16_t rte_eth_tx_buffer_w(uint16_t port_id, uint16_t queue_id, + struct rte_eth_dev_tx_buffer *buffer, + struct rte_mbuf *tx_pkt); +uint16_t +rte_eth_recycle_mbufs_w(uint16_t rx_port_id, uint16_t rx_queue_id, + uint16_t tx_port_id, uint16_t tx_queue_id, + struct rte_eth_recycle_rxq_info *recycle_rxq_info); +int rte_eth_tx_queue_count_w(uint16_t port_id, uint16_t queue_id); +uint32_t rte_flow_dynf_metadata_get_w(struct rte_mbuf *m); +void rte_flow_dynf_metadata_set_w(struct rte_mbuf *m, uint32_t v); +int rte_flow_dynf_metadata_avail_w(void); +uint32_t rte_hash_crc_1byte_w(uint8_t data, uint32_t init_val); +uint32_t rte_hash_crc_2byte_w(uint16_t data, uint32_t init_val); +uint32_t rte_hash_crc_4byte_w(uint32_t data, uint32_t init_val); +uint32_t rte_hash_crc_8byte_w(uint64_t data, uint32_t init_val); +uint32_t rte_hash_crc_w(const void *data, uint32_t data_len, uint32_t init_val); +void rte_jhash_2hashes_w(const void *key, uint32_t length, uint32_t *pc, + uint32_t *pb); +void rte_jhash_32b_2hashes_w(const uint32_t *k, uint32_t length, uint32_t *pc, + uint32_t *pb); +uint32_t rte_jhash_w(const void *key, uint32_t length, uint32_t initval); +uint32_t rte_jhash_32b_w(const uint32_t *k, uint32_t length, uint32_t initval); +uint32_t rte_jhash_3words_w(uint32_t a, uint32_t b, uint32_t c, + uint32_t initval); +uint32_t rte_jhash_2words_w(uint32_t a, uint32_t b, uint32_t initval); +uint32_t rte_jhash_1word_w(uint32_t a, uint32_t initval); +uint32_t rte_fbk_hash_get_bucket_w(const struct rte_fbk_hash_table *ht, + uint32_t key); +int rte_fbk_hash_add_key_with_bucket_w(struct rte_fbk_hash_table *ht, + uint32_t key, uint16_t value, + uint32_t bucket); +int rte_fbk_hash_add_key_w(struct rte_fbk_hash_table *ht, uint32_t key, + uint16_t value); +int rte_fbk_hash_delete_key_with_bucket_w(struct rte_fbk_hash_table *ht, + uint32_t key, uint32_t bucket); +int rte_fbk_hash_delete_key_w(struct rte_fbk_hash_table *ht, uint32_t key); +int rte_fbk_hash_lookup_with_bucket_w(const struct rte_fbk_hash_table *ht, + uint32_t key, uint32_t bucket); +int rte_fbk_hash_lookup_w(const struct rte_fbk_hash_table *ht, uint32_t key); +void rte_fbk_hash_clear_all_w(struct rte_fbk_hash_table *ht); +double rte_fbk_hash_get_load_factor_w(struct rte_fbk_hash_table *ht); +void rte_rcu_qsbr_thread_online_w(struct rte_rcu_qsbr *v, + unsigned int thread_id); +void rte_rcu_qsbr_thread_offline_w(struct rte_rcu_qsbr *v, + unsigned int thread_id); +void rte_rcu_qsbr_lock_w(struct rte_rcu_qsbr *v, unsigned int thread_id); +void rte_rcu_qsbr_unlock_w(struct rte_rcu_qsbr *v, unsigned int thread_id); +uint64_t rte_rcu_qsbr_start_w(struct rte_rcu_qsbr *v); +void rte_rcu_qsbr_quiescent_w(struct rte_rcu_qsbr *v, unsigned int thread_id); +int rte_rcu_qsbr_check_w(struct rte_rcu_qsbr *v, uint64_t t, bool wait); +uint8_t rte_read8_relaxed_w(const void *addr); +uint16_t rte_read16_relaxed_w(const void *addr); +uint32_t rte_read32_relaxed_w(const void *addr); +uint64_t rte_read64_relaxed_w(const void *addr); +void rte_write8_relaxed_w(uint8_t value, void *addr); +void rte_write16_relaxed_w(uint16_t value, void *addr); +void rte_write32_relaxed_w(uint32_t value, void *addr); +void rte_write64_relaxed_w(uint64_t value, void *addr); +uint8_t rte_read8_w(const void *addr); +uint16_t rte_read16_w(const void *addr); +uint32_t rte_read32_w(const void *addr); +uint64_t rte_read64_w(const void *addr); +void rte_write8_w(uint8_t value, void *addr); +void rte_write16_w(uint16_t value, void *addr); +void rte_write32_w(uint32_t value, void *addr); +void rte_write64_w(uint64_t value, void *addr); +void rte_write32_wc_relaxed_w(uint32_t value, void *addr); +void rte_write32_wc_w(uint32_t value, void *addr); +void rte_mcslock_lock_w(rte_mcslock_t **msl, rte_mcslock_t *me); +void rte_mcslock_unlock_w(rte_mcslock_t **msl, rte_mcslock_t *me); +int rte_mcslock_trylock_w(rte_mcslock_t **msl, rte_mcslock_t *me); +int rte_mcslock_is_locked_w(rte_mcslock_t *msl); +void rte_pflock_init_w(struct rte_pflock *pf); +void rte_pflock_read_lock_w(rte_pflock_t *pf); +void rte_pflock_read_unlock_w(rte_pflock_t *pf); +void rte_pflock_write_lock_w(rte_pflock_t *pf); +void rte_pflock_write_unlock_w(rte_pflock_t *pf); +uint32_t rte_reciprocal_divide_w(uint32_t a, struct rte_reciprocal R); +uint64_t rte_reciprocal_divide_u64_w(uint64_t a, + const struct rte_reciprocal_u64 *R); +void rte_seqcount_init_w(rte_seqcount_t *seqcount); +uint32_t rte_seqcount_read_begin_w(const rte_seqcount_t *seqcount); +bool rte_seqcount_read_retry_w(const rte_seqcount_t *seqcount, + uint32_t begin_sn); +void rte_seqcount_write_begin_w(rte_seqcount_t *seqcount); +void rte_seqcount_write_end_w(rte_seqcount_t *seqcount); +void rte_seqlock_init_w(rte_seqlock_t *seqlock); +uint32_t rte_seqlock_read_begin_w(const rte_seqlock_t *seqlock); +bool rte_seqlock_read_retry_w(const rte_seqlock_t *seqlock, uint32_t begin_sn); +void rte_seqlock_write_lock_w(rte_seqlock_t *seqlock); +void rte_seqlock_write_unlock_w(rte_seqlock_t *seqlock); +unsigned int rte_stack_push_w(struct rte_stack *s, void *const *obj_table, + unsigned int n); +unsigned int rte_stack_pop_w(struct rte_stack *s, void **obj_table, + unsigned int n); +unsigned int rte_stack_count_w(struct rte_stack *s); +unsigned int rte_stack_free_count_w(struct rte_stack *s); +uint32_t rte_softrss_w(uint32_t *input_tuple, uint32_t input_len, + const uint8_t *rss_key); +uint32_t rte_softrss_be_w(uint32_t *input_tuple, uint32_t input_len, + const uint8_t *rss_key); +void rte_ticketlock_init_w(rte_ticketlock_t *tl); +void rte_ticketlock_lock_w(rte_ticketlock_t *tl); +void rte_ticketlock_unlock_w(rte_ticketlock_t *tl); +int rte_ticketlock_trylock_w(rte_ticketlock_t *tl); +int rte_ticketlock_is_locked_w(rte_ticketlock_t *tl); +void rte_ticketlock_recursive_init_w(rte_ticketlock_recursive_t *tlr); +void rte_ticketlock_recursive_lock_w(rte_ticketlock_recursive_t *tlr); +void rte_ticketlock_recursive_unlock_w(rte_ticketlock_recursive_t *tlr); +int rte_ticketlock_recursive_trylock_w(rte_ticketlock_recursive_t *tlr); +uint64_t rte_cyclecounter_cycles_to_ns_w(struct rte_timecounter *tc, + uint64_t cycles); +uint64_t rte_timecounter_update_w(struct rte_timecounter *tc, + uint64_t cycle_now); +uint64_t rte_timespec_to_ns_w(const struct timespec *ts); +struct timespec rte_ns_to_timespec_w(uint64_t nsec); +bool rte_trace_feature_is_enabled_w(void); diff --git a/dpdk/build.rs b/dpdk/build.rs index 52f5b0197..1c30f3c66 100644 --- a/dpdk/build.rs +++ b/dpdk/build.rs @@ -2,7 +2,7 @@ // Copyright Open Network Fabric Authors fn main() { - let sysroot = dpdk_sysroot_helper::get_sysroot(); - println!("cargo:rustc-link-search=all={sysroot}/lib"); - println!("cargo:rustc-link-arg=--sysroot={sysroot}"); + // let sysroot = dpdk_sysroot_helper::get_sysroot(); + // println!("cargo:rustc-link-search=all={sysroot}/lib"); + // println!("cargo:rustc-link-arg=--sysroot={sysroot}"); } diff --git a/dpdk/src/lcore.rs b/dpdk/src/lcore.rs index 7c35c7b97..12a4dbc48 100644 --- a/dpdk/src/lcore.rs +++ b/dpdk/src/lcore.rs @@ -237,7 +237,7 @@ impl LCoreId { #[tracing::instrument(level = "trace")] pub fn current() -> LCoreId { - LCoreId(unsafe { dpdk_sys::rte_lcore_id_w() }) + LCoreId(unsafe { dpdk_sys::rte_lcore_id() }) } #[tracing::instrument(level = "trace")] diff --git a/hardware/Cargo.toml b/hardware/Cargo.toml index 7d4fbf476..b4f469ce1 100644 --- a/hardware/Cargo.toml +++ b/hardware/Cargo.toml @@ -36,9 +36,9 @@ tracing = { workspace = true, features = ["std"] } [dev-dependencies] # internal -fixin = { workspace = true, features = [] } +# fixin = { workspace = true, features = [] } id = { workspace = true, features = ["serde", "rkyv"] } -n-vm = { workspace = true } +# n-vm = { workspace = true } test-utils = { workspace = true, features = [] } # external diff --git a/hardware/build.rs b/hardware/build.rs index 52f5b0197..1c30f3c66 100644 --- a/hardware/build.rs +++ b/hardware/build.rs @@ -2,7 +2,7 @@ // Copyright Open Network Fabric Authors fn main() { - let sysroot = dpdk_sysroot_helper::get_sysroot(); - println!("cargo:rustc-link-search=all={sysroot}/lib"); - println!("cargo:rustc-link-arg=--sysroot={sysroot}"); + // let sysroot = dpdk_sysroot_helper::get_sysroot(); + // println!("cargo:rustc-link-search=all={sysroot}/lib"); + // println!("cargo:rustc-link-arg=--sysroot={sysroot}"); } diff --git a/hardware/src/scan.rs b/hardware/src/scan.rs index ef8899164..1e20b49a9 100644 --- a/hardware/src/scan.rs +++ b/hardware/src/scan.rs @@ -225,82 +225,82 @@ mod test { support::{SupportedDevice, SupportedVendor}, }; - #[test] - #[n_vm::in_vm] - fn collect_them_all_and_bind_them() { - let system = Node::scan_all(); - let nics: Vec<_> = system - .iter() - .filter_map(|node| match node.attributes() { - Some(NodeAttributes::Pci(dev)) => { - if dev.vendor_id() == SupportedVendor::RedHat.vendor_id() - && SupportedDevice::VirtioNet - .device_ids() - .contains(&dev.device_id()) - { - let mut nic = PciNic::new(dev.address()).unwrap(); - nic.bind_to_vfio_pci().unwrap(); - Some(nic) - } else { - None - } - } - _ => None, - }) - .collect(); - assert_eq!(nics.len(), 3, "expected exactly 3 virtio network cards"); - } + // #[test] + // #[n_vm::in_vm] + // fn collect_them_all_and_bind_them() { + // let system = Node::scan_all(); + // let nics: Vec<_> = system + // .iter() + // .filter_map(|node| match node.attributes() { + // Some(NodeAttributes::Pci(dev)) => { + // if dev.vendor_id() == SupportedVendor::RedHat.vendor_id() + // && SupportedDevice::VirtioNet + // .device_ids() + // .contains(&dev.device_id()) + // { + // let mut nic = PciNic::new(dev.address()).unwrap(); + // nic.bind_to_vfio_pci().unwrap(); + // Some(nic) + // } else { + // None + // } + // } + // _ => None, + // }) + // .collect(); + // assert_eq!(nics.len(), 3, "expected exactly 3 virtio network cards"); + // } - #[test] - #[n_vm::in_vm] - fn bind_fabric_nics_and_skip_mgmt_nic() { - let system = Node::scan_all(); - let mgmt_nic_pci_address = "0000:00:02.0".try_into().unwrap(); - let nics: Vec<_> = system - .iter() - .filter_map(|node| match node.attributes() { - Some(NodeAttributes::Pci(dev)) => { - if dev.vendor_id() == SupportedVendor::RedHat.vendor_id() - && SupportedDevice::VirtioNet - .device_ids() - .contains(&dev.device_id()) - && dev.address() != mgmt_nic_pci_address - { - let mut nic = PciNic::new(dev.address()).unwrap(); - nic.bind_to_vfio_pci().unwrap(); - Some(nic) - } else { - None - } - } - _ => None, - }) - .collect(); - assert_eq!(nics.len(), 2, "expected exactly 2 virtio network cards"); - } + // #[test] + // #[n_vm::in_vm] + // fn bind_fabric_nics_and_skip_mgmt_nic() { + // let system = Node::scan_all(); + // let mgmt_nic_pci_address = "0000:00:02.0".try_into().unwrap(); + // let nics: Vec<_> = system + // .iter() + // .filter_map(|node| match node.attributes() { + // Some(NodeAttributes::Pci(dev)) => { + // if dev.vendor_id() == SupportedVendor::RedHat.vendor_id() + // && SupportedDevice::VirtioNet + // .device_ids() + // .contains(&dev.device_id()) + // && dev.address() != mgmt_nic_pci_address + // { + // let mut nic = PciNic::new(dev.address()).unwrap(); + // nic.bind_to_vfio_pci().unwrap(); + // Some(nic) + // } else { + // None + // } + // } + // _ => None, + // }) + // .collect(); + // assert_eq!(nics.len(), 2, "expected exactly 2 virtio network cards"); + // } - #[test] - #[n_vm::in_vm] - fn bind_nic_test() { - let system = Node::scan_all(); - let target_pci_address = "0001:00:02.0".try_into().unwrap(); - let Some(mut nic) = system.iter().find_map(|node| match node.attributes() { - Some(NodeAttributes::Pci(dev)) => { - if dev.address() == target_pci_address - && dev.vendor_id() == SupportedVendor::RedHat.vendor_id() - && SupportedDevice::VirtioNet - .device_ids() - .contains(&dev.device_id()) - { - Some(PciNic::new(dev.address()).unwrap()) - } else { - None - } - } - _ => None, - }) else { - panic!("target nic not found"); - }; - nic.bind_to_vfio_pci().unwrap(); - } + // #[test] + // #[n_vm::in_vm] + // fn bind_nic_test() { + // let system = Node::scan_all(); + // let target_pci_address = "0001:00:02.0".try_into().unwrap(); + // let Some(mut nic) = system.iter().find_map(|node| match node.attributes() { + // Some(NodeAttributes::Pci(dev)) => { + // if dev.address() == target_pci_address + // && dev.vendor_id() == SupportedVendor::RedHat.vendor_id() + // && SupportedDevice::VirtioNet + // .device_ids() + // .contains(&dev.device_id()) + // { + // Some(PciNic::new(dev.address()).unwrap()) + // } else { + // None + // } + // } + // _ => None, + // }) else { + // panic!("target nic not found"); + // }; + // nic.bind_to_vfio_pci().unwrap(); + // } } diff --git a/init/build.rs b/init/build.rs index 52f5b0197..1c30f3c66 100644 --- a/init/build.rs +++ b/init/build.rs @@ -2,7 +2,7 @@ // Copyright Open Network Fabric Authors fn main() { - let sysroot = dpdk_sysroot_helper::get_sysroot(); - println!("cargo:rustc-link-search=all={sysroot}/lib"); - println!("cargo:rustc-link-arg=--sysroot={sysroot}"); + // let sysroot = dpdk_sysroot_helper::get_sysroot(); + // println!("cargo:rustc-link-search=all={sysroot}/lib"); + // println!("cargo:rustc-link-arg=--sysroot={sysroot}"); } diff --git a/k8s-intf/Cargo.toml b/k8s-intf/Cargo.toml index a3efed406..73d542f03 100644 --- a/k8s-intf/Cargo.toml +++ b/k8s-intf/Cargo.toml @@ -37,5 +37,5 @@ lpm = { workspace = true, features = [] } net = { workspace = true, features = ["bolero", "test_buffer"] } [build-dependencies] -dotenvy = { workspace = true, features = [] } -ureq = { workspace = true, features = ["rustls", "gzip"] } +# dotenvy = { workspace = true, features = [] } +# ureq = { workspace = true, features = ["rustls", "gzip"] } diff --git a/k8s-intf/build.rs b/k8s-intf/build.rs index f0477bf9b..8a37ff1e3 100644 --- a/k8s-intf/build.rs +++ b/k8s-intf/build.rs @@ -1,47 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright Open Network Fabric Authors -use std::env; use std::fs; +use std::io::Read; use std::path::PathBuf; -fn workspace_root() -> PathBuf { - PathBuf::from(env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR not set")) - .ancestors() - .nth(1) - .expect("Workspace root not found") - .to_path_buf() -} - -fn get_agent_crd_url() -> String { - let env_file_path = workspace_root().join("scripts").join("k8s-crd.env"); - println!("cargo:rerun-if-changed={}", env_file_path.display()); - - let env_file = - dotenvy::from_path_iter(env_file_path).expect("Failed to read scripts/k8s-crd.env"); - - env_file - .filter_map(Result::ok) - .find_map(|(key, value)| { - if key == "K8S_GATEWAY_AGENT_CRD_URL" { - Some(value) - } else { - None - } - }) - .expect("K8S_GATEWAY_AGENT_CRD_URL not found in scripts/k8s-crd.env") -} - -fn fetch_crd(url: &str) -> String { - println!("cargo:note=Fetching CRD from: {url}"); - ureq::get(url) - .call() - .expect("Failed to fetch agent CRD from url") - .body_mut() - .read_to_string() - .expect("Failed to read response body") -} - const LICENSE_PREAMBLE: &str = "// SPDX-License-Identifier: Apache-2.0 // Copyright Open Network Fabric Authors @@ -124,8 +87,31 @@ fn code_needs_regen(new_code: &str) -> bool { } fn main() { - let agent_crd_url = get_agent_crd_url(); - let agent_crd_contents = fetch_crd(&agent_crd_url); + let agent_crd_contents = { + let agent_crd_path = + PathBuf::from(std::env::var("GW_CRD_PATH").expect("GW_CRD_PATH var unset")) + .join("gwint.githedgehog.com_gatewayagents.yaml"); + let mut agent_crd_file = std::fs::OpenOptions::new() + .read(true) + .write(false) + .open(&agent_crd_path) + .unwrap_or_else(|e| { + panic!( + "failed to open {path}: {e}", + path = agent_crd_path.to_str().expect("non unicode crd path") + ) + }); + let mut contents = String::with_capacity( + agent_crd_file + .metadata() + .expect("unable to get crd metadata") + .len() as usize, + ); + agent_crd_file + .read_to_string(&mut contents) + .unwrap_or_else(|e| panic!("unable to read crd data into string: {e}")); + contents + }; let agent_generated_code = generate_rust_for_crd(&agent_crd_contents); if !code_needs_regen(&agent_generated_code) { diff --git a/k8s-intf/src/generated/gateway_agent_crd.rs b/k8s-intf/src/generated/gateway_agent_crd.rs index 828617a4b..6138cedf6 100644 --- a/k8s-intf/src/generated/gateway_agent_crd.rs +++ b/k8s-intf/src/generated/gateway_agent_crd.rs @@ -140,12 +140,10 @@ pub struct GatewayAgentGroups { #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] pub struct GatewayAgentGroupsMembers { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub priority: Option, - #[serde(default, skip_serializing_if = "Option::is_none", rename = "vtepIP")] - pub vtep_ip: Option, + pub name: String, + pub priority: i32, + #[serde(rename = "vtepIP")] + pub vtep_ip: String, } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] @@ -177,18 +175,29 @@ pub struct GatewayAgentPeeringsPeeringExpose { #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] pub struct GatewayAgentPeeringsPeeringExposeAs { + /// CIDR to include, only one of cidr, not can be set #[serde(default, skip_serializing_if = "Option::is_none")] pub cidr: Option, + /// CIDR to exclude, only one of cidr, not can be set #[serde(default, skip_serializing_if = "Option::is_none")] pub not: Option, + /// Port ranges (e.g. "80, 443, 3000-3100"), used together with exactly one of cidr, not + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ports: Option, } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] pub struct GatewayAgentPeeringsPeeringExposeIps { + /// CIDR to include, only one of cidr, not, vpcSubnet can be set #[serde(default, skip_serializing_if = "Option::is_none")] pub cidr: Option, + /// CIDR to exclude, only one of cidr, not, vpcSubnet can be set #[serde(default, skip_serializing_if = "Option::is_none")] pub not: Option, + /// Port ranges (e.g. "80, 443, 3000-3100"), used together with exactly one of cidr, not, vpcSubnet + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ports: Option, + /// CIDR by VPC subnet name to include, only one of cidr, not, vpcSubnet can be set #[serde(default, skip_serializing_if = "Option::is_none", rename = "vpcSubnet")] pub vpc_subnet: Option, } diff --git a/nix/.rust-toolchain.manifest-lock.json b/nix/.rust-toolchain.manifest-lock.json new file mode 100644 index 000000000..18160d91b --- /dev/null +++ b/nix/.rust-toolchain.manifest-lock.json @@ -0,0 +1,10 @@ +{ + "channel": "1.92.0", + "hash": { + "md5": "5925de5268fdcb9c70be7fa06de5583d", + "sha1": "aace35bc46aa55685f1e19c34d644f3d49b057c6", + "sha256": "b2a49624353173ecdacf59c158c00929300606e1963f6e4609fb483a508402d0", + "sha512": "0a8fc59360a5e6f3236d9a35ce2c8e0ba184e8be9b5a918f9bc7aae3e5cc1f8133eaa01fd044fdc6ba645805a98aa645e343fbb7b15a850ea0e83ff20d42ebaa" + }, + "url": "https://static.rust-lang.org/dist/channel-rust-1.92.0.toml" +} diff --git a/nix/overlays/dataplane-dev.nix b/nix/overlays/dataplane-dev.nix new file mode 100644 index 000000000..9756d3c71 --- /dev/null +++ b/nix/overlays/dataplane-dev.nix @@ -0,0 +1,43 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright Open Network Fabric Authors +{ + sources, +}: +final: prev: +let + fenix = import sources.fenix { }; + rust-toolchain = fenix.fromToolchainFile { + file = ../../rust-toolchain.toml; + sha256 = (builtins.fromJSON (builtins.readFile ../.rust-toolchain.manifest-lock.json)).hash.sha256; + }; + rustPlatform = final.makeRustPlatform { + stdenv = final.llvmPackages.stdenv; + cargo = rust-toolchain; + rustc = rust-toolchain; + }; +in +{ + inherit rust-toolchain; + rustPlatform' = rustPlatform; + + kopium = import ../pkgs/kopium { + src = sources.kopium; + inherit rustPlatform; + }; + cargo-bolero = prev.cargo-bolero.override { inherit rustPlatform; }; + cargo-deny = prev.cargo-deny.override { inherit rustPlatform; }; + cargo-llvm-cov = prev.cargo-llvm-cov.override { inherit rustPlatform; }; + cargo-nextest = prev.cargo-nextest.override { inherit rustPlatform; }; + just = prev.just.override { inherit rustPlatform; }; + npins = prev.npins.override { inherit rustPlatform; }; + gateway-crd = + let + path = "config/crd/bases/gwint.githedgehog.com_gatewayagents.yaml"; + in + final.writeTextFile { + name = "gateway-crd"; + text = builtins.readFile "${sources.gateway}/${path}"; + executable = false; + destination = "/src/gateway/${path}"; + }; +} diff --git a/nix/overlays/dataplane.nix b/nix/overlays/dataplane.nix index 3487cba14..b8b85dd99 100644 --- a/nix/overlays/dataplane.nix +++ b/nix/overlays/dataplane.nix @@ -1,6 +1,10 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright Open Network Fabric Authors { sources, - env ? { }, + sanitizers, + platform, + profile, }: final: prev: let @@ -11,21 +15,32 @@ let with builtins; (mapAttrs (var: val: (toString (orig.${var} or "")) + " " + (toString val)) add) ); adapt = final.stdenvAdapters; - bintools = final.buildPackages.llvmPackages.bintools; - lld = final.buildPackages.llvmPackages.lld; - stdenv-llvm = adapt.addAttrsToDerivation (orig: { + bintools = final.pkgsBuildHost.llvmPackages.bintools; + lld = final.pkgsBuildHost.llvmPackages.lld; + added-to-env = helpers.addToEnv platform.override.stdenv.env profile; + stdenv' = adapt.addAttrsToDerivation (orig: { doCheck = false; + separateDebugInfo = true; + env = helpers.addToEnv added-to-env (orig.env or { }); nativeBuildInputs = (orig.nativeBuildInputs or [ ]) ++ [ bintools lld ]; - }) (adapt.makeStaticLibraries final.buildPackages.llvmPackages.stdenv); - stdenv-llvm-with-flags = adapt.addAttrsToDerivation (orig: { - env = helpers.addToEnv env (orig.env or { }); - }) stdenv-llvm; - dataplane-dep = pkg: pkg.override { stdenv = stdenv-llvm-with-flags; }; + }) final.llvmPackages.stdenv; + dataplane-dep = pkg: pkg.override { stdenv = stdenv'; }; + fenix = import sources.fenix { }; + rust-toolchain = fenix.fromToolchainFile { + file = ../../rust-toolchain.toml; + sha256 = (builtins.fromJSON (builtins.readFile ../.rust-toolchain.manifest-lock.json)).hash.sha256; + }; + rustPlatform' = final.makeRustPlatform { + stdenv = stdenv'; + cargo = rust-toolchain; + rustc = rust-toolchain; + }; in { + inherit rust-toolchain stdenv' rustPlatform'; # Don't bother adapting ethtool or iproute2's build to our custom flags / env. Failure to null this can trigger # _massive_ builds because ethtool depends on libnl (et al), and we _do_ overlay libnl. Thus, the ethtool / iproute2 # get rebuilt and you end up rebuilding the whole world. @@ -44,8 +59,8 @@ in mscgen = null; pandoc = null; - # We should avoid accepting anything in our dpdk + friends pkgs which depends on udev / systemd; our deploy won't - # support any such mechanisms. + # We should avoid accepting anything in our dpdk + friends pkgs which depends on udev / systemd; our deploy simply + # won't support any such mechanisms. # # Usually this type of dependency takes the form of udev rules / systemd service files being generated (which is no # problem). That said, builds which hard and fast depend on systemd or udev are very suspicious in this context, so @@ -61,13 +76,17 @@ in # At minimum, the provided functions are generally quite small and likely to benefit from inlining, so static linking # is a solid plan. libmd = (dataplane-dep prev.libmd).overrideAttrs (orig: { - outputs = (orig.outputs or [ "out" ]) ++ [ "static" ]; + outputs = (orig.outputs or [ "out" ]) ++ [ + "man" + "dev" + "static" + ]; # we need to enable shared libs (in addition to static) to make dpdk's build happy. Basically, DPDK's build has no # means of disabling shared libraries, and it doesn't really make any sense to static link this into each .so # file. Ideally we would just _not_ build those .so files, but that would require doing brain surgery on dpdk's # meson build, and maintaining such a change set is not worth it to avoid building some .so files. configureFlags = (orig.configureFlags or [ ]) ++ [ - "--enable-shared" + "--enable-static" ]; postInstall = (orig.postInstall or "") + '' mkdir -p "$static/lib"; @@ -85,7 +104,7 @@ in # we need to enable shared (in addition to static) to build dpdk. # See the note on libmd for reasoning. configureFlags = orig.configureFlags ++ [ - "--enable-shared" + "--enable-static" ]; postInstall = (orig.postInstall or "") + '' mkdir -p "$static/lib"; @@ -105,7 +124,17 @@ in # More, this is a very low level library designed to send messages between a privileged process and the kernel. # The simple fact that this appears in our toolchain justifies sanitizers like safe-stack and cfi and/or flags like # -fcf-protection=full. - libnl = dataplane-dep prev.libnl; + libnl = (dataplane-dep prev.libnl).overrideAttrs (orig: { + outputs = (orig.outputs or [ "out" ]) ++ [ "static" ]; + configureFlags = (orig.configureFlags or [ ]) ++ [ + "--enable-static" + ]; + postInstall = (orig.postInstall or "") + '' + mkdir -p $static/lib + find $out/lib -name '*.la' -exec rm {} \; + mv $out/lib/*.a $static/lib/ + ''; + }); # This is needed by DPDK in order to determine which pinned core runs on which numa node and which NIC is most # efficiently connected to which NUMA node. You can disable the need for this library entirely by editing dpdk's @@ -116,16 +145,14 @@ in # function. In "the glorious future" we should bump all of this logic up to the dataplane's init process, compute # what we need to, pre-mmap _all_ of our heap memory, configure our cgroups and CPU affinities, and then pin our cores # and use memory pools local to the numa node of the pinned core. That would be a fair amount of work, but it would - # liminate a fairly large dependency and likely increase the performance and security of the dataplane. + # eliminate a dependency and likely increase the performance and security of the dataplane. # # For now, we leave this on so DPDK can do some of that for us. That said, this logic is quite cold and would ideally # be size optimized and punted far from all hot paths. BOLT should be helpful here. numactl = (dataplane-dep prev.numactl).overrideAttrs (orig: { outputs = (prev.lib.lists.remove "man" orig.outputs) ++ [ "static" ]; - # we need to enable shared (in addition to static) to build dpdk. - # See the note on libmd for reasoning. configureFlags = (orig.configureFlags or [ ]) ++ [ - "--enable-shared" # dpdk does not like to build its .so files if we don't build numa.so as well + "--enable-static" ]; postInstall = (orig.postInstall or "") + '' mkdir -p "$static/lib"; @@ -145,25 +172,64 @@ in rdma-core = (dataplane-dep prev.rdma-core).overrideAttrs (orig: { version = sources.rdma-core.branch; src = sources.rdma-core.outPath; - outputs = [ - "dev" - "out" + + # Patching the shebang lines in the perl scripts causes nixgraph to (incorrectly) think we depend on perl at + # runtime. We absolutely do not (we don't even ship a perl interpreter), so don't patch these shebang lines. + # In fact, we don't use any of the scripts from this package. + dontPatchShebangs = true; + + # The upstream postFixup is broken by dontPatchShebangs = true + # It's whole function was to further mutate the shebang lines in perl scripts, so we don't care. + # Just null it. + postFixup = null; + + outputs = (orig.outputs or [ ]) ++ [ "static" ]; - cmakeFlags = orig.cmakeFlags ++ [ - "-DENABLE_STATIC=1" - # we don't need pyverbs, and turning it off reduces build time / complexity. - "-DNO_PYVERBS=1" - # no need for docs in container images. - "-DNO_MAN_PAGES=1" - # we don't care about this lib's exported symbols / compat situation _at all_ because we static link (which - # doesn't even have symbol versioning / compatibility in the first place). Turning this off just reduces the - # build's internal complexity and makes lto easier. - "-DNO_COMPAT_SYMS=1" - ]; + # CMake depends on -Werror to function, but the test program it uses to confirm that -Werror works "always produces + # warnings." The reason for this is that we have injected our own CFLAGS and they have nothing to do with the + # trivial program. This causes the unused-command-line-argument warning to trigger. + # We disable that warning here to make sure rdma-core can build (more specifically, to make sure that it can build + # with debug symbols). + CFLAGS = "-Wno-unused-command-line-argument"; + cmakeFlags = + orig.cmakeFlags + ++ [ + "-DRDMA_DYNAMIC_PROVIDERS=none" + "-DRDMA_STATIC_PROVIDERS=all" + "-DENABLE_STATIC=1" + # we don't need pyverbs, and turning it off reduces build time / complexity. + "-DNO_PYVERBS=1" + # no need for docs in container images. + "-DNO_MAN_PAGES=1" + # we don't care about this lib's exported symbols / compat situation _at all_ because we static link (which + # doesn't even have symbol versioning / compatibility in the first place). Turning this off just reduces the + # build's internal complexity and makes lto easier. + "-DNO_COMPAT_SYMS=1" + # Very old versions of rdma-core used what they call the "legacy write path" to support rdma-operations. + # These have (long) since been superseded by the ioctl mode, but the library generates both code paths by + # default due to rdma-core's fairly aggressive backwards compatibility stance. + # We have absolutely no need or desire to support the legacy mode, and we can potentially save ourselves some + # instruction cache pressure by disabling that old code at compile time. + "-DIOCTL_MODE=ioctl" + ] + ++ + final.lib.optionals + ( + (builtins.elem "thread" sanitizers) + || (builtins.elem "address" sanitizers) + || (builtins.elem "safe-stack" sanitizers) + ) + [ + # This allows address / thread sanitizer to build (thread/ub sanitizers do not like -Wl,-z,defs or + # -Wl,--no-undefined). + # This isn't a hack: undefined symbols from sanitizers is a known issue and is not unique to us. + "-DSUPPORTS_NO_UNDEFINED=0" + ]; postInstall = (orig.postInstall or "") + '' - mkdir -p $static/lib; + mkdir -p $static/lib $man; mv $out/lib/*.a $static/lib/ + mv $out/share $man/ ''; }); @@ -175,5 +241,18 @@ in # # Also, while this library has a respectable security track record, this is also a super strong candidate for # cfi, safe-stack, and cf-protection. - dpdk = dataplane-dep (final.callPackage ../pkgs/dpdk { src = sources.dpdk; }); + dpdk = dataplane-dep ( + final.callPackage ../pkgs/dpdk (platform.override.dpdk.buildInputs // { src = sources.dpdk; }) + ); + + # DPDK is largely composed of static-inline functions. + # We need to wrap those functions with "_w" variants so that we can actually call them from rust. + # + # This wrapping process does not really cause any performance issue due to lto; the compiler is going to "unwrap" + # these methods anyway. + dpdk-wrapper = dataplane-dep (final.callPackage ../pkgs/dpdk-wrapper { }); + + pciutils = dataplane-dep (prev.pciutils.override { static = true; }); + # This isn't directly required by dataplane, + perftest = dataplane-dep (final.callPackage ../pkgs/perftest { src = sources.perftest; }); } diff --git a/nix/overlays/default.nix b/nix/overlays/default.nix index 6139dfb3c..d7bb9d7f7 100644 --- a/nix/overlays/default.nix +++ b/nix/overlays/default.nix @@ -1,9 +1,26 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright Open Network Fabric Authors { sources, - env ? { }, + sanitizers, + platform, + profile, }: { + llvm = import ./llvm.nix { + inherit sources; + }; + dataplane = import ./dataplane.nix { - inherit sources env; + inherit + sources + sanitizers + platform + profile + ; + }; + + dataplane-dev = import ./dataplane-dev.nix { + inherit sources; }; } diff --git a/nix/overlays/llvm.nix b/nix/overlays/llvm.nix new file mode 100644 index 000000000..9e7049db3 --- /dev/null +++ b/nix/overlays/llvm.nix @@ -0,0 +1,36 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright Open Network Fabric Authors +{ + sources, +}: +let + fenix = import sources.fenix { }; + rust-toolchain = fenix.fromToolchainFile { + file = ../../rust-toolchain.toml; + sha256 = (builtins.fromJSON (builtins.readFile ../.rust-toolchain.manifest-lock.json)).hash.sha256; + }; +in +final: prev: { + # It is essential that we always use the same version of llvm that our rustc is backed by. + # To minimize maintenance burden, we explicitly compute the version of LLVM we need by asking rustc + # which version it is using. + # This is significantly less error prone than hunting around for all versions of pkgs.llvmPackages_${version} + # every time rust updates. + llvmPackages = + let + version = builtins.readFile ( + final.runCommandLocal "llvm-version-for-our-rustc" + { + RUSTC = "${rust-toolchain.out}/bin/rustc"; + GREP = "${final.pkgsBuildHost.gnugrep}/bin/grep"; + SED = "${final.pkgsBuildHost.gnused}/bin/sed"; + } + '' + $RUSTC --version --verbose | \ + $GREP '^LLVM version:' | \ + $SED -z 's|LLVM version: \([0-9]\+\)\.[0-9]\+\.[0-9]\+\n|\1|' > $out + '' + ); + in + final."llvmPackages_${version}"; +} diff --git a/nix/pkgs/dpdk-wrapper/default.nix b/nix/pkgs/dpdk-wrapper/default.nix new file mode 100644 index 000000000..60ffe4623 --- /dev/null +++ b/nix/pkgs/dpdk-wrapper/default.nix @@ -0,0 +1,37 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright Open Network Fabric Authors +{ + stdenv, + dpdk, + libbsd, +}: +stdenv.mkDerivation { + pname = "dpdk-wrapper"; + version = dpdk.version; + + src = ./src; + + nativeBuildInptus = [ + dpdk + libbsd + ]; + + outputs = [ + "dev" + "out" + ]; + + # DPDK marks all experimental apis as deprecated, but we wish to wrap such apis as well. Thus, turn off deprecation + # warnings. + CFLAGS = [ "-Wno-deprecated-declarations" ]; + + buildPhase = '' + set euxo pipefail + mkdir -p $dev/include $out/lib + $CC $CFLAGS -I${dpdk}/include -I${libbsd.dev}/include -c $src/dpdk_wrapper.c -o wrapper.o; + $AR rcs $out/lib/libdpdk_wrapper.a wrapper.o; + $RANLIB $out/lib/libdpdk_wrapper.a; + cp $src/*.h $dev/include + ''; + +} diff --git a/nix/pkgs/dpdk-wrapper/src/dpdk_wrapper.c b/nix/pkgs/dpdk-wrapper/src/dpdk_wrapper.c new file mode 100644 index 000000000..2309a4ec9 --- /dev/null +++ b/nix/pkgs/dpdk-wrapper/src/dpdk_wrapper.c @@ -0,0 +1,1518 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright Open Network Fabric Authors + +#include "dpdk_wrapper.h" + +int rte_errno_get() { return rte_errno; } + +// Static wrappers + +int rte_is_aligned_w(const void *const ptr, const unsigned int align) { + return rte_is_aligned(ptr, align); +} +void rte_atomic_thread_fence_w(rte_memory_order memorder) { + rte_atomic_thread_fence(memorder); +} +int rte_atomic16_cmpset_w(uint16_t *dst, uint16_t exp, uint16_t src) { + return rte_atomic16_cmpset(dst, exp, src); +} +uint16_t rte_atomic16_exchange_w(uint16_t *dst, uint16_t val) { + return rte_atomic16_exchange(dst, val); +} +void rte_atomic16_init_w(rte_atomic16_t *v) { rte_atomic16_init(v); } +int16_t rte_atomic16_read_w(const rte_atomic16_t *v) { + return rte_atomic16_read(v); +} +void rte_atomic16_set_w(rte_atomic16_t *v, int16_t new_value) { + rte_atomic16_set(v, new_value); +} +void rte_atomic16_add_w(rte_atomic16_t *v, int16_t inc) { + rte_atomic16_add(v, inc); +} +void rte_atomic16_sub_w(rte_atomic16_t *v, int16_t dec) { + rte_atomic16_sub(v, dec); +} +void rte_atomic16_inc_w(rte_atomic16_t *v) { rte_atomic16_inc(v); } +void rte_atomic16_dec_w(rte_atomic16_t *v) { rte_atomic16_dec(v); } +int16_t rte_atomic16_add_return_w(rte_atomic16_t *v, int16_t inc) { + return rte_atomic16_add_return(v, inc); +} +int16_t rte_atomic16_sub_return_w(rte_atomic16_t *v, int16_t dec) { + return rte_atomic16_sub_return(v, dec); +} +int rte_atomic16_inc_and_test_w(rte_atomic16_t *v) { + return rte_atomic16_inc_and_test(v); +} +int rte_atomic16_dec_and_test_w(rte_atomic16_t *v) { + return rte_atomic16_dec_and_test(v); +} +int rte_atomic16_test_and_set_w(rte_atomic16_t *v) { + return rte_atomic16_test_and_set(v); +} +void rte_atomic16_clear_w(rte_atomic16_t *v) { rte_atomic16_clear(v); } +int rte_atomic32_cmpset_w(uint32_t *dst, uint32_t exp, uint32_t src) { + return rte_atomic32_cmpset(dst, exp, src); +} +uint32_t rte_atomic32_exchange_w(uint32_t *dst, uint32_t val) { + return rte_atomic32_exchange(dst, val); +} +void rte_atomic32_init_w(rte_atomic32_t *v) { rte_atomic32_init(v); } +int32_t rte_atomic32_read_w(const rte_atomic32_t *v) { + return rte_atomic32_read(v); +} +void rte_atomic32_set_w(rte_atomic32_t *v, int32_t new_value) { + rte_atomic32_set(v, new_value); +} +void rte_atomic32_add_w(rte_atomic32_t *v, int32_t inc) { + rte_atomic32_add(v, inc); +} +void rte_atomic32_sub_w(rte_atomic32_t *v, int32_t dec) { + rte_atomic32_sub(v, dec); +} +void rte_atomic32_inc_w(rte_atomic32_t *v) { rte_atomic32_inc(v); } +void rte_atomic32_dec_w(rte_atomic32_t *v) { rte_atomic32_dec(v); } +int32_t rte_atomic32_add_return_w(rte_atomic32_t *v, int32_t inc) { + return rte_atomic32_add_return(v, inc); +} +int32_t rte_atomic32_sub_return_w(rte_atomic32_t *v, int32_t dec) { + return rte_atomic32_sub_return(v, dec); +} +int rte_atomic32_inc_and_test_w(rte_atomic32_t *v) { + return rte_atomic32_inc_and_test(v); +} +int rte_atomic32_dec_and_test_w(rte_atomic32_t *v) { + return rte_atomic32_dec_and_test(v); +} +int rte_atomic32_test_and_set_w(rte_atomic32_t *v) { + return rte_atomic32_test_and_set(v); +} +void rte_atomic32_clear_w(rte_atomic32_t *v) { rte_atomic32_clear(v); } +int rte_atomic64_cmpset_w(uint64_t *dst, uint64_t exp, uint64_t src) { + return rte_atomic64_cmpset(dst, exp, src); +} +uint64_t rte_atomic64_exchange_w(uint64_t *dst, uint64_t val) { + return rte_atomic64_exchange(dst, val); +} +void rte_atomic64_init_w(rte_atomic64_t *v) { rte_atomic64_init(v); } +int64_t rte_atomic64_read_w(rte_atomic64_t *v) { return rte_atomic64_read(v); } +void rte_atomic64_set_w(rte_atomic64_t *v, int64_t new_value) { + rte_atomic64_set(v, new_value); +} +void rte_atomic64_add_w(rte_atomic64_t *v, int64_t inc) { + rte_atomic64_add(v, inc); +} +void rte_atomic64_sub_w(rte_atomic64_t *v, int64_t dec) { + rte_atomic64_sub(v, dec); +} +void rte_atomic64_inc_w(rte_atomic64_t *v) { rte_atomic64_inc(v); } +void rte_atomic64_dec_w(rte_atomic64_t *v) { rte_atomic64_dec(v); } +int64_t rte_atomic64_add_return_w(rte_atomic64_t *v, int64_t inc) { + return rte_atomic64_add_return(v, inc); +} +int64_t rte_atomic64_sub_return_w(rte_atomic64_t *v, int64_t dec) { + return rte_atomic64_sub_return(v, dec); +} +int rte_atomic64_inc_and_test_w(rte_atomic64_t *v) { + return rte_atomic64_inc_and_test(v); +} +int rte_atomic64_dec_and_test_w(rte_atomic64_t *v) { + return rte_atomic64_dec_and_test(v); +} +int rte_atomic64_test_and_set_w(rte_atomic64_t *v) { + return rte_atomic64_test_and_set(v); +} +void rte_atomic64_clear_w(rte_atomic64_t *v) { rte_atomic64_clear(v); } +void rte_smp_mb_w(void) { rte_smp_mb(); } +uint64_t rte_get_tsc_cycles_w(void) { return rte_get_tsc_cycles(); } +uint64_t rte_get_timer_cycles_w(void) { return rte_get_timer_cycles(); } +uint64_t rte_get_timer_hz_w(void) { return rte_get_timer_hz(); } +void rte_delay_ms_w(unsigned int ms) { rte_delay_ms(ms); } +uint64_t rte_rdtsc_w(void) { return rte_rdtsc(); } +uint64_t rte_rdtsc_precise_w(void) { return rte_rdtsc_precise(); } +size_t rte_strlcpy_w(char *dst, const char *src, size_t size) { + return rte_strlcpy(dst, src, size); +} +size_t rte_strlcat_w(char *dst, const char *src, size_t size) { + return rte_strlcat(dst, src, size); +} +const char *rte_str_skip_leading_spaces_w(const char *src) { + return rte_str_skip_leading_spaces(src); +} +void rte_uuid_copy_w(rte_uuid_t dst, const rte_uuid_t src) { + rte_uuid_copy(dst, src); +} +int rte_gettid_w(void) { return rte_gettid(); } +unsigned int rte_lcore_id_w(void) { return rte_lcore_id(); } +void rte_pause_w(void) { rte_pause(); } +void rte_wait_until_equal_16_w(uint16_t *addr, uint16_t expected, + rte_memory_order memorder) { + rte_wait_until_equal_16(addr, expected, memorder); +} +void rte_wait_until_equal_32_w(uint32_t *addr, uint32_t expected, + rte_memory_order memorder) { + rte_wait_until_equal_32(addr, expected, memorder); +} +void rte_wait_until_equal_64_w(uint64_t *addr, uint64_t expected, + rte_memory_order memorder) { + rte_wait_until_equal_64(addr, expected, memorder); +} +void rte_spinlock_init_w(rte_spinlock_t *sl) { rte_spinlock_init(sl); } +void rte_spinlock_lock_w(rte_spinlock_t *sl) { rte_spinlock_lock(sl); } +void rte_spinlock_unlock_w(rte_spinlock_t *sl) { rte_spinlock_unlock(sl); } +int rte_spinlock_trylock_w(rte_spinlock_t *sl) { + return rte_spinlock_trylock(sl); +} +int rte_spinlock_is_locked_w(rte_spinlock_t *sl) { + return rte_spinlock_is_locked(sl); +} +int rte_tm_supported_w(void) { return rte_tm_supported(); } +void rte_spinlock_lock_tm_w(rte_spinlock_t *sl) { rte_spinlock_lock_tm(sl); } +void rte_spinlock_unlock_tm_w(rte_spinlock_t *sl) { + rte_spinlock_unlock_tm(sl); +} +int rte_spinlock_trylock_tm_w(rte_spinlock_t *sl) { + return rte_spinlock_trylock_tm(sl); +} +void rte_spinlock_recursive_init_w(rte_spinlock_recursive_t *slr) { + rte_spinlock_recursive_init(slr); +} +void rte_spinlock_recursive_lock_w(rte_spinlock_recursive_t *slr) { + rte_spinlock_recursive_lock(slr); +} +void rte_spinlock_recursive_unlock_w(rte_spinlock_recursive_t *slr) { + rte_spinlock_recursive_unlock(slr); +} +int rte_spinlock_recursive_trylock_w(rte_spinlock_recursive_t *slr) { + return rte_spinlock_recursive_trylock(slr); +} +void rte_spinlock_recursive_lock_tm_w(rte_spinlock_recursive_t *slr) { + rte_spinlock_recursive_lock_tm(slr); +} +void rte_spinlock_recursive_unlock_tm_w(rte_spinlock_recursive_t *slr) { + rte_spinlock_recursive_unlock_tm(slr); +} +int rte_spinlock_recursive_trylock_tm_w(rte_spinlock_recursive_t *slr) { + return rte_spinlock_recursive_trylock_tm(slr); +} +// unsigned int rte_xbegin_w(void) { return rte_xbegin(); } +// void rte_xend_w(void) { rte_xend(); } +// int rte_xtest_w(void) { return rte_xtest(); } +// int rte_try_tm_w(int *lock) { return rte_try_tm(lock); } +uint32_t rte_bit_relaxed_get32_w(unsigned int nr, uint32_t *addr) { + return rte_bit_relaxed_get32(nr, addr); +} +void rte_bit_relaxed_set32_w(unsigned int nr, uint32_t *addr) { + rte_bit_relaxed_set32(nr, addr); +} +void rte_bit_relaxed_clear32_w(unsigned int nr, uint32_t *addr) { + rte_bit_relaxed_clear32(nr, addr); +} +uint32_t rte_bit_relaxed_test_and_set32_w(unsigned int nr, uint32_t *addr) { + return rte_bit_relaxed_test_and_set32(nr, addr); +} +uint32_t rte_bit_relaxed_test_and_clear32_w(unsigned int nr, uint32_t *addr) { + return rte_bit_relaxed_test_and_clear32(nr, addr); +} +uint64_t rte_bit_relaxed_get64_w(unsigned int nr, uint64_t *addr) { + return rte_bit_relaxed_get64(nr, addr); +} +void rte_bit_relaxed_set64_w(unsigned int nr, uint64_t *addr) { + rte_bit_relaxed_set64(nr, addr); +} +void rte_bit_relaxed_clear64_w(unsigned int nr, uint64_t *addr) { + rte_bit_relaxed_clear64(nr, addr); +} +uint64_t rte_bit_relaxed_test_and_set64_w(unsigned int nr, uint64_t *addr) { + return rte_bit_relaxed_test_and_set64(nr, addr); +} +uint64_t rte_bit_relaxed_test_and_clear64_w(unsigned int nr, uint64_t *addr) { + return rte_bit_relaxed_test_and_clear64(nr, addr); +} +unsigned int rte_clz32_w(uint32_t v) { return rte_clz32(v); } +unsigned int rte_clz64_w(uint64_t v) { return rte_clz64(v); } +unsigned int rte_ctz32_w(uint32_t v) { return rte_ctz32(v); } +unsigned int rte_ctz64_w(uint64_t v) { return rte_ctz64(v); } +unsigned int rte_popcount32_w(uint32_t v) { return rte_popcount32(v); } +unsigned int rte_popcount64_w(uint64_t v) { return rte_popcount64(v); } +uint32_t rte_combine32ms1b_w(uint32_t x) { return rte_combine32ms1b(x); } +uint64_t rte_combine64ms1b_w(uint64_t v) { return rte_combine64ms1b(v); } +uint32_t rte_bsf32_w(uint32_t v) { return rte_bsf32(v); } +int rte_bsf32_safe_w(uint32_t v, uint32_t *pos) { + return rte_bsf32_safe(v, pos); +} +uint32_t rte_bsf64_w(uint64_t v) { return rte_bsf64(v); } +int rte_bsf64_safe_w(uint64_t v, uint32_t *pos) { + return rte_bsf64_safe(v, pos); +} +uint32_t rte_fls_u32_w(uint32_t x) { return rte_fls_u32(x); } +uint32_t rte_fls_u64_w(uint64_t x) { return rte_fls_u64(x); } +int rte_is_power_of_2_w(uint32_t n) { return rte_is_power_of_2(n); } +uint32_t rte_align32pow2_w(uint32_t x) { return rte_align32pow2(x); } +uint32_t rte_align32prevpow2_w(uint32_t x) { return rte_align32prevpow2(x); } +uint64_t rte_align64pow2_w(uint64_t v) { return rte_align64pow2(v); } +uint64_t rte_align64prevpow2_w(uint64_t v) { return rte_align64prevpow2(v); } +uint32_t rte_log2_u32_w(uint32_t v) { return rte_log2_u32(v); } +uint32_t rte_log2_u64_w(uint64_t v) { return rte_log2_u64(v); } +void rte_rwlock_init_w(rte_rwlock_t *rwl) { rte_rwlock_init(rwl); } +void rte_rwlock_read_lock_w(rte_rwlock_t *rwl) { rte_rwlock_read_lock(rwl); } +int rte_rwlock_read_trylock_w(rte_rwlock_t *rwl) { + return rte_rwlock_read_trylock(rwl); +} +void rte_rwlock_read_unlock_w(rte_rwlock_t *rwl) { + rte_rwlock_read_unlock(rwl); +} +int rte_rwlock_write_trylock_w(rte_rwlock_t *rwl) { + return rte_rwlock_write_trylock(rwl); +} +void rte_rwlock_write_lock_w(rte_rwlock_t *rwl) { rte_rwlock_write_lock(rwl); } +void rte_rwlock_write_unlock_w(rte_rwlock_t *rwl) { + rte_rwlock_write_unlock(rwl); +} +int rte_rwlock_write_is_locked_w(rte_rwlock_t *rwl) { + return rte_rwlock_write_is_locked(rwl); +} +void rte_rwlock_read_lock_tm_w(rte_rwlock_t *rwl) { + rte_rwlock_read_lock_tm(rwl); +} +void rte_rwlock_read_unlock_tm_w(rte_rwlock_t *rwl) { + rte_rwlock_read_unlock_tm(rwl); +} +void rte_rwlock_write_lock_tm_w(rte_rwlock_t *rwl) { + rte_rwlock_write_lock_tm(rwl); +} +void rte_rwlock_write_unlock_tm_w(rte_rwlock_t *rwl) { + rte_rwlock_write_unlock_tm(rwl); +} +unsigned int rte_ring_mp_enqueue_bulk_elem_w(struct rte_ring *r, + const void *obj_table, + unsigned int esize, unsigned int n, + unsigned int *free_space) { + return rte_ring_mp_enqueue_bulk_elem(r, obj_table, esize, n, free_space); +} +unsigned int rte_ring_sp_enqueue_bulk_elem_w(struct rte_ring *r, + const void *obj_table, + unsigned int esize, unsigned int n, + unsigned int *free_space) { + return rte_ring_sp_enqueue_bulk_elem(r, obj_table, esize, n, free_space); +} +unsigned int rte_ring_mp_hts_enqueue_bulk_elem_w(struct rte_ring *r, + const void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *free_space) { + return rte_ring_mp_hts_enqueue_bulk_elem(r, obj_table, esize, n, free_space); +} +unsigned int rte_ring_mc_hts_dequeue_bulk_elem_w(struct rte_ring *r, + void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *available) { + return rte_ring_mc_hts_dequeue_bulk_elem(r, obj_table, esize, n, available); +} +unsigned int rte_ring_mp_hts_enqueue_burst_elem_w(struct rte_ring *r, + const void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *free_space) { + return rte_ring_mp_hts_enqueue_burst_elem(r, obj_table, esize, n, free_space); +} +unsigned int rte_ring_mc_hts_dequeue_burst_elem_w(struct rte_ring *r, + void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *available) { + return rte_ring_mc_hts_dequeue_burst_elem(r, obj_table, esize, n, available); +} +unsigned int rte_ring_mp_hts_enqueue_bulk_w(struct rte_ring *r, + void *const *obj_table, + unsigned int n, + unsigned int *free_space) { + return rte_ring_mp_hts_enqueue_bulk(r, obj_table, n, free_space); +} +unsigned int rte_ring_mc_hts_dequeue_bulk_w(struct rte_ring *r, + void **obj_table, unsigned int n, + unsigned int *available) { + return rte_ring_mc_hts_dequeue_bulk(r, obj_table, n, available); +} +unsigned int rte_ring_mp_hts_enqueue_burst_w(struct rte_ring *r, + void *const *obj_table, + unsigned int n, + unsigned int *free_space) { + return rte_ring_mp_hts_enqueue_burst(r, obj_table, n, free_space); +} +unsigned int rte_ring_mc_hts_dequeue_burst_w(struct rte_ring *r, + void **obj_table, unsigned int n, + unsigned int *available) { + return rte_ring_mc_hts_dequeue_burst(r, obj_table, n, available); +} +unsigned int rte_ring_mp_rts_enqueue_bulk_elem_w(struct rte_ring *r, + const void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *free_space) { + return rte_ring_mp_rts_enqueue_bulk_elem(r, obj_table, esize, n, free_space); +} +unsigned int rte_ring_mc_rts_dequeue_bulk_elem_w(struct rte_ring *r, + void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *available) { + return rte_ring_mc_rts_dequeue_bulk_elem(r, obj_table, esize, n, available); +} +unsigned int rte_ring_mp_rts_enqueue_burst_elem_w(struct rte_ring *r, + const void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *free_space) { + return rte_ring_mp_rts_enqueue_burst_elem(r, obj_table, esize, n, free_space); +} +unsigned int rte_ring_mc_rts_dequeue_burst_elem_w(struct rte_ring *r, + void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *available) { + return rte_ring_mc_rts_dequeue_burst_elem(r, obj_table, esize, n, available); +} +unsigned int rte_ring_mp_rts_enqueue_bulk_w(struct rte_ring *r, + void *const *obj_table, + unsigned int n, + unsigned int *free_space) { + return rte_ring_mp_rts_enqueue_bulk(r, obj_table, n, free_space); +} +unsigned int rte_ring_mc_rts_dequeue_bulk_w(struct rte_ring *r, + void **obj_table, unsigned int n, + unsigned int *available) { + return rte_ring_mc_rts_dequeue_bulk(r, obj_table, n, available); +} +unsigned int rte_ring_mp_rts_enqueue_burst_w(struct rte_ring *r, + void *const *obj_table, + unsigned int n, + unsigned int *free_space) { + return rte_ring_mp_rts_enqueue_burst(r, obj_table, n, free_space); +} +unsigned int rte_ring_mc_rts_dequeue_burst_w(struct rte_ring *r, + void **obj_table, unsigned int n, + unsigned int *available) { + return rte_ring_mc_rts_dequeue_burst(r, obj_table, n, available); +} +uint32_t rte_ring_get_prod_htd_max_w(const struct rte_ring *r) { + return rte_ring_get_prod_htd_max(r); +} +int rte_ring_set_prod_htd_max_w(struct rte_ring *r, uint32_t v) { + return rte_ring_set_prod_htd_max(r, v); +} +uint32_t rte_ring_get_cons_htd_max_w(const struct rte_ring *r) { + return rte_ring_get_cons_htd_max(r); +} +int rte_ring_set_cons_htd_max_w(struct rte_ring *r, uint32_t v) { + return rte_ring_set_cons_htd_max(r, v); +} +unsigned int rte_ring_enqueue_bulk_elem_w(struct rte_ring *r, + const void *obj_table, + unsigned int esize, unsigned int n, + unsigned int *free_space) { + return rte_ring_enqueue_bulk_elem(r, obj_table, esize, n, free_space); +} +int rte_ring_mp_enqueue_elem_w(struct rte_ring *r, void *obj, + unsigned int esize) { + return rte_ring_mp_enqueue_elem(r, obj, esize); +} +int rte_ring_sp_enqueue_elem_w(struct rte_ring *r, void *obj, + unsigned int esize) { + return rte_ring_sp_enqueue_elem(r, obj, esize); +} +int rte_ring_enqueue_elem_w(struct rte_ring *r, void *obj, unsigned int esize) { + return rte_ring_enqueue_elem(r, obj, esize); +} +unsigned int rte_ring_mc_dequeue_bulk_elem_w(struct rte_ring *r, + void *obj_table, + unsigned int esize, unsigned int n, + unsigned int *available) { + return rte_ring_mc_dequeue_bulk_elem(r, obj_table, esize, n, available); +} +unsigned int rte_ring_sc_dequeue_bulk_elem_w(struct rte_ring *r, + void *obj_table, + unsigned int esize, unsigned int n, + unsigned int *available) { + return rte_ring_sc_dequeue_bulk_elem(r, obj_table, esize, n, available); +} +unsigned int rte_ring_dequeue_bulk_elem_w(struct rte_ring *r, void *obj_table, + unsigned int esize, unsigned int n, + unsigned int *available) { + return rte_ring_dequeue_bulk_elem(r, obj_table, esize, n, available); +} +int rte_ring_mc_dequeue_elem_w(struct rte_ring *r, void *obj_p, + unsigned int esize) { + return rte_ring_mc_dequeue_elem(r, obj_p, esize); +} +int rte_ring_sc_dequeue_elem_w(struct rte_ring *r, void *obj_p, + unsigned int esize) { + return rte_ring_sc_dequeue_elem(r, obj_p, esize); +} +int rte_ring_dequeue_elem_w(struct rte_ring *r, void *obj_p, + unsigned int esize) { + return rte_ring_dequeue_elem(r, obj_p, esize); +} +unsigned int rte_ring_mp_enqueue_burst_elem_w(struct rte_ring *r, + const void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *free_space) { + return rte_ring_mp_enqueue_burst_elem(r, obj_table, esize, n, free_space); +} +unsigned int rte_ring_sp_enqueue_burst_elem_w(struct rte_ring *r, + const void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *free_space) { + return rte_ring_sp_enqueue_burst_elem(r, obj_table, esize, n, free_space); +} +unsigned int rte_ring_enqueue_burst_elem_w(struct rte_ring *r, + const void *obj_table, + unsigned int esize, unsigned int n, + unsigned int *free_space) { + return rte_ring_enqueue_burst_elem(r, obj_table, esize, n, free_space); +} +unsigned int rte_ring_mc_dequeue_burst_elem_w(struct rte_ring *r, + void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *available) { + return rte_ring_mc_dequeue_burst_elem(r, obj_table, esize, n, available); +} +unsigned int rte_ring_sc_dequeue_burst_elem_w(struct rte_ring *r, + void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *available) { + return rte_ring_sc_dequeue_burst_elem(r, obj_table, esize, n, available); +} +unsigned int rte_ring_dequeue_burst_elem_w(struct rte_ring *r, void *obj_table, + unsigned int esize, unsigned int n, + unsigned int *available) { + return rte_ring_dequeue_burst_elem(r, obj_table, esize, n, available); +} +unsigned int rte_ring_enqueue_bulk_elem_start_w(struct rte_ring *r, + unsigned int n, + unsigned int *free_space) { + return rte_ring_enqueue_bulk_elem_start(r, n, free_space); +} +unsigned int rte_ring_enqueue_bulk_start_w(struct rte_ring *r, unsigned int n, + unsigned int *free_space) { + return rte_ring_enqueue_bulk_start(r, n, free_space); +} +unsigned int rte_ring_enqueue_burst_elem_start_w(struct rte_ring *r, + unsigned int n, + unsigned int *free_space) { + return rte_ring_enqueue_burst_elem_start(r, n, free_space); +} +unsigned int rte_ring_enqueue_burst_start_w(struct rte_ring *r, unsigned int n, + unsigned int *free_space) { + return rte_ring_enqueue_burst_start(r, n, free_space); +} +void rte_ring_enqueue_elem_finish_w(struct rte_ring *r, const void *obj_table, + unsigned int esize, unsigned int n) { + rte_ring_enqueue_elem_finish(r, obj_table, esize, n); +} +void rte_ring_enqueue_finish_w(struct rte_ring *r, void *const *obj_table, + unsigned int n) { + rte_ring_enqueue_finish(r, obj_table, n); +} +unsigned int rte_ring_dequeue_bulk_elem_start_w(struct rte_ring *r, + void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *available) { + return rte_ring_dequeue_bulk_elem_start(r, obj_table, esize, n, available); +} +unsigned int rte_ring_dequeue_bulk_start_w(struct rte_ring *r, void **obj_table, + unsigned int n, + unsigned int *available) { + return rte_ring_dequeue_bulk_start(r, obj_table, n, available); +} +unsigned int rte_ring_dequeue_burst_elem_start_w(struct rte_ring *r, + void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *available) { + return rte_ring_dequeue_burst_elem_start(r, obj_table, esize, n, available); +} +unsigned int rte_ring_dequeue_burst_start_w(struct rte_ring *r, + void **obj_table, unsigned int n, + unsigned int *available) { + return rte_ring_dequeue_burst_start(r, obj_table, n, available); +} +void rte_ring_dequeue_elem_finish_w(struct rte_ring *r, unsigned int n) { + rte_ring_dequeue_elem_finish(r, n); +} +void rte_ring_dequeue_finish_w(struct rte_ring *r, unsigned int n) { + rte_ring_dequeue_finish(r, n); +} +unsigned int rte_ring_enqueue_zc_bulk_elem_start_w(struct rte_ring *r, + unsigned int esize, + unsigned int n, + struct rte_ring_zc_data *zcd, + unsigned int *free_space) { + return rte_ring_enqueue_zc_bulk_elem_start(r, esize, n, zcd, free_space); +} +unsigned int rte_ring_enqueue_zc_bulk_start_w(struct rte_ring *r, + unsigned int n, + struct rte_ring_zc_data *zcd, + unsigned int *free_space) { + return rte_ring_enqueue_zc_bulk_start(r, n, zcd, free_space); +} +unsigned int rte_ring_enqueue_zc_burst_elem_start_w( + struct rte_ring *r, unsigned int esize, unsigned int n, + struct rte_ring_zc_data *zcd, unsigned int *free_space) { + return rte_ring_enqueue_zc_burst_elem_start(r, esize, n, zcd, free_space); +} +unsigned int rte_ring_enqueue_zc_burst_start_w(struct rte_ring *r, + unsigned int n, + struct rte_ring_zc_data *zcd, + unsigned int *free_space) { + return rte_ring_enqueue_zc_burst_start(r, n, zcd, free_space); +} +void rte_ring_enqueue_zc_elem_finish_w(struct rte_ring *r, unsigned int n) { + rte_ring_enqueue_zc_elem_finish(r, n); +} +void rte_ring_enqueue_zc_finish_w(struct rte_ring *r, unsigned int n) { + rte_ring_enqueue_zc_finish(r, n); +} +unsigned int rte_ring_dequeue_zc_bulk_elem_start_w(struct rte_ring *r, + unsigned int esize, + unsigned int n, + struct rte_ring_zc_data *zcd, + unsigned int *available) { + return rte_ring_dequeue_zc_bulk_elem_start(r, esize, n, zcd, available); +} +unsigned int rte_ring_dequeue_zc_bulk_start_w(struct rte_ring *r, + unsigned int n, + struct rte_ring_zc_data *zcd, + unsigned int *available) { + return rte_ring_dequeue_zc_bulk_start(r, n, zcd, available); +} +unsigned int rte_ring_dequeue_zc_burst_elem_start_w( + struct rte_ring *r, unsigned int esize, unsigned int n, + struct rte_ring_zc_data *zcd, unsigned int *available) { + return rte_ring_dequeue_zc_burst_elem_start(r, esize, n, zcd, available); +} +unsigned int rte_ring_dequeue_zc_burst_start_w(struct rte_ring *r, + unsigned int n, + struct rte_ring_zc_data *zcd, + unsigned int *available) { + return rte_ring_dequeue_zc_burst_start(r, n, zcd, available); +} +void rte_ring_dequeue_zc_elem_finish_w(struct rte_ring *r, unsigned int n) { + rte_ring_dequeue_zc_elem_finish(r, n); +} +void rte_ring_dequeue_zc_finish_w(struct rte_ring *r, unsigned int n) { + rte_ring_dequeue_zc_finish(r, n); +} +unsigned int rte_ring_mp_enqueue_bulk_w(struct rte_ring *r, + void *const *obj_table, unsigned int n, + unsigned int *free_space) { + return rte_ring_mp_enqueue_bulk(r, obj_table, n, free_space); +} +unsigned int rte_ring_sp_enqueue_bulk_w(struct rte_ring *r, + void *const *obj_table, unsigned int n, + unsigned int *free_space) { + return rte_ring_sp_enqueue_bulk(r, obj_table, n, free_space); +} +unsigned int rte_ring_enqueue_bulk_w(struct rte_ring *r, void *const *obj_table, + unsigned int n, unsigned int *free_space) { + return rte_ring_enqueue_bulk(r, obj_table, n, free_space); +} +int rte_ring_mp_enqueue_w(struct rte_ring *r, void *obj) { + return rte_ring_mp_enqueue(r, obj); +} +int rte_ring_sp_enqueue_w(struct rte_ring *r, void *obj) { + return rte_ring_sp_enqueue(r, obj); +} +int rte_ring_enqueue_w(struct rte_ring *r, void *obj) { + return rte_ring_enqueue(r, obj); +} +unsigned int rte_ring_mc_dequeue_bulk_w(struct rte_ring *r, void **obj_table, + unsigned int n, + unsigned int *available) { + return rte_ring_mc_dequeue_bulk(r, obj_table, n, available); +} +unsigned int rte_ring_sc_dequeue_bulk_w(struct rte_ring *r, void **obj_table, + unsigned int n, + unsigned int *available) { + return rte_ring_sc_dequeue_bulk(r, obj_table, n, available); +} +unsigned int rte_ring_dequeue_bulk_w(struct rte_ring *r, void **obj_table, + unsigned int n, unsigned int *available) { + return rte_ring_dequeue_bulk(r, obj_table, n, available); +} +int rte_ring_mc_dequeue_w(struct rte_ring *r, void **obj_p) { + return rte_ring_mc_dequeue(r, obj_p); +} +int rte_ring_sc_dequeue_w(struct rte_ring *r, void **obj_p) { + return rte_ring_sc_dequeue(r, obj_p); +} +int rte_ring_dequeue_w(struct rte_ring *r, void **obj_p) { + return rte_ring_dequeue(r, obj_p); +} +unsigned int rte_ring_count_w(const struct rte_ring *r) { + return rte_ring_count(r); +} +unsigned int rte_ring_free_count_w(const struct rte_ring *r) { + return rte_ring_free_count(r); +} +int rte_ring_full_w(const struct rte_ring *r) { return rte_ring_full(r); } +int rte_ring_empty_w(const struct rte_ring *r) { return rte_ring_empty(r); } +unsigned int rte_ring_get_size_w(const struct rte_ring *r) { + return rte_ring_get_size(r); +} +unsigned int rte_ring_get_capacity_w(const struct rte_ring *r) { + return rte_ring_get_capacity(r); +} +enum rte_ring_sync_type +rte_ring_get_prod_sync_type_w(const struct rte_ring *r) { + return rte_ring_get_prod_sync_type(r); +} +int rte_ring_is_prod_single_w(const struct rte_ring *r) { + return rte_ring_is_prod_single(r); +} +enum rte_ring_sync_type +rte_ring_get_cons_sync_type_w(const struct rte_ring *r) { + return rte_ring_get_cons_sync_type(r); +} +int rte_ring_is_cons_single_w(const struct rte_ring *r) { + return rte_ring_is_cons_single(r); +} +unsigned int rte_ring_mp_enqueue_burst_w(struct rte_ring *r, + void *const *obj_table, unsigned int n, + unsigned int *free_space) { + return rte_ring_mp_enqueue_burst(r, obj_table, n, free_space); +} +unsigned int rte_ring_sp_enqueue_burst_w(struct rte_ring *r, + void *const *obj_table, unsigned int n, + unsigned int *free_space) { + return rte_ring_sp_enqueue_burst(r, obj_table, n, free_space); +} +unsigned int rte_ring_enqueue_burst_w(struct rte_ring *r, + void *const *obj_table, unsigned int n, + unsigned int *free_space) { + return rte_ring_enqueue_burst(r, obj_table, n, free_space); +} +unsigned int rte_ring_mc_dequeue_burst_w(struct rte_ring *r, void **obj_table, + unsigned int n, + unsigned int *available) { + return rte_ring_mc_dequeue_burst(r, obj_table, n, available); +} +unsigned int rte_ring_sc_dequeue_burst_w(struct rte_ring *r, void **obj_table, + unsigned int n, + unsigned int *available) { + return rte_ring_sc_dequeue_burst(r, obj_table, n, available); +} +unsigned int rte_ring_dequeue_burst_w(struct rte_ring *r, void **obj_table, + unsigned int n, unsigned int *available) { + return rte_ring_dequeue_burst(r, obj_table, n, available); +} +void *rte_memcpy_w(void *dst, const void *src, size_t n) { + return rte_memcpy(dst, src, n); +} +// void *rte_mov15_or_less_w(void *dst, const void *src, size_t n) { +// return rte_mov15_or_less(dst, src, n); +// } +void rte_mov16_w(uint8_t *dst, const uint8_t *src) { rte_mov16(dst, src); } +void rte_mov32_w(uint8_t *dst, const uint8_t *src) { rte_mov32(dst, src); } +void rte_mov64_w(uint8_t *dst, const uint8_t *src) { rte_mov64(dst, src); } +void rte_mov256_w(uint8_t *dst, const uint8_t *src) { rte_mov256(dst, src); } +// void *rte_memcpy_generic_w(void *dst, const void *src, size_t n) { +// return rte_memcpy_generic(dst, src, n); +// } +// void *rte_memcpy_aligned_w(void *dst, const void *src, size_t n) { +// return rte_memcpy_aligned(dst, src, n); +// } +struct rte_mempool_objhdr *rte_mempool_get_header_w(void *obj) { + return rte_mempool_get_header(obj); +} +struct rte_mempool *rte_mempool_from_obj_w(void *obj) { + return rte_mempool_from_obj(obj); +} +struct rte_mempool_objtlr *rte_mempool_get_trailer_w(void *obj) { + return rte_mempool_get_trailer(obj); +} +struct rte_mempool_ops *rte_mempool_get_ops_w(int ops_index) { + return rte_mempool_get_ops(ops_index); +} +int rte_mempool_ops_dequeue_bulk_w(struct rte_mempool *mp, void **obj_table, + unsigned int n) { + return rte_mempool_ops_dequeue_bulk(mp, obj_table, n); +} +int rte_mempool_ops_dequeue_contig_blocks_w(struct rte_mempool *mp, + void **first_obj_table, + unsigned int n) { + return rte_mempool_ops_dequeue_contig_blocks(mp, first_obj_table, n); +} +int rte_mempool_ops_enqueue_bulk_w(struct rte_mempool *mp, + void *const *obj_table, unsigned int n) { + return rte_mempool_ops_enqueue_bulk(mp, obj_table, n); +} +struct rte_mempool_cache *rte_mempool_default_cache_w(struct rte_mempool *mp, + unsigned int lcore_id) { + return rte_mempool_default_cache(mp, lcore_id); +} +void rte_mempool_cache_flush_w(struct rte_mempool_cache *cache, + struct rte_mempool *mp) { + rte_mempool_cache_flush(cache, mp); +} +void rte_mempool_do_generic_put_w(struct rte_mempool *mp, + void *const *obj_table, unsigned int n, + struct rte_mempool_cache *cache) { + rte_mempool_do_generic_put(mp, obj_table, n, cache); +} +void rte_mempool_generic_put_w(struct rte_mempool *mp, void *const *obj_table, + unsigned int n, + struct rte_mempool_cache *cache) { + rte_mempool_generic_put(mp, obj_table, n, cache); +} +void rte_mempool_put_bulk_w(struct rte_mempool *mp, void *const *obj_table, + unsigned int n) { + rte_mempool_put_bulk(mp, obj_table, n); +} +void rte_mempool_put_w(struct rte_mempool *mp, void *obj) { + rte_mempool_put(mp, obj); +} +int rte_mempool_do_generic_get_w(struct rte_mempool *mp, void **obj_table, + unsigned int n, + struct rte_mempool_cache *cache) { + return rte_mempool_do_generic_get(mp, obj_table, n, cache); +} +int rte_mempool_generic_get_w(struct rte_mempool *mp, void **obj_table, + unsigned int n, struct rte_mempool_cache *cache) { + return rte_mempool_generic_get(mp, obj_table, n, cache); +} +int rte_mempool_get_bulk_w(struct rte_mempool *mp, void **obj_table, + unsigned int n) { + return rte_mempool_get_bulk(mp, obj_table, n); +} +int rte_mempool_get_w(struct rte_mempool *mp, void **obj_p) { + return rte_mempool_get(mp, obj_p); +} +int rte_mempool_get_contig_blocks_w(struct rte_mempool *mp, + void **first_obj_table, unsigned int n) { + return rte_mempool_get_contig_blocks(mp, first_obj_table, n); +} +int rte_mempool_full_w(const struct rte_mempool *mp) { + return rte_mempool_full(mp); +} +int rte_mempool_empty_w(const struct rte_mempool *mp) { + return rte_mempool_empty(mp); +} +rte_iova_t rte_mempool_virt2iova_w(const void *elt) { + return rte_mempool_virt2iova(elt); +} +void *rte_mempool_get_priv_w(struct rte_mempool *mp) { + return rte_mempool_get_priv(mp); +} +void rte_prefetch0_w(const void *p) { rte_prefetch0(p); } +void rte_prefetch1_w(const void *p) { rte_prefetch1(p); } +void rte_prefetch2_w(const void *p) { rte_prefetch2(p); } +void rte_prefetch_non_temporal_w(const void *p) { + rte_prefetch_non_temporal(p); +} +void rte_prefetch0_write_w(const void *p) { rte_prefetch0_write(p); } +void rte_prefetch1_write_w(const void *p) { rte_prefetch1_write(p); } +void rte_prefetch2_write_w(const void *p) { rte_prefetch2_write(p); } +void rte_cldemote_w(const void *p) { rte_cldemote(p); } +uint16_t rte_constant_bswap16_w(uint16_t x) { return rte_constant_bswap16(x); } +uint32_t rte_constant_bswap32_w(uint32_t x) { return rte_constant_bswap32(x); } +uint64_t rte_constant_bswap64_w(uint64_t x) { return rte_constant_bswap64(x); } +// uint16_t rte_arch_bswap16_w(uint16_t _x) { return rte_arch_bswap16(_x); } +// uint32_t rte_arch_bswap32_w(uint32_t _x) { return rte_arch_bswap32(_x); } +// uint64_t rte_arch_bswap64_w(uint64_t _x) { return rte_arch_bswap64(_x); } +void rte_mbuf_prefetch_part1_w(struct rte_mbuf *m) { + rte_mbuf_prefetch_part1(m); +} +void rte_mbuf_prefetch_part2_w(struct rte_mbuf *m) { + rte_mbuf_prefetch_part2(m); +} +uint16_t rte_pktmbuf_priv_size_w(struct rte_mempool *mp) { + return rte_pktmbuf_priv_size(mp); +} +rte_iova_t rte_mbuf_iova_get_w(const struct rte_mbuf *m) { + return rte_mbuf_iova_get(m); +} +void rte_mbuf_iova_set_w(struct rte_mbuf *m, rte_iova_t iova) { + rte_mbuf_iova_set(m, iova); +} +rte_iova_t rte_mbuf_data_iova_w(const struct rte_mbuf *mb) { + return rte_mbuf_data_iova(mb); +} +rte_iova_t rte_mbuf_data_iova_default_w(const struct rte_mbuf *mb) { + return rte_mbuf_data_iova_default(mb); +} +struct rte_mbuf *rte_mbuf_from_indirect_w(struct rte_mbuf *mi) { + return rte_mbuf_from_indirect(mi); +} +char *rte_mbuf_buf_addr_w(struct rte_mbuf *mb, struct rte_mempool *mp) { + return rte_mbuf_buf_addr(mb, mp); +} +char *rte_mbuf_data_addr_default_w(struct rte_mbuf *mb) { + return rte_mbuf_data_addr_default(mb); +} +char *rte_mbuf_to_baddr_w(struct rte_mbuf *md) { return rte_mbuf_to_baddr(md); } +void *rte_mbuf_to_priv_w(struct rte_mbuf *m) { return rte_mbuf_to_priv(m); } +uint32_t rte_pktmbuf_priv_flags_w(struct rte_mempool *mp) { + return rte_pktmbuf_priv_flags(mp); +} +uint16_t rte_mbuf_refcnt_read_w(const struct rte_mbuf *m) { + return rte_mbuf_refcnt_read(m); +} +void rte_mbuf_refcnt_set_w(struct rte_mbuf *m, uint16_t new_value) { + rte_mbuf_refcnt_set(m, new_value); +} +uint16_t rte_mbuf_refcnt_update_w(struct rte_mbuf *m, int16_t value) { + return rte_mbuf_refcnt_update(m, value); +} +uint16_t +rte_mbuf_ext_refcnt_read_w(const struct rte_mbuf_ext_shared_info *shinfo) { + return rte_mbuf_ext_refcnt_read(shinfo); +} +void rte_mbuf_ext_refcnt_set_w(struct rte_mbuf_ext_shared_info *shinfo, + uint16_t new_value) { + rte_mbuf_ext_refcnt_set(shinfo, new_value); +} +uint16_t rte_mbuf_ext_refcnt_update_w(struct rte_mbuf_ext_shared_info *shinfo, + int16_t value) { + return rte_mbuf_ext_refcnt_update(shinfo, value); +} +struct rte_mbuf *rte_mbuf_raw_alloc_w(struct rte_mempool *mp) { + return rte_mbuf_raw_alloc(mp); +} +void rte_mbuf_raw_free_w(struct rte_mbuf *m) { rte_mbuf_raw_free(m); } +uint16_t rte_pktmbuf_data_room_size_w(struct rte_mempool *mp) { + return rte_pktmbuf_data_room_size(mp); +} +void rte_pktmbuf_reset_headroom_w(struct rte_mbuf *m) { + rte_pktmbuf_reset_headroom(m); +} +void rte_pktmbuf_reset_w(struct rte_mbuf *m) { rte_pktmbuf_reset(m); } +struct rte_mbuf *rte_pktmbuf_alloc_w(struct rte_mempool *mp) { + return rte_pktmbuf_alloc(mp); +} +int rte_pktmbuf_alloc_bulk_w(struct rte_mempool *pool, struct rte_mbuf **mbufs, + unsigned int count) { + return rte_pktmbuf_alloc_bulk(pool, mbufs, count); +} +struct rte_mbuf_ext_shared_info * +rte_pktmbuf_ext_shinfo_init_helper_w(void *buf_addr, uint16_t *buf_len, + rte_mbuf_extbuf_free_callback_t free_cb, + void *fcb_opaque) { + return rte_pktmbuf_ext_shinfo_init_helper(buf_addr, buf_len, free_cb, + fcb_opaque); +} +void rte_pktmbuf_attach_extbuf_w(struct rte_mbuf *m, void *buf_addr, + rte_iova_t buf_iova, uint16_t buf_len, + struct rte_mbuf_ext_shared_info *shinfo) { + rte_pktmbuf_attach_extbuf(m, buf_addr, buf_iova, buf_len, shinfo); +} +void rte_mbuf_dynfield_copy_w(struct rte_mbuf *mdst, + const struct rte_mbuf *msrc) { + rte_mbuf_dynfield_copy(mdst, msrc); +} +void rte_pktmbuf_attach_w(struct rte_mbuf *mi, struct rte_mbuf *m) { + rte_pktmbuf_attach(mi, m); +} +void rte_pktmbuf_detach_w(struct rte_mbuf *m) { rte_pktmbuf_detach(m); } +struct rte_mbuf *rte_pktmbuf_prefree_seg_w(struct rte_mbuf *m) { + return rte_pktmbuf_prefree_seg(m); +} +void rte_pktmbuf_free_seg_w(struct rte_mbuf *m) { rte_pktmbuf_free_seg(m); } +void rte_pktmbuf_free_w(struct rte_mbuf *m) { rte_pktmbuf_free(m); } +void rte_pktmbuf_refcnt_update_w(struct rte_mbuf *m, int16_t v) { + rte_pktmbuf_refcnt_update(m, v); +} +uint16_t rte_pktmbuf_headroom_w(const struct rte_mbuf *m) { + return rte_pktmbuf_headroom(m); +} +uint16_t rte_pktmbuf_tailroom_w(const struct rte_mbuf *m) { + return rte_pktmbuf_tailroom(m); +} +struct rte_mbuf *rte_pktmbuf_lastseg_w(struct rte_mbuf *m) { + return rte_pktmbuf_lastseg(m); +} +char *rte_pktmbuf_prepend_w(struct rte_mbuf *m, uint16_t len) { + return rte_pktmbuf_prepend(m, len); +} +char *rte_pktmbuf_append_w(struct rte_mbuf *m, uint16_t len) { + return rte_pktmbuf_append(m, len); +} +char *rte_pktmbuf_adj_w(struct rte_mbuf *m, uint16_t len) { + return rte_pktmbuf_adj(m, len); +} +int rte_pktmbuf_trim_w(struct rte_mbuf *m, uint16_t len) { + return rte_pktmbuf_trim(m, len); +} +int rte_pktmbuf_is_contiguous_w(const struct rte_mbuf *m) { + return rte_pktmbuf_is_contiguous(m); +} +const void *rte_pktmbuf_read_w(const struct rte_mbuf *m, uint32_t off, + uint32_t len, void *buf) { + return rte_pktmbuf_read(m, off, len, buf); +} +int rte_pktmbuf_chain_w(struct rte_mbuf *head, struct rte_mbuf *tail) { + return rte_pktmbuf_chain(head, tail); +} +uint64_t rte_mbuf_tx_offload_w(uint64_t il2, uint64_t il3, uint64_t il4, + uint64_t tso, uint64_t ol3, uint64_t ol2, + uint64_t unused) { + return rte_mbuf_tx_offload(il2, il3, il4, tso, ol3, ol2, unused); +} +int rte_validate_tx_offload_w(const struct rte_mbuf *m) { + return rte_validate_tx_offload(m); +} +int rte_pktmbuf_linearize_w(struct rte_mbuf *mbuf) { + return rte_pktmbuf_linearize(mbuf); +} +uint32_t rte_mbuf_sched_queue_get_w(const struct rte_mbuf *m) { + return rte_mbuf_sched_queue_get(m); +} +uint8_t rte_mbuf_sched_traffic_class_get_w(const struct rte_mbuf *m) { + return rte_mbuf_sched_traffic_class_get(m); +} +uint8_t rte_mbuf_sched_color_get_w(const struct rte_mbuf *m) { + return rte_mbuf_sched_color_get(m); +} +void rte_mbuf_sched_get_w(const struct rte_mbuf *m, uint32_t *queue_id, + uint8_t *traffic_class, uint8_t *color) { + rte_mbuf_sched_get(m, queue_id, traffic_class, color); +} +void rte_mbuf_sched_queue_set_w(struct rte_mbuf *m, uint32_t queue_id) { + rte_mbuf_sched_queue_set(m, queue_id); +} +void rte_mbuf_sched_traffic_class_set_w(struct rte_mbuf *m, + uint8_t traffic_class) { + rte_mbuf_sched_traffic_class_set(m, traffic_class); +} +void rte_mbuf_sched_color_set_w(struct rte_mbuf *m, uint8_t color) { + rte_mbuf_sched_color_set(m, color); +} +void rte_mbuf_sched_set_w(struct rte_mbuf *m, uint32_t queue_id, + uint8_t traffic_class, uint8_t color) { + rte_mbuf_sched_set(m, queue_id, traffic_class, color); +} +int rte_is_same_ether_addr_w(const struct rte_ether_addr *ea1, + const struct rte_ether_addr *ea2) { + return rte_is_same_ether_addr(ea1, ea2); +} +int rte_is_zero_ether_addr_w(const struct rte_ether_addr *ea) { + return rte_is_zero_ether_addr(ea); +} +int rte_is_unicast_ether_addr_w(const struct rte_ether_addr *ea) { + return rte_is_unicast_ether_addr(ea); +} +int rte_is_multicast_ether_addr_w(const struct rte_ether_addr *ea) { + return rte_is_multicast_ether_addr(ea); +} +int rte_is_broadcast_ether_addr_w(const struct rte_ether_addr *ea) { + return rte_is_broadcast_ether_addr(ea); +} +int rte_is_universal_ether_addr_w(const struct rte_ether_addr *ea) { + return rte_is_universal_ether_addr(ea); +} +int rte_is_local_admin_ether_addr_w(const struct rte_ether_addr *ea) { + return rte_is_local_admin_ether_addr(ea); +} +int rte_is_valid_assigned_ether_addr_w(const struct rte_ether_addr *ea) { + return rte_is_valid_assigned_ether_addr(ea); +} +void rte_ether_addr_copy_w(const struct rte_ether_addr *ea_from, + struct rte_ether_addr *ea_to) { + rte_ether_addr_copy(ea_from, ea_to); +} +int rte_vlan_strip_w(struct rte_mbuf *m) { return rte_vlan_strip(m); } +int rte_vlan_insert_w(struct rte_mbuf **m) { return rte_vlan_insert(m); } +uint32_t rte_bitmap_get_memory_footprint_w(uint32_t n_bits) { + return rte_bitmap_get_memory_footprint(n_bits); +} +struct rte_bitmap *rte_bitmap_init_w(uint32_t n_bits, uint8_t *mem, + uint32_t mem_size) { + return rte_bitmap_init(n_bits, mem, mem_size); +} +struct rte_bitmap *rte_bitmap_init_with_all_set_w(uint32_t n_bits, uint8_t *mem, + uint32_t mem_size) { + return rte_bitmap_init_with_all_set(n_bits, mem, mem_size); +} +void rte_bitmap_free_w(struct rte_bitmap *bmp) { return rte_bitmap_free(bmp); } +void rte_bitmap_reset_w(struct rte_bitmap *bmp) { rte_bitmap_reset(bmp); } +void rte_bitmap_prefetch0_w(struct rte_bitmap *bmp, uint32_t pos) { + rte_bitmap_prefetch0(bmp, pos); +} +uint64_t rte_bitmap_get_w(struct rte_bitmap *bmp, uint32_t pos) { + return rte_bitmap_get(bmp, pos); +} +void rte_bitmap_set_w(struct rte_bitmap *bmp, uint32_t pos) { + rte_bitmap_set(bmp, pos); +} +void rte_bitmap_set_slab_w(struct rte_bitmap *bmp, uint32_t pos, + uint64_t slab) { + rte_bitmap_set_slab(bmp, pos, slab); +} +void rte_bitmap_clear_w(struct rte_bitmap *bmp, uint32_t pos) { + rte_bitmap_clear(bmp, pos); +} +int rte_bitmap_scan_w(struct rte_bitmap *bmp, uint32_t *pos, uint64_t *slab) { + return rte_bitmap_scan(bmp, pos, slab); +} +uint16_t rte_raw_cksum_w(const void *buf, size_t len) { + return rte_raw_cksum(buf, len); +} +int rte_raw_cksum_mbuf_w(const struct rte_mbuf *m, uint32_t off, uint32_t len, + uint16_t *cksum) { + return rte_raw_cksum_mbuf(m, off, len, cksum); +} +uint8_t rte_ipv4_hdr_len_w(const struct rte_ipv4_hdr *ipv4_hdr) { + return rte_ipv4_hdr_len(ipv4_hdr); +} +uint16_t rte_ipv4_cksum_w(const struct rte_ipv4_hdr *ipv4_hdr) { + return rte_ipv4_cksum(ipv4_hdr); +} +uint16_t rte_ipv4_cksum_simple_w(const struct rte_ipv4_hdr *ipv4_hdr) { + return rte_ipv4_cksum_simple(ipv4_hdr); +} +uint16_t rte_ipv4_phdr_cksum_w(const struct rte_ipv4_hdr *ipv4_hdr, + uint64_t ol_flags) { + return rte_ipv4_phdr_cksum(ipv4_hdr, ol_flags); +} +uint16_t rte_ipv4_udptcp_cksum_w(const struct rte_ipv4_hdr *ipv4_hdr, + const void *l4_hdr) { + return rte_ipv4_udptcp_cksum(ipv4_hdr, l4_hdr); +} +uint16_t rte_ipv4_udptcp_cksum_mbuf_w(const struct rte_mbuf *m, + const struct rte_ipv4_hdr *ipv4_hdr, + uint16_t l4_off) { + return rte_ipv4_udptcp_cksum_mbuf(m, ipv4_hdr, l4_off); +} +int rte_ipv4_udptcp_cksum_verify_w(const struct rte_ipv4_hdr *ipv4_hdr, + const void *l4_hdr) { + return rte_ipv4_udptcp_cksum_verify(ipv4_hdr, l4_hdr); +} +int rte_ipv4_udptcp_cksum_mbuf_verify_w(const struct rte_mbuf *m, + const struct rte_ipv4_hdr *ipv4_hdr, + uint16_t l4_off) { + return rte_ipv4_udptcp_cksum_mbuf_verify(m, ipv4_hdr, l4_off); +} +bool rte_ipv6_addr_eq_w(const struct rte_ipv6_addr *a, + const struct rte_ipv6_addr *b) { + return rte_ipv6_addr_eq(a, b); +} +void rte_ipv6_addr_mask_w(struct rte_ipv6_addr *ip, uint8_t depth) { + rte_ipv6_addr_mask(ip, depth); +} +bool rte_ipv6_addr_eq_prefix_w(const struct rte_ipv6_addr *a, + const struct rte_ipv6_addr *b, uint8_t depth) { + return rte_ipv6_addr_eq_prefix(a, b, depth); +} +uint8_t rte_ipv6_mask_depth_w(const struct rte_ipv6_addr *mask) { + return rte_ipv6_mask_depth(mask); +} +bool rte_ipv6_addr_is_unspec_w(const struct rte_ipv6_addr *ip) { + return rte_ipv6_addr_is_unspec(ip); +} +bool rte_ipv6_addr_is_loopback_w(const struct rte_ipv6_addr *ip) { + return rte_ipv6_addr_is_loopback(ip); +} +bool rte_ipv6_addr_is_linklocal_w(const struct rte_ipv6_addr *ip) { + return rte_ipv6_addr_is_linklocal(ip); +} +bool rte_ipv6_addr_is_sitelocal_w(const struct rte_ipv6_addr *ip) { + return rte_ipv6_addr_is_sitelocal(ip); +} +bool rte_ipv6_addr_is_v4compat_w(const struct rte_ipv6_addr *ip) { + return rte_ipv6_addr_is_v4compat(ip); +} +bool rte_ipv6_addr_is_v4mapped_w(const struct rte_ipv6_addr *ip) { + return rte_ipv6_addr_is_v4mapped(ip); +} +bool rte_ipv6_addr_is_mcast_w(const struct rte_ipv6_addr *ip) { + return rte_ipv6_addr_is_mcast(ip); +} +enum rte_ipv6_mc_scope rte_ipv6_mc_scope_w(const struct rte_ipv6_addr *ip) { + return rte_ipv6_mc_scope(ip); +} +void rte_ipv6_llocal_from_ethernet_w(struct rte_ipv6_addr *ip, + const struct rte_ether_addr *mac) { + rte_ipv6_llocal_from_ethernet(ip, mac); +} +void rte_ipv6_solnode_from_addr_w(struct rte_ipv6_addr *sol, + const struct rte_ipv6_addr *ip) { + rte_ipv6_solnode_from_addr(sol, ip); +} +void rte_ether_mcast_from_ipv6_w(struct rte_ether_addr *mac, + const struct rte_ipv6_addr *ip) { + rte_ether_mcast_from_ipv6(mac, ip); +} +int rte_ipv6_check_version_w(const struct rte_ipv6_hdr *ip) { + return rte_ipv6_check_version(ip); +} +uint16_t rte_ipv6_phdr_cksum_w(const struct rte_ipv6_hdr *ipv6_hdr, + uint64_t ol_flags) { + return rte_ipv6_phdr_cksum(ipv6_hdr, ol_flags); +} +uint16_t rte_ipv6_udptcp_cksum_w(const struct rte_ipv6_hdr *ipv6_hdr, + const void *l4_hdr) { + return rte_ipv6_udptcp_cksum(ipv6_hdr, l4_hdr); +} +uint16_t rte_ipv6_udptcp_cksum_mbuf_w(const struct rte_mbuf *m, + const struct rte_ipv6_hdr *ipv6_hdr, + uint16_t l4_off) { + return rte_ipv6_udptcp_cksum_mbuf(m, ipv6_hdr, l4_off); +} +int rte_ipv6_udptcp_cksum_verify_w(const struct rte_ipv6_hdr *ipv6_hdr, + const void *l4_hdr) { + return rte_ipv6_udptcp_cksum_verify(ipv6_hdr, l4_hdr); +} +int rte_ipv6_udptcp_cksum_mbuf_verify_w(const struct rte_mbuf *m, + const struct rte_ipv6_hdr *ipv6_hdr, + uint16_t l4_off) { + return rte_ipv6_udptcp_cksum_mbuf_verify(m, ipv6_hdr, l4_off); +} +int rte_ipv6_get_next_ext_w(const uint8_t *p, int proto, size_t *ext_len) { + return rte_ipv6_get_next_ext(p, proto, ext_len); +} +enum rte_color +rte_meter_srtcm_color_blind_check_w(struct rte_meter_srtcm *m, + struct rte_meter_srtcm_profile *p, + uint64_t time, uint32_t pkt_len) { + return rte_meter_srtcm_color_blind_check(m, p, time, pkt_len); +} +enum rte_color rte_meter_srtcm_color_aware_check_w( + struct rte_meter_srtcm *m, struct rte_meter_srtcm_profile *p, uint64_t time, + uint32_t pkt_len, enum rte_color pkt_color) { + return rte_meter_srtcm_color_aware_check(m, p, time, pkt_len, pkt_color); +} +enum rte_color +rte_meter_trtcm_color_blind_check_w(struct rte_meter_trtcm *m, + struct rte_meter_trtcm_profile *p, + uint64_t time, uint32_t pkt_len) { + return rte_meter_trtcm_color_blind_check(m, p, time, pkt_len); +} +enum rte_color rte_meter_trtcm_color_aware_check_w( + struct rte_meter_trtcm *m, struct rte_meter_trtcm_profile *p, uint64_t time, + uint32_t pkt_len, enum rte_color pkt_color) { + return rte_meter_trtcm_color_aware_check(m, p, time, pkt_len, pkt_color); +} +enum rte_color rte_meter_trtcm_rfc4115_color_blind_check_w( + struct rte_meter_trtcm_rfc4115 *m, + struct rte_meter_trtcm_rfc4115_profile *p, uint64_t time, + uint32_t pkt_len) { + return rte_meter_trtcm_rfc4115_color_blind_check(m, p, time, pkt_len); +} +enum rte_color rte_meter_trtcm_rfc4115_color_aware_check_w( + struct rte_meter_trtcm_rfc4115 *m, + struct rte_meter_trtcm_rfc4115_profile *p, uint64_t time, uint32_t pkt_len, + enum rte_color pkt_color) { + return rte_meter_trtcm_rfc4115_color_aware_check(m, p, time, pkt_len, + pkt_color); +} +uint64_t rte_eth_rss_hf_refine_w(uint64_t rss_hf) { + return rte_eth_rss_hf_refine(rss_hf); +} + +uint16_t rte_eth_rx_burst_w(uint16_t port_id, uint16_t queue_id, + struct rte_mbuf **rx_pkts, const uint16_t nb_pkts) { + return rte_eth_rx_burst(port_id, queue_id, rx_pkts, nb_pkts); +} +int rte_eth_rx_queue_count_w(uint16_t port_id, uint16_t queue_id) { + return rte_eth_rx_queue_count(port_id, queue_id); +} +int rte_eth_rx_descriptor_status_w(uint16_t port_id, uint16_t queue_id, + uint16_t offset) { + return rte_eth_rx_descriptor_status(port_id, queue_id, offset); +} +int rte_eth_tx_descriptor_status_w(uint16_t port_id, uint16_t queue_id, + uint16_t offset) { + return rte_eth_tx_descriptor_status(port_id, queue_id, offset); +} +uint16_t rte_eth_tx_burst_w(uint16_t port_id, uint16_t queue_id, + struct rte_mbuf **tx_pkts, uint16_t nb_pkts) { + return rte_eth_tx_burst(port_id, queue_id, tx_pkts, nb_pkts); +} +uint16_t rte_eth_tx_prepare_w(uint16_t port_id, uint16_t queue_id, + struct rte_mbuf **tx_pkts, uint16_t nb_pkts) { + return rte_eth_tx_prepare(port_id, queue_id, tx_pkts, nb_pkts); +} +uint16_t rte_eth_tx_buffer_flush_w(uint16_t port_id, uint16_t queue_id, + struct rte_eth_dev_tx_buffer *buffer) { + return rte_eth_tx_buffer_flush(port_id, queue_id, buffer); +} +uint16_t rte_eth_tx_buffer_w(uint16_t port_id, uint16_t queue_id, + struct rte_eth_dev_tx_buffer *buffer, + struct rte_mbuf *tx_pkt) { + return rte_eth_tx_buffer(port_id, queue_id, buffer, tx_pkt); +} +uint16_t +rte_eth_recycle_mbufs_w(uint16_t rx_port_id, uint16_t rx_queue_id, + uint16_t tx_port_id, uint16_t tx_queue_id, + struct rte_eth_recycle_rxq_info *recycle_rxq_info) { + return rte_eth_recycle_mbufs(rx_port_id, rx_queue_id, tx_port_id, tx_queue_id, + recycle_rxq_info); +} +int rte_eth_tx_queue_count_w(uint16_t port_id, uint16_t queue_id) { + return rte_eth_tx_queue_count(port_id, queue_id); +} +uint32_t rte_flow_dynf_metadata_get_w(struct rte_mbuf *m) { + return rte_flow_dynf_metadata_get(m); +} +void rte_flow_dynf_metadata_set_w(struct rte_mbuf *m, uint32_t v) { + rte_flow_dynf_metadata_set(m, v); +} +int rte_flow_dynf_metadata_avail_w(void) { + return rte_flow_dynf_metadata_avail(); +} +uint32_t rte_hash_crc_1byte_w(uint8_t data, uint32_t init_val) { + return rte_hash_crc_1byte(data, init_val); +} +uint32_t rte_hash_crc_2byte_w(uint16_t data, uint32_t init_val) { + return rte_hash_crc_2byte(data, init_val); +} +uint32_t rte_hash_crc_4byte_w(uint32_t data, uint32_t init_val) { + return rte_hash_crc_4byte(data, init_val); +} +uint32_t rte_hash_crc_8byte_w(uint64_t data, uint32_t init_val) { + return rte_hash_crc_8byte(data, init_val); +} +uint32_t rte_hash_crc_w(const void *data, uint32_t data_len, + uint32_t init_val) { + return rte_hash_crc(data, data_len, init_val); +} +void rte_jhash_2hashes_w(const void *key, uint32_t length, uint32_t *pc, + uint32_t *pb) { + rte_jhash_2hashes(key, length, pc, pb); +} +void rte_jhash_32b_2hashes_w(const uint32_t *k, uint32_t length, uint32_t *pc, + uint32_t *pb) { + rte_jhash_32b_2hashes(k, length, pc, pb); +} +uint32_t rte_jhash_w(const void *key, uint32_t length, uint32_t initval) { + return rte_jhash(key, length, initval); +} +uint32_t rte_jhash_32b_w(const uint32_t *k, uint32_t length, uint32_t initval) { + return rte_jhash_32b(k, length, initval); +} +uint32_t rte_jhash_3words_w(uint32_t a, uint32_t b, uint32_t c, + uint32_t initval) { + return rte_jhash_3words(a, b, c, initval); +} +uint32_t rte_jhash_2words_w(uint32_t a, uint32_t b, uint32_t initval) { + return rte_jhash_2words(a, b, initval); +} +uint32_t rte_jhash_1word_w(uint32_t a, uint32_t initval) { + return rte_jhash_1word(a, initval); +} +uint32_t rte_fbk_hash_get_bucket_w(const struct rte_fbk_hash_table *ht, + uint32_t key) { + return rte_fbk_hash_get_bucket(ht, key); +} +int rte_fbk_hash_add_key_with_bucket_w(struct rte_fbk_hash_table *ht, + uint32_t key, uint16_t value, + uint32_t bucket) { + return rte_fbk_hash_add_key_with_bucket(ht, key, value, bucket); +} +int rte_fbk_hash_add_key_w(struct rte_fbk_hash_table *ht, uint32_t key, + uint16_t value) { + return rte_fbk_hash_add_key(ht, key, value); +} +int rte_fbk_hash_delete_key_with_bucket_w(struct rte_fbk_hash_table *ht, + uint32_t key, uint32_t bucket) { + return rte_fbk_hash_delete_key_with_bucket(ht, key, bucket); +} +int rte_fbk_hash_delete_key_w(struct rte_fbk_hash_table *ht, uint32_t key) { + return rte_fbk_hash_delete_key(ht, key); +} +int rte_fbk_hash_lookup_with_bucket_w(const struct rte_fbk_hash_table *ht, + uint32_t key, uint32_t bucket) { + return rte_fbk_hash_lookup_with_bucket(ht, key, bucket); +} +int rte_fbk_hash_lookup_w(const struct rte_fbk_hash_table *ht, uint32_t key) { + return rte_fbk_hash_lookup(ht, key); +} +void rte_fbk_hash_clear_all_w(struct rte_fbk_hash_table *ht) { + rte_fbk_hash_clear_all(ht); +} +double rte_fbk_hash_get_load_factor_w(struct rte_fbk_hash_table *ht) { + return rte_fbk_hash_get_load_factor(ht); +} +void rte_rcu_qsbr_thread_online_w(struct rte_rcu_qsbr *v, + unsigned int thread_id) { + rte_rcu_qsbr_thread_online(v, thread_id); +} +void rte_rcu_qsbr_thread_offline_w(struct rte_rcu_qsbr *v, + unsigned int thread_id) { + rte_rcu_qsbr_thread_offline(v, thread_id); +} +void rte_rcu_qsbr_lock_w(struct rte_rcu_qsbr *v, unsigned int thread_id) { + rte_rcu_qsbr_lock(v, thread_id); +} +void rte_rcu_qsbr_unlock_w(struct rte_rcu_qsbr *v, unsigned int thread_id) { + rte_rcu_qsbr_unlock(v, thread_id); +} +uint64_t rte_rcu_qsbr_start_w(struct rte_rcu_qsbr *v) { + return rte_rcu_qsbr_start(v); +} +void rte_rcu_qsbr_quiescent_w(struct rte_rcu_qsbr *v, unsigned int thread_id) { + rte_rcu_qsbr_quiescent(v, thread_id); +} +int rte_rcu_qsbr_check_w(struct rte_rcu_qsbr *v, uint64_t t, bool wait) { + return rte_rcu_qsbr_check(v, t, wait); +} +uint8_t rte_read8_relaxed_w(const void *addr) { + return rte_read8_relaxed(addr); +} +uint16_t rte_read16_relaxed_w(const void *addr) { + return rte_read16_relaxed(addr); +} +uint32_t rte_read32_relaxed_w(const void *addr) { + return rte_read32_relaxed(addr); +} +uint64_t rte_read64_relaxed_w(const void *addr) { + return rte_read64_relaxed(addr); +} +void rte_write8_relaxed_w(uint8_t value, void *addr) { + rte_write8_relaxed(value, addr); +} +void rte_write16_relaxed_w(uint16_t value, void *addr) { + rte_write16_relaxed(value, addr); +} +void rte_write32_relaxed_w(uint32_t value, void *addr) { + rte_write32_relaxed(value, addr); +} +void rte_write64_relaxed_w(uint64_t value, void *addr) { + rte_write64_relaxed(value, addr); +} +uint8_t rte_read8_w(const void *addr) { return rte_read8(addr); } +uint16_t rte_read16_w(const void *addr) { return rte_read16(addr); } +uint32_t rte_read32_w(const void *addr) { return rte_read32(addr); } +uint64_t rte_read64_w(const void *addr) { return rte_read64(addr); } +void rte_write8_w(uint8_t value, void *addr) { rte_write8(value, addr); } +void rte_write16_w(uint16_t value, void *addr) { rte_write16(value, addr); } +void rte_write32_w(uint32_t value, void *addr) { rte_write32(value, addr); } +void rte_write64_w(uint64_t value, void *addr) { rte_write64(value, addr); } +void rte_write32_wc_relaxed_w(uint32_t value, void *addr) { + rte_write32_wc_relaxed(value, addr); +} +void rte_write32_wc_w(uint32_t value, void *addr) { + rte_write32_wc(value, addr); +} +void rte_mcslock_lock_w(rte_mcslock_t **msl, rte_mcslock_t *me) { + rte_mcslock_lock(msl, me); +} +void rte_mcslock_unlock_w(rte_mcslock_t **msl, rte_mcslock_t *me) { + rte_mcslock_unlock(msl, me); +} +int rte_mcslock_trylock_w(rte_mcslock_t **msl, rte_mcslock_t *me) { + return rte_mcslock_trylock(msl, me); +} +int rte_mcslock_is_locked_w(rte_mcslock_t *msl) { + return rte_mcslock_is_locked(msl); +} +void rte_pflock_init_w(struct rte_pflock *pf) { rte_pflock_init(pf); } +void rte_pflock_read_lock_w(rte_pflock_t *pf) { rte_pflock_read_lock(pf); } +void rte_pflock_read_unlock_w(rte_pflock_t *pf) { rte_pflock_read_unlock(pf); } +void rte_pflock_write_lock_w(rte_pflock_t *pf) { rte_pflock_write_lock(pf); } +void rte_pflock_write_unlock_w(rte_pflock_t *pf) { + rte_pflock_write_unlock(pf); +} +uint32_t rte_reciprocal_divide_w(uint32_t a, struct rte_reciprocal R) { + return rte_reciprocal_divide(a, R); +} +uint64_t rte_reciprocal_divide_u64_w(uint64_t a, + const struct rte_reciprocal_u64 *R) { + return rte_reciprocal_divide_u64(a, R); +} +void rte_seqcount_init_w(rte_seqcount_t *seqcount) { + rte_seqcount_init(seqcount); +} +uint32_t rte_seqcount_read_begin_w(const rte_seqcount_t *seqcount) { + return rte_seqcount_read_begin(seqcount); +} +bool rte_seqcount_read_retry_w(const rte_seqcount_t *seqcount, + uint32_t begin_sn) { + return rte_seqcount_read_retry(seqcount, begin_sn); +} +void rte_seqcount_write_begin_w(rte_seqcount_t *seqcount) { + rte_seqcount_write_begin(seqcount); +} +void rte_seqcount_write_end_w(rte_seqcount_t *seqcount) { + rte_seqcount_write_end(seqcount); +} +void rte_seqlock_init_w(rte_seqlock_t *seqlock) { rte_seqlock_init(seqlock); } +uint32_t rte_seqlock_read_begin_w(const rte_seqlock_t *seqlock) { + return rte_seqlock_read_begin(seqlock); +} +bool rte_seqlock_read_retry_w(const rte_seqlock_t *seqlock, uint32_t begin_sn) { + return rte_seqlock_read_retry(seqlock, begin_sn); +} +void rte_seqlock_write_lock_w(rte_seqlock_t *seqlock) { + rte_seqlock_write_lock(seqlock); +} +void rte_seqlock_write_unlock_w(rte_seqlock_t *seqlock) { + rte_seqlock_write_unlock(seqlock); +} +unsigned int rte_stack_push_w(struct rte_stack *s, void *const *obj_table, + unsigned int n) { + return rte_stack_push(s, obj_table, n); +} +unsigned int rte_stack_pop_w(struct rte_stack *s, void **obj_table, + unsigned int n) { + return rte_stack_pop(s, obj_table, n); +} +unsigned int rte_stack_count_w(struct rte_stack *s) { + return rte_stack_count(s); +} +unsigned int rte_stack_free_count_w(struct rte_stack *s) { + return rte_stack_free_count(s); +} +uint32_t rte_softrss_w(uint32_t *input_tuple, uint32_t input_len, + const uint8_t *rss_key) { + return rte_softrss(input_tuple, input_len, rss_key); +} +uint32_t rte_softrss_be_w(uint32_t *input_tuple, uint32_t input_len, + const uint8_t *rss_key) { + return rte_softrss_be(input_tuple, input_len, rss_key); +} +void rte_ticketlock_init_w(rte_ticketlock_t *tl) { rte_ticketlock_init(tl); } +void rte_ticketlock_lock_w(rte_ticketlock_t *tl) { rte_ticketlock_lock(tl); } +void rte_ticketlock_unlock_w(rte_ticketlock_t *tl) { + rte_ticketlock_unlock(tl); +} +int rte_ticketlock_trylock_w(rte_ticketlock_t *tl) { + return rte_ticketlock_trylock(tl); +} +int rte_ticketlock_is_locked_w(rte_ticketlock_t *tl) { + return rte_ticketlock_is_locked(tl); +} +void rte_ticketlock_recursive_init_w(rte_ticketlock_recursive_t *tlr) { + rte_ticketlock_recursive_init(tlr); +} +void rte_ticketlock_recursive_lock_w(rte_ticketlock_recursive_t *tlr) { + rte_ticketlock_recursive_lock(tlr); +} +void rte_ticketlock_recursive_unlock_w(rte_ticketlock_recursive_t *tlr) { + rte_ticketlock_recursive_unlock(tlr); +} +int rte_ticketlock_recursive_trylock_w(rte_ticketlock_recursive_t *tlr) { + return rte_ticketlock_recursive_trylock(tlr); +} +uint64_t rte_cyclecounter_cycles_to_ns_w(struct rte_timecounter *tc, + uint64_t cycles) { + return rte_cyclecounter_cycles_to_ns(tc, cycles); +} +uint64_t rte_timecounter_update_w(struct rte_timecounter *tc, + uint64_t cycle_now) { + return rte_timecounter_update(tc, cycle_now); +} +uint64_t rte_timespec_to_ns_w(const struct timespec *ts) { + return rte_timespec_to_ns(ts); +} +struct timespec rte_ns_to_timespec_w(uint64_t nsec) { + return rte_ns_to_timespec(nsec); +} +bool rte_trace_feature_is_enabled_w(void) { + return rte_trace_feature_is_enabled(); +} diff --git a/nix/pkgs/dpdk-wrapper/src/dpdk_wrapper.h b/nix/pkgs/dpdk-wrapper/src/dpdk_wrapper.h new file mode 100644 index 000000000..3ebfe21e7 --- /dev/null +++ b/nix/pkgs/dpdk-wrapper/src/dpdk_wrapper.h @@ -0,0 +1,1034 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright Open Network Fabric Authors + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +// #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Things which are either duplicated, totally inapplicable or not needed +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include // this is an internal header +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include + +// #include +// #include +// #include +// #include + +/** + * Thin wrapper to expose `rte_errno`. + * + * @return + * The last rte_errno value (thread local value). + */ +int rte_errno_get(); + +/** + * TX offloads to be set in [`rte_eth_tx_mode.offloads`]. + * + * This is a bitfield. Union these to enable multiple offloads. + * + * I wrapped these because the enum must be explicitly typed as 64 bit, but + * DPDK is not yet using the C23 standard (which would allow the inheritance + * notation with `uint64_t` seen here.). + */ +enum rte_eth_tx_offload : uint64_t { + TX_OFFLOAD_VLAN_INSERT = RTE_ETH_TX_OFFLOAD_VLAN_INSERT, + TX_OFFLOAD_IPV4_CKSUM = RTE_ETH_TX_OFFLOAD_IPV4_CKSUM, + TX_OFFLOAD_UDP_CKSUM = RTE_ETH_TX_OFFLOAD_UDP_CKSUM, + TX_OFFLOAD_TCP_CKSUM = RTE_ETH_TX_OFFLOAD_TCP_CKSUM, + TX_OFFLOAD_SCTP_CKSUM = RTE_ETH_TX_OFFLOAD_SCTP_CKSUM, + TX_OFFLOAD_TCP_TSO = RTE_ETH_TX_OFFLOAD_TCP_TSO, + TX_OFFLOAD_UDP_TSO = RTE_ETH_TX_OFFLOAD_UDP_TSO, + TX_OFFLOAD_OUTER_IPV4_CKSUM = RTE_ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM, + TX_OFFLOAD_QINQ_INSERT = RTE_ETH_TX_OFFLOAD_QINQ_INSERT, + TX_OFFLOAD_VXLAN_TNL_TSO = RTE_ETH_TX_OFFLOAD_VXLAN_TNL_TSO, + TX_OFFLOAD_GRE_TNL_TSO = RTE_ETH_TX_OFFLOAD_GRE_TNL_TSO, + TX_OFFLOAD_IPIP_TNL_TSO = RTE_ETH_TX_OFFLOAD_IPIP_TNL_TSO, + TX_OFFLOAD_GENEVE_TNL_TSO = RTE_ETH_TX_OFFLOAD_GENEVE_TNL_TSO, + TX_OFFLOAD_MACSEC_INSERT = RTE_ETH_TX_OFFLOAD_MACSEC_INSERT, + TX_OFFLOAD_MT_LOCKFREE = RTE_ETH_TX_OFFLOAD_MT_LOCKFREE, + TX_OFFLOAD_MULTI_SEGS = RTE_ETH_TX_OFFLOAD_MULTI_SEGS, + TX_OFFLOAD_MBUF_FAST_FREE = RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE, + TX_OFFLOAD_SECURITY = RTE_ETH_TX_OFFLOAD_SECURITY, + TX_OFFLOAD_UDP_TNL_TSO = RTE_ETH_TX_OFFLOAD_UDP_TNL_TSO, + TX_OFFLOAD_IP_TNL_TSO = RTE_ETH_TX_OFFLOAD_IP_TNL_TSO, + TX_OFFLOAD_OUTER_UDP_CKSUM = RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM, + TX_OFFLOAD_SEND_ON_TIMESTAMP = RTE_ETH_TX_OFFLOAD_SEND_ON_TIMESTAMP +}; + +/** + * RX offloads to be set in [`rte_eth_rx_mode.offloads`]. + * + * This is a bitfield. Union these to enable multiple offloads. + * + * I wrapped these because the enum must be explicitly typed as 64 bit, but + * DPDK is not yet using the C23 standard (which would allow the inheritance + * notation with `uint64_t` seen here.). + */ +enum rte_eth_rx_offload : uint64_t { + RX_OFFLOAD_VLAN_STRIP = RTE_ETH_RX_OFFLOAD_VLAN_STRIP, + RX_OFFLOAD_IPV4_CKSUM = RTE_ETH_RX_OFFLOAD_IPV4_CKSUM, + RX_OFFLOAD_UDP_CKSUM = RTE_ETH_RX_OFFLOAD_UDP_CKSUM, + RX_OFFLOAD_TCP_CKSUM = RTE_ETH_RX_OFFLOAD_TCP_CKSUM, + RX_OFFLOAD_TCP_LRO = RTE_ETH_RX_OFFLOAD_TCP_LRO, + RX_OFFLOAD_QINQ_STRIP = RTE_ETH_RX_OFFLOAD_QINQ_STRIP, + RX_OFFLOAD_OUTER_IPV4_CKSUM = RTE_ETH_RX_OFFLOAD_OUTER_IPV4_CKSUM, + RX_OFFLOAD_MACSEC_STRIP = RTE_ETH_RX_OFFLOAD_MACSEC_STRIP, + RX_OFFLOAD_VLAN_FILTER = RTE_ETH_RX_OFFLOAD_VLAN_FILTER, + RX_OFFLOAD_VLAN_EXTEND = RTE_ETH_RX_OFFLOAD_VLAN_EXTEND, + RX_OFFLOAD_SCATTER = RTE_ETH_RX_OFFLOAD_SCATTER, + RX_OFFLOAD_TIMESTAMP = RTE_ETH_RX_OFFLOAD_TIMESTAMP, + RX_OFFLOAD_SECURITY = RTE_ETH_RX_OFFLOAD_SECURITY, + RX_OFFLOAD_KEEP_CRC = RTE_ETH_RX_OFFLOAD_KEEP_CRC, + RX_OFFLOAD_SCTP_CKSUM = RTE_ETH_RX_OFFLOAD_SCTP_CKSUM, + RX_OFFLOAD_OUTER_UDP_CKSUM = RTE_ETH_RX_OFFLOAD_OUTER_UDP_CKSUM, + RX_OFFLOAD_RSS_HASH = RTE_ETH_RX_OFFLOAD_RSS_HASH, + RX_OFFLOAD_BUFFER_SPLIT = RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT, +}; + +int rte_errno_get(); + +// Static wrappers + +void rte_atomic_thread_fence_w(rte_memory_order memorder); +int rte_atomic16_cmpset_w(uint16_t *dst, uint16_t exp, uint16_t src); +uint16_t rte_atomic16_exchange_w(uint16_t *dst, uint16_t val); +void rte_atomic16_init_w(rte_atomic16_t *v); +int16_t rte_atomic16_read_w(const rte_atomic16_t *v); +void rte_atomic16_set_w(rte_atomic16_t *v, int16_t new_value); +void rte_atomic16_add_w(rte_atomic16_t *v, int16_t inc); +void rte_atomic16_sub_w(rte_atomic16_t *v, int16_t dec); +void rte_atomic16_inc_w(rte_atomic16_t *v); +void rte_atomic16_dec_w(rte_atomic16_t *v); +int16_t rte_atomic16_add_return_w(rte_atomic16_t *v, int16_t inc); +int16_t rte_atomic16_sub_return_w(rte_atomic16_t *v, int16_t dec); +int rte_atomic16_inc_and_test_w(rte_atomic16_t *v); +int rte_atomic16_dec_and_test_w(rte_atomic16_t *v); +int rte_atomic16_test_and_set_w(rte_atomic16_t *v); +void rte_atomic16_clear_w(rte_atomic16_t *v); +int rte_atomic32_cmpset_w(uint32_t *dst, uint32_t exp, uint32_t src); +uint32_t rte_atomic32_exchange_w(uint32_t *dst, uint32_t val); +void rte_atomic32_init_w(rte_atomic32_t *v); +int32_t rte_atomic32_read_w(const rte_atomic32_t *v); +void rte_atomic32_set_w(rte_atomic32_t *v, int32_t new_value); +void rte_atomic32_add_w(rte_atomic32_t *v, int32_t inc); +void rte_atomic32_sub_w(rte_atomic32_t *v, int32_t dec); +void rte_atomic32_inc_w(rte_atomic32_t *v); +void rte_atomic32_dec_w(rte_atomic32_t *v); +int32_t rte_atomic32_add_return_w(rte_atomic32_t *v, int32_t inc); +int32_t rte_atomic32_sub_return_w(rte_atomic32_t *v, int32_t dec); +int rte_atomic32_inc_and_test_w(rte_atomic32_t *v); +int rte_atomic32_dec_and_test_w(rte_atomic32_t *v); +int rte_atomic32_test_and_set_w(rte_atomic32_t *v); +void rte_atomic32_clear_w(rte_atomic32_t *v); +int rte_atomic64_cmpset_w(uint64_t *dst, uint64_t exp, uint64_t src); +uint64_t rte_atomic64_exchange_w(uint64_t *dst, uint64_t val); +void rte_atomic64_init_w(rte_atomic64_t *v); +int64_t rte_atomic64_read_w(rte_atomic64_t *v); +void rte_atomic64_set_w(rte_atomic64_t *v, int64_t new_value); +void rte_atomic64_add_w(rte_atomic64_t *v, int64_t inc); +void rte_atomic64_sub_w(rte_atomic64_t *v, int64_t dec); +void rte_atomic64_inc_w(rte_atomic64_t *v); +void rte_atomic64_dec_w(rte_atomic64_t *v); +int64_t rte_atomic64_add_return_w(rte_atomic64_t *v, int64_t inc); +int64_t rte_atomic64_sub_return_w(rte_atomic64_t *v, int64_t dec); +int rte_atomic64_inc_and_test_w(rte_atomic64_t *v); +int rte_atomic64_dec_and_test_w(rte_atomic64_t *v); +int rte_atomic64_test_and_set_w(rte_atomic64_t *v); +void rte_atomic64_clear_w(rte_atomic64_t *v); +void rte_smp_mb_w(void); +uint64_t rte_get_tsc_cycles_w(void); +uint64_t rte_get_timer_cycles_w(void); +uint64_t rte_get_timer_hz_w(void); +void rte_delay_ms_w(unsigned int ms); +uint64_t rte_rdtsc_w(void); +uint64_t rte_rdtsc_precise_w(void); +size_t rte_strlcpy_w(char *dst, const char *src, size_t size); +size_t rte_strlcat_w(char *dst, const char *src, size_t size); +const char *rte_str_skip_leading_spaces_w(const char *src); +void rte_uuid_copy_w(rte_uuid_t dst, const rte_uuid_t src); +int rte_gettid_w(void); +unsigned int rte_lcore_id_w(void); +void rte_pause_w(void); +void rte_wait_until_equal_16_w(uint16_t *addr, uint16_t expected, + rte_memory_order memorder); +void rte_wait_until_equal_32_w(uint32_t *addr, uint32_t expected, + rte_memory_order memorder); +void rte_wait_until_equal_64_w(uint64_t *addr, uint64_t expected, + rte_memory_order memorder); +void rte_spinlock_init_w(rte_spinlock_t *sl); +void rte_spinlock_lock_w(rte_spinlock_t *sl); +void rte_spinlock_unlock_w(rte_spinlock_t *sl); +int rte_spinlock_trylock_w(rte_spinlock_t *sl); +int rte_spinlock_is_locked_w(rte_spinlock_t *sl); +int rte_tm_supported_w(void); +void rte_spinlock_lock_tm_w(rte_spinlock_t *sl); +void rte_spinlock_unlock_tm_w(rte_spinlock_t *sl); +int rte_spinlock_trylock_tm_w(rte_spinlock_t *sl); +void rte_spinlock_recursive_init_w(rte_spinlock_recursive_t *slr); +void rte_spinlock_recursive_lock_w(rte_spinlock_recursive_t *slr); +void rte_spinlock_recursive_unlock_w(rte_spinlock_recursive_t *slr); +int rte_spinlock_recursive_trylock_w(rte_spinlock_recursive_t *slr); +void rte_spinlock_recursive_lock_tm_w(rte_spinlock_recursive_t *slr); +void rte_spinlock_recursive_unlock_tm_w(rte_spinlock_recursive_t *slr); +int rte_spinlock_recursive_trylock_tm_w(rte_spinlock_recursive_t *slr); +uint32_t rte_bit_relaxed_get32_w(unsigned int nr, uint32_t *addr); +void rte_bit_relaxed_set32_w(unsigned int nr, uint32_t *addr); +void rte_bit_relaxed_clear32_w(unsigned int nr, uint32_t *addr); +uint32_t rte_bit_relaxed_test_and_set32_w(unsigned int nr, uint32_t *addr); +uint32_t rte_bit_relaxed_test_and_clear32_w(unsigned int nr, uint32_t *addr); +uint64_t rte_bit_relaxed_get64_w(unsigned int nr, uint64_t *addr); +void rte_bit_relaxed_set64_w(unsigned int nr, uint64_t *addr); +void rte_bit_relaxed_clear64_w(unsigned int nr, uint64_t *addr); +uint64_t rte_bit_relaxed_test_and_set64_w(unsigned int nr, uint64_t *addr); +uint64_t rte_bit_relaxed_test_and_clear64_w(unsigned int nr, uint64_t *addr); +unsigned int rte_clz32_w(uint32_t v); +unsigned int rte_clz64_w(uint64_t v); +unsigned int rte_ctz32_w(uint32_t v); +unsigned int rte_ctz64_w(uint64_t v); +unsigned int rte_popcount32_w(uint32_t v); +unsigned int rte_popcount64_w(uint64_t v); +uint32_t rte_combine32ms1b_w(uint32_t x); +uint64_t rte_combine64ms1b_w(uint64_t v); +uint32_t rte_bsf32_w(uint32_t v); +int rte_bsf32_safe_w(uint32_t v, uint32_t *pos); +uint32_t rte_bsf64_w(uint64_t v); +int rte_bsf64_safe_w(uint64_t v, uint32_t *pos); +uint32_t rte_fls_u32_w(uint32_t x); +uint32_t rte_fls_u64_w(uint64_t x); +int rte_is_power_of_2_w(uint32_t n); +uint32_t rte_align32pow2_w(uint32_t x); +uint32_t rte_align32prevpow2_w(uint32_t x); +uint64_t rte_align64pow2_w(uint64_t v); +uint64_t rte_align64prevpow2_w(uint64_t v); +uint32_t rte_log2_u32_w(uint32_t v); +uint32_t rte_log2_u64_w(uint64_t v); +void rte_rwlock_init_w(rte_rwlock_t *rwl); +void rte_rwlock_read_lock_w(rte_rwlock_t *rwl); +int rte_rwlock_read_trylock_w(rte_rwlock_t *rwl); +void rte_rwlock_read_unlock_w(rte_rwlock_t *rwl); +int rte_rwlock_write_trylock_w(rte_rwlock_t *rwl); +void rte_rwlock_write_lock_w(rte_rwlock_t *rwl); +void rte_rwlock_write_unlock_w(rte_rwlock_t *rwl); +int rte_rwlock_write_is_locked_w(rte_rwlock_t *rwl); +void rte_rwlock_read_lock_tm_w(rte_rwlock_t *rwl); +void rte_rwlock_read_unlock_tm_w(rte_rwlock_t *rwl); +void rte_rwlock_write_lock_tm_w(rte_rwlock_t *rwl); +void rte_rwlock_write_unlock_tm_w(rte_rwlock_t *rwl); +unsigned int rte_ring_mp_enqueue_bulk_elem_w(struct rte_ring *r, + const void *obj_table, + unsigned int esize, unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_sp_enqueue_bulk_elem_w(struct rte_ring *r, + const void *obj_table, + unsigned int esize, unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_mp_hts_enqueue_bulk_elem_w(struct rte_ring *r, + const void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_mc_hts_dequeue_bulk_elem_w(struct rte_ring *r, + void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *available); +unsigned int rte_ring_mp_hts_enqueue_burst_elem_w(struct rte_ring *r, + const void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_mc_hts_dequeue_burst_elem_w(struct rte_ring *r, + void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *available); +unsigned int rte_ring_mp_hts_enqueue_bulk_w(struct rte_ring *r, + void *const *obj_table, + unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_mc_hts_dequeue_bulk_w(struct rte_ring *r, + void **obj_table, unsigned int n, + unsigned int *available); +unsigned int rte_ring_mp_hts_enqueue_burst_w(struct rte_ring *r, + void *const *obj_table, + unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_mc_hts_dequeue_burst_w(struct rte_ring *r, + void **obj_table, unsigned int n, + unsigned int *available); +unsigned int rte_ring_mp_rts_enqueue_bulk_elem_w(struct rte_ring *r, + const void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_mc_rts_dequeue_bulk_elem_w(struct rte_ring *r, + void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *available); +unsigned int rte_ring_mp_rts_enqueue_burst_elem_w(struct rte_ring *r, + const void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_mc_rts_dequeue_burst_elem_w(struct rte_ring *r, + void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *available); +unsigned int rte_ring_mp_rts_enqueue_bulk_w(struct rte_ring *r, + void *const *obj_table, + unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_mc_rts_dequeue_bulk_w(struct rte_ring *r, + void **obj_table, unsigned int n, + unsigned int *available); +unsigned int rte_ring_mp_rts_enqueue_burst_w(struct rte_ring *r, + void *const *obj_table, + unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_mc_rts_dequeue_burst_w(struct rte_ring *r, + void **obj_table, unsigned int n, + unsigned int *available); +uint32_t rte_ring_get_prod_htd_max_w(const struct rte_ring *r); +int rte_ring_set_prod_htd_max_w(struct rte_ring *r, uint32_t v); +uint32_t rte_ring_get_cons_htd_max_w(const struct rte_ring *r); +int rte_ring_set_cons_htd_max_w(struct rte_ring *r, uint32_t v); +unsigned int rte_ring_enqueue_bulk_elem_w(struct rte_ring *r, + const void *obj_table, + unsigned int esize, unsigned int n, + unsigned int *free_space); +int rte_ring_mp_enqueue_elem_w(struct rte_ring *r, void *obj, + unsigned int esize); +int rte_ring_sp_enqueue_elem_w(struct rte_ring *r, void *obj, + unsigned int esize); +int rte_ring_enqueue_elem_w(struct rte_ring *r, void *obj, unsigned int esize); +unsigned int rte_ring_mc_dequeue_bulk_elem_w(struct rte_ring *r, + void *obj_table, + unsigned int esize, unsigned int n, + unsigned int *available); +unsigned int rte_ring_sc_dequeue_bulk_elem_w(struct rte_ring *r, + void *obj_table, + unsigned int esize, unsigned int n, + unsigned int *available); +unsigned int rte_ring_dequeue_bulk_elem_w(struct rte_ring *r, void *obj_table, + unsigned int esize, unsigned int n, + unsigned int *available); +int rte_ring_mc_dequeue_elem_w(struct rte_ring *r, void *obj_p, + unsigned int esize); +int rte_ring_sc_dequeue_elem_w(struct rte_ring *r, void *obj_p, + unsigned int esize); +int rte_ring_dequeue_elem_w(struct rte_ring *r, void *obj_p, + unsigned int esize); +unsigned int rte_ring_mp_enqueue_burst_elem_w(struct rte_ring *r, + const void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_sp_enqueue_burst_elem_w(struct rte_ring *r, + const void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_enqueue_burst_elem_w(struct rte_ring *r, + const void *obj_table, + unsigned int esize, unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_mc_dequeue_burst_elem_w(struct rte_ring *r, + void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *available); +unsigned int rte_ring_sc_dequeue_burst_elem_w(struct rte_ring *r, + void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *available); +unsigned int rte_ring_dequeue_burst_elem_w(struct rte_ring *r, void *obj_table, + unsigned int esize, unsigned int n, + unsigned int *available); +unsigned int rte_ring_enqueue_bulk_elem_start_w(struct rte_ring *r, + unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_enqueue_bulk_start_w(struct rte_ring *r, unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_enqueue_burst_elem_start_w(struct rte_ring *r, + unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_enqueue_burst_start_w(struct rte_ring *r, unsigned int n, + unsigned int *free_space); +void rte_ring_enqueue_elem_finish_w(struct rte_ring *r, const void *obj_table, + unsigned int esize, unsigned int n); +void rte_ring_enqueue_finish_w(struct rte_ring *r, void *const *obj_table, + unsigned int n); +unsigned int rte_ring_dequeue_bulk_elem_start_w(struct rte_ring *r, + void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *available); +unsigned int rte_ring_dequeue_bulk_start_w(struct rte_ring *r, void **obj_table, + unsigned int n, + unsigned int *available); +unsigned int rte_ring_dequeue_burst_elem_start_w(struct rte_ring *r, + void *obj_table, + unsigned int esize, + unsigned int n, + unsigned int *available); +unsigned int rte_ring_dequeue_burst_start_w(struct rte_ring *r, + void **obj_table, unsigned int n, + unsigned int *available); +void rte_ring_dequeue_elem_finish_w(struct rte_ring *r, unsigned int n); +void rte_ring_dequeue_finish_w(struct rte_ring *r, unsigned int n); +unsigned int rte_ring_enqueue_zc_bulk_elem_start_w(struct rte_ring *r, + unsigned int esize, + unsigned int n, + struct rte_ring_zc_data *zcd, + unsigned int *free_space); +unsigned int rte_ring_enqueue_zc_bulk_start_w(struct rte_ring *r, + unsigned int n, + struct rte_ring_zc_data *zcd, + unsigned int *free_space); +unsigned int rte_ring_enqueue_zc_burst_elem_start_w( + struct rte_ring *r, unsigned int esize, unsigned int n, + struct rte_ring_zc_data *zcd, unsigned int *free_space); +unsigned int rte_ring_enqueue_zc_burst_start_w(struct rte_ring *r, + unsigned int n, + struct rte_ring_zc_data *zcd, + unsigned int *free_space); +void rte_ring_enqueue_zc_elem_finish_w(struct rte_ring *r, unsigned int n); +void rte_ring_enqueue_zc_finish_w(struct rte_ring *r, unsigned int n); +unsigned int rte_ring_dequeue_zc_bulk_elem_start_w(struct rte_ring *r, + unsigned int esize, + unsigned int n, + struct rte_ring_zc_data *zcd, + unsigned int *available); +unsigned int rte_ring_dequeue_zc_bulk_start_w(struct rte_ring *r, + unsigned int n, + struct rte_ring_zc_data *zcd, + unsigned int *available); +unsigned int rte_ring_dequeue_zc_burst_elem_start_w( + struct rte_ring *r, unsigned int esize, unsigned int n, + struct rte_ring_zc_data *zcd, unsigned int *available); +unsigned int rte_ring_dequeue_zc_burst_start_w(struct rte_ring *r, + unsigned int n, + struct rte_ring_zc_data *zcd, + unsigned int *available); +void rte_ring_dequeue_zc_elem_finish_w(struct rte_ring *r, unsigned int n); +void rte_ring_dequeue_zc_finish_w(struct rte_ring *r, unsigned int n); +unsigned int rte_ring_mp_enqueue_bulk_w(struct rte_ring *r, + void *const *obj_table, unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_sp_enqueue_bulk_w(struct rte_ring *r, + void *const *obj_table, unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_enqueue_bulk_w(struct rte_ring *r, void *const *obj_table, + unsigned int n, unsigned int *free_space); +int rte_ring_mp_enqueue_w(struct rte_ring *r, void *obj); +int rte_ring_sp_enqueue_w(struct rte_ring *r, void *obj); +int rte_ring_enqueue_w(struct rte_ring *r, void *obj); +unsigned int rte_ring_mc_dequeue_bulk_w(struct rte_ring *r, void **obj_table, + unsigned int n, + unsigned int *available); +unsigned int rte_ring_sc_dequeue_bulk_w(struct rte_ring *r, void **obj_table, + unsigned int n, + unsigned int *available); +unsigned int rte_ring_dequeue_bulk_w(struct rte_ring *r, void **obj_table, + unsigned int n, unsigned int *available); +int rte_ring_mc_dequeue_w(struct rte_ring *r, void **obj_p); +int rte_ring_sc_dequeue_w(struct rte_ring *r, void **obj_p); +int rte_ring_dequeue_w(struct rte_ring *r, void **obj_p); +unsigned int rte_ring_count_w(const struct rte_ring *r); +unsigned int rte_ring_free_count_w(const struct rte_ring *r); +int rte_ring_full_w(const struct rte_ring *r); +int rte_ring_empty_w(const struct rte_ring *r); +unsigned int rte_ring_get_size_w(const struct rte_ring *r); +unsigned int rte_ring_get_capacity_w(const struct rte_ring *r); +enum rte_ring_sync_type rte_ring_get_prod_sync_type_w(const struct rte_ring *r); +int rte_ring_is_prod_single_w(const struct rte_ring *r); +enum rte_ring_sync_type rte_ring_get_cons_sync_type_w(const struct rte_ring *r); +int rte_ring_is_cons_single_w(const struct rte_ring *r); +unsigned int rte_ring_mp_enqueue_burst_w(struct rte_ring *r, + void *const *obj_table, unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_sp_enqueue_burst_w(struct rte_ring *r, + void *const *obj_table, unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_enqueue_burst_w(struct rte_ring *r, + void *const *obj_table, unsigned int n, + unsigned int *free_space); +unsigned int rte_ring_mc_dequeue_burst_w(struct rte_ring *r, void **obj_table, + unsigned int n, + unsigned int *available); +unsigned int rte_ring_sc_dequeue_burst_w(struct rte_ring *r, void **obj_table, + unsigned int n, + unsigned int *available); +unsigned int rte_ring_dequeue_burst_w(struct rte_ring *r, void **obj_table, + unsigned int n, unsigned int *available); +void *rte_memcpy_w(void *dst, const void *src, size_t n); +void rte_mov16_w(uint8_t *dst, const uint8_t *src); +void rte_mov32_w(uint8_t *dst, const uint8_t *src); +void rte_mov64_w(uint8_t *dst, const uint8_t *src); +void rte_mov256_w(uint8_t *dst, const uint8_t *src); +struct rte_mempool_objhdr *rte_mempool_get_header_w(void *obj); +struct rte_mempool *rte_mempool_from_obj_w(void *obj); +struct rte_mempool_objtlr *rte_mempool_get_trailer_w(void *obj); +struct rte_mempool_ops *rte_mempool_get_ops_w(int ops_index); +int rte_mempool_ops_dequeue_bulk_w(struct rte_mempool *mp, void **obj_table, + unsigned int n); +int rte_mempool_ops_dequeue_contig_blocks_w(struct rte_mempool *mp, + void **first_obj_table, + unsigned int n); +int rte_mempool_ops_enqueue_bulk_w(struct rte_mempool *mp, + void *const *obj_table, unsigned int n); +struct rte_mempool_cache *rte_mempool_default_cache_w(struct rte_mempool *mp, + unsigned int lcore_id); +void rte_mempool_cache_flush_w(struct rte_mempool_cache *cache, + struct rte_mempool *mp); +void rte_mempool_do_generic_put_w(struct rte_mempool *mp, + void *const *obj_table, unsigned int n, + struct rte_mempool_cache *cache); +void rte_mempool_generic_put_w(struct rte_mempool *mp, void *const *obj_table, + unsigned int n, struct rte_mempool_cache *cache); +void rte_mempool_put_bulk_w(struct rte_mempool *mp, void *const *obj_table, + unsigned int n); +void rte_mempool_put_w(struct rte_mempool *mp, void *obj); +int rte_mempool_do_generic_get_w(struct rte_mempool *mp, void **obj_table, + unsigned int n, + struct rte_mempool_cache *cache); +int rte_mempool_generic_get_w(struct rte_mempool *mp, void **obj_table, + unsigned int n, struct rte_mempool_cache *cache); +int rte_mempool_get_bulk_w(struct rte_mempool *mp, void **obj_table, + unsigned int n); +int rte_mempool_get_w(struct rte_mempool *mp, void **obj_p); +int rte_mempool_get_contig_blocks_w(struct rte_mempool *mp, + void **first_obj_table, unsigned int n); +int rte_mempool_full_w(const struct rte_mempool *mp); +int rte_mempool_empty_w(const struct rte_mempool *mp); +rte_iova_t rte_mempool_virt2iova_w(const void *elt); +void *rte_mempool_get_priv_w(struct rte_mempool *mp); +void rte_prefetch0_w(const void *p); +void rte_prefetch1_w(const void *p); +void rte_prefetch2_w(const void *p); +void rte_prefetch_non_temporal_w(const void *p); +void rte_prefetch0_write_w(const void *p); +void rte_prefetch1_write_w(const void *p); +void rte_prefetch2_write_w(const void *p); +void rte_cldemote_w(const void *p); +uint16_t rte_constant_bswap16_w(uint16_t x); +uint32_t rte_constant_bswap32_w(uint32_t x); +uint64_t rte_constant_bswap64_w(uint64_t x); +void rte_mbuf_prefetch_part1_w(struct rte_mbuf *m); +void rte_mbuf_prefetch_part2_w(struct rte_mbuf *m); +uint16_t rte_pktmbuf_priv_size_w(struct rte_mempool *mp); +rte_iova_t rte_mbuf_iova_get_w(const struct rte_mbuf *m); +void rte_mbuf_iova_set_w(struct rte_mbuf *m, rte_iova_t iova); +rte_iova_t rte_mbuf_data_iova_w(const struct rte_mbuf *mb); +rte_iova_t rte_mbuf_data_iova_default_w(const struct rte_mbuf *mb); +struct rte_mbuf *rte_mbuf_from_indirect_w(struct rte_mbuf *mi); +char *rte_mbuf_buf_addr_w(struct rte_mbuf *mb, struct rte_mempool *mp); +char *rte_mbuf_data_addr_default_w(struct rte_mbuf *mb); +char *rte_mbuf_to_baddr_w(struct rte_mbuf *md); +void *rte_mbuf_to_priv_w(struct rte_mbuf *m); +uint32_t rte_pktmbuf_priv_flags_w(struct rte_mempool *mp); +uint16_t rte_mbuf_refcnt_read_w(const struct rte_mbuf *m); +void rte_mbuf_refcnt_set_w(struct rte_mbuf *m, uint16_t new_value); +uint16_t rte_mbuf_refcnt_update_w(struct rte_mbuf *m, int16_t value); +uint16_t +rte_mbuf_ext_refcnt_read_w(const struct rte_mbuf_ext_shared_info *shinfo); +void rte_mbuf_ext_refcnt_set_w(struct rte_mbuf_ext_shared_info *shinfo, + uint16_t new_value); +uint16_t rte_mbuf_ext_refcnt_update_w(struct rte_mbuf_ext_shared_info *shinfo, + int16_t value); +struct rte_mbuf *rte_mbuf_raw_alloc_w(struct rte_mempool *mp); +void rte_mbuf_raw_free_w(struct rte_mbuf *m); +uint16_t rte_pktmbuf_data_room_size_w(struct rte_mempool *mp); +void rte_pktmbuf_reset_headroom_w(struct rte_mbuf *m); +void rte_pktmbuf_reset_w(struct rte_mbuf *m); +struct rte_mbuf *rte_pktmbuf_alloc_w(struct rte_mempool *mp); +int rte_pktmbuf_alloc_bulk_w(struct rte_mempool *pool, struct rte_mbuf **mbufs, + unsigned int count); +struct rte_mbuf_ext_shared_info * +rte_pktmbuf_ext_shinfo_init_helper_w(void *buf_addr, uint16_t *buf_len, + rte_mbuf_extbuf_free_callback_t free_cb, + void *fcb_opaque); +void rte_pktmbuf_attach_extbuf_w(struct rte_mbuf *m, void *buf_addr, + rte_iova_t buf_iova, uint16_t buf_len, + struct rte_mbuf_ext_shared_info *shinfo); +void rte_mbuf_dynfield_copy_w(struct rte_mbuf *mdst, + const struct rte_mbuf *msrc); +void rte_pktmbuf_attach_w(struct rte_mbuf *mi, struct rte_mbuf *m); +void rte_pktmbuf_detach_w(struct rte_mbuf *m); +struct rte_mbuf *rte_pktmbuf_prefree_seg_w(struct rte_mbuf *m); +void rte_pktmbuf_free_seg_w(struct rte_mbuf *m); +void rte_pktmbuf_free_w(struct rte_mbuf *m); +void rte_pktmbuf_refcnt_update_w(struct rte_mbuf *m, int16_t v); +uint16_t rte_pktmbuf_headroom_w(const struct rte_mbuf *m); +uint16_t rte_pktmbuf_tailroom_w(const struct rte_mbuf *m); +struct rte_mbuf *rte_pktmbuf_lastseg_w(struct rte_mbuf *m); +char *rte_pktmbuf_prepend_w(struct rte_mbuf *m, uint16_t len); +char *rte_pktmbuf_append_w(struct rte_mbuf *m, uint16_t len); +char *rte_pktmbuf_adj_w(struct rte_mbuf *m, uint16_t len); +int rte_pktmbuf_trim_w(struct rte_mbuf *m, uint16_t len); +int rte_pktmbuf_is_contiguous_w(const struct rte_mbuf *m); +const void *rte_pktmbuf_read_w(const struct rte_mbuf *m, uint32_t off, + uint32_t len, void *buf); +int rte_pktmbuf_chain_w(struct rte_mbuf *head, struct rte_mbuf *tail); +uint64_t rte_mbuf_tx_offload_w(uint64_t il2, uint64_t il3, uint64_t il4, + uint64_t tso, uint64_t ol3, uint64_t ol2, + uint64_t unused); +int rte_validate_tx_offload_w(const struct rte_mbuf *m); +int rte_pktmbuf_linearize_w(struct rte_mbuf *mbuf); +uint32_t rte_mbuf_sched_queue_get_w(const struct rte_mbuf *m); +uint8_t rte_mbuf_sched_traffic_class_get_w(const struct rte_mbuf *m); +uint8_t rte_mbuf_sched_color_get_w(const struct rte_mbuf *m); +void rte_mbuf_sched_get_w(const struct rte_mbuf *m, uint32_t *queue_id, + uint8_t *traffic_class, uint8_t *color); +void rte_mbuf_sched_queue_set_w(struct rte_mbuf *m, uint32_t queue_id); +void rte_mbuf_sched_traffic_class_set_w(struct rte_mbuf *m, + uint8_t traffic_class); +void rte_mbuf_sched_color_set_w(struct rte_mbuf *m, uint8_t color); +void rte_mbuf_sched_set_w(struct rte_mbuf *m, uint32_t queue_id, + uint8_t traffic_class, uint8_t color); +int rte_is_same_ether_addr_w(const struct rte_ether_addr *ea1, + const struct rte_ether_addr *ea2); +int rte_is_zero_ether_addr_w(const struct rte_ether_addr *ea); +int rte_is_unicast_ether_addr_w(const struct rte_ether_addr *ea); +int rte_is_multicast_ether_addr_w(const struct rte_ether_addr *ea); +int rte_is_broadcast_ether_addr_w(const struct rte_ether_addr *ea); +int rte_is_universal_ether_addr_w(const struct rte_ether_addr *ea); +int rte_is_local_admin_ether_addr_w(const struct rte_ether_addr *ea); +int rte_is_valid_assigned_ether_addr_w(const struct rte_ether_addr *ea); +void rte_ether_addr_copy_w(const struct rte_ether_addr *ea_from, + struct rte_ether_addr *ea_to); +int rte_vlan_strip_w(struct rte_mbuf *m); +int rte_vlan_insert_w(struct rte_mbuf **m); +uint32_t rte_bitmap_get_memory_footprint_w(uint32_t n_bits); +struct rte_bitmap *rte_bitmap_init_w(uint32_t n_bits, uint8_t *mem, + uint32_t mem_size); +struct rte_bitmap *rte_bitmap_init_with_all_set_w(uint32_t n_bits, uint8_t *mem, + uint32_t mem_size); +void rte_bitmap_free_w(struct rte_bitmap *bmp); +void rte_bitmap_reset_w(struct rte_bitmap *bmp); +void rte_bitmap_prefetch0_w(struct rte_bitmap *bmp, uint32_t pos); +uint64_t rte_bitmap_get_w(struct rte_bitmap *bmp, uint32_t pos); +void rte_bitmap_set_w(struct rte_bitmap *bmp, uint32_t pos); +void rte_bitmap_set_slab_w(struct rte_bitmap *bmp, uint32_t pos, uint64_t slab); +void rte_bitmap_clear_w(struct rte_bitmap *bmp, uint32_t pos); +int rte_bitmap_scan_w(struct rte_bitmap *bmp, uint32_t *pos, uint64_t *slab); +uint16_t rte_raw_cksum_w(const void *buf, size_t len); +int rte_raw_cksum_mbuf_w(const struct rte_mbuf *m, uint32_t off, uint32_t len, + uint16_t *cksum); +uint8_t rte_ipv4_hdr_len_w(const struct rte_ipv4_hdr *ipv4_hdr); +uint16_t rte_ipv4_cksum_w(const struct rte_ipv4_hdr *ipv4_hdr); +uint16_t rte_ipv4_cksum_simple_w(const struct rte_ipv4_hdr *ipv4_hdr); +uint16_t rte_ipv4_phdr_cksum_w(const struct rte_ipv4_hdr *ipv4_hdr, + uint64_t ol_flags); +uint16_t rte_ipv4_udptcp_cksum_w(const struct rte_ipv4_hdr *ipv4_hdr, + const void *l4_hdr); +uint16_t rte_ipv4_udptcp_cksum_mbuf_w(const struct rte_mbuf *m, + const struct rte_ipv4_hdr *ipv4_hdr, + uint16_t l4_off); +int rte_ipv4_udptcp_cksum_verify_w(const struct rte_ipv4_hdr *ipv4_hdr, + const void *l4_hdr); +int rte_ipv4_udptcp_cksum_mbuf_verify_w(const struct rte_mbuf *m, + const struct rte_ipv4_hdr *ipv4_hdr, + uint16_t l4_off); +bool rte_ipv6_addr_eq_w(const struct rte_ipv6_addr *a, + const struct rte_ipv6_addr *b); +void rte_ipv6_addr_mask_w(struct rte_ipv6_addr *ip, uint8_t depth); +bool rte_ipv6_addr_eq_prefix_w(const struct rte_ipv6_addr *a, + const struct rte_ipv6_addr *b, uint8_t depth); +uint8_t rte_ipv6_mask_depth_w(const struct rte_ipv6_addr *mask); +bool rte_ipv6_addr_is_unspec_w(const struct rte_ipv6_addr *ip); +bool rte_ipv6_addr_is_loopback_w(const struct rte_ipv6_addr *ip); +bool rte_ipv6_addr_is_linklocal_w(const struct rte_ipv6_addr *ip); +bool rte_ipv6_addr_is_sitelocal_w(const struct rte_ipv6_addr *ip); +bool rte_ipv6_addr_is_v4compat_w(const struct rte_ipv6_addr *ip); +bool rte_ipv6_addr_is_v4mapped_w(const struct rte_ipv6_addr *ip); +bool rte_ipv6_addr_is_mcast_w(const struct rte_ipv6_addr *ip); +enum rte_ipv6_mc_scope rte_ipv6_mc_scope_w(const struct rte_ipv6_addr *ip); +void rte_ipv6_llocal_from_ethernet_w(struct rte_ipv6_addr *ip, + const struct rte_ether_addr *mac); +void rte_ipv6_solnode_from_addr_w(struct rte_ipv6_addr *sol, + const struct rte_ipv6_addr *ip); +void rte_ether_mcast_from_ipv6_w(struct rte_ether_addr *mac, + const struct rte_ipv6_addr *ip); +int rte_ipv6_check_version_w(const struct rte_ipv6_hdr *ip); +uint16_t rte_ipv6_phdr_cksum_w(const struct rte_ipv6_hdr *ipv6_hdr, + uint64_t ol_flags); +uint16_t rte_ipv6_udptcp_cksum_w(const struct rte_ipv6_hdr *ipv6_hdr, + const void *l4_hdr); +uint16_t rte_ipv6_udptcp_cksum_mbuf_w(const struct rte_mbuf *m, + const struct rte_ipv6_hdr *ipv6_hdr, + uint16_t l4_off); +int rte_ipv6_udptcp_cksum_verify_w(const struct rte_ipv6_hdr *ipv6_hdr, + const void *l4_hdr); +int rte_ipv6_udptcp_cksum_mbuf_verify_w(const struct rte_mbuf *m, + const struct rte_ipv6_hdr *ipv6_hdr, + uint16_t l4_off); +int rte_ipv6_get_next_ext_w(const uint8_t *p, int proto, size_t *ext_len); +enum rte_color +rte_meter_srtcm_color_blind_check_w(struct rte_meter_srtcm *m, + struct rte_meter_srtcm_profile *p, + uint64_t time, uint32_t pkt_len); +enum rte_color rte_meter_srtcm_color_aware_check_w( + struct rte_meter_srtcm *m, struct rte_meter_srtcm_profile *p, uint64_t time, + uint32_t pkt_len, enum rte_color pkt_color); +enum rte_color +rte_meter_trtcm_color_blind_check_w(struct rte_meter_trtcm *m, + struct rte_meter_trtcm_profile *p, + uint64_t time, uint32_t pkt_len); +enum rte_color rte_meter_trtcm_color_aware_check_w( + struct rte_meter_trtcm *m, struct rte_meter_trtcm_profile *p, uint64_t time, + uint32_t pkt_len, enum rte_color pkt_color); +enum rte_color rte_meter_trtcm_rfc4115_color_blind_check_w( + struct rte_meter_trtcm_rfc4115 *m, + struct rte_meter_trtcm_rfc4115_profile *p, uint64_t time, uint32_t pkt_len); +enum rte_color rte_meter_trtcm_rfc4115_color_aware_check_w( + struct rte_meter_trtcm_rfc4115 *m, + struct rte_meter_trtcm_rfc4115_profile *p, uint64_t time, uint32_t pkt_len, + enum rte_color pkt_color); +uint64_t rte_eth_rss_hf_refine_w(uint64_t rss_hf); +uint16_t rte_eth_rx_burst_w(uint16_t port_id, uint16_t queue_id, + struct rte_mbuf **rx_pkts, const uint16_t nb_pkts); +int rte_eth_rx_queue_count_w(uint16_t port_id, uint16_t queue_id); +int rte_eth_rx_descriptor_status_w(uint16_t port_id, uint16_t queue_id, + uint16_t offset); +int rte_eth_tx_descriptor_status_w(uint16_t port_id, uint16_t queue_id, + uint16_t offset); +uint16_t rte_eth_tx_burst_w(uint16_t port_id, uint16_t queue_id, + struct rte_mbuf **tx_pkts, uint16_t nb_pkts); +uint16_t rte_eth_tx_prepare_w(uint16_t port_id, uint16_t queue_id, + struct rte_mbuf **tx_pkts, uint16_t nb_pkts); +uint16_t rte_eth_tx_buffer_flush_w(uint16_t port_id, uint16_t queue_id, + struct rte_eth_dev_tx_buffer *buffer); +uint16_t rte_eth_tx_buffer_w(uint16_t port_id, uint16_t queue_id, + struct rte_eth_dev_tx_buffer *buffer, + struct rte_mbuf *tx_pkt); +uint16_t +rte_eth_recycle_mbufs_w(uint16_t rx_port_id, uint16_t rx_queue_id, + uint16_t tx_port_id, uint16_t tx_queue_id, + struct rte_eth_recycle_rxq_info *recycle_rxq_info); +int rte_eth_tx_queue_count_w(uint16_t port_id, uint16_t queue_id); +uint32_t rte_flow_dynf_metadata_get_w(struct rte_mbuf *m); +void rte_flow_dynf_metadata_set_w(struct rte_mbuf *m, uint32_t v); +int rte_flow_dynf_metadata_avail_w(void); +uint32_t rte_hash_crc_1byte_w(uint8_t data, uint32_t init_val); +uint32_t rte_hash_crc_2byte_w(uint16_t data, uint32_t init_val); +uint32_t rte_hash_crc_4byte_w(uint32_t data, uint32_t init_val); +uint32_t rte_hash_crc_8byte_w(uint64_t data, uint32_t init_val); +uint32_t rte_hash_crc_w(const void *data, uint32_t data_len, uint32_t init_val); +void rte_jhash_2hashes_w(const void *key, uint32_t length, uint32_t *pc, + uint32_t *pb); +void rte_jhash_32b_2hashes_w(const uint32_t *k, uint32_t length, uint32_t *pc, + uint32_t *pb); +uint32_t rte_jhash_w(const void *key, uint32_t length, uint32_t initval); +uint32_t rte_jhash_32b_w(const uint32_t *k, uint32_t length, uint32_t initval); +uint32_t rte_jhash_3words_w(uint32_t a, uint32_t b, uint32_t c, + uint32_t initval); +uint32_t rte_jhash_2words_w(uint32_t a, uint32_t b, uint32_t initval); +uint32_t rte_jhash_1word_w(uint32_t a, uint32_t initval); +uint32_t rte_fbk_hash_get_bucket_w(const struct rte_fbk_hash_table *ht, + uint32_t key); +int rte_fbk_hash_add_key_with_bucket_w(struct rte_fbk_hash_table *ht, + uint32_t key, uint16_t value, + uint32_t bucket); +int rte_fbk_hash_add_key_w(struct rte_fbk_hash_table *ht, uint32_t key, + uint16_t value); +int rte_fbk_hash_delete_key_with_bucket_w(struct rte_fbk_hash_table *ht, + uint32_t key, uint32_t bucket); +int rte_fbk_hash_delete_key_w(struct rte_fbk_hash_table *ht, uint32_t key); +int rte_fbk_hash_lookup_with_bucket_w(const struct rte_fbk_hash_table *ht, + uint32_t key, uint32_t bucket); +int rte_fbk_hash_lookup_w(const struct rte_fbk_hash_table *ht, uint32_t key); +void rte_fbk_hash_clear_all_w(struct rte_fbk_hash_table *ht); +double rte_fbk_hash_get_load_factor_w(struct rte_fbk_hash_table *ht); +void rte_rcu_qsbr_thread_online_w(struct rte_rcu_qsbr *v, + unsigned int thread_id); +void rte_rcu_qsbr_thread_offline_w(struct rte_rcu_qsbr *v, + unsigned int thread_id); +void rte_rcu_qsbr_lock_w(struct rte_rcu_qsbr *v, unsigned int thread_id); +void rte_rcu_qsbr_unlock_w(struct rte_rcu_qsbr *v, unsigned int thread_id); +uint64_t rte_rcu_qsbr_start_w(struct rte_rcu_qsbr *v); +void rte_rcu_qsbr_quiescent_w(struct rte_rcu_qsbr *v, unsigned int thread_id); +int rte_rcu_qsbr_check_w(struct rte_rcu_qsbr *v, uint64_t t, bool wait); +uint8_t rte_read8_relaxed_w(const void *addr); +uint16_t rte_read16_relaxed_w(const void *addr); +uint32_t rte_read32_relaxed_w(const void *addr); +uint64_t rte_read64_relaxed_w(const void *addr); +void rte_write8_relaxed_w(uint8_t value, void *addr); +void rte_write16_relaxed_w(uint16_t value, void *addr); +void rte_write32_relaxed_w(uint32_t value, void *addr); +void rte_write64_relaxed_w(uint64_t value, void *addr); +uint8_t rte_read8_w(const void *addr); +uint16_t rte_read16_w(const void *addr); +uint32_t rte_read32_w(const void *addr); +uint64_t rte_read64_w(const void *addr); +void rte_write8_w(uint8_t value, void *addr); +void rte_write16_w(uint16_t value, void *addr); +void rte_write32_w(uint32_t value, void *addr); +void rte_write64_w(uint64_t value, void *addr); +void rte_write32_wc_relaxed_w(uint32_t value, void *addr); +void rte_write32_wc_w(uint32_t value, void *addr); +void rte_mcslock_lock_w(rte_mcslock_t **msl, rte_mcslock_t *me); +void rte_mcslock_unlock_w(rte_mcslock_t **msl, rte_mcslock_t *me); +int rte_mcslock_trylock_w(rte_mcslock_t **msl, rte_mcslock_t *me); +int rte_mcslock_is_locked_w(rte_mcslock_t *msl); +void rte_pflock_init_w(struct rte_pflock *pf); +void rte_pflock_read_lock_w(rte_pflock_t *pf); +void rte_pflock_read_unlock_w(rte_pflock_t *pf); +void rte_pflock_write_lock_w(rte_pflock_t *pf); +void rte_pflock_write_unlock_w(rte_pflock_t *pf); +uint32_t rte_reciprocal_divide_w(uint32_t a, struct rte_reciprocal R); +uint64_t rte_reciprocal_divide_u64_w(uint64_t a, + const struct rte_reciprocal_u64 *R); +void rte_seqcount_init_w(rte_seqcount_t *seqcount); +uint32_t rte_seqcount_read_begin_w(const rte_seqcount_t *seqcount); +bool rte_seqcount_read_retry_w(const rte_seqcount_t *seqcount, + uint32_t begin_sn); +void rte_seqcount_write_begin_w(rte_seqcount_t *seqcount); +void rte_seqcount_write_end_w(rte_seqcount_t *seqcount); +void rte_seqlock_init_w(rte_seqlock_t *seqlock); +uint32_t rte_seqlock_read_begin_w(const rte_seqlock_t *seqlock); +bool rte_seqlock_read_retry_w(const rte_seqlock_t *seqlock, uint32_t begin_sn); +void rte_seqlock_write_lock_w(rte_seqlock_t *seqlock); +void rte_seqlock_write_unlock_w(rte_seqlock_t *seqlock); +unsigned int rte_stack_push_w(struct rte_stack *s, void *const *obj_table, + unsigned int n); +unsigned int rte_stack_pop_w(struct rte_stack *s, void **obj_table, + unsigned int n); +unsigned int rte_stack_count_w(struct rte_stack *s); +unsigned int rte_stack_free_count_w(struct rte_stack *s); +uint32_t rte_softrss_w(uint32_t *input_tuple, uint32_t input_len, + const uint8_t *rss_key); +uint32_t rte_softrss_be_w(uint32_t *input_tuple, uint32_t input_len, + const uint8_t *rss_key); +void rte_ticketlock_init_w(rte_ticketlock_t *tl); +void rte_ticketlock_lock_w(rte_ticketlock_t *tl); +void rte_ticketlock_unlock_w(rte_ticketlock_t *tl); +int rte_ticketlock_trylock_w(rte_ticketlock_t *tl); +int rte_ticketlock_is_locked_w(rte_ticketlock_t *tl); +void rte_ticketlock_recursive_init_w(rte_ticketlock_recursive_t *tlr); +void rte_ticketlock_recursive_lock_w(rte_ticketlock_recursive_t *tlr); +void rte_ticketlock_recursive_unlock_w(rte_ticketlock_recursive_t *tlr); +int rte_ticketlock_recursive_trylock_w(rte_ticketlock_recursive_t *tlr); +uint64_t rte_cyclecounter_cycles_to_ns_w(struct rte_timecounter *tc, + uint64_t cycles); +uint64_t rte_timecounter_update_w(struct rte_timecounter *tc, + uint64_t cycle_now); +uint64_t rte_timespec_to_ns_w(const struct timespec *ts); +struct timespec rte_ns_to_timespec_w(uint64_t nsec); +bool rte_trace_feature_is_enabled_w(void); diff --git a/nix/pkgs/dpdk/default.nix b/nix/pkgs/dpdk/default.nix index 44d4474bd..b8f8d300b 100644 --- a/nix/pkgs/dpdk/default.nix +++ b/nix/pkgs/dpdk/default.nix @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright Open Network Fabric Authors { src, stdenv, @@ -13,13 +15,16 @@ build-params ? { lto = "true"; build-type = "release"; # "debug" | "release" + platform = "bluefield3"; }, + writeText, }: stdenv.mkDerivation { pname = "dpdk"; version = src.branch; - src = src.outPath; + # src = src.outPath; + src = ./src; nativeBuildInputs = [ meson ninja @@ -232,6 +237,42 @@ stdenv.mkDerivation { "net/virtio" "vdpa/mlx5" ]; + arch = stdenv.hostPlatform.parsed.cpu.name; + cpu = stdenv.hostPlatform.parsed.cpu.arch; + kernel = stdenv.hostPlatform.parsed.kernel.name; + endian = + { + littleEndian = "little"; + bigEndian = "big"; + } + .${stdenv.hostPlatform.parsed.cpu.significantByte.name}; + libc-vendor = + { + glibc = "gnu"; + musl = "musl"; + } + .${stdenv.hostPlatform.libc}; + isCrossCompile = stdenv.buildPlatform.parsed != stdenv.hostPlatform.parsed; + cross-prefix = "${arch}-unknown-${kernel}-${libc-vendor}"; + cross-file = writeText "cross-file.ini" '' + [binaries] + c = '${cross-prefix}-cc' + cpp = '${cross-prefix}-c++' + ar = '${cross-prefix}-ar' + strip = '${cross-prefix}-strip' + pkgconfig = '${cross-prefix}-pkg-config' + pkg-config = '${cross-prefix}-pkg-config' + + [host_machine] + system = '${kernel}' + cpu_family = '${arch}' + cpu = '${cpu}' + endian = '${endian}' + + [properties] + platform = '${build-params.platform}' + libc = '${libc-vendor}' + ''; in with build-params; [ @@ -239,7 +280,7 @@ stdenv.mkDerivation { "-Dauto_features=disabled" "-Db_colorout=never" "-Db_lto=${lto}" - "-Db_lundef=true" + "-Db_lundef=false" "-Db_pgo=off" "-Db_pie=true" "-Dbackend=ninja" @@ -253,19 +294,25 @@ stdenv.mkDerivation { ''-Ddisable_drivers=${lib.concatStringsSep "," disabledDrivers}'' ''-Denable_drivers=${lib.concatStringsSep "," enabledDrivers}'' ''-Denable_libs=${lib.concatStringsSep "," enabledLibs}'' + ''-Ddisable_apps=*'' ''-Ddisable_libs=${lib.concatStringsSep "," disabledLibs}'' - ]; + ] + ++ (if isCrossCompile then [ ''--cross-file=${cross-file}'' ] else [ ]); outputs = [ - "out" - "static" "dev" + "out" "share" + "static" ]; + CFLAGS = if stdenv.targetPlatform.parsed.cpu.name == "aarch64" then "-ffat-lto-objects" else ""; + postInstall = '' # Remove docs. We don't build these anyway rm -rf $out/share/doc + # Remove python files from bin output (we never use them and they confuse dependency reports) + rm $out/bin/*.py mkdir -p $static/lib $share; mv $out/lib/*.a $static/lib mv $out/share $share diff --git a/nix/pkgs/dpdk/src b/nix/pkgs/dpdk/src new file mode 160000 index 000000000..cd60dcd50 --- /dev/null +++ b/nix/pkgs/dpdk/src @@ -0,0 +1 @@ +Subproject commit cd60dcd503b91956f966a1f6d595b35d256ac00f diff --git a/nix/pkgs/kopium/default.nix b/nix/pkgs/kopium/default.nix new file mode 100644 index 000000000..6b3e2bf56 --- /dev/null +++ b/nix/pkgs/kopium/default.nix @@ -0,0 +1,11 @@ +{ + src, + rustPlatform, +}: +rustPlatform.buildRustPackage (final: { + pname = "kopium"; + version = src.version; + src = src.outPath; + cargoLock.lockFile = "${final.src}/Cargo.lock"; + doCheck = false; +}) diff --git a/nix/pkgs/perftest/default.nix b/nix/pkgs/perftest/default.nix new file mode 100644 index 000000000..0bc0ee783 --- /dev/null +++ b/nix/pkgs/perftest/default.nix @@ -0,0 +1,19 @@ +{ + src, + stdenv, + rdma-core, + autoreconfHook, + pciutils, +}: +stdenv.mkDerivation (final: { + pname = "perftest"; + version = src.version; + src = src.outPath; + nativeBuildInputs = [ + autoreconfHook + ]; + buildInputs = [ + pciutils + rdma-core + ]; +}) diff --git a/nix/platforms.nix b/nix/platforms.nix new file mode 100644 index 000000000..3c5b7825c --- /dev/null +++ b/nix/platforms.nix @@ -0,0 +1,130 @@ +{ + lib ? (import { }).lib, + platform, + kernel ? "linux", + libc, +}: +let + platforms = rec { + x86-64-v3 = rec { + arch = "x86_64"; + march = "x86-64-v3"; + numa = { + max-nodes = 8; + }; + override = { + stdenv.env = rec { + NIX_CFLAGS_COMPILE = [ "-march=${march}" ]; + NIX_CXXFLAGS_COMPILE = NIX_CFLAGS_COMPILE; + NIX_CFLAGS_LINK = [ ]; + }; + dpdk = { + buildInputs = { }; + }; + }; + }; + x86-64-v4 = lib.recursiveUpdate x86-64-v3 rec { + march = "x86-64-v4"; + override.stdenv.env = rec { + NIX_CFLAGS_COMPILE = [ "-march=${march}" ]; + NIX_CXXFLAGS_COMPILE = NIX_CFLAGS_COMPILE; + NIX_CFLAGS_LINK = [ ]; + }; + }; + zen3 = lib.recursiveUpdate x86-64-v4 rec { + march = "znver3"; + override.stdenv.env = rec { + NIX_CFLAGS_COMPILE = [ "-march=${march}" ]; + NIX_CXXFLAGS_COMPILE = NIX_CFLAGS_COMPILE; + NIX_CFLAGS_LINK = [ ]; + }; + }; + zen4 = lib.recursiveUpdate zen3 rec { + march = "znver4"; + override.stdenv.env = rec { + NIX_CFLAGS_COMPILE = [ "-march=${march}" ]; + NIX_CXXFLAGS_COMPILE = NIX_CFLAGS_COMPILE; + NIX_CFLAGS_LINK = [ ]; + }; + }; + zen5 = lib.recursiveUpdate zen4 rec { + march = "znver5"; + override.stdenv.env = rec { + NIX_CFLAGS_COMPILE = [ "-march=${march}" ]; + NIX_CXXFLAGS_COMPILE = NIX_CFLAGS_COMPILE; + NIX_CFLAGS_LINK = [ ]; + }; + }; + bluefield2 = rec { + arch = "aarch64"; + march = "armv8.2-a"; + mcpu = "cortex-a72"; + numa = { + max-nodes = 1; + }; + override = { + stdenv.env = rec { + NIX_CFLAGS_COMPILE = [ "-mcpu=${mcpu}" ]; + NIX_CXXFLAGS_COMPILE = NIX_CFLAGS_COMPILE; + NIX_CFLAGS_LINK = [ ]; + }; + dpdk = { + buildInputs = { + numactl = null; + }; + }; + }; + }; + bluefield3 = lib.recursiveUpdate bluefield2 rec { + march = "armv8.4-a"; + mcpu = "cortex-a78ae"; + override.stdenv.env = rec { + NIX_CFLAGS_COMPILE = [ "-mcpu=${mcpu}" ]; + NIX_CXXFLAGS_COMPILE = NIX_CFLAGS_COMPILE; + NIX_CFLAGS_LINK = [ ]; + }; + }; + }; +in +lib.fix ( + final: + platforms.${platform} + // { + info = + { + x86_64 = { + linux = { + gnu = { + target = "x86_64-unknown-linux-gnu"; + machine = "x86_64"; + nixarch = "gnu64"; + libc = "gnu"; + }; + musl = { + target = "x86_64-unknown-linux-musl"; + machine = "x86_64"; + nixarch = "musl64"; + libc = "musl"; + }; + }; + }; + aarch64 = { + linux = { + gnu = { + target = "aarch64-unknown-linux-gnu"; + machine = "aarch64"; + nixarch = "aarch64-multiplatform"; + libc = "gnu"; + }; + musl = { + target = "aarch64-unknown-linux-musl"; + machine = "aarch64"; + nixarch = "aarch64-multiplatform-musl"; + libc = "musl"; + }; + }; + }; + } + .${final.arch}.${kernel}.${libc}; + } +) diff --git a/nix/profiles.nix b/nix/profiles.nix new file mode 100644 index 000000000..0c9d1f8a9 --- /dev/null +++ b/nix/profiles.nix @@ -0,0 +1,147 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright Open Network Fabric Authors +{ + arch, + prof, + sanitizers, + instrumentation, +}: +let + common.NIX_CFLAGS_COMPILE = [ + "-g3" + "-gdwarf-5" + # odr or strict-aliasing violations are indicative of LTO incompatibility, so check for that + "-Werror=odr" + "-Werror=strict-aliasing" + ]; + common.NIX_CXXFLAGS_COMPILE = common.NIX_CFLAGS_COMPILE; + common.NIX_CFLAGS_LINK = [ + # getting proper LTO from LLVM compiled objects is best done with lld rather than ld, mold, or wild (at least at the + # time of writing) + "-fuse-ld=lld" + # we always want pic/pie and GOT offsets should be computed at compile time whenever possible + "-Wl,-z,relro,-z,now" + ]; + debug.NIX_CFLAGS_COMPILE = [ + "-fno-inline" + "-fno-omit-frame-pointer" + "-D_FORTIFY_SOURCE=0" # disable security stuff because the goal is to make the asm as easy to understand as possible + "-Wno-macro-redefined" # many apps opt in to _FORTIFY_SOURCE={1,2,3} explicitly, and -Wall errors when you redefine + ]; + debug.NIX_CXXFLAGS_COMPILE = debug.NIX_CFLAGS_COMPILE; + debug.NIX_CFLAGS_LINK = [ ]; + optimize.NIX_CFLAGS_COMPILE = [ + "-O3" + "-flto=full" + "-fsplit-lto-unit" # important for compatibility with rust's LTO + ]; + optimize.NIX_CXXFLAGS_COMPILE = optimize.NIX_CFLAGS_COMPILE ++ [ + "-fwhole-program-vtables" + ]; + optimize.NIX_CFLAGS_LINK = optimize.NIX_CXXFLAGS_COMPILE ++ [ + "-Wl,--lto-whole-program-visibility" + # just to keep the artifacts small, we don't currently use any linked artifact anyway + "-Wl,--gc-sections" + "-Wl,--as-needed" + ]; + secure.NIX_CFLAGS_COMPILE = [ + "-fstack-protector-strong" + "-fstack-clash-protection" + # "-fcf-protection=full" # requires extra testing before we enable + ]; + secure.NIX_CXXFLAGS_COMPILE = secure.NIX_CFLAGS_COMPILE; + # handing the CFLAGS back to clang/lld is basically required for -fsanitize + secure.NIX_CFLAGS_LINK = secure.NIX_CFLAGS_COMPILE; + march.x86_64.NIX_CFLAGS_COMPILE = [ + # DPDK functionally requires some -m flags on x86_64. + # These features have been available for a long time and can be found on any reasonably recent machine, so just + # enable them here for all x86_64 builds. + "-mrtm" + "-mcrc32" + "-mssse3" + ]; + march.x86_64.NIX_CXXFLAGS_COMPILE = march.x86_64.NIX_CFLAGS_COMPILE; + march.aarch64.NIX_CFLAGS_COMPILE = [ ]; + march.aarch64.NIX_CXXFLAGS_COMPILE = march.aarch64.NIX_CFLAGS_COMPILE; + march.aarch64.NIX_CFLAGS_LINK = [ ]; + sanitize.address.NIX_CFLAGS_COMPILE = [ + "-fsanitize=address,local-bounds" + ]; + sanitize.address.NIX_CXXFLAGS_COMPILE = sanitize.address.NIX_CFLAGS_COMPILE; + sanitize.address.NIX_CFLAGS_LINK = sanitize.address.NIX_CFLAGS_COMPILE ++ [ + "-static-libasan" + ]; + sanitize.leak.NIX_CFLAGS_COMPILE = [ + "-fsanitize=leak" + ]; + sanitize.leak.NIX_CXXFLAGS_COMPILE = sanitize.leak.NIX_CFLAGS_COMPILE; + sanitize.leak.NIX_CFLAGS_LINK = sanitize.leak.NIX_CFLAGS_COMPILE; + sanitize.thread.NIX_CFLAGS_COMPILE = [ + "-fsanitize=thread" + ]; + sanitize.thread.NIX_CXXFLAGS_COMPILE = sanitize.thread.NIX_CFLAGS_COMPILE; + sanitize.thread.NIX_CFLAGS_LINK = sanitize.thread.NIX_CFLAGS_COMPILE ++ [ + "-Wl,--allow-shlib-undefined" + ]; + # note: cfi _requires_ LTO and is fundamentally ill suited to debug builds + sanitize.cfi.NIX_CFLAGS_COMPILE = [ + "-fsanitize=cfi" + # visibility=default is functionally required if you use basically any cfi higher than icall. + # In theory we could set -fvisibility=hidden, but in practice that doesn't work because too many dependencies + # fail to build with that setting enabled. + # NOTE: you also want to enable -Wl,--lto-whole-program-visibility in the linker flags if visibility=default so that + # symbols can be refined to hidden visibility at link time. + # This "whole-program-visibility" flag is already enabled by the optimize profile, and + # given that the optimize profile is required for cfi to even bild, we don't explicitly enable it again here. + "-fvisibility=default" + # required to properly link with rust + "-fsanitize-cfi-icall-experimental-normalize-integers" + # required in cases where perfect type strictness is not maintained but you still want to use CFI. + # Type fudging is common in C code, especially in cases where function pointers are used with lax const correctness. + # Ideally we wouldn't enable this, but we can't really re-write all of the C code in the world. + "-fsanitize-cfi-icall-generalize-pointers" + ]; + sanitize.cfi.NIX_CXXFLAGS_COMPILE = sanitize.cfi.NIX_CFLAGS_COMPILE; + sanitize.cfi.NIX_CFLAGS_LINK = sanitize.cfi.NIX_CFLAGS_COMPILE; + sanitize.safe-stack.NIX_CFLAGS_COMPILE = [ + "-fsanitize=safe-stack" + ]; + sanitize.safe-stack.NIX_CXXFLAGS_COMPILE = sanitize.safe-stack.NIX_CFLAGS_COMPILE; + sanitize.safe-stack.NIX_CFLAGS_LINK = sanitize.safe-stack.NIX_CFLAGS_COMPILE ++ [ + "-Wl,--allow-shlib-undefined" + ]; + instrument.none.NIX_CFLAGS_COMPILE = [ ]; + instrument.none.NIX_CXXFLAGS_COMPILE = instrument.none.NIX_CFLAGS_COMPILE; + instrument.none.NIX_CFLAGS_LINK = instrument.none.NIX_CFLAGS_COMPILE; + instrument.produce.NIX_CFLAGS_COMPILE = [ + "-fprofile-instr-generate" + "-fcoverage-mapping" + "-fno-omit-frame-pointer" + ]; + instrument.produce.NIX_CXXFLAGS_COMPILE = instrument.produce.NIX_CFLAGS_COMPILE; + instrument.produce.NIX_CFLAGS_LINK = instrument.produce.NIX_CFLAGS_COMPILE; + combine-profiles = + features: + builtins.foldl' ( + acc: elem: acc // (builtins.mapAttrs (var: val: (acc.${var} or [ ]) ++ val) elem) + ) { } features; + profile = { + debug = combine-profiles [ + common + debug + ]; + release = combine-profiles [ + common + optimize + secure + ]; + }; +in +combine-profiles ( + [ + profile."${prof}" + march."${arch}" + instrument."${instrumentation}" + ] + ++ (builtins.map (s: sanitize.${s}) sanitizers) +) diff --git a/nix/rust-toolchain.manifest-lock.nix b/nix/rust-toolchain.manifest-lock.nix new file mode 100644 index 000000000..2c333d943 --- /dev/null +++ b/nix/rust-toolchain.manifest-lock.nix @@ -0,0 +1,18 @@ +let + rust-toolchain = (builtins.fromTOML (builtins.readFile ../rust-toolchain.toml)).toolchain; + channel = rust-toolchain.channel; + url = "https://static.rust-lang.org/dist/channel-rust-${channel}.toml"; + manifest-path = builtins.fetchurl { + inherit url; + name = "manifest.toml"; + }; + hash = { + md5 = builtins.hashFile "md5" manifest-path; + sha1 = builtins.hashFile "sha1" manifest-path; + sha256 = builtins.hashFile "sha256" manifest-path; + sha512 = builtins.hashFile "sha512" manifest-path; + }; +in +{ + inherit channel url hash; +} diff --git a/npins/sources.json b/npins/sources.json index bc55da807..ee0f05b92 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -1,5 +1,21 @@ { "pins": { + "crane": { + "type": "GitRelease", + "repository": { + "type": "GitHub", + "owner": "ipetkov", + "repo": "crane" + }, + "pre_releases": false, + "version_upper_bound": null, + "release_prefix": null, + "submodules": false, + "version": "v0.21.3", + "revision": "4a7cf504d83f7d0460f9cf28fe6cbaa5fb856034", + "url": "https://api.github.com/repos/ipetkov/crane/tarball/v0.21.3", + "hash": "1a27r58apm5arxyydn78j9yz0aa7d20v4ai688d23lbivfs0jaa5" + }, "dpdk": { "type": "Git", "repository": { @@ -13,11 +29,74 @@ "url": "https://github.com/DPDK/dpdk/archive/ed957165eadbe60a47d5ec223578cdd1c13d0bd9.tar.gz", "hash": "09h7wnmq4c9xm1nsyv5mz1yf91c1l6vy9sdcamb09qjjx4wgs0q9" }, + "fenix": { + "type": "Tarball", + "url": "https://github.com/nix-community/fenix/archive/main.tar.gz", + "hash": "1gkd9ppvsxl4jjg1jyw61wm99xhy4hdqx5dxqj06gfxi2zkamvzf" + }, + "gateway": { + "type": "GitRelease", + "repository": { + "type": "GitHub", + "owner": "githedgehog", + "repo": "gateway" + }, + "pre_releases": false, + "version_upper_bound": null, + "release_prefix": null, + "submodules": false, + "version": "v0.33.0", + "revision": "18913fe34d78af396deb1e6a034d0258168122b1", + "url": "https://api.github.com/repos/githedgehog/gateway/tarball/v0.33.0", + "hash": "0sjdagppmmb8wjpf8p7gpxjsh18xyy1n6zs3hy08h15ldv0ip2sz" + }, + "kopium": { + "type": "GitRelease", + "repository": { + "type": "GitHub", + "owner": "kube-rs", + "repo": "kopium" + }, + "pre_releases": false, + "version_upper_bound": null, + "release_prefix": null, + "submodules": false, + "version": "0.22.5", + "revision": "f346e2044500c8d71523c35d474bc2f6235a0060", + "url": "https://api.github.com/repos/kube-rs/kopium/tarball/0.22.5", + "hash": "14lr2qgfh50rlpw5wgy6cw1qvkz44bwwx06srlks243hgkw9p2fd" + }, + "naersk": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "nix-community", + "repo": "naersk" + }, + "branch": "master", + "submodules": false, + "revision": "d4155d6ebb70fbe2314959842f744aa7cabbbf6a", + "url": "https://github.com/nix-community/naersk/archive/d4155d6ebb70fbe2314959842f744aa7cabbbf6a.tar.gz", + "hash": "1pmj1d3xp3fjz8m3msvmh8jnylwmgk76iah9qnfs8ddgwlij1v5g" + }, "nixpkgs": { "type": "Channel", "name": "nixpkgs-unstable", - "url": "https://releases.nixos.org/nixpkgs/nixpkgs-26.05pre911335.23735a82a828/nixexprs.tar.xz", - "hash": "03cv7yy3ldb3i50in6qkm98y68nlid874l52wayzgx0z7pbpq1rk" + "url": "https://releases.nixos.org/nixpkgs/nixpkgs-26.05pre914780.306ea70f9eb0/nixexprs.tar.xz", + "hash": "1xx42m8amnda6z8nbm2ksv0plpzcdqxzymb1qqnp0xnf0k2bz2d1" + }, + "perftest": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "linux-rdma", + "repo": "perftest" + }, + "branch": "master", + "submodules": false, + "revision": "4e4f6629904ba07bf81f207b31433cb9dabbe8ab", + "url": "https://github.com/linux-rdma/perftest/archive/4e4f6629904ba07bf81f207b31433cb9dabbe8ab.tar.gz", + "hash": "0rvwmx9nbhr0m5zmrcpxcqwdjpl4bwsfwc7vmdn31n5gxn0qnn1x" }, "rdma-core": { "type": "Git", diff --git a/profiles.nix b/profiles.nix deleted file mode 100644 index b3d52d626..000000000 --- a/profiles.nix +++ /dev/null @@ -1,71 +0,0 @@ -let - common.NIX_CFLAGS_COMPILE = [ - "-glldb" - "-gdwarf-5" - # odr or strict-aliasing violations are indicative of LTO incompatibility, so check for that - "-Werror=odr" - "-Werror=strict-aliasing" - ]; - common.NIX_CXXFLAGS_COMPILE = common.NIX_CFLAGS_COMPILE; - common.NIX_CFLAGS_LINK = [ - # getting proper LTO from LLVM compiled objects is best done with lld rather than ld, mold, or wild (at least at the - # time of writing) - "-fuse-ld=lld" - # we always want pic/pie and GOT offsets should be computed at compile time whenever possible - "-Wl,-z,relro,-z,now" - ]; - debug.NIX_CFLAGS_COMPILE = [ - "-fno-inline" - "-fno-omit-frame-pointer" - "-D_FORTIFY_SOURCE=0" # disable security stuff because the goal is to make the asm as easy to understand as possible - "-Wno-macro-redefined" # many apps opt in to _FORTIFY_SOURCE={1,2,3} explicitly, and -Wall errors when you redefine - ]; - debug.NIX_CXXFLAGS_COMPILE = debug.NIX_CFLAGS_COMPILE; - debug.NIX_CFLAGS_LINK = [ ]; - optimize.NIX_CFLAGS_COMPILE = [ - "-O3" - "-flto=full" - "-ffat-lto-objects" - "-fsplit-lto-unit" # important for compatibility with rust's LTO - ]; - optimize.NIX_CXXFLAGS_COMPILE = optimize.NIX_CFLAGS_COMPILE ++ [ - "-fwhole-program-vtables" - ]; - optimize.NIX_CFLAGS_LINK = [ - "-flto=full" - "-Wl,--lto-whole-program-visibility" - # just to keep the artifacts small, we don't currently use any linked artifact anyway - "-Wl,--gc-sections" - "-Wl,--as-needed" - ]; - secure.NIX_CFLAGS_COMPILE = [ - "-fstack-protector-strong" - "-fstack-clash-protection" - # "-fcf-protection=full" # requires extra testing before we enable - # "-fsanitize=safe-stack" # requires extra testing before we enable (not compatible with musl) - # "-fsanitize=cfi" # requires extra testing before we enable - # enable if you turn on cfi to properly link with rust - # "-fsanitize-cfi-icall-experimental-normalize-integers" - # consider enabling if you turn on cfi (not compatible with cross DSO cfi) - # "-fsanitize-cfi-icall-generalize-pointers" - ]; - secure.NIX_CXXFLAGS_COMPILE = secure.NIX_CFLAGS_COMPILE; - # handing the CFLAGS back to clang/lld is basically required for -fsanitize - secure.NIX_CFLAGS_LINK = secure.NIX_CFLAGS_COMPILE; - combine-profiles = - features: - builtins.foldl' ( - acc: elem: builtins.mapAttrs (var: val: (acc.${var} or [ ]) ++ val) elem - ) { } features; -in -{ - debug = combine-profiles [ - common - debug - ]; - release = combine-profiles [ - common - optimize - secure - ]; -} diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 000000000..46e38a196 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,28 @@ +[toolchain] +# NOTE: you can and should manually update this on new rust releases +channel = "1.92.0" + +components = [ + "rustc", + "cargo", + "rust-std", + "rust-docs", + "rustfmt-preview", + "clippy-preview", + "rust-analyzer-preview", + "rust-src", + + ## other (disabled) components ## + # "rust-mingw", ## not relevant to us + # "llvm-tools-preview", ## we already have a full llvm in the npins, no need for another + # "rust-analysis", ## obsolete + # "miri-preview", ## not yet functional for us + # "rustc-codegen-cranelift-preview" ## not relevant to us +] + +targets = [ + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl" +] diff --git a/shell.nix b/shell.nix index 918e6cad1..ef124bdb4 100644 --- a/shell.nix +++ b/shell.nix @@ -1,18 +1,57 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright Open Network Fabric Authors { - pkgs ? import { }, + overlay ? "dataplane", + platform ? "x86-64-v3", + libc ? "gnu", + prof ? "debug", + instrumentation ? "none", + sanitize ? "address", }: -(pkgs.buildFHSEnv { - name = "dataplane-shell"; +let + d = import ./default.nix { + inherit + overlay + platform + libc + prof + instrumentation + sanitize + ; + }; + pkgs = import {}; +in +(d.pkgs-super.buildPackages.buildFHSEnv { + name = "dataplane-dev"; targetPkgs = - pkgs: - (with pkgs; [ - # dev tools - bash - direnv - just - nil - nixd - npins - wget - ]); + pkgs: with pkgs; [ + stdenv.cc.libc.dev + stdenv.cc.libc.out + # libmd.dev + # libmd.static + libbsd.dev + # libbsd.static + numactl.dev + # numactl.static + rdma-core.dev + # rdma-core.static + # dpdk.dev + # dpdk.static + # dpdk-wrapper.dev + # dpdk-wrapper.out + ]; + # (with pkgs.buildPackages; [ + # # dev tools + # bash + # direnv + # just + # nil + # nixd + # npins + # wget + # llvmPackages.bintools + # llvmPackages.clang + # llvmPackages.libclang.lib + # llvmPackages.lld + # ]); }).env diff --git a/sysfs/Cargo.toml b/sysfs/Cargo.toml index 5638e18ef..ab301ec3f 100644 --- a/sysfs/Cargo.toml +++ b/sysfs/Cargo.toml @@ -20,7 +20,7 @@ tracing-subscriber = { workspace = true, features = ["fmt"] } [dev-dependencies] # internal -n-vm = { workspace = true } +# n-vm = { workspace = true } # external diff --git a/sysfs/build.rs b/sysfs/build.rs index 52f5b0197..1c30f3c66 100644 --- a/sysfs/build.rs +++ b/sysfs/build.rs @@ -2,7 +2,7 @@ // Copyright Open Network Fabric Authors fn main() { - let sysroot = dpdk_sysroot_helper::get_sysroot(); - println!("cargo:rustc-link-search=all={sysroot}/lib"); - println!("cargo:rustc-link-arg=--sysroot={sysroot}"); + // let sysroot = dpdk_sysroot_helper::get_sysroot(); + // println!("cargo:rustc-link-search=all={sysroot}/lib"); + // println!("cargo:rustc-link-arg=--sysroot={sysroot}"); }