You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Use iddqd::BiHashMap for scope_id/interface map
The unnumbered manager needs bidirectional lookup between scope_id and
interface name. The prod code used a single HashMap with O(n) reverse
scans; the mock maintained two manually synchronized HashMaps. Replace
both with a ScopeMap newtype wrapping iddqd::BiHashMap.
* Use iddqd IdOrdMap for Router.sessions
Updates Router.sessions to be a new SessionMap which wraps an IdOrdMap,
allowing us to use the SessionRunner's PeerId as a HashMap key. This
ensures the map keys are borrowed from the values, so it's impossible to
insert a SessionRunner into the map using a key that isn't derived from
itself, i.e. you can't insert a SessionRunner behind the wrong PeerId.
* Remove redundant peer_to_session map
The peer_to_session map was very similar to the SessionMap in its uses.
It mapped a PeerId to a SessionEndpoint, which was just a lightweight
wrapper for a SessionRunner's event_tx (FSM event sender) and config
(SessionInfo) used by the dispatcher during lookups for incoming TCP
connections. Since both event_tx and SessionInfo are info coming from
SessionRunner, this can all be accessed using the existing SessionMap
without needing to maintain two separate maps. This gets rid of the
peer_to_session map in lieu of using the SessionMap.
* Review Feedback
Signed-off-by: Trey Aspelund <trey@oxidecomputer.com>
---------
Signed-off-by: Trey Aspelund <trey@oxidecomputer.com>
0 commit comments