diff --git a/hostmap.go b/hostmap.go index 6466a9b9..a8acfac5 100644 --- a/hostmap.go +++ b/hostmap.go @@ -238,18 +238,26 @@ const ( ) type HostInfo struct { + // The first cache line is everything the packet paths touch. + remote atomic.Pointer[netip.AddrPort] - remotes *RemoteList - promoteCounter atomic.Uint32 ConnectionState *ConnectionState - remoteIndexId uint32 - localIndexId uint32 + + // Traffic bits, pendingDeletion, and the rebind epoch we last sent under + state atomic.Uint32 + + promoteCounter atomic.Uint32 + remoteIndexId uint32 + localIndexId uint32 + remotes *RemoteList // vpnAddrs is a list of vpn addresses assigned to this host that are within our own vpn networks // The host may have other vpn addresses that are outside our // vpn networks but were removed because they are not usable vpnAddrs []netip.Addr + // Everything below is off the packet path: handshakes, relays, roaming and the connection manager. + // networks is a combination of specific vpn addresses (not prefixes!) and full unsafe networks assigned to this host. networks *bart.Table[NetworkType] relayState RelayState @@ -270,9 +278,6 @@ type HostInfo struct { lastRoam time.Time lastRoamRemote netip.AddrPort - // Traffic bits, pendingDeletion, and the rebind epoch we last sent under - state atomic.Uint32 - // lastUsed tracks the last time ConnectionManager checked the tunnel and it was in use. // This value will be behind against actual tunnel utilization in the hot path. // This should only be used by the ConnectionManagers ticker routine.