Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dev-tools/rack-init-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ mod tests {
autoneg: false,
lldp: Some(lldp("uplink-0")),
tx_eq: None,
allow_ddm_traffic: false,
};
RackInitializeRequest {
trust_quorum_peers: Some(trust_quorum_peers()),
Expand Down Expand Up @@ -217,6 +218,7 @@ mod tests {
autoneg: false,
lldp: Some(lldp("uplink-0")),
tx_eq: None,
allow_ddm_traffic: false,
};
let mut request = static_bfd_request();
request.rack_network_config = RackNetworkConfig {
Expand Down
8 changes: 8 additions & 0 deletions nexus/mgs-updates/src/test_util/host_phase_2_test_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ mod api_impl {
use sled_agent_types_versions::v33;
use sled_agent_types_versions::v39;
use sled_agent_types_versions::v42;
use sled_agent_types_versions::v47;
use sled_diagnostics::SledDiagnosticsQueryOutput;
use std::collections::BTreeMap;
use std::collections::BTreeSet;
Expand Down Expand Up @@ -772,6 +773,13 @@ mod api_impl {
unimplemented!()
}

async fn write_network_bootstore_config_v47(
_rqctx: RequestContext<Self::Context>,
_body: TypedBody<v47::system_networking::WriteNetworkConfigRequest>,
) -> Result<HttpResponseUpdatedNoContent, HttpError> {
unimplemented!()
}

async fn write_network_bootstore_config_v42(
_rqctx: RequestContext<Self::Context>,
_body: TypedBody<v42::system_networking::WriteNetworkConfigRequest>,
Expand Down
1 change: 1 addition & 0 deletions nexus/switch-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ pub fn build_rack_network_config(
management_addrs: c.management_ip.map(|ip| vec![ip]),
}),
tx_eq,
allow_ddm_traffic: false,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't necessarily a blocker for this PR, but might impact testing - IIUC, as written, RSS will write any allow_ddm_traffic: true values from the RSS config into the bootstore when it does it initial population of it. But once Nexus starts running, the sync_switch_configuration bg task will send down new bootstore contents with this false set on every port, so you may lose the ddm traffic as soon as Nexus gets started running bg tasks.

};

ports.push(port_config);
Expand Down
5 changes: 5 additions & 0 deletions openapi/bootstrap-agent-lockstep.json
Original file line number Diff line number Diff line change
Expand Up @@ -2425,6 +2425,11 @@
"$ref": "#/components/schemas/UplinkAddressConfig"
}
},
"allow_ddm_traffic": {
"description": "Whether or not to allow DDM traffic on this port",
"default": false,
"type": "boolean"
},
"autoneg": {
"description": "Whether or not to set autonegotiation",
"default": false,
Expand Down
5 changes: 5 additions & 0 deletions openapi/nexus-lockstep.json
Original file line number Diff line number Diff line change
Expand Up @@ -8249,6 +8249,11 @@
"$ref": "#/components/schemas/UplinkAddressConfig"
}
},
"allow_ddm_traffic": {
"description": "Whether or not to allow DDM traffic on this port",
"default": false,
"type": "boolean"
},
"autoneg": {
"description": "Whether or not to set autonegotiation",
"default": false,
Expand Down
1 change: 1 addition & 0 deletions openapi/sled-agent/sled-agent-46.0.0-1baf31.json.gitstub
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
53852bb2a26daa794e73d58810d7eb1a07a38f6b:openapi/sled-agent/sled-agent-46.0.0-1baf31.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://oxide.computer",
"email": "api@oxide.computer"
},
"version": "46.0.0"
"version": "47.0.0"
},
"paths": {
"/artifacts": {
Expand Down Expand Up @@ -8264,6 +8264,11 @@
"$ref": "#/components/schemas/UplinkAddressConfig"
}
},
"allow_ddm_traffic": {
"description": "Whether or not to allow DDM traffic on this port",
"default": false,
"type": "boolean"
},
"autoneg": {
"description": "Whether or not to set autonegotiation",
"default": false,
Expand Down
2 changes: 1 addition & 1 deletion openapi/sled-agent/sled-agent-latest.json
20 changes: 17 additions & 3 deletions sled-agent/api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use omicron_common::api::internal::{
use sled_agent_types_versions::{
latest, v1, v4, v6, v7, v9, v10, v11, v12, v14, v16, v17, v18, v20, v22,
v24, v25, v26, v28, v29, v30, v31, v32, v33, v34, v37, v39, v40, v41, v42,
v43,
v43, v47,
};
use sled_diagnostics::SledDiagnosticsQueryOutput;
use slog_error_chain::InlineErrorChain;
Expand All @@ -39,6 +39,7 @@ api_versions!([
// | example for the next person.
// v
// (next_int, IDENT),
(47, ALLOW_DDM_TRAFFIC),
(46, MODIFY_SVC_STATE_ENUM),
(45, REMOVE_UPLINK_ENSURE),
(44, PROPOLIS_NVME_VWC),
Expand Down Expand Up @@ -996,7 +997,7 @@ pub trait SledAgentApi {
// -------------------------------------------------------------------------
fn static_assert_latest_write_network_config_type() {
static_assertions::assert_type_eq_all!(
v42::system_networking::WriteNetworkConfigRequest,
v47::system_networking::WriteNetworkConfigRequest,
latest::system_networking::WriteNetworkConfigRequest
);
}
Expand All @@ -1006,7 +1007,20 @@ pub trait SledAgentApi {
#[endpoint {
method = PUT,
path = "/network-bootstore-config",
versions = VERSION_NON_EMPTY_UPLINK_PORTS..,
versions = VERSION_ALLOW_DDM_TRAFFIC..,
operation_id = "write_network_bootstore_config",
}]
async fn write_network_bootstore_config_v47(
rqctx: RequestContext<Self::Context>,
body: TypedBody<v47::system_networking::WriteNetworkConfigRequest>,
) -> Result<HttpResponseUpdatedNoContent, HttpError>;

// As described above, this must not forward to newer versions; sled-agent
// must implement this by faithfully serializing the requested version.
#[endpoint {
method = PUT,
path = "/network-bootstore-config",
versions = VERSION_NON_EMPTY_UPLINK_PORTS..VERSION_ALLOW_DDM_TRAFFIC,
operation_id = "write_network_bootstore_config",
}]
async fn write_network_bootstore_config_v42(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ fn main() {
system_description: None,
management_addrs: None,
}),
allow_ddm_traffic: false,
}])
.expect("port list is non-empty"),
bgp: vec![BgpConfig {
Expand Down
1 change: 1 addition & 0 deletions sled-agent/multirack-join/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,7 @@ mod tests {
autoneg: false,
lldp: None,
tx_eq: None,
allow_ddm_traffic: false,
}];

RackNetworkConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ fn port_config(
autoneg,
lldp: None,
tx_eq: None,
allow_ddm_traffic: false,
}
}

