Skip to content

Commit

Permalink
Merge branch 'main' into support-bundle-storage-api
Browse files Browse the repository at this point in the history
  • Loading branch information
smklein committed Nov 4, 2024
2 parents d11d6ca + 122eccf commit e565c44
Show file tree
Hide file tree
Showing 46 changed files with 865 additions and 152 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
20 changes: 10 additions & 10 deletions Cargo.lock

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

8 changes: 6 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,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 @@ -395,6 +395,7 @@ hickory-server = "0.24.1"
highway = "1.2.0"
hkdf = "0.12.4"
http = "1.1.0"
http-body = "1.0.1"
http-body-util = "0.1.2"
http-range = "0.1.5"
httpmock = "0.8.0-alpha.1"
Expand Down Expand Up @@ -642,7 +643,10 @@ 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 = "2.1.2", default-features = false, features = ["deflate","bzip2"] }
# NOTE: Avoid upgrading zip until https://github.com/zip-rs/zip2/issues/231 is resolved
# XXX XXX THIS PR IS DOING THIS UPGRADE TO GET ACCESS TO SEEKABLE APIS
# XXX CONSIDER USING https://github.com/bearcove/rc-zip FOR READING
zip = { version = "=2.1.4", 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
12 changes: 6 additions & 6 deletions flake.lock

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

12 changes: 12 additions & 0 deletions nexus/db-model/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ table! {
speed -> crate::SwitchLinkSpeedEnum,
autoneg -> Bool,
lldp_link_config_id -> Nullable<Uuid>,
tx_eq_config_id -> Nullable<Uuid>,
}
}

Expand All @@ -164,6 +165,17 @@ table! {
}
}

table! {
tx_eq_config (id) {
id -> Uuid,
pre1 -> Nullable<Int4>,
pre2 -> Nullable<Int4>,
main -> Nullable<Int4>,
post2 -> Nullable<Int4>,
post1 -> Nullable<Int4>,
}
}

table! {
switch_port_settings_interface_config (id) {
port_settings_id -> Uuid,
Expand Down
3 changes: 2 additions & 1 deletion nexus/db-model/src/schema_versions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use std::collections::BTreeMap;
///
/// This must be updated when you change the database schema. Refer to
/// schema/crdb/README.adoc in the root of this repository for details.
pub const SCHEMA_VERSION: SemverVersion = SemverVersion::new(112, 0, 0);
pub const SCHEMA_VERSION: SemverVersion = SemverVersion::new(113, 0, 0);

/// List of all past database schema versions, in *reverse* order
///
Expand All @@ -29,6 +29,7 @@ static KNOWN_VERSIONS: Lazy<Vec<KnownVersion>> = Lazy::new(|| {
// | leaving the first copy as an example for the next person.
// v
// KnownVersion::new(next_int, "unique-dirname-with-the-sql-files"),
KnownVersion::new(113, "add-tx-eq"),
KnownVersion::new(112, "blueprint-dataset"),
KnownVersion::new(111, "drop-omicron-zone-underlay-address"),
KnownVersion::new(110, "clickhouse-policy"),
Expand Down
Loading

0 comments on commit e565c44

Please sign in to comment.