Skip to content

Commit

Permalink
Add tfport-data-link timeseries schema and SMF config adds.
Browse files Browse the repository at this point in the history
  • Loading branch information
zeeshanlakhani committed Oct 22, 2024
1 parent ab1f377 commit 6b05001
Show file tree
Hide file tree
Showing 6 changed files with 248 additions and 20 deletions.
2 changes: 1 addition & 1 deletion common/src/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub const MGS_PORT: u16 = 12225;
pub const WICKETD_PORT: u16 = 12226;
pub const BOOTSTRAP_ARTIFACT_PORT: u16 = 12227;
pub const CRUCIBLE_PANTRY_PORT: u16 = 17000;

pub const TFPORTD_PORT: u16 = 12231;
pub const NEXUS_INTERNAL_PORT: u16 = 12221;

/// The port on which Nexus exposes its external API on the underlay network.
Expand Down
132 changes: 132 additions & 0 deletions oximeter/oximeter/schema/tfport-data-link.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
format_version = 1

[target]
name = "tfport_data_link"
description = "A network data link on a tfport interface"
authz_scope = "fleet"

versions = [
{ version = 1, fields = [ "kind", "link_name", "rack_id", "sled_id", "sled_model", "sled_revision", "sled_serial", "switch_id", "switch_fab", "switch_lot", "switch_wafer", "switch_wafer_loc_x", "switch_wafer_loc_y", "switch_model", "switch_revision", "switch_serial", "switch_slot" ] },
]

[fields.kind]
type = "string"
description = "The kind or class of the data link"

[fields.link_name]
type = "string"
description = "Name of the data link"

[fields.rack_id]
type = "uuid"
description = "ID for the link's rack"

[fields.sled_id]
type = "uuid"
description = "ID for the link's sled"

[fields.sled_model]
type = "string"
description = "Model number of the link's sled"

[fields.sled_revision]
type = "u32"
description = "Revision number of the sled"

[fields.sled_serial]
type = "string"
description = "Serial number of the sled"

[fields.switch_id]
type = "uuid"
description = "ID of the switch the link is on"

[fields.switch_fab]
type = "string"
description = "Fabrication plant identifier of the switch the link is on"

[fields.switch_lot]
type = "string"
description = "Lot number of the switch the link is on"

[fields.switch_wafer]
type = "u8"
description = "Wafer number of the switch the link is on"

[fields.switch_wafer_loc_x]
type = "i8"
description = "X-coordinate wafer location of the switch the link is on"

[fields.switch_wafer_loc_y]
type = "i8"
description = "Y-coordinate wafer location of the switch the link is on"

[fields.switch_model]
type = "string"
description = "The model number switch the link is on"

[fields.switch_revision]
type = "u32"
description = "Revision number of the switch the link is on"

[fields.switch_serial]
type = "string"
description = "Serial number of the switch the link is on"

[fields.switch_slot]
type = "u16"
description = "Slot number of the switch the link is on"

[[metrics]]
name = "bytes_sent"
description = "Number of bytes sent on the link"
units = "bytes"
datum_type = "cumulative_u64"
versions = [
{ added_in = 1, fields = [] }
]

[[metrics]]
name = "bytes_received"
description = "Number of bytes received on the link"
units = "bytes"
datum_type = "cumulative_u64"
versions = [
{ added_in = 1, fields = [] }
]

[[metrics]]
name = "packets_sent"
description = "Number of packets sent on the link"
units = "count"
datum_type = "cumulative_u64"
versions = [
{ added_in = 1, fields = [] }
]

[[metrics]]
name = "packets_received"
description = "Number of packets received on the link"
units = "count"
datum_type = "cumulative_u64"
versions = [
{ added_in = 1, fields = [] }
]

[[metrics]]
name = "errors_sent"
description = "Number of errors encountered when sending on the link"
units = "count"
datum_type = "cumulative_u64"
versions = [
{ added_in = 1, fields = [] }
]

[[metrics]]
name = "errors_received"
description = "Number of errors encountered when receiving on the link"
units = "count"
datum_type = "cumulative_u64"
versions = [
{ added_in = 1, fields = [] }
]
12 changes: 6 additions & 6 deletions package-manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -717,8 +717,8 @@ only_for_targets.image = "standard"
# the other `source.*` keys.
source.type = "prebuilt"
source.repo = "dendrite"
source.commit = "b425a6c783b3081613ffa00407f271cae06568c4"
source.sha256 = "5acb29662fa052fc7805716cf761c39bf0cef168c1e33d9fdb259104503203e5"
source.commit = "64f9e655a9270f27449513fea7a3e2c1eda14a95"
source.sha256 = "64a407e75c35589394d252fccf849f6a4b882d1665756643bcf9b18ae91f979d"
output.type = "zone"
output.intermediate_only = true

Expand All @@ -744,8 +744,8 @@ only_for_targets.image = "standard"
# the other `source.*` keys.
source.type = "prebuilt"
source.repo = "dendrite"
source.commit = "b425a6c783b3081613ffa00407f271cae06568c4"
source.sha256 = "2c1f901ac96028264fd904fb197d1aaef522432ad16097d3606321101813dfde"
source.commit = "64f9e655a9270f27449513fea7a3e2c1eda14a95"
source.sha256 = "f3d37c3b540efcdb5f2e7782fe15b75e1e672d7bbf428b4f6366a44d8b273c45"
output.type = "zone"
output.intermediate_only = true

