fix: parse Inspur PCIe CPU affinity

This commit is contained in:
Mikhail Chusavitin
2026-09-14 10:48:47 +03:00
parent 9ac38c2914
commit 8794e0adec
6 changed files with 140 additions and 54 deletions
+25 -20
View File
@@ -40,6 +40,9 @@ func ParseComponentLog(content []byte, hw *models.HardwareConfig) {
// Parse RESTful Network Adapter info
parseNetworkAdapterInfo(text, hw)
// Combined component.log dumps may be the only PCIe inventory source.
hw.PCIeDevices = MergePCIeDevices(hw.PCIeDevices, ParsePCIeDevices(content))
// Extract firmware from all components
extractComponentFirmware(text, hw)
}
@@ -517,25 +520,26 @@ type NetworkAdapterRESTInfo struct {
}
type sysAdapter struct {
ID int `json:"id"`
Name string `json:"name"`
Location string `json:"Location"`
Present int `json:"present"`
Slot int `json:"slot"`
PcieBus int `json:"pcie_bus"`
PcieDev int `json:"pcie_dev"`
PcieFunc int `json:"pcie_func"`
VendorID int `json:"vendor_id"`
DeviceID int `json:"device_id"`
Vendor string `json:"vendor"`
Model string `json:"model"`
FwVer string `json:"fw_ver"`
Status string `json:"status"`
SN string `json:"sn"`
PN string `json:"pn"`
PortNum int `json:"port_num"`
PortType string `json:"port_type"`
Ports []struct {
ID int `json:"id"`
Name string `json:"name"`
Location string `json:"Location"`
DeviceLocator string `json:"location"`
Present int `json:"present"`
Slot int `json:"slot"`
PcieBus int `json:"pcie_bus"`
PcieDev int `json:"pcie_dev"`
PcieFunc int `json:"pcie_func"`
VendorID int `json:"vendor_id"`
DeviceID int `json:"device_id"`
Vendor string `json:"vendor"`
Model string `json:"model"`
FwVer string `json:"fw_ver"`
Status string `json:"status"`
SN string `json:"sn"`
PN string `json:"pn"`
PortNum int `json:"port_num"`
PortType string `json:"port_type"`
Ports []struct {
ID int `json:"id"`
MacAddr string `json:"mac_addr"`
} `json:"ports"`
@@ -579,7 +583,7 @@ func parseNetworkAdapterInfo(text string, hw *models.HardwareConfig) {
}
base := models.NetworkAdapter{
Location: adapter.Location,
Location: inspurFirstNonEmpty(adapter.Location, adapter.DeviceLocator),
Present: adapter.Present == 1,
Model: model,
Vendor: vendor,
@@ -591,6 +595,7 @@ func parseNetworkAdapterInfo(text string, hw *models.HardwareConfig) {
PortCount: adapter.PortNum,
PortType: adapter.PortType,
Status: adapter.Status,
NUMANode: parseInspurCPUAffinity(adapter.Location, adapter.DeviceLocator),
}
// If another source (asset.json PcieInfo) already recorded this card's PCI