Repository navigation
Description
We have a few types in the API with the suffix "2". This happens when we add two types with identical names; schemars appends "2" (and "3" and "4"...) to disambiguate the types. Currently we have these:
- SwitchInterfaceKind2
- SwitchPortGeometry2
- TxEqConfig2
Here are the type definitions with conflicting names:
omicron/nexus/types/versions/src/initial/networking.rs
Lines 326 to 341 in 9abb41f
| #[derive(Copy, Clone, Debug, Deserialize, Serialize, JsonSchema)] | |
| #[serde(tag = "type", rename_all = "snake_case")] | |
| pub enum SwitchInterfaceKind { | |
| /// Primary interfaces are associated with physical links. There is exactly | |
| /// one primary interface per physical link. | |
| Primary, | |
| /// VLAN interfaces allow physical interfaces to be multiplexed onto | |
| /// multiple logical links, each distinguished by a 12-bit 802.1Q Ethernet | |
| /// tag. | |
| Vlan(SwitchVlanInterface), | |
| /// Loopback interfaces are anchors for IP addresses that are not specific | |
| /// to any particular port. | |
| Loopback, | |
| } |
omicron/common/src/api/external/mod.rs
Lines 3072 to 3088 in 9abb41f
| /// Describes the kind of an switch interface. | |
| #[derive(Clone, Debug, Deserialize, JsonSchema, Serialize, PartialEq)] | |
| #[serde(rename_all = "snake_case")] | |
| pub enum SwitchInterfaceKind { | |
| /// Primary interfaces are associated with physical links. There is exactly | |
| /// one primary interface per physical link. | |
| Primary, | |
| /// VLAN interfaces allow physical interfaces to be multiplexed onto | |
| /// multiple logical links, each distinguished by a 12-bit 802.1Q Ethernet | |
| /// tag. | |
| Vlan, | |
| /// Loopback interfaces are anchors for IP addresses that are not specific | |
| /// to any particular port. | |
| Loopback, | |
| } |
omicron/nexus/types/versions/src/initial/networking.rs
Lines 210 to 222 in 9abb41f
| /// The link geometry associated with a switch port. | |
| #[derive(Copy, Clone, Debug, Deserialize, Serialize, JsonSchema)] | |
| #[serde(rename_all = "snake_case")] | |
| pub enum SwitchPortGeometry { | |
| /// The port contains a single QSFP28 link with four lanes. | |
| Qsfp28x1, | |
| /// The port contains two QSFP28 links each with two lanes. | |
| Qsfp28x2, | |
| /// The port contains four SFP28 links each with one lane. | |
| Sfp28x4, | |
| } |
omicron/common/src/api/external/mod.rs
Lines 2893 to 2905 in 9abb41f
| /// The link geometry associated with a switch port. | |
| #[derive(Clone, Debug, Deserialize, JsonSchema, Serialize, PartialEq)] | |
| #[serde(rename_all = "lowercase")] | |
| pub enum SwitchPortGeometry { | |
| /// The port contains a single QSFP28 link with four lanes. | |
| Qsfp28x1, | |
| /// The port contains two QSFP28 links each with two lanes. | |
| Qsfp28x2, | |
| /// The port contains four SFP28 links each with one lane. | |
| Sfp28x4, | |
| } |
omicron/sled-agent/types/versions/src/initial/early_networking.rs
Lines 243 to 259 in 9abb41f
| /// Per-port tx-eq overrides. This can be used to fine-tune the transceiver | |
| /// equalization settings to improve signal integrity. | |
| #[derive( | |
| Clone, Copy, Debug, Deserialize, Serialize, PartialEq, Eq, Hash, JsonSchema, | |
| )] | |
| pub struct TxEqConfig { | |
| /// Pre-cursor tap1 | |
| pub pre1: Option<i32>, | |
| /// Pre-cursor tap2 | |
| pub pre2: Option<i32>, | |
| /// Main tap | |
| pub main: Option<i32>, | |
| /// Post-cursor tap2 | |
| pub post2: Option<i32>, | |
| /// Post-cursor tap1 | |
| pub post1: Option<i32>, | |
| } |
omicron/common/src/api/external/mod.rs
Lines 3056 to 3070 in 9abb41f
| /// Per-port tx-eq overrides. This can be used to fine-tune the transceiver | |
| /// equalization settings to improve signal integrity. | |
| #[derive(Clone, Debug, Deserialize, JsonSchema, Serialize, PartialEq)] | |
| pub struct TxEqConfig { | |
| /// Pre-cursor tap1 | |
| pub pre1: Option<i32>, | |
| /// Pre-cursor tap2 | |
| pub pre2: Option<i32>, | |
| /// Main tap | |
| pub main: Option<i32>, | |
| /// Post-cursor tap2 | |
| pub post2: Option<i32>, | |
| /// Post-cursor tap1 | |
| pub post1: Option<i32>, | |
| } |
SwitchInterfaceKind has a slightly different structure (the Vlan variant); I'm not sure if the distinction is important. SwitchPortGeometry and TxEqConfig look to be identical--I'm not sure if there's some contextual reason why the types cannot be shared.
Activity
[nexus] Remove duplicated networking types from `omicron-common` / ex…