Expand Down Expand Up @@ -679,6 +680,7 @@ impl TestInput {
autoneg: false,
lldp: None,
tx_eq: None,
allow_ddm_traffic: false,
}])
} else {
rack_config(switch0.chain(switch1).collect())
Expand Down Expand Up @@ -839,6 +841,7 @@ fn diffable_to_port_config(
routes: Vec::new(),
bgp_peers: Vec::new(),
lldp: None,
allow_ddm_traffic: false,
}
}

Expand Down
1 change: 1 addition & 0 deletions sled-agent/scrimlet-reconcilers/src/handle/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ impl<T: MgsFlavor> Harness<T> {
autoneg: false,
lldp: None,
tx_eq: None,
allow_ddm_traffic: false,
}])
.unwrap()
}
Expand Down
2 changes: 2 additions & 0 deletions sled-agent/scrimlet-reconcilers/src/lldpd_reconciler/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ impl TestSetup {
autoneg: false,
lldp: Some(config.clone()),
tx_eq: None,
allow_ddm_traffic: false,
});
}

Expand All @@ -173,6 +174,7 @@ impl TestSetup {
autoneg: false,
lldp: None,
tx_eq: None,
allow_ddm_traffic: false,
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ fn any_uplink_ports() -> UplinkPorts {
autoneg: false,
lldp: None,
tx_eq: None,
allow_ddm_traffic: false,
}])
.unwrap()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ fn port_config(
autoneg: false,
lldp: None,
tx_eq: None,
allow_ddm_traffic: false,
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ fn port_config(switch: SwitchSlot, routes: Vec<RouteConfig>) -> PortConfig {
autoneg: false,
lldp: None,
tx_eq: None,
allow_ddm_traffic: false,
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ fn any_uplink_ports() -> UplinkPorts {
autoneg: false,
lldp: None,
tx_eq: None,
allow_ddm_traffic: false,
}])
.unwrap()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ impl TestSetup {
autoneg: false,
lldp: None,
tx_eq: None,
allow_ddm_traffic: false,
});
}

Expand All @@ -145,6 +146,7 @@ impl TestSetup {
autoneg: false,
lldp: None,
tx_eq: None,
allow_ddm_traffic: false,
});
}

