Compare commits

...
Author SHA1 Message Date
kraemr 78c0868b01 default compilation target -> xdp 2025-10-21 14:33:01 +02:00
kraemr cc2e2c0d8a added support for xdp 2025-10-21 14:32:37 +02:00
7 changed files with 123 additions and 13 deletions

No files matched your search

Generated
+105 -7
View File
@@ -367,6 +367,26 @@ version = "0.22.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
[[package]]
name = "bindgen"
version = "0.72.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895"
dependencies = [
"bitflags 2.9.0",
"cexpr",
"clang-sys",
"itertools",
"log",
"prettyplease",
"proc-macro2",
"quote",
"regex",
"rustc-hash 2.1.1",
"shlex",
"syn 2.0.105",
]
[[package]]
name = "bitflags"
version = "1.3.2"
@@ -455,6 +475,15 @@ dependencies = [
"shlex",
]
[[package]]
name = "cexpr"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766"
dependencies = [
"nom",
]
[[package]]
name = "cfg-if"
version = "1.0.0"
@@ -506,6 +535,17 @@ dependencies = [
"half",
]
[[package]]
name = "clang-sys"
version = "1.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4"
dependencies = [
"glob",
"libc",
"libloading",
]
[[package]]
name = "clap"
version = "4.5.40"
@@ -789,7 +829,7 @@ dependencies = [
"lazy_static",
"mintex",
"parking_lot",
"rustc-hash",
"rustc-hash 1.1.0",
"serde",
"serde_json",
"thousands",
@@ -1036,8 +1076,7 @@ dependencies = [
[[package]]
name = "ethercrab"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fbb13becfa15713adb09b27fdb74468b827cdc78aa99aea638a89c1b0db3ce94"
source = "git+https://github.com/ethercrab-rs/ethercrab?branch=main#5bd732c491172835b8d122545bee0c4f4dd79eb8"
dependencies = [
"async-io",
"atomic-waker",
@@ -1061,13 +1100,13 @@ dependencies = [
"smlang",
"spin",
"timerfd",
"xsk-rs",
]
[[package]]
name = "ethercrab-wire"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d15828cb020fb44c92ca67e1ee3c122c9621c2e00d383d066e488f0619023ba2"
source = "git+https://github.com/ethercrab-rs/ethercrab?branch=main#5bd732c491172835b8d122545bee0c4f4dd79eb8"
dependencies = [
"ethercrab-wire-derive",
"heapless",
@@ -1076,8 +1115,7 @@ dependencies = [
[[package]]
name = "ethercrab-wire-derive"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e790b8011211ed70babfcacbd4277b91ee21402ad5ba6a2c293db02e2f12919"
source = "git+https://github.com/ethercrab-rs/ethercrab?branch=main#5bd732c491172835b8d122545bee0c4f4dd79eb8"
dependencies = [
"criterion",
"proc-macro2",
@@ -1272,6 +1310,12 @@ version = "0.31.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f"
[[package]]
name = "glob"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280"
[[package]]
name = "h2"
version = "0.4.10"
@@ -1762,6 +1806,15 @@ dependencies = [
"pkg-config",
]
[[package]]
name = "libxdp-sys"
version = "0.2.2+1.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e07efa8681fd85d4a284b5c62025ea4c34d19ae8299e5c39bf9e8e0b72d9c8e3"
dependencies = [
"bindgen",
]
[[package]]
name = "linux-raw-sys"
version = "0.4.15"
@@ -1860,6 +1913,12 @@ dependencies = [
"unicase",
]
[[package]]
name = "minimal-lexical"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
[[package]]
name = "miniz_oxide"
version = "0.8.8"
@@ -1933,6 +1992,16 @@ version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43794a0ace135be66a25d3ae77d41b91615fb68ae937f904090203e81f755b65"
[[package]]
name = "nom"
version = "7.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
dependencies = [
"memchr",
"minimal-lexical",
]
[[package]]
name = "nu-ansi-term"
version = "0.50.1"
@@ -2271,6 +2340,16 @@ dependencies = [
"zerocopy",
]
[[package]]
name = "prettyplease"
version = "0.2.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b"
dependencies = [
"proc-macro2",
"syn 2.0.105",
]
[[package]]
name = "proc-macro-crate"
version = "1.3.1"
@@ -2487,6 +2566,12 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
[[package]]
name = "rustc-hash"
version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
[[package]]
name = "rustix"
version = "0.38.44"
@@ -3884,6 +3969,19 @@ dependencies = [
"tap",
]
[[package]]
name = "xsk-rs"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "964acfdda803c92ec548602e3e7e8e946d59513abf920e12a820f6a621193c06"
dependencies = [
"bitflags 2.9.0",
"cfg-if",
"libc",
"libxdp-sys",
"log",
]
[[package]]
name = "yoke"
version = "0.8.0"
+1 -1
View File
@@ -12,7 +12,7 @@ anyhow = "1.0.100"
axum = "0.8.6"
ethercat_hal = { path = "../ethercat-hal" }
ethercrab = "0.6"
ethercrab = { git = "https://github.com/ethercrab-rs/ethercrab", branch = "main", features = ["xdp"] }
interfaces = "0.0.9"
serde = "1.0.219"
serde_json = "1.0.143"
+1 -1
View File
@@ -8,7 +8,7 @@ workspace = true
[dependencies]
clap = { version = "4.5.40", features = ["derive"] }
ethercrab = "0.6.0"
ethercrab = { git = "https://github.com/ethercrab-rs/ethercrab", branch = "main", features = ["xdp"] }
interfaces = "0.0.9"
tokio = { version = "1.45.1", features = ["macros", "rt-multi-thread"] }
ethercat_hal = { path = "../ethercat-hal" }
+1 -1
View File
@@ -8,7 +8,7 @@ workspace = true
[dependencies]
anyhow = "1.0.100"
ethercrab = "0.6"
ethercrab = { git = "https://github.com/ethercrab-rs/ethercrab", branch = "main", features = ["xdp"] }
ethercat_hal_derive = { version = "0.1.0", path = "../ethercat-hal-derive" }
bitvec = { version = "1.0.1", features = ["alloc"] }
smol = "2.0.2"
+1 -1
View File
@@ -34,5 +34,5 @@ craneLib.buildPackage {
inherit src strictDeps nativeBuildInputs buildInputs pname version;
};
cargoExtraArgs = "-p server --features tracing-journald,io-uring --no-default-features";
cargoExtraArgs = "-p server --features tracing-journald,xdp --no-default-features";
}
+2 -1
View File
@@ -9,7 +9,7 @@ workspace = true
[dependencies]
ethercrab = "0.6"
ethercrab = { git = "https://github.com/ethercrab-rs/ethercrab", branch = "main", features = ["xdp"] }
ethercat_hal = { path = "../ethercat-hal" }
control_core = { path = "../control-core" }
control_core_derive = { path = "../control-core-derive" }
@@ -79,6 +79,7 @@ tracing-otel = [
mock-machine = []
memory-locking = []
io-uring = []
xdp = []
development-build = []
[profile.release]
+12 -1
View File
@@ -54,7 +54,10 @@ pub async fn setup_loop(interface: &str, app_state: Arc<AppState>) -> Result<(),
// Set the thread to real-time priority
let _ = set_realtime_priority();
#[cfg(not(all(target_os = "linux", feature = "io-uring")))]
#[cfg(not(any(
all(target_os = "linux", feature = "io-uring"),
all(target_os = "linux", feature = "xdp")
)))]
{
use ethercrab::std::tx_rx_task;
use futures::executor::block_on;
@@ -73,6 +76,14 @@ pub async fn setup_loop(interface: &str, app_state: Arc<AppState>) -> Result<(),
let _ = tx_rx_task_io_uring(&interface, tx, rx)
.expect("Failed to spawn TX/RX task (io_uring)");
}
#[cfg(all(target_os = "linux", feature = "xdp"))]
{
use ethercrab::std::tx_rx_task_xdp;
let _ = tx_rx_task_xdp(&interface, tx, rx)
.expect("Failed to spawn TX/RX task (io_uring)");
}
})
.expect("Building thread");