Skip to content

Commit

Permalink
Merge pull request #724 from zeeke/fix-pciaddr-err
Browse files Browse the repository at this point in the history
Fix `undefined: pciAddr`
  • Loading branch information
adrianchiris committed Jun 25, 2024
2 parents 73f0ac6 + c7c1edb commit 43bfa6c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/host/internal/sriov/sriov.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func (s *sriov) getVfInfo(vfAddr string, pfName string, eswitchMode string, devi
vf.Mac = link.Attrs().HardwareAddr.String()
}
}
vf.GUID = s.networkHelper.GetNetDevNodeGUID(pciAddr)
vf.GUID = s.networkHelper.GetNetDevNodeGUID(vfAddr)

for _, device := range devices {
if vfAddr == device.Address {
Expand Down
4 changes: 4 additions & 0 deletions pkg/host/internal/sriov/sriov_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ var _ = Describe("SRIOV", func() {
EncapType: "ether",
}).MinTimes(1)
hostMock.EXPECT().GetNetDevLinkSpeed("enp216s0f0np0").Return("100000 Mb/s")
hostMock.EXPECT().GetNetDevLinkAdminState("enp216s0f0np0").Return("up")
hostMock.EXPECT().GetNetDevNodeGUID("0000:d8:00.2").Return("guid1")
storeManagerMode.EXPECT().LoadPfsStatus("0000:d8:00.0").Return(nil, false, nil)

dputilsLibMock.EXPECT().IsSriovPF("0000:d8:00.0").Return(true)
Expand Down Expand Up @@ -130,6 +132,7 @@ var _ = Describe("SRIOV", func() {
NumVfs: 1,
LinkSpeed: "100000 Mb/s",
LinkType: "ETH",
LinkAdminState: "up",
EswitchMode: "switchdev",
ExternallyManaged: false,
TotalVfs: 1,
Expand All @@ -143,6 +146,7 @@ var _ = Describe("SRIOV", func() {
Mtu: 1500,
VfID: 0,
RepresentorName: "enp216s0f0np0_0",
GUID: "guid1",
}},
}))
})
Expand Down

0 comments on commit 43bfa6c

Please sign in to comment.