Add ddm_apply API endpoint - #877
Conversation
|
Note for reviewers: the remove path for FSMs/interfaces is not fully plumbed yet. That will come in a follow-up PR dependent on this one, as it will involve adjusting some of the FSM internals and I want to make sure it's not holding up the use of ddm_apply for multi-rack PoC stuff. Also, the vast majority of this PR (in terms of LoC) is a new falcon-lab test. The actual changes in ddm/ddmd are a few hundred lines. |
28a0a0a to
d06714c
Compare
cfzimmerman
left a comment
There was a problem hiding this comment.
I'm mostly just reviewing these to learn the codebase. Looks good!
Signed-off-by: Trey Aspelund <trey@oxidecomputer.com>
d06714c to
dbbeeab
Compare
Does this work actually need to be in |
Signed-off-by: Trey Aspelund <trey@oxidecomputer.com>
Signed-off-by: Trey Aspelund <trey@oxidecomputer.com>
Signed-off-by: Trey Aspelund <trey@oxidecomputer.com>
f0155c4 to
909f0da
Compare
I talked with @andrewjstone and he said he's fine with the merge waiting for the teardown fixes. Thank you for the quick review, although it turns out it wasn't so urgent 😅 |
Signed-off-by: Trey Aspelund <trey@oxidecomputer.com>
Signed-off-by: Trey Aspelund <trey@oxidecomputer.com>
Callers of ddm_apply and ddmd -a now pass bare interface names. Init resolves the interface's IPv6 link-local address via libnet::get_ipaddrs() (matching the interface and any of its logical interfaces) instead of looking up an address object. Config.aobj_name is removed; if_name is set at construction and keys the peer map and event mesh. The SMF method script strips any address object suffix from config/interfaces for compatibility. Signed-off-by: Trey Aspelund <trey@oxidecomputer.com>
Serialize reconciliation behind one Overseer write lock, accepting that admin reads wait for departing FSMs to complete teardown. Each state machine carries an InterfaceLifetime. Interfaces from the ddmd command line are static and live for the life of the daemon. ddm_apply reconciles only the dynamic set, so a client that knows nothing about the static interfaces (Omicron) cannot strip them, and a static name in the request is ignored with a warning. Every read endpoint still reports both kinds. InterfaceInfo gains ifindex and lifetime. Also use UnicastLinkLocalIpv6Addr to ensure sys::link_local_addr IPs are indeed IPv6 Link-local addresses. The trio ztest now starts s2 with a static interface and checks that ddm_apply with an empty set, and with the static name, leaves it alone. Signed-off-by: Trey Aspelund <trey@oxidecomputer.com>
Signed-off-by: Trey Aspelund <trey@oxidecomputer.com>
…nario Start the hub with a static interface toward peer2 and drive everything else through ddm_apply. Check that the static adjacency exchanges routes alongside a dynamic one, that naming the static interface in ddm_apply is a no-op, and that ddm_apply() removes only the dynamic interface. Signed-off-by: Trey Aspelund <trey@oxidecomputer.com>
|
I've pushed new commits which implement the back half of the FSM lifecycle. We now thread ownership of FSM threads back out through to the FSM handles, which now have a centralized owner called the I will be out on PTO for the next 2 weeks, but I think this is in a good enough spot to be reviewed. |
Adds a new API endpoint (/ddm/omicron/apply) which provides an
idempotent method for clients to supply a list of front-panel interfaces
on which to run DDM.
Adds GET /interfaces API endpoint to query interfaces known to DDM. This
exposes all configured interfaces, not just ones that have a known peer.
Replace ifname string match with a dpd client query for the "uplink"
link-prop. Route installation into dpd is now skipped when DDM learned
about the route from a peer on a link where "uplink" is false, rather
than when the ifname contains "tfportrear".
Refactors start_state_machines() to be a method of struct HandlerContext
in order to centralize state where it can be mutated by the API handler.
Consolidates HandlerContext.peers and HandlerContext.event_channels
into a single IdOrdMap.
event_channelswas a duplicatecollection holding just mpsc Senders, which were already accessible from
peerswithout even needing to go through a lock first.Adds unit tests as well as a new falcon-lab topology (ddm-lifecycle) and
an associated test case. This is currently commented out in buildomat,
since the full FSM lifecycle has not yet been implemented (removing an
interface from DDM does not trigger shutdown of all its threads).
Sets SO_REUSEADDR on the unicast DDM socket, aligning with the multicast
socket behavior. On daemon restart it was observed that bind would fail
with EADDRINUSE if the kernel hadn't yet cleared out old socket state.
Signed-off-by: Trey Aspelund trey@oxidecomputer.com