Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cxl-host): fix syntax error and improve ci #47

Merged
merged 2 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ jobs:

- name: Generate support files
run: make generate

- name: Format Golang
run: if [ "$(gofmt -l . | wc -l)" -gt 0 ]; then exit 1; fi

- name: Build Golang
- name: Build cfm-service & cfm-cli (Golang)
run: make build-go

- name: Build cxl-host (Golang)
working-directory: ./cmd/cxl-host
run: make local
48 changes: 24 additions & 24 deletions cmd/cxl-host/service/cxl_host_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ func (s *CxlHostApiService) RedfishV1AccountServiceGet(ctx context.Context) (red
},
ServiceEnabled: &enabled,
Status: redfishapi.ResourceStatus{
Health: &resourcehealthOk,
State: &resourcestateEnabled,
Health: resourcehealthOk,
State: resourcestateEnabled,
},
}

Expand Down Expand Up @@ -272,8 +272,8 @@ func (s *CxlHostApiService) RedfishV1ChassisChassisIdGet(ctx context.Context, ch
// },
SerialNumber: &uuid,
Status: redfishapi.ResourceStatus{
Health: &resourcehealthOk,
State: &resourcestateEnabled,
Health: resourcehealthOk,
State: resourcestateEnabled,
},
UUID: uuid,
Version: &version,
Expand Down Expand Up @@ -346,8 +346,8 @@ func (s *CxlHostApiService) RedfishV1ChassisChassisIdMemoryMemoryIdGet(ctx conte
Enabled: true,
Name: memoryId,
Status: redfishapi.ResourceStatus{
Health: &resourcehealthOk,
State: &resourcestateEnabled,
Health: resourcehealthOk,
State: resourcestateEnabled,
},
}

Expand Down Expand Up @@ -395,8 +395,8 @@ func (s *CxlHostApiService) RedfishV1FabricsFabricIdGet(ctx context.Context, fab
Name: fabricId + " Fabric",
Oem: nil,
Status: redfishapi.ResourceStatus{
Health: &resourcehealthOk,
State: &resourcestateEnabled,
Health: resourcehealthOk,
State: resourcestateEnabled,
},
Switches: redfishapi.OdataV4IdRef{
OdataId: "/redfish/v1/Fabrics/" + fabricId + "/Switches",
Expand Down Expand Up @@ -458,8 +458,8 @@ func (s *CxlHostApiService) RedfishV1FabricsFabricIdSwitchesSwitchIdGet(ctx cont
RedundancyodataCount: 1,
SerialNumber: &serial,
Status: redfishapi.ResourceStatus{
Health: &resourcehealthOk,
State: &resourcestateEnabled,
Health: resourcehealthOk,
State: resourcestateEnabled,
},
SupportedProtocols: []redfishapi.ProtocolProtocol{redfishapi.PROTOCOLPROTOCOL_CXL},
SwitchType: redfishapi.PROTOCOLPROTOCOL_CXL,
Expand Down Expand Up @@ -532,8 +532,8 @@ func (s *CxlHostApiService) RedfishV1FabricsFabricIdSwitchesSwitchIdPortsPortIdG
PortType: redfishapi.PORTV1110PORTTYPE_BIDIRECTIONAL_PORT,
SignalDetected: &detected,
Status: redfishapi.ResourceStatus{
Health: &resourcehealthOk,
State: &resourcestateEnabled,
Health: resourcehealthOk,
State: resourcestateEnabled,
},
}

Expand Down Expand Up @@ -627,8 +627,8 @@ func (s *CxlHostApiService) RedfishV1SessionServiceGet(ctx context.Context) (red
SessionTimeout: int64(SessionTimeout),
Sessions: redfishapi.OdataV4IdRef{OdataId: "/redfish/v1/SessionService/Sessions"},
Status: redfishapi.ResourceStatus{
Health: &resourcehealthOk,
State: &resourcestateEnabled,
Health: resourcehealthOk,
State: resourcestateEnabled,
},
}

Expand Down Expand Up @@ -911,7 +911,7 @@ func (s *CxlHostApiService) RedfishV1ChassisChassisIdPCIeDevicesPCIeDeviceIdCXLL

dev := GetCXLDevInfo(BDtoBDF(pCIeDeviceId))
gcxlid := FormatGCXLID(dev)
fmt := redfishapi.ResourceV1200DurableNameFormat("GCXLID")
fmt := redfishapi.ResourceV1191DurableNameFormat("GCXLID")
resource := redfishapi.CxlLogicalDeviceV111CxlLogicalDevice{
OdataContext: "/redfish/v1/$metadata#CXLLogicalDevice.CXLLogicalDevice",
OdataId: "/redfish/v1/Chassis/" + chassisId + "/PCIeDevices/" + pCIeDeviceId + "/CXLLogicalDevices/" + cXLLogicalDeviceId,
Expand All @@ -936,12 +936,12 @@ func (s *CxlHostApiService) RedfishV1ChassisChassisIdPCIeDevicesPCIeDeviceIdCXLL
Name: "Locally attached CXL Logical Device " + string(dev.GetCxlType()),
SemanticsSupported: []redfishapi.CxlLogicalDeviceV111CxlSemantic{},
Status: redfishapi.ResourceStatus{
Health: &resourcehealthOk,
State: &resourcestateEnabled,
Health: resourcehealthOk,
State: resourcestateEnabled,
},
Identifiers: []redfishapi.ResourceIdentifier{{
DurableName: &gcxlid,
DurableNameFormat: &fmt,
DurableNameFormat: fmt,
}},
}
devCap := dev.GetCxlCap()
Expand Down Expand Up @@ -1032,8 +1032,8 @@ func (s *CxlHostApiService) RedfishV1ChassisChassisIdPCIeDevicesPCIeDeviceIdGet(
OdataId: "/redfish/v1/Chassis/" + chassisId + "/PCIeDevices/" + pCIeDeviceId + "/PCIeFunctions",
},
Status: redfishapi.ResourceStatus{
Health: &resourcehealthOk,
State: &resourcestateEnabled,
Health: resourcehealthOk,
State: resourcestateEnabled,
},
}

Expand Down Expand Up @@ -1118,8 +1118,8 @@ func (s *CxlHostApiService) RedfishV1ChassisChassisIdPCIeDevicesPCIeDeviceIdPCIe
Name: "PCIe Function",
RevisionId: &revisionId,
Status: redfishapi.ResourceStatus{
Health: &resourcehealthOk,
State: &resourcestateEnabled,
Health: resourcehealthOk,
State: resourcestateEnabled,
},
VendorId: &vendorId,
}
Expand Down Expand Up @@ -1464,8 +1464,8 @@ func (s *CxlHostApiService) RedfishV1SystemsComputerSystemIdMemoryMemoryIdGet(ct
Name: "CXL Device memory",
MemoryMedia: []redfishapi.MemoryV1190MemoryMedia{redfishapi.MEMORYV1190MEMORYMEDIA_PROPRIETARY},
Status: redfishapi.ResourceStatus{
Health: &resourcehealthOk,
State: &resourcestateEnabled,
Health: resourcehealthOk,
State: resourcestateEnabled,
},
Links: redfishapi.MemoryV1190Links{
MemoryMediaSources: []redfishapi.OdataV4IdRef{
Expand Down
Loading