From f3ab3387b640de27875502209a55211087e9b23d Mon Sep 17 00:00:00 2001 From: taspelund <15963272+taspelund@users.noreply.github.com> Date: Mon, 7 Oct 2024 12:08:06 -0600 Subject: [PATCH] Rename static route local_pref to rib_priority (#6693) This is the omicron half of maghemite#359. This renames the `local_pref` field of static routes to `rib_priority` to avoid overloading the name of a standardized and well-known BGP attribute (Local Preference). This change shrinks the size of the field from u32 -> u8 and unwraps the Option before shipping routes to mgd, aligning with the updated API. This also brings omicron back into sync with maghemite. Fixes: #6711 Signed-off-by: Trey Aspelund --------- Signed-off-by: Trey Aspelund Co-authored-by: Levon Tarver --- Cargo.lock | 4 +- Cargo.toml | 6 +- common/src/api/external/mod.rs | 4 +- common/src/api/internal/shared.rs | 4 +- nexus/db-model/src/schema.rs | 2 +- nexus/db-model/src/switch_port.rs | 9 +- .../src/db/datastore/switch_port.rs | 2 +- .../tasks/sync_switch_configuration.rs | 101 ++++++++++-------- nexus/src/app/rack.rs | 2 +- nexus/tests/integration_tests/switch_port.rs | 2 +- nexus/types/src/external_api/params.rs | 2 +- openapi/bootstrap-agent.json | 16 +-- openapi/nexus-internal.json | 16 +-- openapi/nexus.json | 18 ++-- openapi/sled-agent.json | 16 +-- openapi/wicketd.json | 16 +-- package-manifest.toml | 12 +-- schema/rss-sled-plan.json | 16 +-- sled-agent/src/bootstrap/early_networking.rs | 14 ++- sled-agent/src/rack_setup/service.rs | 2 +- .../tests/integration_tests/early_network.rs | 2 +- .../madrid-rss-sled-plan.json | 4 +- sled-agent/types/src/early_networking.rs | 12 +-- tools/maghemite_ddm_openapi_version | 2 +- tools/maghemite_mg_openapi_version | 4 +- tools/maghemite_mgd_checksums | 4 +- wicket-common/src/example.rs | 4 +- wicket/src/cli/rack_setup/config_toml.rs | 6 +- wicket/src/ui/panes/rack_setup.rs | 59 +++++----- wicketd/src/rss_config.rs | 2 +- 30 files changed, 193 insertions(+), 170 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 224086b455..7c08c5ca5e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2004,7 +2004,7 @@ dependencies = [ [[package]] name = "ddm-admin-client" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/maghemite?branch=hyper-v1-no-merge#b13b5b240f3967de753fd589b1036745d2770b52" +source = "git+https://github.com/oxidecomputer/maghemite?rev=056283eb02b6887fbf27f66a215662520f7c159c#056283eb02b6887fbf27f66a215662520f7c159c" dependencies = [ "oxnet", "percent-encoding", @@ -5093,7 +5093,7 @@ dependencies = [ [[package]] name = "mg-admin-client" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/maghemite?branch=hyper-v1-no-merge#b13b5b240f3967de753fd589b1036745d2770b52" +source = "git+https://github.com/oxidecomputer/maghemite?rev=056283eb02b6887fbf27f66a215662520f7c159c#056283eb02b6887fbf27f66a215662520f7c159c" dependencies = [ "anyhow", "chrono", diff --git a/Cargo.toml b/Cargo.toml index 29213e85b7..5c1b6695b2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -420,10 +420,8 @@ macaddr = { version = "1.0.1", features = ["serde_std"] } maplit = "1.0.2" mockall = "0.13" newtype_derive = "0.1.6" -# mg-admin-client = { git = "https://github.com/oxidecomputer/maghemite", rev = "9e0fe45ca3862176dc31ad8cc83f605f8a7e1a42" } -# ddm-admin-client = { git = "https://github.com/oxidecomputer/maghemite", rev = "9e0fe45ca3862176dc31ad8cc83f605f8a7e1a42" } -mg-admin-client = { git = "https://github.com/oxidecomputer/maghemite", branch = "hyper-v1-no-merge" } -ddm-admin-client = { git = "https://github.com/oxidecomputer/maghemite", branch = "hyper-v1-no-merge" } +mg-admin-client = { git = "https://github.com/oxidecomputer/maghemite", rev = "056283eb02b6887fbf27f66a215662520f7c159c" } +ddm-admin-client = { git = "https://github.com/oxidecomputer/maghemite", rev = "056283eb02b6887fbf27f66a215662520f7c159c" } multimap = "0.10.0" nexus-auth = { path = "nexus/auth" } nexus-client = { path = "clients/nexus-client" } diff --git a/common/src/api/external/mod.rs b/common/src/api/external/mod.rs index 7cd4e41663..dd27d49e01 100644 --- a/common/src/api/external/mod.rs +++ b/common/src/api/external/mod.rs @@ -2607,8 +2607,8 @@ pub struct SwitchPortRouteConfig { /// over an 802.1Q tagged L2 segment. pub vlan_id: Option, - /// Local preference indicating priority within and across protocols. - pub local_pref: Option, + /// RIB Priority indicating priority within and across protocols. + pub rib_priority: Option, } /* diff --git a/common/src/api/internal/shared.rs b/common/src/api/internal/shared.rs index 0eb8eb5fb5..7776958254 100644 --- a/common/src/api/internal/shared.rs +++ b/common/src/api/internal/shared.rs @@ -306,9 +306,9 @@ pub struct RouteConfig { /// The VLAN id associated with this route. #[serde(default)] pub vlan_id: Option, - /// The local preference associated with this route. + /// The RIB priority (i.e. Admin Distance) associated with this route. #[serde(default)] - pub local_pref: Option, + pub rib_priority: Option, } #[derive( diff --git a/nexus/db-model/src/schema.rs b/nexus/db-model/src/schema.rs index 779fda0757..acc0565a4f 100644 --- a/nexus/db-model/src/schema.rs +++ b/nexus/db-model/src/schema.rs @@ -188,7 +188,7 @@ table! { dst -> Inet, gw -> Inet, vid -> Nullable, - local_pref -> Nullable, + local_pref -> Nullable, } } diff --git a/nexus/db-model/src/switch_port.rs b/nexus/db-model/src/switch_port.rs index f91f107a11..2420482cce 100644 --- a/nexus/db-model/src/switch_port.rs +++ b/nexus/db-model/src/switch_port.rs @@ -559,7 +559,8 @@ pub struct SwitchPortRouteConfig { pub dst: IpNetwork, pub gw: IpNetwork, pub vid: Option, - pub local_pref: Option, + #[diesel(column_name = local_pref)] + pub rib_priority: Option, } impl SwitchPortRouteConfig { @@ -569,9 +570,9 @@ impl SwitchPortRouteConfig { dst: IpNetwork, gw: IpNetwork, vid: Option, - local_pref: Option, + rib_priority: Option, ) -> Self { - Self { port_settings_id, interface_name, dst, gw, vid, local_pref } + Self { port_settings_id, interface_name, dst, gw, vid, rib_priority } } } @@ -583,7 +584,7 @@ impl Into for SwitchPortRouteConfig { dst: self.dst.into(), gw: self.gw.into(), vlan_id: self.vid.map(Into::into), - local_pref: self.local_pref.map(Into::into), + rib_priority: self.rib_priority.map(Into::into), } } } diff --git a/nexus/db-queries/src/db/datastore/switch_port.rs b/nexus/db-queries/src/db/datastore/switch_port.rs index 59748aa4db..61335ccab4 100644 --- a/nexus/db-queries/src/db/datastore/switch_port.rs +++ b/nexus/db-queries/src/db/datastore/switch_port.rs @@ -1237,7 +1237,7 @@ async fn do_switch_port_settings_create( route.dst.into(), route.gw.into(), route.vid.map(Into::into), - route.local_pref.map(Into::into), + route.rib_priority.map(Into::into), )); } } diff --git a/nexus/src/app/background/tasks/sync_switch_configuration.rs b/nexus/src/app/background/tasks/sync_switch_configuration.rs index fae97233c3..3d3ad84627 100644 --- a/nexus/src/app/background/tasks/sync_switch_configuration.rs +++ b/nexus/src/app/background/tasks/sync_switch_configuration.rs @@ -71,6 +71,10 @@ const PHY0: &str = "phy0"; // before breaking to check for shutdown conditions. const BGP_SESSION_RESOLUTION: u64 = 100; +// This is the default RIB Priority used for static routes. This mirrors +// the const defined in maghemite in rdb/src/lib.rs. +const DEFAULT_RIB_PRIORITY_STATIC: u8 = 1; + pub struct SwitchPortSettingsManager { datastore: Arc, resolver: Resolver, @@ -978,7 +982,7 @@ impl BackgroundTask for SwitchPortSettingsManager { destination: r.dst.into(), nexthop: r.gw.ip(), vlan_id: r.vid.map(|x| x.0), - local_pref: r.local_pref.map(|x| x.0), + rib_priority: r.rib_priority.map(|x| x.0), }) .collect(), switch: *location, @@ -1497,8 +1501,7 @@ fn build_sled_agent_clients( sled_agent_clients } -type SwitchStaticRoutes = - HashSet<(Ipv4Addr, Prefix4, Option, Option)>; +type SwitchStaticRoutes = HashSet<(Ipv4Addr, Prefix4, Option, Option)>; fn static_routes_to_del( current_static_routes: HashMap, @@ -1514,11 +1517,12 @@ fn static_routes_to_del( // if it's on the switch but not desired (in our db), it should be removed let stale_routes = routes_on_switch .difference(routes_wanted) - .map(|(nexthop, prefix, vlan_id, local_pref)| StaticRoute4 { + .map(|(nexthop, prefix, vlan_id, rib_priority)| StaticRoute4 { nexthop: *nexthop, prefix: *prefix, vlan_id: *vlan_id, - local_pref: *local_pref, + rib_priority: rib_priority + .unwrap_or(DEFAULT_RIB_PRIORITY_STATIC), }) .collect::>(); @@ -1532,11 +1536,12 @@ fn static_routes_to_del( // if no desired routes are present, all routes on this switch should be deleted let stale_routes = routes_on_switch .iter() - .map(|(nexthop, prefix, vlan_id, local_pref)| StaticRoute4 { + .map(|(nexthop, prefix, vlan_id, rib_priority)| StaticRoute4 { nexthop: *nexthop, prefix: *prefix, vlan_id: *vlan_id, - local_pref: *local_pref, + rib_priority: rib_priority + .unwrap_or(DEFAULT_RIB_PRIORITY_STATIC), }) .collect::>(); @@ -1583,11 +1588,12 @@ fn static_routes_to_add( }; let missing_routes = routes_wanted .difference(routes_on_switch) - .map(|(nexthop, prefix, vlan_id, local_pref)| StaticRoute4 { + .map(|(nexthop, prefix, vlan_id, rib_priority)| StaticRoute4 { nexthop: *nexthop, prefix: *prefix, vlan_id: *vlan_id, - local_pref: *local_pref, + rib_priority: rib_priority + .unwrap_or(DEFAULT_RIB_PRIORITY_STATIC), }) .collect::>(); @@ -1640,7 +1646,7 @@ fn static_routes_in_db( nexthop, prefix, route.vid.map(|x| x.0), - route.local_pref.map(|x| x.0), + route.rib_priority.map(|x| x.0), )); } @@ -1819,46 +1825,49 @@ async fn static_routes_on_switch<'a>( let mut routes_on_switch = HashMap::new(); for (location, client) in mgd_clients { - let static_routes: SwitchStaticRoutes = match client - .static_list_v4_routes() - .await - { - Ok(routes) => { - let mut flattened = HashSet::new(); - for (destination, paths) in routes.iter() { - let Ok(dst) = destination.parse() else { - error!( - log, - "failed to parse static route destination: \ + let static_routes: SwitchStaticRoutes = + match client.static_list_v4_routes().await { + Ok(routes) => { + let mut flattened = HashSet::new(); + for (destination, paths) in routes.iter() { + let Ok(dst) = destination.parse() else { + error!( + log, + "failed to parse static route destination: \ {destination}" - ); - continue; - }; - for p in paths.iter() { - let nh = match p.nexthop { - IpAddr::V4(addr) => addr, - IpAddr::V6(addr) => { - error!( - log, - "ipv6 nexthops not supported: {addr}" - ); - continue; - } + ); + continue; }; - flattened.insert((nh, dst, p.vlan_id, p.local_pref)); + for p in paths.iter() { + let nh = match p.nexthop { + IpAddr::V4(addr) => addr, + IpAddr::V6(addr) => { + error!( + log, + "ipv6 nexthops not supported: {addr}" + ); + continue; + } + }; + flattened.insert(( + nh, + dst, + p.vlan_id, + Some(p.rib_priority), + )); + } } + flattened } - flattened - } - Err(_) => { - error!( - &log, - "unable to retrieve routes from switch"; - "switch_location" => ?location, - ); - continue; - } - }; + Err(_) => { + error!( + &log, + "unable to retrieve routes from switch"; + "switch_location" => ?location, + ); + continue; + } + }; routes_on_switch.insert(*location, static_routes); } routes_on_switch diff --git a/nexus/src/app/rack.rs b/nexus/src/app/rack.rs index bc980bb543..71269ae03c 100644 --- a/nexus/src/app/rack.rs +++ b/nexus/src/app/rack.rs @@ -592,7 +592,7 @@ impl super::Nexus { dst: r.destination, gw: r.nexthop, vid: r.vlan_id, - local_pref: r.local_pref, + rib_priority: r.rib_priority, }) .collect(); diff --git a/nexus/tests/integration_tests/switch_port.rs b/nexus/tests/integration_tests/switch_port.rs index 92c44eddad..6500d7249a 100644 --- a/nexus/tests/integration_tests/switch_port.rs +++ b/nexus/tests/integration_tests/switch_port.rs @@ -148,7 +148,7 @@ async fn test_port_settings_basic_crud(ctx: &ControlPlaneTestContext) { dst: "1.2.3.0/24".parse().unwrap(), gw: "1.2.3.4".parse().unwrap(), vid: None, - local_pref: None, + rib_priority: None, }], }, ); diff --git a/nexus/types/src/external_api/params.rs b/nexus/types/src/external_api/params.rs index f0be0c048f..8ef4409957 100644 --- a/nexus/types/src/external_api/params.rs +++ b/nexus/types/src/external_api/params.rs @@ -1791,7 +1791,7 @@ pub struct Route { /// Local preference for route. Higher preference indictes precedence /// within and across protocols. - pub local_pref: Option, + pub rib_priority: Option, } /// Select a BGP config by a name or id. diff --git a/openapi/bootstrap-agent.json b/openapi/bootstrap-agent.json index 6b4d2093a1..54feaa7325 100644 --- a/openapi/bootstrap-agent.json +++ b/openapi/bootstrap-agent.json @@ -1257,19 +1257,19 @@ } ] }, - "local_pref": { - "nullable": true, - "description": "The local preference associated with this route.", - "default": null, - "type": "integer", - "format": "uint32", - "minimum": 0 - }, "nexthop": { "description": "The nexthop/gateway address.", "type": "string", "format": "ip" }, + "rib_priority": { + "nullable": true, + "description": "The RIB priority (i.e. Admin Distance) associated with this route.", + "default": null, + "type": "integer", + "format": "uint8", + "minimum": 0 + }, "vlan_id": { "nullable": true, "description": "The VLAN id associated with this route.", diff --git a/openapi/nexus-internal.json b/openapi/nexus-internal.json index 8228ffe28e..9226b9d319 100644 --- a/openapi/nexus-internal.json +++ b/openapi/nexus-internal.json @@ -4823,19 +4823,19 @@ } ] }, - "local_pref": { - "nullable": true, - "description": "The local preference associated with this route.", - "default": null, - "type": "integer", - "format": "uint32", - "minimum": 0 - }, "nexthop": { "description": "The nexthop/gateway address.", "type": "string", "format": "ip" }, + "rib_priority": { + "nullable": true, + "description": "The RIB priority (i.e. Admin Distance) associated with this route.", + "default": null, + "type": "integer", + "format": "uint8", + "minimum": 0 + }, "vlan_id": { "nullable": true, "description": "The VLAN id associated with this route.", diff --git a/openapi/nexus.json b/openapi/nexus.json index 963a9896b4..ecaf428404 100644 --- a/openapi/nexus.json +++ b/openapi/nexus.json @@ -18431,11 +18431,11 @@ "type": "string", "format": "ip" }, - "local_pref": { + "rib_priority": { "nullable": true, "description": "Local preference for route. Higher preference indictes precedence within and across protocols.", "type": "integer", - "format": "uint32", + "format": "uint8", "minimum": 0 }, "vid": { @@ -20496,18 +20496,18 @@ "description": "The interface name this route configuration is assigned to.", "type": "string" }, - "local_pref": { - "nullable": true, - "description": "Local preference indicating priority within and across protocols.", - "type": "integer", - "format": "uint32", - "minimum": 0 - }, "port_settings_id": { "description": "The port settings object this route configuration belongs to.", "type": "string", "format": "uuid" }, + "rib_priority": { + "nullable": true, + "description": "RIB Priority indicating priority within and across protocols.", + "type": "integer", + "format": "uint8", + "minimum": 0 + }, "vlan_id": { "nullable": true, "description": "The VLAN identifier for the route. Use this if the gateway is reachable over an 802.1Q tagged L2 segment.", diff --git a/openapi/sled-agent.json b/openapi/sled-agent.json index 375d6321bc..59ec25c253 100644 --- a/openapi/sled-agent.json +++ b/openapi/sled-agent.json @@ -4724,19 +4724,19 @@ } ] }, - "local_pref": { - "nullable": true, - "description": "The local preference associated with this route.", - "default": null, - "type": "integer", - "format": "uint32", - "minimum": 0 - }, "nexthop": { "description": "The nexthop/gateway address.", "type": "string", "format": "ip" }, + "rib_priority": { + "nullable": true, + "description": "The RIB priority (i.e. Admin Distance) associated with this route.", + "default": null, + "type": "integer", + "format": "uint8", + "minimum": 0 + }, "vlan_id": { "nullable": true, "description": "The VLAN id associated with this route.", diff --git a/openapi/wicketd.json b/openapi/wicketd.json index c7f6ea68d8..55db469210 100644 --- a/openapi/wicketd.json +++ b/openapi/wicketd.json @@ -3136,19 +3136,19 @@ } ] }, - "local_pref": { - "nullable": true, - "description": "The local preference associated with this route.", - "default": null, - "type": "integer", - "format": "uint32", - "minimum": 0 - }, "nexthop": { "description": "The nexthop/gateway address.", "type": "string", "format": "ip" }, + "rib_priority": { + "nullable": true, + "description": "The RIB priority (i.e. Admin Distance) associated with this route.", + "default": null, + "type": "integer", + "format": "uint8", + "minimum": 0 + }, "vlan_id": { "nullable": true, "description": "The VLAN id associated with this route.", diff --git a/package-manifest.toml b/package-manifest.toml index acfd2c97d8..1a93e0d165 100644 --- a/package-manifest.toml +++ b/package-manifest.toml @@ -634,10 +634,10 @@ source.repo = "maghemite" # `tools/maghemite_openapi_version`. Failing to do so will cause a failure when # building `ddm-admin-client` (which will instruct you to update # `tools/maghemite_openapi_version`). -source.commit = "c92d6ff85db8992066f49da176cf686acfd8fe0f" +source.commit = "056283eb02b6887fbf27f66a215662520f7c159c" # The SHA256 digest is automatically posted to: # https://buildomat.eng.oxide.computer/public/file/oxidecomputer/maghemite/image//mg-ddm-gz.sha256.txt -source.sha256 = "c33915998894dd36a2d1078f7e13717aa20760924c30640d7647d4791dd5f2ee" +source.sha256 = "973fc43ed3b0727d72e3493339e1fdb69e7cb2767ee4aa27f65c4a2da8f8126b" output.type = "tarball" [package.mg-ddm] @@ -650,10 +650,10 @@ source.repo = "maghemite" # `tools/maghemite_openapi_version`. Failing to do so will cause a failure when # building `ddm-admin-client` (which will instruct you to update # `tools/maghemite_openapi_version`). -source.commit = "c92d6ff85db8992066f49da176cf686acfd8fe0f" +source.commit = "056283eb02b6887fbf27f66a215662520f7c159c" # The SHA256 digest is automatically posted to: # https://buildomat.eng.oxide.computer/public/file/oxidecomputer/maghemite/image//mg-ddm.sha256.txt -source.sha256 = "be9d657ec22a69468b18f2b4d48e55621538eade8b8d3e367a1d8d5cc686cfbe" +source.sha256 = "ed60620a32a35a6885064e7c777369d5092455cd5c1aa240672dfaac05c31f56" output.type = "zone" output.intermediate_only = true @@ -665,10 +665,10 @@ source.repo = "maghemite" # `tools/maghemite_openapi_version`. Failing to do so will cause a failure when # building `ddm-admin-client` (which will instruct you to update # `tools/maghemite_openapi_version`). -source.commit = "c92d6ff85db8992066f49da176cf686acfd8fe0f" +source.commit = "056283eb02b6887fbf27f66a215662520f7c159c" # The SHA256 digest is automatically posted to: # https://buildomat.eng.oxide.computer/public/file/oxidecomputer/maghemite/image//mgd.sha256.txt -source.sha256 = "e000485f7e04ac1cf9b3532b60bcf23598ab980331ba4f1c6788a7e95c1e9ef8" +source.sha256 = "7c10ac7d284ce78e70e652ad91bebf3fee7a2274ee403a09cc986c6ee73cf1eb" output.type = "zone" output.intermediate_only = true diff --git a/schema/rss-sled-plan.json b/schema/rss-sled-plan.json index 5150d9c471..7e8513e1e3 100644 --- a/schema/rss-sled-plan.json +++ b/schema/rss-sled-plan.json @@ -978,21 +978,21 @@ } ] }, - "local_pref": { - "description": "The local preference associated with this route.", + "nexthop": { + "description": "The nexthop/gateway address.", + "type": "string", + "format": "ip" + }, + "rib_priority": { + "description": "The RIB priority (i.e. Admin Distance) associated with this route.", "default": null, "type": [ "integer", "null" ], - "format": "uint32", + "format": "uint8", "minimum": 0.0 }, - "nexthop": { - "description": "The nexthop/gateway address.", - "type": "string", - "format": "ip" - }, "vlan_id": { "description": "The VLAN id associated with this route.", "default": null, diff --git a/sled-agent/src/bootstrap/early_networking.rs b/sled-agent/src/bootstrap/early_networking.rs index abc88d67c1..f147d3144f 100644 --- a/sled-agent/src/bootstrap/early_networking.rs +++ b/sled-agent/src/bootstrap/early_networking.rs @@ -45,6 +45,10 @@ use tokio::time::sleep; const BGP_SESSION_RESOLUTION: u64 = 100; +// This is the default RIB Priority used for static routes. This mirrors +// the const defined in maghemite in rdb/src/lib.rs. +const DEFAULT_RIB_PRIORITY_STATIC: u8 = 1; + /// Errors that can occur during early network setup #[derive(Error, Debug)] pub enum EarlyNetworkSetupError { @@ -631,8 +635,14 @@ impl<'a> EarlyNetworkSetup<'a> { IpAddr::V6(_) => continue, }; let vlan_id = r.vlan_id; - let local_pref = r.local_pref; - let sr = StaticRoute4 { nexthop, prefix, vlan_id, local_pref }; + let rib_priority = r.rib_priority; + let sr = StaticRoute4 { + nexthop, + prefix, + vlan_id, + rib_priority: rib_priority + .unwrap_or(DEFAULT_RIB_PRIORITY_STATIC), + }; rq.routes.list.push(sr); } } diff --git a/sled-agent/src/rack_setup/service.rs b/sled-agent/src/rack_setup/service.rs index fa64a5c06c..ef08c48061 100644 --- a/sled-agent/src/rack_setup/service.rs +++ b/sled-agent/src/rack_setup/service.rs @@ -778,7 +778,7 @@ impl ServiceInner { destination: r.destination, nexthop: r.nexthop, vlan_id: r.vlan_id, - local_pref: r.local_pref, + rib_priority: r.rib_priority, }) .collect(), addresses: config diff --git a/sled-agent/tests/integration_tests/early_network.rs b/sled-agent/tests/integration_tests/early_network.rs index 9b69975054..c0ecc09f12 100644 --- a/sled-agent/tests/integration_tests/early_network.rs +++ b/sled-agent/tests/integration_tests/early_network.rs @@ -126,7 +126,7 @@ fn current_config_example() -> (&'static str, EarlyNetworkConfig) { destination: "10.1.9.32/16".parse().unwrap(), nexthop: "10.1.9.32".parse().unwrap(), vlan_id: None, - local_pref: None, + rib_priority: None, }], addresses: vec!["2001:db8::/96".parse().unwrap()], switch: SwitchLocation::Switch0, diff --git a/sled-agent/tests/output/new-rss-sled-plans/madrid-rss-sled-plan.json b/sled-agent/tests/output/new-rss-sled-plans/madrid-rss-sled-plan.json index 2da814042d..270d926ea8 100644 --- a/sled-agent/tests/output/new-rss-sled-plans/madrid-rss-sled-plan.json +++ b/sled-agent/tests/output/new-rss-sled-plans/madrid-rss-sled-plan.json @@ -129,7 +129,7 @@ "destination": "0.0.0.0/0", "nexthop": "172.20.15.33", "vlan_id": null, - "local_pref": null + "rib_priority": null } ], "addresses": [ @@ -152,7 +152,7 @@ "destination": "0.0.0.0/0", "nexthop": "172.20.15.33", "vlan_id": null, - "local_pref": null + "rib_priority": null } ], "addresses": [ diff --git a/sled-agent/types/src/early_networking.rs b/sled-agent/types/src/early_networking.rs index 755033dc23..46ceb2dbbf 100644 --- a/sled-agent/types/src/early_networking.rs +++ b/sled-agent/types/src/early_networking.rs @@ -323,8 +323,8 @@ pub mod back_compat { pub uplink_cidr: Ipv4Net, /// VLAN id to use for uplink pub uplink_vid: Option, - /// Local preference - pub local_pref: Option, + /// RIB Priority + pub rib_priority: Option, } impl From for PortConfigV2 { @@ -334,7 +334,7 @@ pub mod back_compat { destination: "0.0.0.0/0".parse().unwrap(), nexthop: value.gateway_ip.into(), vlan_id: value.uplink_vid, - local_pref: value.local_pref, + rib_priority: value.rib_priority, }], addresses: vec![UplinkAddressConfig { address: value.uplink_cidr.into(), @@ -477,7 +477,7 @@ mod tests { uplink_port_fec: PortFec::None, uplink_cidr: "192.168.0.1/16".parse().unwrap(), uplink_vid: None, - local_pref: None, + rib_priority: None, }], }), }; @@ -507,7 +507,7 @@ mod tests { destination: "0.0.0.0/0".parse().unwrap(), nexthop: uplink.gateway_ip.into(), vlan_id: None, - local_pref: None, + rib_priority: None, }], addresses: vec![UplinkAddressConfig { address: uplink.uplink_cidr.into(), @@ -553,7 +553,7 @@ mod tests { destination: "0.0.0.0/0".parse().unwrap(), nexthop: "192.168.0.2".parse().unwrap(), vlan_id: None, - local_pref: None, + rib_priority: None, }], addresses: vec!["192.168.0.1/16".parse().unwrap()], switch: SwitchLocation::Switch0, diff --git a/tools/maghemite_ddm_openapi_version b/tools/maghemite_ddm_openapi_version index 0c223c85a8..920e67ac5b 100644 --- a/tools/maghemite_ddm_openapi_version +++ b/tools/maghemite_ddm_openapi_version @@ -1,2 +1,2 @@ -COMMIT="c92d6ff85db8992066f49da176cf686acfd8fe0f" +COMMIT="056283eb02b6887fbf27f66a215662520f7c159c" SHA2="007bfb717ccbc077c0250dee3121aeb0c5bb0d1c16795429a514fa4f8635a5ef" diff --git a/tools/maghemite_mg_openapi_version b/tools/maghemite_mg_openapi_version index 0db6a3b63d..0811251c05 100644 --- a/tools/maghemite_mg_openapi_version +++ b/tools/maghemite_mg_openapi_version @@ -1,2 +1,2 @@ -COMMIT="c92d6ff85db8992066f49da176cf686acfd8fe0f" -SHA2="5b327f213f8f341cf9072d428980f53757b2c6383f684ac80bbccfb1984ffe5f" +COMMIT="056283eb02b6887fbf27f66a215662520f7c159c" +SHA2="28389b4a5fb5d9767b518aacdd09470135aefa2f6704a3b3fb05cd71b21613ae" diff --git a/tools/maghemite_mgd_checksums b/tools/maghemite_mgd_checksums index 2e180a83db..42465a5a34 100644 --- a/tools/maghemite_mgd_checksums +++ b/tools/maghemite_mgd_checksums @@ -1,2 +1,2 @@ -CIDL_SHA256="e000485f7e04ac1cf9b3532b60bcf23598ab980331ba4f1c6788a7e95c1e9ef8" -MGD_LINUX_SHA256="1c3d93bbfbe4ce97af7cb81c13e42a2eea464e18de6827794a55d5bfd971b66c" \ No newline at end of file +CIDL_SHA256="7c10ac7d284ce78e70e652ad91bebf3fee7a2274ee403a09cc986c6ee73cf1eb" +MGD_LINUX_SHA256="be4c6f7375ff3e619102783513348e8769579bd011a85e33779b690759fd0868" diff --git a/wicket-common/src/example.rs b/wicket-common/src/example.rs index 34af11e906..3951520f01 100644 --- a/wicket-common/src/example.rs +++ b/wicket-common/src/example.rs @@ -197,7 +197,7 @@ impl ExampleRackSetupData { destination: "0.0.0.0/0".parse().unwrap(), nexthop: "172.30.0.10".parse().unwrap(), vlan_id: Some(1), - local_pref: None, + rib_priority: None, }], bgp_peers: switch0_port0_bgp_peers, uplink_port_speed: PortSpeed::Speed400G, @@ -215,7 +215,7 @@ impl ExampleRackSetupData { destination: "0.0.0.0/0".parse().unwrap(), nexthop: "172.33.0.10".parse().unwrap(), vlan_id: Some(1), - local_pref: None, + rib_priority: None, }], bgp_peers: switch1_port0_bgp_peers, uplink_port_speed: PortSpeed::Speed400G, diff --git a/wicket/src/cli/rack_setup/config_toml.rs b/wicket/src/cli/rack_setup/config_toml.rs index 17b31e7730..92496e94d5 100644 --- a/wicket/src/cli/rack_setup/config_toml.rs +++ b/wicket/src/cli/rack_setup/config_toml.rs @@ -329,15 +329,15 @@ fn populate_uplink_table(cfg: &UserSpecifiedPortConfig) -> Table { // routes = [] let mut routes_out = Array::new(); for r in routes { - let RouteConfig { destination, nexthop, vlan_id, local_pref } = r; + let RouteConfig { destination, nexthop, vlan_id, rib_priority } = r; let mut route = InlineTable::new(); route.insert("nexthop", string_value(nexthop)); route.insert("destination", string_value(destination)); if let Some(vlan_id) = vlan_id { route.insert("vlan_id", i64_value(i64::from(*vlan_id))); } - if let Some(local_pref) = local_pref { - route.insert("local_pref", i64_value(i64::from(*local_pref))); + if let Some(rib_priority) = rib_priority { + route.insert("rib_priority", i64_value(i64::from(*rib_priority))); } routes_out.push(Value::InlineTable(route)); } diff --git a/wicket/src/ui/panes/rack_setup.rs b/wicket/src/ui/panes/rack_setup.rs index cbf66a1cf3..be299ef022 100644 --- a/wicket/src/ui/panes/rack_setup.rs +++ b/wicket/src/ui/panes/rack_setup.rs @@ -804,34 +804,39 @@ fn rss_config_text<'a>( ], ]; - let routes = routes.iter().map(|r| { - let RouteConfig { destination, nexthop, vlan_id, local_pref } = - r; - - let mut items = vec![ - Span::styled(" • Route : ", label_style), - Span::styled( - format!("{} -> {}", destination, nexthop), - ok_style, - ), - ]; - if let Some(vlan_id) = vlan_id { - items.extend([ - Span::styled(" (vlan_id=", label_style), - Span::styled(vlan_id.to_string(), ok_style), - Span::styled(")", label_style), - ]); - } - if let Some(local_pref) = local_pref { - items.extend([ - Span::styled(" (local_pref=", label_style), - Span::styled(local_pref.to_string(), ok_style), - Span::styled(")", label_style), - ]); - } + let routes = + routes.iter().map(|r| { + let RouteConfig { + destination, + nexthop, + vlan_id, + rib_priority, + } = r; + + let mut items = vec![ + Span::styled(" • Route : ", label_style), + Span::styled( + format!("{} -> {}", destination, nexthop), + ok_style, + ), + ]; + if let Some(vlan_id) = vlan_id { + items.extend([ + Span::styled(" (vlan_id=", label_style), + Span::styled(vlan_id.to_string(), ok_style), + Span::styled(")", label_style), + ]); + } + if let Some(rib_priority) = rib_priority { + items.extend([ + Span::styled(" (rib_priority=", label_style), + Span::styled(rib_priority.to_string(), ok_style), + Span::styled(")", label_style), + ]); + } - items - }); + items + }); let addresses = addresses.iter().map(|a| { let mut items = vec![ diff --git a/wicketd/src/rss_config.rs b/wicketd/src/rss_config.rs index 46ede25eaa..2be098dbc2 100644 --- a/wicketd/src/rss_config.rs +++ b/wicketd/src/rss_config.rs @@ -716,7 +716,7 @@ fn build_port_config( destination: r.destination, nexthop: r.nexthop, vlan_id: r.vlan_id, - local_pref: r.local_pref, + rib_priority: r.rib_priority, }) .collect(), addresses: config