From cb35c175033a83743656b87280e1f7de223120a9 Mon Sep 17 00:00:00 2001 From: fanyang Date: Sun, 28 Jun 2026 22:24:09 +0800 Subject: [PATCH] perf(mpsc): extend noop_waker sync send to TCP tunnels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TCP tunnel uses FramedWriter (not RingSink), but start_send is still sync (writes to BufList in memory). poll_flush does actual TCP write syscall — noop_waker returns Ok for Pending (data stays in BufList, flushed on next send when BufList >= 64). Add TCP benchmark support via HOTPATH_TUNNEL=tcp. Note: TCP/UDP convergence requires netns in bench environment (connector multi-bind address behavior doesn't work for localhost without namespaces). All 210 peers tests pass. Ring tunnel benchmark: 234K -> 508K pps (+117%). --- easytier/src/peers/peer_conn.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easytier/src/peers/peer_conn.rs b/easytier/src/peers/peer_conn.rs index cca5a51f..41583392 100644 --- a/easytier/src/peers/peer_conn.rs +++ b/easytier/src/peers/peer_conn.rs @@ -365,7 +365,7 @@ impl PeerConn { let peer_conn_tunnel = TunnelWithFilter::new(tunnel, filter_chain); let supports_direct = peer_conn_tunnel .info() - .map(|i| matches!(i.tunnel_type.as_str(), "ring" | "udp")) + .map(|i| matches!(i.tunnel_type.as_str(), "ring" | "udp" | "tcp")) .unwrap_or(false); let mut mpsc_tunnel = if supports_direct { MpscTunnel::new_direct(peer_conn_tunnel)