tun: Keep relayed data on the reader transmit path

The sticky gate only drains socket submissions, so moving relay data between reader and staged sender CPUs can reorder packets on independent NIC queues. Keep relayed batches on the reader with separate, shared counter reservations while preserving the direct gate and sender affinity.

Cover gate switches, oversized relay credit, mixed direct placement and stalled shared-tunnel reservations. Add Forgejo build, test, race, crypto, lint and artifact jobs on incus-docker.
This commit is contained in:
Ryan Huber committed 2026-10-18 14:59:21 +00:00
1 parent 5cbbba254e
commit a784af4026
6 files changed
+307 -26

No files matched your search

+2
View File
@@ -226,12 +226,14 @@ func (q *affinityQueue) Read() ([]tio.Packet, error) {
type affinityConn struct {
flowCaptureConn
masks []unix.CPUSet
sizes []int
}
func (c *affinityConn) WriteBatch(p [][]byte, addrs []netip.AddrPort) (int, error) {
mask := threadMask()
c.mu.Lock()
c.masks = append(c.masks, mask)
c.sizes = append(c.sizes, len(p))
c.mu.Unlock()
return c.flowCaptureConn.WriteBatch(p, addrs)
}