Expand All @@ -764,8 +764,8 @@ only_for_targets.image = "standard"
# the other `source.*` keys.
source.type = "prebuilt"
source.repo = "dendrite"
source.commit = "b425a6c783b3081613ffa00407f271cae06568c4"
source.sha256 = "94d1231d5b4ba5ea3cd7ce90ea0c46d43c87bfdd3e694cc99a78f8578ba1b9f7"
source.commit = "64f9e655a9270f27449513fea7a3e2c1eda14a95"
source.sha256 = "83920ffa3ebeea86cadcc4b7992c35a5c972997923b81714df67e20904b31576"
output.type = "zone"
output.intermediate_only = true

Expand Down
112 changes: 104 additions & 8 deletions sled-agent/src/services.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ use omicron_common::address::LLDP_PORT;
use omicron_common::address::MGS_PORT;
use omicron_common::address::RACK_PREFIX;
use omicron_common::address::SLED_PREFIX;
use omicron_common::address::TFPORTD_PORT;
use omicron_common::address::WICKETD_NEXUS_PROXY_PORT;
use omicron_common::address::WICKETD_PORT;
use omicron_common::address::{
Expand Down Expand Up @@ -2852,17 +2853,68 @@ impl ServiceManager {
SwitchService::Tfport { pkt_source, asic } => {
info!(self.inner.log, "Setting up tfport service");
let mut tfport_config =
PropertyGroupBuilder::new("config")
PropertyGroupBuilder::new("config");

tfport_config = tfport_config
.add_property(
"host",
"astring",
&format!("[{}]", Ipv6Addr::LOCALHOST),
)
.add_property(
"port",
"astring",
&format!("{}", DENDRITE_PORT),
);

if let Some(i) = info {
tfport_config = tfport_config
.add_property(
"rack_id",
"astring",
&i.rack_id.to_string(),
)
.add_property(
"sled_id",
"astring",
&i.config
.sled_identifiers
.sled_id
.to_string(),
)
.add_property(
"sled_model",
"astring",
&i.config
.sled_identifiers
.model
.to_string(),
)
.add_property(
"host",
"sled_revision",
"astring",
&format!("[{}]", Ipv6Addr::LOCALHOST),
&i.config
.sled_identifiers
.revision
.to_string(),
)
.add_property(
"port",
"sled_serial",
"astring",
&format!("{}", DENDRITE_PORT),
&i.config
.sled_identifiers
.serial
.to_string(),
);
}

for address in addresses {
tfport_config = tfport_config.add_property(
"address",
"astring",
&format!("[{}]:{}", address, TFPORTD_PORT),
);
}

let is_gimlet = is_gimlet().map_err(|e| {
Error::Underlay(
Expand Down Expand Up @@ -4501,9 +4553,53 @@ impl ServiceManager {
info!(self.inner.log, "refreshed lldpd service with new configuration")
}
SwitchService::Tfport { .. } => {
// Since tfport and dpd communicate using localhost,
// the tfport service shouldn't need to be
// restarted.
info!(self.inner.log, "configuring tfport service");
if let Some(info) = self.inner.sled_info.get() {
smfh.setprop_default_instance(
"config/rack_id",
info.rack_id,
)?;
smfh.setprop_default_instance(
"config/sled_id",
info.config.sled_identifiers.sled_id,
)?;
smfh.setprop_default_instance(
"config/sled_model",
info.config
.sled_identifiers
.model
.to_string(),
)?;
smfh.setprop_default_instance(
"config/sled_revision",
info.config.sled_identifiers.revision,
)?;
smfh.setprop_default_instance(
"config/sled_serial",
info.config
.sled_identifiers
.serial
.to_string(),
)?;
} else {
info!(
self.inner.log,
"no rack_id/sled_id available yet"
);
}
smfh.delpropvalue_default_instance(
"config/address",
"*",
)?;
for address in &request.addresses {
smfh.addpropvalue_type_default_instance(
"config/address",
&format!("[{}]:{}", address, TFPORTD_PORT),
"astring",
)?;
}
smfh.refresh()?;
info!(self.inner.log, "refreshed tfport service with new configuration")
}
SwitchService::Pumpkind { .. } => {
// Unless we want to plumb through the "only log
Expand Down
4 changes: 2 additions & 2 deletions tools/dendrite_openapi_version
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
COMMIT="b425a6c783b3081613ffa00407f271cae06568c4"
SHA2="20567cfb7028ab9ca08ce9423c9818f9151519dea789c3cb3016bc4cbb3927a4"
COMMIT="64f9e655a9270f27449513fea7a3e2c1eda14a95"
SHA2="b1bcf5ad3c2ce556d861367aa2942340a7ccfe592c83e96dd06923cc151ac26b"
6 changes: 3 additions & 3 deletions tools/dendrite_stub_checksums
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
CIDL_SHA256_ILLUMOS="5acb29662fa052fc7805716cf761c39bf0cef168c1e33d9fdb259104503203e5"
CIDL_SHA256_LINUX_DPD="78c5f9d3a71767e1b1de44ad289ccef5ae79faed8a19e4791f6b32f3f948b4c1"
CIDL_SHA256_LINUX_SWADM="731abee76a514f677bcbd58af42efca3ecdbdd25d03e45419e6b32e3dc04000d"
CIDL_SHA256_ILLUMOS="64a407e75c35589394d252fccf849f6a4b882d1665756643bcf9b18ae91f979d"
CIDL_SHA256_LINUX_DPD="5901ea46e4b147f2d51dc2ed45e1e2c50ae92fdfb45ac17b48c3ecb7103db3dd"
CIDL_SHA256_LINUX_SWADM="ce6de2f619504b21acfa085c5ae258fd57bca06b5d8663fb78ab889d717cc6c2"

0 comments on commit 6b05001

Please sign in to comment.