Repository navigation
dpdk-stdlib-tcp: Sync socket — TcpStream and TcpListener public API - #92
Conversation
Implement ROADMAP item #28 (tasks 8.4, 8.5): - TcpStream: enum Inner { Dpdk(DpdkTcpStream), Std(std::net::TcpStream) } - connect<A: ToSocketAddrs> with v4→DPDK / v6→kernel dispatch - connect_timeout, shutdown, peer_addr, local_addr - set_read_timeout, set_write_timeout, read_timeout, write_timeout - set_nodelay, nodelay, set_ttl, ttl, set_linger, linger - set_nonblocking, take_error, peek, try_clone (Unsupported on DPDK) - impl Read/Write for TcpStream and for &TcpStream (serialized via mutex) - TcpListener: enum Inner { Dpdk, Std } - bind<A: ToSocketAddrs> with v4/v6 dispatch - accept() -> (TcpStream, SocketAddr) - local_addr, set_ttl, ttl, incoming() -> Incoming iterator - SpscByteRing: add peek() method for non-destructive read - TcpContext + init_tcp_context() for process-wide DPDK engine context
Synthetic Performance Results — Graviton (run)Commit: ✅ synthetic UDP socket bound to 10.0.0.1:9000 (MAC: 02:00:00:00:00:01) Synthetic UDP Performance ResultsMeasures framework overhead: sync IPv4 Baseline
IPv6
IPv6 vs IPv4 Comparison (sync path)
IPv4 avg sync/async ratio: 0.9x, worst: 1.0x | IPv6 vs IPv4 worst ratio: 1.34x (OK)
|
Synthetic Performance Results (run)Commit: ✅ synthetic UDP socket bound to 10.0.0.1:9000 (MAC: 02:00:00:00:00:01) Synthetic UDP Performance ResultsMeasures framework overhead: sync IPv4 Baseline
IPv6
IPv6 vs IPv4 Comparison (sync path)
IPv4 avg sync/async ratio: 0.9x, worst: 1.1x | IPv6 vs IPv4 worst ratio: 1.41x (OK)
|
[Perf] Stage: DeployDeploying |
[CI] Stage: DeployInfrastructure ready.
|
[CI] Stage: DeployInfrastructure ready.
|
[Perf] Stage: Instances Ready
|
[Perf] Stage: TRex ConfigStarting TRex configuration (MAC discovery + NIC binding)... |
[Perf] Stage: TRex Config OK
|
[Perf] Stage: TRex StartedTRex server running. Beginning benchmarks... |
[Perf] DUT ReadyDUT instance |
[Perf] Stage: Benchmark (1/4)Running |
[Perf] Benchmark Diag:
|
[CI] Stage: SummaryAll tests PASSED. ARP seeding: kernel /proc/net/arp (automatic)
|
[Perf] Benchmark Diag:
|
[Perf] Stage: Benchmark (2/4)Running |
[Perf] Benchmark Diag:
|
[CI] Stage: SummaryAll tests PASSED. ARP seeding: kernel /proc/net/arp (automatic)
|
✅ Integration Tests Passed — Graviton (run)Branch: Test Results
Application Logs (last 20 lines)receiver-echo-server.log sender-echo-server.log sender-test-client.log |
✅ Integration Tests Passed (Run 27772898314)Branch: Test Results
Application Logs (last 20 lines)receiver-echo-server.log sender-echo-server.log sender-test-client.log receiver-test-client-iperf.log sender-test-client-iperf.log Full Application Logs (last 200 lines each)receiver-echo-server.logsender-echo-server.logsender-test-client.logreceiver-test-client-iperf.logsender-test-client-iperf.log
|
[Perf] Benchmark Diag:
|
[Perf] Stage: Benchmark (3/4)Running |
[Perf] Benchmark Diag:
|
[Perf] Benchmark Diag:
|
[Perf] Stage: Benchmark (4/4)Running |
[Perf] Benchmark Diag:
|
[Perf] Benchmark Diag:
|
[Perf] Diag: testpmd logtestpmd output (last 30 lines) |
[Perf] Stage: Results[17:07:28] INFO Generating markdown summary... Performance Test Results — unknownCommit: 64B packets
512B packets
1400B packets
8500B packets
NIC Drops Instrumentation Self-CheckCompares
plain-rust Kernel NIC Drops (ethtool -S delta)ethtool snapshots not available — baseline or final file missing in |
Synthetic Performance Results (run)Commit: ✅ synthetic UDP socket bound to 10.0.0.1:9000 (MAC: 02:00:00:00:00:01) Synthetic UDP Performance ResultsMeasures framework overhead: sync IPv4 Baseline
IPv6
IPv6 vs IPv4 Comparison (sync path)
IPv4 avg sync/async ratio: 0.9x, worst: 1.0x | IPv6 vs IPv4 worst ratio: 1.31x (OK)
|
Synthetic Performance Results — Graviton (run)Commit: ✅ synthetic UDP socket bound to 10.0.0.1:9000 (MAC: 02:00:00:00:00:01) Synthetic UDP Performance ResultsMeasures framework overhead: sync IPv4 Baseline
IPv6
IPv6 vs IPv4 Comparison (sync path)
IPv4 avg sync/async ratio: 0.9x, worst: 1.0x | IPv6 vs IPv4 worst ratio: 1.31x (OK)
|
[CI] Stage: DeployInfrastructure ready.
|
[CI] Stage: DeployInfrastructure ready.
|
[CI] Stage: SummaryAll tests PASSED. ARP seeding: kernel /proc/net/arp (automatic)
|
1 similar comment
[CI] Stage: SummaryAll tests PASSED. ARP seeding: kernel /proc/net/arp (automatic)
|
✅ Integration Tests Passed — Graviton (run)Branch: Test Results
Application Logs (last 20 lines)receiver-echo-server.log sender-echo-server.log sender-test-client.log |
✅ Integration Tests Passed (Run 27776366955)Branch: Test Results
Application Logs (last 20 lines)receiver-echo-server.log sender-echo-server.log sender-test-client.log receiver-test-client-iperf.log sender-test-client-iperf.log Full Application Logs (last 200 lines each)receiver-echo-server.logsender-echo-server.logsender-test-client.logreceiver-test-client-iperf.logsender-test-client-iperf.log
|
ROADMAP Item
#28:
dpdk-stdlib-tcp: Sync socket — TcpStream and TcpListener public APISpec:
.kiro/specs/tcp-support/· tasks 8.4, 8.5Changes
TcpStream (
tcp_stream.rs)enum Inner { Dpdk(DpdkTcpStream), Std(std::net::TcpStream) }with v4→DPDK / v6→kernel dispatchstd::net::TcpStreamsurface:connect,connect_timeout,shutdown,peer_addr,local_addr,set_read_timeout/set_write_timeout,set_nodelay/nodelay,set_ttl/ttl,set_linger/linger,set_nonblocking,take_error,peek,try_clone(returnsUnsupportedon DPDK arm)impl Read/Write for TcpStreamandimpl Read/Write for &TcpStream(serialized via read_mutex/write_mutex per P0-C)TcpContext+init_tcp_context()for engine bootstrappingTcpListener (
tcp_listener.rs)enum Inner { Dpdk(DpdkTcpListener), Std(std::net::TcpListener) }bind<A: ToSocketAddrs>with v4/v6 dispatchaccept() -> (TcpStream, SocketAddr)local_addr(),set_ttl(),ttl(),incoming() -> IncomingSpscByteRing (
ring.rs)peek(&self, buf: &mut [u8]) -> usizefor non-destructive read (used byTcpStream::peek)Tests Added
tcp_stream_try_clone_dpdk_returns_unsupportedtcp_stream_peer_addr_and_local_addrtcp_stream_shutdown_sends_commandtcp_stream_set_linger_updates_handletcp_stream_take_error_returns_none_initiallytcp_stream_take_error_returns_latched_errortcp_stream_read_write_dpdktcp_stream_try_clone_std_works(v6 dispatch path)Tradeoffs
set_linger/lingeron the Std (kernel) arm is a no-op sincetcp_lingeris unstable in stdtry_clone()on DPDK arm returnsUnsupported— documented divergence;into_split()is the intended concurrent pattern for SPSCpeek()on DPDK arm returnsWouldBlockwhen ring is empty (in blocking mode, full blocking peek would require additional condvar wait logic)All 666+ existing tests pass locally (
cargo build && cargo test).