[nexus] Remove duplicated networking types from omicron-common / external API#10344
Open
jgallagher wants to merge 8 commits intomainfrom
Open
[nexus] Remove duplicated networking types from omicron-common / external API#10344jgallagher wants to merge 8 commits intomainfrom
omicron-common / external API#10344jgallagher wants to merge 8 commits intomainfrom
Conversation
Contributor
|
Starting to look at this today, thank you for your patience! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes #10293. 2/3 of these were straightforward; removing the duplicate
SwitchPortGeometry2andTxEqConfig2types required removing those fromcommonand moving any other types still incommonthat used them out intonexus-types-versions; those are done in the first two commits on this PR.Removing the duplicate
SwitchInterfaceKind2was more involved because the two types didn't have the same structure despite having the same name. This is split into two commits: 71f7db2 renames one of them toSwitchInterfaceKindNoVlanDetailsand moves it tonexus-types-versions(where it lives alongsideSwitchInterfaceKind). Then9db5a0cad8694f40e1c572f172794b2144ce4bdbmakes an API change toSwitchInterfaceConfig(changing thekindto theSwitchInterfaceKindthat includes the vlan ID) andSwitchPortSettings.The
SwitchPortSettingschange needs the most scrutiny. My understanding is that on main,SwitchPortSettingshas these two fields:where each item in
interfaceshas akindof eitherPrimary,Loopback, orVlan. If the kind isVlan, then there will be an item invlan_interfacescontaining just the interface ID and the vlan ID:This is based on both the comments and the path that inserts these into the db, where we only add items to
vlan_interfacesif it's coming from aninterfacewith theVlankind:omicron/nexus/db-queries/src/db/datastore/switch_port.rs
Lines 1398 to 1412 in 3e4c5bc
I assume the expectation here is that clients would have to reassemble these two vecs to glue together the vlan ID of any interface with a vlan by taking the interface ID from
interfacesand finding it invlan_interfaces. The change I made on this PR is to drop thevlan_interfacesfield entirely, change thekindofSwitchInterfaceConfigto include the vlan ID, then do the reassembly ourselves when we load this object from the db:omicron/nexus/db-queries/src/db/datastore/switch_port.rs
Lines 198 to 252 in 4f0da85
But please confirm that (a) I understood what these fields contained and (b) the reassembly I'm doing there is correct!