Expand Down
27 changes: 25 additions & 2 deletions sled-agent/src/http_entrypoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ use trust_quorum_types::messages::{
use trust_quorum_types::status::{CommitStatus, CoordinatorStatus, NodeStatus};

// Fixed identifiers for prior versions only
use sled_agent_types_versions::{v1, v20, v25, v26, v30, v33, v39, v42};
use sled_agent_types_versions::{v1, v20, v25, v26, v30, v33, v39, v42, v47};
use sled_diagnostics::{
SledDiagnosticsCommandHttpOutput, SledDiagnosticsQueryOutput,
};
Expand Down Expand Up @@ -949,6 +949,7 @@ impl SledAgentApi for SledAgentImpl {
use v30::early_networking::EarlyNetworkConfigBody as BodyV30;
use v33::system_networking::SystemNetworkingConfig as BodyV33;
use v39::system_networking::SystemNetworkingConfig as BodyV39;
use v42::system_networking::SystemNetworkingConfig as BodyV42;
type LatestEnvelope = EarlyNetworkConfigEnvelope;

let sa = rqctx.context();
Expand Down Expand Up @@ -976,7 +977,9 @@ impl SledAgentApi for SledAgentImpl {
))
})?;
let body = BodyV20::from(BodyV26::from(BodyV30::from(
BodyV33::from(BodyV39::from(latest_version_body)),
BodyV33::from(BodyV39::from(BodyV42::from(
latest_version_body,
))),
)));
v20::early_networking::EarlyNetworkConfig {
generation: config.generation,
Expand All @@ -997,6 +1000,26 @@ impl SledAgentApi for SledAgentImpl {
.await
}

async fn write_network_bootstore_config_v47(
rqctx: RequestContext<Self::Context>,
body: TypedBody<v47::system_networking::WriteNetworkConfigRequest>,
) -> Result<HttpResponseUpdatedNoContent, HttpError> {
let sa = rqctx.context();
let bs = sa.bootstore();
let body = body.into_inner();
let config = EarlyNetworkConfigEnvelope::from(&body.body)
.serialize_to_bootstore_with_generation(body.generation);

bs.update_network_config(config).await.map_err(|e| {
HttpError::for_internal_error(format!(
"failed to write updated config to boot store: {}",
InlineErrorChain::new(&e),
))
})?;

Ok(HttpResponseUpdatedNoContent())
}

async fn write_network_bootstore_config_v42(
rqctx: RequestContext<Self::Context>,
body: TypedBody<v42::system_networking::WriteNetworkConfigRequest>,
Expand Down
17 changes: 16 additions & 1 deletion sled-agent/src/sim/http_entrypoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ use sled_agent_types_versions::v30;
use sled_agent_types_versions::v33;
use sled_agent_types_versions::v39;
use sled_agent_types_versions::v42;
use sled_agent_types_versions::v47;
use sled_diagnostics::SledDiagnosticsQueryOutput;
use slog_error_chain::InlineErrorChain;
use std::collections::BTreeMap;
Expand Down Expand Up @@ -404,6 +405,7 @@ impl SledAgentApi for SledAgentSimImpl {
use v30::early_networking::EarlyNetworkConfigBody as BodyV30;
use v33::system_networking::SystemNetworkingConfig as BodyV33;
use v39::system_networking::SystemNetworkingConfig as BodyV39;
use v42::system_networking::SystemNetworkingConfig as BodyV42;

let config =
rqctx.context().bootstore_network_config.lock().unwrap().clone();
Expand All @@ -427,7 +429,7 @@ impl SledAgentApi for SledAgentSimImpl {
// Downconvert from the current version to the v20 version we have to
// return from this endpoint.
let body = BodyV20::from(BodyV26::from(BodyV30::from(BodyV33::from(
BodyV39::from(latest_version_body),
BodyV39::from(BodyV42::from(latest_version_body)),
))));

Ok(HttpResponseOk(v20::early_networking::EarlyNetworkConfig {
Expand All @@ -437,6 +439,19 @@ impl SledAgentApi for SledAgentSimImpl {
}))
}

async fn write_network_bootstore_config_v47(
rqctx: RequestContext<Self::Context>,
body: TypedBody<v47::system_networking::WriteNetworkConfigRequest>,
) -> Result<HttpResponseUpdatedNoContent, HttpError> {
let mut config =
rqctx.context().bootstore_network_config.lock().unwrap();
let body = body.into_inner();

*config = EarlyNetworkConfigEnvelope::from(&body.body)
.serialize_to_bootstore_with_generation(body.generation);
Ok(HttpResponseUpdatedNoContent())
}

async fn write_network_bootstore_config_v42(
rqctx: RequestContext<Self::Context>,
body: TypedBody<v42::system_networking::WriteNetworkConfigRequest>,
Expand Down
Loading
Loading