rust-dpdk
DPDK vs 内核网络栈
| 特性 | 内核网络栈 | DPDK |
|---|---|---|
| 上下文切换 | 每次包都切换 | 轮询模式,无切换 |
| 内存拷贝 | 多次拷贝 | 零拷贝 |
| 中断 | 频繁中断 | 轮询 (poll mode driver) |
| 延迟 | 较高 | 微秒级 |
| 吞吐量 | 万级 PPS | 百万级 PPS |
| CPU 利用率 | 较低但有开销 | 高但高效 |
核心组件
// DPDK 核心结构
struct DpdkContext {
memory_pool: Mempool, // 内存池
More from huiali/rust-skills
rust-performance
Performance optimization expert covering profiling, benchmarking, memory allocation, SIMD, cache optimization, false sharing, lock contention, and NUMA-aware programming.
17rust-anti-pattern
Rust anti-patterns and common mistakes expert. Handles code review issues with clone abuse, unwrap in production, String misuse, index loops, and refactoring guidance.
14rust-actor
Actor model expert covering message passing, state isolation, supervision trees, deadlock prevention, fault tolerance, Actix framework, and Erlang-style concurrency patterns.
13rust-type-driven
Type-driven design expert covering newtype pattern, type state, PhantomData, marker traits, builder pattern, compile-time validation, sealed traits, and zero-sized types (ZST).
13rust-ecosystem
Rust ecosystem expert covering crate selection, library recommendations, framework comparisons, async runtime choices (tokio, async-std), and common tools.
13rust-ffi
FFI cross-language interop expert covering C/C++ bindings, bindgen, cbindgen, PyO3, JNI, memory layout, data conversion, and safe FFI patterns.
13