Skip to content

PR5: Packet ownership and copy reduction - #11

Merged
mrmidi merged 6 commits into
masterfrom
pr5/packet-copy-optimization
Jul 22, 2026
Merged

PR5: Packet ownership and copy reduction#11
mrmidi merged 6 commits into
masterfrom
pr5/packet-copy-optimization

Conversation

@mrmidi

@mrmidi mrmidi commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Summary

Reduces packet ownership overhead on the iOS Network Extension hot path.

  • Reserves native outbound queue capacity before allocating and copying packet bytes.
  • Transfers inbound native packet ownership to Swift Data without a native-to-Swift payload copy.
  • Delivers inbound packets in ordered batches and writes each batch through one NEPacketTunnelFlow.writePackets call.
  • Keeps YAFF's move-only serialized frame buffer alive through async_write, removing the final frame-vector copy.
  • Exposes copy and packet-lease counters to Swift diagnostics.

Baseline

  • M7 baseline: e121b237b5ca3659daf13c663f67a05990b64db5
  • fptn submodule: f6569b3eaccbdb01527699a7117f5e72faea3a81

Validation

  • iOS Simulator Debug build succeeds.
  • FptnSelectionCLI Debug build succeeds.
  • CLI selection simulation succeeds.
  • Added a native GTest fixture for deterministic byte equality between owned and legacy YAFF serialization.
  • Fresh GitHub Actions runs are in progress after rebasing onto master.

Scope

Only the iOS tunnel hot path, native submodule, and CLI validation are in scope. No selection, startup IPC, reconnect, or tvOS/macOS feature work is included.

@mrmidi
mrmidi force-pushed the pr5/packet-copy-optimization branch from 7ce3ae4 to 6ad9342 Compare July 22, 2026 15:00
@mrmidi
mrmidi changed the base branch from pre-pr5/selection-architecture to master July 22, 2026 15:00
@mrmidi
mrmidi marked this pull request as ready for review July 22, 2026 16:27
@mrmidi
mrmidi merged commit 2d6eed1 into master Jul 22, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant