Skip to content

Commit

Permalink
Merge branch 'main' into read_only_regions_need_ref_counting_too
Browse files Browse the repository at this point in the history
  • Loading branch information
jmpesp committed Nov 5, 2024
2 parents f52fa63 + 7ca80f1 commit b020b78
Show file tree
Hide file tree
Showing 49 changed files with 994 additions and 162 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/hakari.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
with:
toolchain: stable
- name: Install cargo-hakari
uses: taiki-e/install-action@939f4af9602e15ef93b3329722569cb907a004ff # v2
uses: taiki-e/install-action@4b40a9728e3c110fabe8850443d8bbe69daddb22 # v2
with:
tool: cargo-hakari
- name: Check workspace-hack Cargo.toml is up-to-date
Expand Down
96 changes: 86 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ crucible-common = { git = "https://github.com/oxidecomputer/crucible", rev = "b7
csv = "1.3.0"
curve25519-dalek = "4"
datatest-stable = "0.2.9"
display-error-chain = "0.2.1"
display-error-chain = "0.2.2"
omicron-ddm-admin-client = { path = "clients/ddm-admin-client" }
db-macros = { path = "nexus/db-macros" }
debug-ignore = "1.0.5"
Expand Down Expand Up @@ -638,7 +638,8 @@ wicket-common = { path = "wicket-common" }
wicketd-api = { path = "wicketd-api" }
wicketd-client = { path = "clients/wicketd-client" }
zeroize = { version = "1.8.1", features = ["zeroize_derive", "std"] }
zip = { version = "0.6.6", default-features = false, features = ["deflate","bzip2"] }
# NOTE: Avoid upgrading zip until https://github.com/zip-rs/zip2/issues/231 is resolved
zip = { version = "=2.1.3", default-features = false, features = ["deflate","bzip2"] }
zone = { version = "0.3", default-features = false, features = ["async"] }

# newtype-uuid is set to default-features = false because we don't want to
Expand Down
18 changes: 1 addition & 17 deletions clients/dpd-client/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ use anyhow::Context;
use anyhow::Result;
use omicron_zone_package::config::Config;
use omicron_zone_package::package::PackageSource;
use progenitor::TypePatch;
use quote::quote;
use std::env;
use std::fs;
Expand Down Expand Up @@ -89,22 +88,7 @@ fn main() -> Result<()> {
slog::debug!(state.log, "client response"; "result" => ?result);
}
})
.with_patch("LinkId", &TypePatch::default()
.with_derive("Eq")
.with_derive("PartialEq")
)
.with_patch("LinkCreate", &TypePatch::default()
.with_derive("Eq")
.with_derive("PartialEq")
)
.with_patch("LinkSettings", &TypePatch::default()
.with_derive("Eq")
.with_derive("PartialEq")
)
.with_patch("PortSettings", &TypePatch::default()
.with_derive("Eq")
.with_derive("PartialEq")
)
.with_derive("PartialEq")
)
.generate_tokens(&spec)
.with_context(|| {
Expand Down
1 change: 1 addition & 0 deletions clients/sled-agent-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ progenitor::generate_api!(
BgpConfig = { derives = [Eq, Hash] },
BgpPeerConfig = { derives = [Eq, Hash] },
LldpPortConfig = { derives = [Eq, Hash, PartialOrd, Ord] },
TxEqConfig = { derives = [Eq, Hash] },
OmicronPhysicalDiskConfig = { derives = [Eq, Hash, PartialOrd, Ord] },
PortConfigV2 = { derives = [Eq, Hash] },
RouteConfig = { derives = [Eq, Hash] },
Expand Down
35 changes: 35 additions & 0 deletions common/src/api/external/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2358,6 +2358,10 @@ pub struct SwitchPortSettingsView {
/// Link-layer discovery protocol (LLDP) settings.
pub link_lldp: Vec<LldpLinkConfig>,

/// TX equalization settings. These are optional, and most links will not
/// need them.
pub tx_eq: Vec<Option<TxEqConfig>>,

/// Layer 3 interface settings.
pub interfaces: Vec<SwitchInterfaceConfig>,

Expand Down Expand Up @@ -2500,6 +2504,9 @@ pub struct SwitchPortLinkConfig {
/// link.
pub lldp_link_config_id: Option<Uuid>,

/// The tx_eq configuration id for this link.
pub tx_eq_config_id: Option<Uuid>,

/// The name of this link.
pub link_name: String,

Expand Down Expand Up @@ -2544,6 +2551,34 @@ pub struct LldpLinkConfig {
pub management_ip: Option<oxnet::IpNet>,
}

/// 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>,
}

impl From<crate::api::internal::shared::TxEqConfig> for TxEqConfig {
fn from(x: crate::api::internal::shared::TxEqConfig) -> TxEqConfig {
TxEqConfig {
pre1: x.pre1,
pre2: x.pre2,
main: x.main,
post2: x.post2,
post1: x.post1,
}
}
}

/// Describes the kind of an switch interface.
#[derive(Clone, Debug, Deserialize, JsonSchema, Serialize, PartialEq)]
#[serde(rename_all = "snake_case")]
Expand Down
28 changes: 27 additions & 1 deletion common/src/api/internal/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,24 @@ pub struct LldpPortConfig {
pub management_addrs: Option<Vec<IpAddr>>,
}

/// 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, 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>,
}

#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq, JsonSchema)]
pub struct PortConfigV2 {
/// The set of routes associated with this port.
Expand All @@ -479,6 +497,8 @@ pub struct PortConfigV2 {
pub autoneg: bool,
/// LLDP configuration for this port
pub lldp: Option<LldpPortConfig>,
/// TX-EQ configuration for this port
pub tx_eq: Option<TxEqConfig>,
}

/// A set of switch uplinks.
Expand All @@ -497,11 +517,17 @@ pub struct HostPortConfig {
pub addrs: Vec<UplinkAddressConfig>,

pub lldp: Option<LldpPortConfig>,
pub tx_eq: Option<TxEqConfig>,
}

impl From<PortConfigV2> for HostPortConfig {
fn from(x: PortConfigV2) -> Self {
Self { port: x.port, addrs: x.addresses, lldp: x.lldp.clone() }
Self {
port: x.port,
addrs: x.addresses,
lldp: x.lldp.clone(),
tx_eq: x.tx_eq,
}
}
}

Expand Down
Loading

0 comments on commit b020b78

Please sign in to comment.