diff --git a/src/model/service_root.rs b/src/model/service_root.rs index 814772a46..7270acb18 100644 --- a/src/model/service_root.rs +++ b/src/model/service_root.rs @@ -111,7 +111,10 @@ impl ServiceRoot { _ => RedfishVendor::NvidiaDpu, }, "wiwynn" => RedfishVendor::NvidiaGBx00, - "supermicro" => RedfishVendor::Supermicro, + "supermicro" => match self.product.as_deref() { + Some("GB NVL") => RedfishVendor::NvidiaGBx00, + _ => RedfishVendor::Supermicro, + }, "lite-on technology corp." => RedfishVendor::LiteOnPowerShelf, "delta" => RedfishVendor::DeltaPowerShelf, _ => RedfishVendor::Unknown, @@ -138,6 +141,29 @@ mod test { assert_eq!(result.vendor().unwrap(), RedfishVendor::Supermicro); } + #[test] + fn test_supermicro_gb300_service_root() { + // Supermicro GB300 NVL exposes an OpenBMC/NVIDIA GB tree, so it must route + // to the shared GB implementation rather than the AMI Supermicro path. + let result = ServiceRoot { + vendor: Some("Supermicro".to_string()), + product: Some("GB NVL".to_string()), + ..Default::default() + }; + assert_eq!(result.vendor().unwrap(), RedfishVendor::NvidiaGBx00); + } + + #[test] + fn test_supermicro_non_gb_service_root() { + // A classic Supermicro (no GB NVL product) still uses the Supermicro path. + let result = ServiceRoot { + vendor: Some("Supermicro".to_string()), + product: Some("SYS-821GE-TNHR".to_string()), + ..Default::default() + }; + assert_eq!(result.vendor().unwrap(), RedfishVendor::Supermicro); + } + #[test] fn test_nvidia_gb_bmc_service_root() { let result = ServiceRoot { diff --git a/src/nvidia_gbx00.rs b/src/nvidia_gbx00.rs index 0d02aca2b..9959c7d14 100644 --- a/src/nvidia_gbx00.rs +++ b/src/nvidia_gbx00.rs @@ -1340,6 +1340,24 @@ impl Redfish for Bmc { } impl Bmc { + /// Returns true if this is a GB300 platform. + /// + /// The host system model (e.g."GB NVL") can be too vague, so detect via the HGX + /// baseboard model ("GB300 ..."). + #[allow(dead_code)] + async fn is_gb300(&self) -> Result { + let systems: Vec = self + .get_collection(ODataId { + odata_id: "/redfish/v1/Systems".to_string(), + }) + .await + .and_then(|c| c.try_get::())? + .members; + Ok(systems + .iter() + .any(|s| s.model.as_deref().unwrap_or_default().contains("GB300"))) + } + /// Check BIOS and BMC attributes and return differences async fn diff_bios_bmc_attr(&self) -> Result, RedfishError> { let mut diffs = vec![];