Skip to content

Commit

Permalink
Check that VF MAC Address is set when calling NeedToUpdateSriov()
Browse files Browse the repository at this point in the history
Signed-off-by: Vasilis Remmas <vremmas@nvidia.com>
  • Loading branch information
vasrem committed Jan 17, 2024
1 parent 639768d commit f942ac6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions api/v1/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,14 @@ func NeedToUpdateSriov(ifaceSpec *Interface, ifaceStatus *InterfaceExt) bool {
return true
}

if strings.EqualFold(ifaceSpec.LinkType, consts.LinkTypeETH) {
if len(vfStatus.Mac) == 0 {
log.V(2).Info("NeedToUpdateSriov(): VF MAC Address needs update",
"vf", vfStatus.VfID, "current", vfStatus.Mac)
return true
}
}

// this is needed to be sure the admin mac address is configured as expected
if ifaceSpec.ExternallyManaged {
log.V(2).Info("NeedToUpdateSriov(): need to update the device as it's externally manage",
Expand Down

0 comments on commit f942ac6

Please sign in to comment.