diff --git a/common/src/api/external/mod.rs b/common/src/api/external/mod.rs index 18343ac44a..0c0062d227 100644 --- a/common/src/api/external/mod.rs +++ b/common/src/api/external/mod.rs @@ -2514,7 +2514,7 @@ pub struct SwitchPortLinkConfig { pub mtu: u16, /// The forward error correction mode of the link. - pub fec: LinkFec, + pub fec: Option, /// The configured speed of the link. pub speed: LinkSpeed, diff --git a/common/src/api/internal/shared.rs b/common/src/api/internal/shared.rs index 5b1a528b36..e0d6452376 100644 --- a/common/src/api/internal/shared.rs +++ b/common/src/api/internal/shared.rs @@ -489,7 +489,7 @@ pub struct PortConfigV2 { /// Port speed. pub uplink_port_speed: PortSpeed, /// Port forward error correction type. - pub uplink_port_fec: PortFec, + pub uplink_port_fec: Option, /// BGP peers on this port pub bgp_peers: Vec, /// Whether or not to set autonegotiation diff --git a/nexus/db-model/src/schema.rs b/nexus/db-model/src/schema.rs index 6ca7171793..218cad84da 100644 --- a/nexus/db-model/src/schema.rs +++ b/nexus/db-model/src/schema.rs @@ -141,7 +141,7 @@ table! { port_settings_id -> Uuid, link_name -> Text, mtu -> Int4, - fec -> crate::SwitchLinkFecEnum, + fec -> Nullable, speed -> crate::SwitchLinkSpeedEnum, autoneg -> Bool, lldp_link_config_id -> Nullable, diff --git a/nexus/db-model/src/switch_port.rs b/nexus/db-model/src/switch_port.rs index 2db9ef04df..8d44c0fb20 100644 --- a/nexus/db-model/src/switch_port.rs +++ b/nexus/db-model/src/switch_port.rs @@ -385,7 +385,7 @@ pub struct SwitchPortLinkConfig { pub lldp_link_config_id: Option, pub link_name: String, pub mtu: SqlU16, - pub fec: SwitchLinkFec, + pub fec: Option, pub speed: SwitchLinkSpeed, pub autoneg: bool, pub tx_eq_config_id: Option, @@ -398,7 +398,7 @@ impl SwitchPortLinkConfig { lldp_link_config_id: Uuid, link_name: String, mtu: u16, - fec: SwitchLinkFec, + fec: Option, speed: SwitchLinkSpeed, autoneg: bool, tx_eq_config_id: Option, @@ -424,7 +424,7 @@ impl Into for SwitchPortLinkConfig { tx_eq_config_id: self.tx_eq_config_id, link_name: self.link_name.clone(), mtu: self.mtu.into(), - fec: self.fec.into(), + fec: self.fec.map(|fec| fec.into()), speed: self.speed.into(), autoneg: self.autoneg, } diff --git a/nexus/db-queries/src/db/datastore/switch_port.rs b/nexus/db-queries/src/db/datastore/switch_port.rs index e0092459b5..6b282434cd 100644 --- a/nexus/db-queries/src/db/datastore/switch_port.rs +++ b/nexus/db-queries/src/db/datastore/switch_port.rs @@ -1229,7 +1229,7 @@ async fn do_switch_port_settings_create( lldp_config_id, link_name.clone(), c.mtu, - c.fec.into(), + c.fec.map(|fec| fec.into()), c.speed.into(), c.autoneg, tx_eq_config_id, diff --git a/nexus/src/app/background/tasks/networking.rs b/nexus/src/app/background/tasks/networking.rs index ed27409c9b..54eb842550 100644 --- a/nexus/src/app/background/tasks/networking.rs +++ b/nexus/src/app/background/tasks/networking.rs @@ -83,11 +83,11 @@ pub(crate) fn api_to_dpd_port_settings( lane: Some(LinkId(0)), kr: false, tx_eq: tx_eq.clone(), - fec: match l.fec { + fec: l.fec.map(|fec| match fec { SwitchLinkFec::Firecode => PortFec::Firecode, SwitchLinkFec::Rs => PortFec::Rs, SwitchLinkFec::None => PortFec::None, - }, + }), speed: match l.speed { SwitchLinkSpeed::Speed0G => PortSpeed::Speed0G, SwitchLinkSpeed::Speed1G => PortSpeed::Speed1G, diff --git a/nexus/src/app/background/tasks/sync_switch_configuration.rs b/nexus/src/app/background/tasks/sync_switch_configuration.rs index ceacae7645..6a82f1634c 100644 --- a/nexus/src/app/background/tasks/sync_switch_configuration.rs +++ b/nexus/src/app/background/tasks/sync_switch_configuration.rs @@ -19,7 +19,7 @@ use internal_dns_types::names::ServiceName; use ipnetwork::IpNetwork; use nexus_db_model::{ AddressLotBlock, BgpConfig, BootstoreConfig, LoopbackAddress, - SwitchLinkFec, SwitchLinkSpeed, INFRA_LOT, NETWORK_KEY, + SwitchLinkSpeed, INFRA_LOT, NETWORK_KEY, }; use uuid::Uuid; @@ -1002,9 +1002,8 @@ impl BackgroundTask for SwitchPortSettingsManager { uplink_port_fec: info .links .get(0) //TODO https://github.com/oxidecomputer/omicron/issues/3062 - .map(|l| l.fec) - .unwrap_or(SwitchLinkFec::None) - .into(), + .map(|l| l.fec.map(|fec| fec.into())) + .unwrap_or(None), uplink_port_speed: info .links .get(0) //TODO https://github.com/oxidecomputer/omicron/issues/3062 diff --git a/nexus/src/app/rack.rs b/nexus/src/app/rack.rs index c23bd37ca7..a9ad97e9c8 100644 --- a/nexus/src/app/rack.rs +++ b/nexus/src/app/rack.rs @@ -654,7 +654,7 @@ impl super::Nexus { let link = LinkConfigCreate { //TODO https://github.com/oxidecomputer/omicron/issues/2274 mtu: 1500, - fec: uplink_config.uplink_port_fec.into(), + fec: uplink_config.uplink_port_fec.map(|fec| fec.into()), speed: uplink_config.uplink_port_speed.into(), autoneg: uplink_config.autoneg, lldp, diff --git a/nexus/tests/integration_tests/switch_port.rs b/nexus/tests/integration_tests/switch_port.rs index 9ce686db56..89ddfe11ac 100644 --- a/nexus/tests/integration_tests/switch_port.rs +++ b/nexus/tests/integration_tests/switch_port.rs @@ -127,7 +127,7 @@ async fn test_port_settings_basic_crud(ctx: &ControlPlaneTestContext) { system_description: Some("System description".into()), management_ip: None, }, - fec: LinkFec::None, + fec: Some(LinkFec::None), speed: LinkSpeed::Speed100G, autoneg: false, tx_eq: None, diff --git a/nexus/types/src/external_api/params.rs b/nexus/types/src/external_api/params.rs index 9af9d3be1e..152e09275f 100644 --- a/nexus/types/src/external_api/params.rs +++ b/nexus/types/src/external_api/params.rs @@ -1716,7 +1716,7 @@ pub struct LinkConfigCreate { pub lldp: LldpLinkConfigCreate, /// The forward error correction mode of the link. - pub fec: LinkFec, + pub fec: Option, /// The speed of the link. pub speed: LinkSpeed, diff --git a/openapi/bootstrap-agent.json b/openapi/bootstrap-agent.json index 2f3058cd46..32fe2f0d8e 100644 --- a/openapi/bootstrap-agent.json +++ b/openapi/bootstrap-agent.json @@ -866,6 +866,7 @@ ] }, "uplink_port_fec": { + "nullable": true, "description": "Port forward error correction type.", "allOf": [ { @@ -888,7 +889,6 @@ "port", "routes", "switch", - "uplink_port_fec", "uplink_port_speed" ] }, diff --git a/openapi/nexus-internal.json b/openapi/nexus-internal.json index c8d8eae103..118bc22e09 100644 --- a/openapi/nexus-internal.json +++ b/openapi/nexus-internal.json @@ -4687,6 +4687,7 @@ ] }, "uplink_port_fec": { + "nullable": true, "description": "Port forward error correction type.", "allOf": [ { @@ -4709,7 +4710,6 @@ "port", "routes", "switch", - "uplink_port_fec", "uplink_port_speed" ] }, diff --git a/openapi/nexus.json b/openapi/nexus.json index 4221b4c411..a272b9167c 100644 --- a/openapi/nexus.json +++ b/openapi/nexus.json @@ -17166,6 +17166,7 @@ "type": "boolean" }, "fec": { + "nullable": true, "description": "The forward error correction mode of the link.", "allOf": [ { @@ -17207,7 +17208,6 @@ }, "required": [ "autoneg", - "fec", "lldp", "mtu", "speed" @@ -20410,6 +20410,7 @@ "type": "boolean" }, "fec": { + "nullable": true, "description": "The forward error correction mode of the link.", "allOf": [ { @@ -20455,7 +20456,6 @@ }, "required": [ "autoneg", - "fec", "link_name", "mtu", "port_settings_id", diff --git a/openapi/sled-agent.json b/openapi/sled-agent.json index e2c3b1e4d3..022c8f0316 100644 --- a/openapi/sled-agent.json +++ b/openapi/sled-agent.json @@ -4686,6 +4686,7 @@ ] }, "uplink_port_fec": { + "nullable": true, "description": "Port forward error correction type.", "allOf": [ { @@ -4708,7 +4709,6 @@ "port", "routes", "switch", - "uplink_port_fec", "uplink_port_speed" ] }, diff --git a/openapi/wicketd.json b/openapi/wicketd.json index 8e20f23d06..0b3c4d7c9e 100644 --- a/openapi/wicketd.json +++ b/openapi/wicketd.json @@ -6676,7 +6676,12 @@ ] }, "uplink_port_fec": { - "$ref": "#/components/schemas/PortFec" + "nullable": true, + "allOf": [ + { + "$ref": "#/components/schemas/PortFec" + } + ] }, "uplink_port_speed": { "$ref": "#/components/schemas/PortSpeed" @@ -6686,7 +6691,6 @@ "addresses", "autoneg", "routes", - "uplink_port_fec", "uplink_port_speed" ], "additionalProperties": false diff --git a/package-manifest.toml b/package-manifest.toml index ae7a58394a..12193d8a6d 100644 --- a/package-manifest.toml +++ b/package-manifest.toml @@ -719,8 +719,8 @@ only_for_targets.image = "standard" # the other `source.*` keys. source.type = "prebuilt" source.repo = "dendrite" -source.commit = "5b1d590426971e481d927d3978e918ec25f3ad21" -source.sha256 = "b2662975bd704edfa393549d90c42c8f363037d630cab66cd9d6891bdb64f470" +source.commit = "8290b412c867438997c8bbb3b1fa75ed23ff250f" +source.sha256 = "d79b764d198777f7356e2338164a9afefff316899c87b0e9bf33254b26f063db" output.type = "zone" output.intermediate_only = true @@ -746,8 +746,8 @@ only_for_targets.image = "standard" # the other `source.*` keys. source.type = "prebuilt" source.repo = "dendrite" -source.commit = "5b1d590426971e481d927d3978e918ec25f3ad21" -source.sha256 = "7dee2af3126b35c6b7e0e22cb45c3e47f5ea8a6d98b991304c0d3e08bc341437" +source.commit = "8290b412c867438997c8bbb3b1fa75ed23ff250f" +source.sha256 = "2f3ccf810dadd6d340a1bef03952f7b43a994a8cb47aa5513ae7b8e3402b524f" output.type = "zone" output.intermediate_only = true @@ -766,8 +766,8 @@ only_for_targets.image = "standard" # the other `source.*` keys. source.type = "prebuilt" source.repo = "dendrite" -source.commit = "5b1d590426971e481d927d3978e918ec25f3ad21" -source.sha256 = "1310877ed0a0f2fb8b764f2c7b4b45c31200c6b899e9ae8ae1e548c9ab6c8bbf" +source.commit = "8290b412c867438997c8bbb3b1fa75ed23ff250f" +source.sha256 = "cc0753ddbaf73e883f0ce9fa6a8865356a6510400b4a5a6d27fcc8b7a14b5b05" output.type = "zone" output.intermediate_only = true diff --git a/schema/rss-sled-plan.json b/schema/rss-sled-plan.json index 56fe35bcde..fbfc92cb7e 100644 --- a/schema/rss-sled-plan.json +++ b/schema/rss-sled-plan.json @@ -698,7 +698,6 @@ "port", "routes", "switch", - "uplink_port_fec", "uplink_port_speed" ], "properties": { @@ -764,9 +763,12 @@ }, "uplink_port_fec": { "description": "Port forward error correction type.", - "allOf": [ + "anyOf": [ { "$ref": "#/definitions/PortFec" + }, + { + "type": "null" } ] }, diff --git a/sled-agent/src/bootstrap/early_networking.rs b/sled-agent/src/bootstrap/early_networking.rs index acfbafe61c..f7440497a4 100644 --- a/sled-agent/src/bootstrap/early_networking.rs +++ b/sled-agent/src/bootstrap/early_networking.rs @@ -699,7 +699,7 @@ impl<'a> EarlyNetworkSetup<'a> { params: LinkCreate { autoneg: port_config.autoneg, kr: false, //NOTE: kr does not apply to user configurable links. - fec: convert_fec(&port_config.uplink_port_fec), + fec: port_config.uplink_port_fec.map(convert_fec), speed: convert_speed(&port_config.uplink_port_speed), lane: Some(LinkId(0)), tx_eq: port_config.tx_eq.map(|x| TxEq { @@ -783,7 +783,7 @@ fn convert_speed(speed: &PortSpeed) -> dpd_client::types::PortSpeed { } } -fn convert_fec(fec: &PortFec) -> dpd_client::types::PortFec { +fn convert_fec(fec: PortFec) -> dpd_client::types::PortFec { match fec { PortFec::Firecode => dpd_client::types::PortFec::Firecode, PortFec::None => dpd_client::types::PortFec::None, diff --git a/sled-agent/src/rack_setup/service.rs b/sled-agent/src/rack_setup/service.rs index 3f33ce0623..90ad65b065 100644 --- a/sled-agent/src/rack_setup/service.rs +++ b/sled-agent/src/rack_setup/service.rs @@ -906,7 +906,9 @@ impl ServiceInner { .collect(), switch: config.switch.into(), uplink_port_speed: config.uplink_port_speed.into(), - uplink_port_fec: config.uplink_port_fec.into(), + uplink_port_fec: config + .uplink_port_fec + .map(|fec| fec.into()), autoneg: config.autoneg, bgp_peers: config .bgp_peers diff --git a/sled-agent/tests/integration_tests/early_network.rs b/sled-agent/tests/integration_tests/early_network.rs index 420ce493d0..ff1b0ee8ac 100644 --- a/sled-agent/tests/integration_tests/early_network.rs +++ b/sled-agent/tests/integration_tests/early_network.rs @@ -132,7 +132,7 @@ fn current_config_example() -> (&'static str, EarlyNetworkConfig) { switch: SwitchLocation::Switch0, port: "foo".to_owned(), uplink_port_speed: PortSpeed::Speed200G, - uplink_port_fec: PortFec::Firecode, + uplink_port_fec: Some(PortFec::Firecode), bgp_peers: vec![BgpPeerConfig { asn: 65000, port: "bar".to_owned(), diff --git a/sled-agent/types/src/early_networking.rs b/sled-agent/types/src/early_networking.rs index 6faead6fe9..cef692769c 100644 --- a/sled-agent/types/src/early_networking.rs +++ b/sled-agent/types/src/early_networking.rs @@ -296,7 +296,7 @@ pub mod back_compat { switch: v1.switch, port: v1.port, uplink_port_speed: v1.uplink_port_speed, - uplink_port_fec: v1.uplink_port_fec, + uplink_port_fec: Some(v1.uplink_port_fec), bgp_peers: v1.bgp_peers.clone(), autoneg: v1.autoneg, lldp: None, @@ -344,7 +344,7 @@ pub mod back_compat { switch: value.switch, port: value.uplink_port, uplink_port_speed: value.uplink_port_speed, - uplink_port_fec: value.uplink_port_fec, + uplink_port_fec: Some(value.uplink_port_fec), bgp_peers: vec![], autoneg: false, lldp: None, @@ -518,7 +518,7 @@ mod tests { switch: uplink.switch, port: uplink.uplink_port, uplink_port_speed: uplink.uplink_port_speed, - uplink_port_fec: uplink.uplink_port_fec, + uplink_port_fec: Some(uplink.uplink_port_fec), autoneg: false, bgp_peers: vec![], lldp: None, @@ -601,7 +601,7 @@ mod tests { switch: port.switch, port: port.port, uplink_port_speed: port.uplink_port_speed, - uplink_port_fec: port.uplink_port_fec, + uplink_port_fec: Some(port.uplink_port_fec), autoneg: false, bgp_peers: vec![], lldp: None, diff --git a/tools/dendrite_openapi_version b/tools/dendrite_openapi_version index 22aa28efaa..bb17afdeb3 100755 --- a/tools/dendrite_openapi_version +++ b/tools/dendrite_openapi_version @@ -1,2 +1,2 @@ -COMMIT="5b1d590426971e481d927d3978e918ec25f3ad21" -SHA2="bcddcd4d600f5cb9bd73754125b4263312fcabadd2a521d44355633a796c8a71" +COMMIT="8290b412c867438997c8bbb3b1fa75ed23ff250f" +SHA2="c381b2ac42fbd68b9230e111cb96beecf90abde10cdc15f02c88d61781c8adb8" diff --git a/tools/dendrite_stub_checksums b/tools/dendrite_stub_checksums index 9738f78501..dccdbde657 100644 --- a/tools/dendrite_stub_checksums +++ b/tools/dendrite_stub_checksums @@ -1,3 +1,3 @@ -CIDL_SHA256_ILLUMOS="b2662975bd704edfa393549d90c42c8f363037d630cab66cd9d6891bdb64f470" -CIDL_SHA256_LINUX_DPD="10d356231ec5357788c5d01da14bc393be4c79dd5df45c142398ef5674e733fb" -CIDL_SHA256_LINUX_SWADM="1e6cc87d1820a4647c171479a0c0a587a892078e49e8e7485769a33e62516f40" +CIDL_SHA256_ILLUMOS="d79b764d198777f7356e2338164a9afefff316899c87b0e9bf33254b26f063db" +CIDL_SHA256_LINUX_DPD="d8b8e4acb2c523b112775361b69f5c8ee2f5c6b1747bb800e6546392ef83b02b" +CIDL_SHA256_LINUX_SWADM="28e4ecd3e73b6674b2afbaff6ae940f3f6c8e2ca0ef7f43175a895dbad553814" diff --git a/wicket-common/src/example.rs b/wicket-common/src/example.rs index 8572b791cd..d437945012 100644 --- a/wicket-common/src/example.rs +++ b/wicket-common/src/example.rs @@ -210,7 +210,7 @@ impl ExampleRackSetupData { }], bgp_peers: switch0_port0_bgp_peers, uplink_port_speed: PortSpeed::Speed400G, - uplink_port_fec: PortFec::Firecode, + uplink_port_fec: Some(PortFec::Firecode), lldp: switch0_port0_lldp, tx_eq, autoneg: true, @@ -230,7 +230,7 @@ impl ExampleRackSetupData { }], bgp_peers: switch1_port0_bgp_peers, uplink_port_speed: PortSpeed::Speed400G, - uplink_port_fec: PortFec::Firecode, + uplink_port_fec: None, lldp: switch1_port0_lldp, tx_eq, autoneg: true, diff --git a/wicket-common/src/rack_setup.rs b/wicket-common/src/rack_setup.rs index 7136bc8d96..c33d3a628f 100644 --- a/wicket-common/src/rack_setup.rs +++ b/wicket-common/src/rack_setup.rs @@ -183,7 +183,7 @@ pub struct UserSpecifiedPortConfig { pub routes: Vec, pub addresses: Vec, pub uplink_port_speed: PortSpeed, - pub uplink_port_fec: PortFec, + pub uplink_port_fec: Option, pub autoneg: bool, #[serde(default)] pub bgp_peers: Vec, diff --git a/wicket/src/cli/rack_setup/config_toml.rs b/wicket/src/cli/rack_setup/config_toml.rs index 727f1bbaa8..191a8cb30f 100644 --- a/wicket/src/cli/rack_setup/config_toml.rs +++ b/wicket/src/cli/rack_setup/config_toml.rs @@ -358,11 +358,14 @@ fn populate_uplink_table(cfg: &UserSpecifiedPortConfig) -> Table { uplink.insert("addresses", Item::Value(Value::Array(addresses_out))); // General properties - for (property, value) in [ - ("uplink_port_speed", enum_to_toml_string(&uplink_port_speed)), - ("uplink_port_fec", enum_to_toml_string(&uplink_port_fec)), - ] { - uplink.insert(property, string_item(value)); + uplink.insert( + "uplink_port_speed", + string_item(enum_to_toml_string(&uplink_port_speed)), + ); + + if let Some(fec) = uplink_port_fec { + uplink + .insert("uplink_port_fec", string_item(enum_to_toml_string(&fec))); } uplink.insert("autoneg", bool_item(*autoneg)); diff --git a/wicket/src/ui/panes/rack_setup.rs b/wicket/src/ui/panes/rack_setup.rs index 1828049fc3..422c47b2bd 100644 --- a/wicket/src/ui/panes/rack_setup.rs +++ b/wicket/src/ui/panes/rack_setup.rs @@ -790,7 +790,13 @@ fn rss_config_text<'a>( ], vec![ Span::styled(" • FEC : ", label_style), - Span::styled(uplink_port_fec.to_string(), ok_style), + Span::styled( + match uplink_port_fec { + Some(fec) => fec.to_string(), + None => "unspecified".to_string(), + }, + ok_style, + ), ], vec![ Span::styled(" • Autoneg : ", label_style), diff --git a/wicket/tests/output/example_non_empty.toml b/wicket/tests/output/example_non_empty.toml index d6f5e7c820..1cd4582a43 100644 --- a/wicket/tests/output/example_non_empty.toml +++ b/wicket/tests/output/example_non_empty.toml @@ -130,7 +130,6 @@ post2 = 0 routes = [{ nexthop = "172.33.0.10", destination = "0.0.0.0/0", vlan_id = 1 }] addresses = [{ address = "172.32.0.1/24" }] uplink_port_speed = "speed400_g" -uplink_port_fec = "firecode" autoneg = true [[rack_network_config.switch1.port0.bgp_peers]] diff --git a/wicketd/src/preflight_check/uplink.rs b/wicketd/src/preflight_check/uplink.rs index e70d9db57b..42210d7719 100644 --- a/wicketd/src/preflight_check/uplink.rs +++ b/wicketd/src/preflight_check/uplink.rs @@ -747,11 +747,11 @@ fn build_port_settings( link_id: &LinkId, ) -> PortSettings { // Map from omicron_common types to dpd_client types - let fec = match uplink.uplink_port_fec { + let fec = uplink.uplink_port_fec.map(|fec| match fec { OmicronPortFec::Firecode => DpdPortFec::Firecode, OmicronPortFec::None => DpdPortFec::None, OmicronPortFec::Rs => DpdPortFec::Rs, - }; + }); let speed = match uplink.uplink_port_speed { OmicronPortSpeed::Speed0G => DpdPortSpeed::Speed0G, OmicronPortSpeed::Speed1G => DpdPortSpeed::Speed1G, diff --git a/wicketd/src/rss_config.rs b/wicketd/src/rss_config.rs index 8ee252ef77..badcb24a3f 100644 --- a/wicketd/src/rss_config.rs +++ b/wicketd/src/rss_config.rs @@ -788,11 +788,11 @@ fn build_port_config( PortSpeed::Speed200G => BaPortSpeed::Speed200G, PortSpeed::Speed400G => BaPortSpeed::Speed400G, }, - uplink_port_fec: match config.uplink_port_fec { + uplink_port_fec: config.uplink_port_fec.map(|fec| match fec { PortFec::Firecode => BaPortFec::Firecode, PortFec::None => BaPortFec::None, PortFec::Rs => BaPortFec::Rs, - }, + }), autoneg: config.autoneg, lldp: config.lldp.as_ref().map(|c| BaLldpPortConfig { status: match c.status {