Repository navigation
feat: implement Port and Mempool initialization with comprehensive tests - #2
Merged
Merged
Conversation
Add real implementations for DPDK port and mempool management: Port (dpdk/src/port.rs): - PortConfig with queue count, descriptor counts, promiscuous mode, MTU - MacAddress with utility methods (is_broadcast, is_multicast, is_zero) - LinkStatus and PortStats types - Port::init() with device info validation and queue setup - Port::start/stop with promiscuous mode support - rx_burst/tx_burst for packet I/O - 17 unit tests Mempool (dpdk/src/mbuf.rs): - MempoolConfig builder pattern - Mempool::create() calling rte_pktmbuf_pool_create - Mempool::create_with_config() and create_default() helpers - alloc_bulk() for batch allocation - available_count(), in_use_count(), is_full(), is_empty() - 28 unit tests Error types (dpdk/src/error.rs): - MempoolCreateFailed, QueueSetupFailed, InvalidName variants Stubs (dpdk-sys/src/stubs.rs): - SOCKET_ID_ANY constant - rte_mempool struct with size/populated_size fields - rte_pktmbuf_pool_create returns valid mempool - rte_pktmbuf_alloc/alloc_bulk return valid mbufs with buffers - rte_mempool_avail_count, in_use_count, full, empty functions https://claude.ai/code/session_01UiHnsVmMyk1CJgck3cCYZQ
gspivey
pushed a commit
that referenced
this pull request
May 21, 2026
Append performance test results from GH Actions run 26227356354 (Graviton, TRex). No regressions detected — IPv6 fallback path adds zero overhead to IPv4 traffic. Mark IPv6 sub-task #2 (UDP over IPv6 checksum) as complete in the README roadmap.
gspivey
added a commit
that referenced
this pull request
May 21, 2026
## Roadmap item IPv6 sub-task #2: **UDP over IPv6 checksum** — mandatory IPv6 pseudo-header checksum validation (RFC 8200 §8.1). ## Changes - Integrated `verify_udp6_checksum` into the RX path (`process_frame_zerocopy`) - IPv6 UDP packets are now parsed and checksum-validated before delivery to the application - Zero checksums are rejected (mandatory for IPv6, unlike IPv4 where 0 means disabled) - Valid IPv6 UDP packets are delivered with `SocketAddrV6` source addresses ## Tests added (21 new tests) **Checksum verification (ipv6.rs):** - VLAN-tagged IPv6 frame checksum verification - Extension header (Hop-by-Hop) checksum verification - Various payload sizes: empty, 1-byte, odd-length, max (1452B) - Corruption detection: src/dst IP, src/dst port, payload - Edge cases: truncated frames, non-IPv6 frames, too-short frames - Pseudo-header checksum properties (different lengths, addresses, large lengths) - Zero-becomes-0xFFFF contract verification (RFC 8200 §8.1) **RX path integration (lib.rs):** - `process_frame_zerocopy_accepts_valid_ipv6_udp` - `process_frame_zerocopy_rejects_corrupted_ipv6_checksum` - `process_frame_zerocopy_rejects_zero_ipv6_checksum` ## Tradeoffs - The RX path tries IPv4 parsing first, then falls back to IPv6. This adds one failed parse attempt for IPv6-only traffic. The cost is negligible (a few comparisons) and avoids changing the hot path for existing IPv4 workloads. - No topology worker integration yet — that will come with sub-task #3 (SocketAddrV6 through UdpSocket) which adds full dual-stack socket support. ## All 607 tests pass, no regressions. --------- Co-authored-by: Agent Router <agent@agent-router.dev>
gspivey
added a commit
that referenced
this pull request
Jun 5, 2026
## Roadmap Item Implements roadmap item #2: **dpdk-stdlib-quic: Crate skeleton and walking-skeleton CI** Spec: `.kiro/specs/s2n-quic-provider/` · tasks 1.1, 1.2, 1.3, 1.4, 1.5 ## Changes - Created `dpdk-stdlib-quic/` workspace crate with `Cargo.toml` pinning `s2n-quic = "=1.81.0"` and `s2n-quic-core = "=0.81.0"` - Added crate to workspace `members` in root `Cargo.toml` - Created `src/lib.rs` with module declarations and public re-exports for all provider components: - `clock` — `StdClock` wrapping `std::time::Instant` - `ecn` — ECN extraction/TOS helpers (direct cast via `#[repr(u8)]`) - `error` — `DpdkQuicError` enum (`thiserror`, `'static + Send + Sync`) - `event_loop` — placeholder for the core poll loop - `frame` — placeholder for frame building re-exports - `loopback` — `LoopbackBackend` implementing all 9 `PacketBackend` methods - `path_handle` — `DpdkPathHandle` implementing `s2n_quic_core::path::Handle` - `provider` — `DpdkProvider` + `ProviderBuilder` with builder pattern - `rx` — `DpdkRxQueue` stub with correct `datagram::Header` types - `stats` — `ProviderStats` (atomic counters) + `ProviderHandle` (shutdown + stats) - `tx` — `DpdkTxQueue` stub - Created `quic-smoke` binary (builds provider in stub mode, prints `QUIC_SMOKE_OK`, exits 0) - Created `quic-integration-tests.yml` workflow (not pushed due to PAT lacking `workflow` scope — file is tracked locally and noted for manual addition) ## Tests Added - 8 loopback backend tests (send/recv roundtrip, empty recv, MAC, name, promiscuous, allmulticast, multiple frames, rx_readiness) - 3 provider init tests (builds without panic, shutdown on non-started, builder defaults) ## Verified - All 715+ workspace tests pass (`cargo test` from workspace root) - `quic-smoke` binary prints `QUIC_SMOKE_OK` and exits 0 - No existing crate APIs modified ## Note The `quic-integration-tests.yml` workflow file could not be pushed because the configured PAT lacks `workflow` scope. The file exists locally and should be pushed by a user/token with appropriate permissions. --------- Co-authored-by: Agent Router <agent@agent-router.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dpdk/src/port.rs): Full implementation of DPDK port initialization, configuration, and packet I/O operations includingPortConfig,MacAddress,LinkStatus,PortStats, and burst-based RX/TXdpdk/src/mbuf.rs): Complete mempool creation withMempoolConfigbuilder pattern, bulk allocation, and pool status queriesdpdk-sys/src/stubs.rs): Working stub implementations that return valid pointers for testingTest plan
dpdkcrate pass (17 for Port, 28 for Mempool, 3 existing)dpdk-syscrate passdpdk-tokiocrate passcargo buildsucceedscargo testpasses (59 total tests)Add real implementations for DPDK port and mempool management:
Port (dpdk/src/port.rs):
Mempool (dpdk/src/mbuf.rs):
Error types (dpdk/src/error.rs):
Stubs (dpdk-sys/src/stubs.rs):
https://claude.ai/code/session_01UiHnsVmMyk1CJgck3cCYZQ