Skip to content

Commit

Permalink
Only set VF GUID and MAC for when VFs are created
Browse files Browse the repository at this point in the history
Changing other VF driver type or other parameter will no longer
trigger setting GUID and MAC
  • Loading branch information
pliurh committed Feb 8, 2022
1 parent cc777c4 commit cf74fae
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pkg/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,15 @@ func configSriovDevice(iface *sriovnetworkv1.Interface, ifaceStatus *sriovnetwor
break
}
}
if strings.EqualFold(iface.LinkType, "IB") {
if err = setVfGuid(addr, pfLink); err != nil {
if iface.NumVfs != ifaceStatus.NumVfs {
// only set VF GUID and MAC for when VFs are created
if strings.EqualFold(iface.LinkType, "IB") {
if err = setVfGuid(addr, pfLink); err != nil {
return err
}
} else if err = setVfAdminMac(addr, pfLink); err != nil {
return err
}
} else if err = setVfAdminMac(addr, pfLink); err != nil {
return err
}
if err = unbindDriverIfNeeded(addr, isRdma); err != nil {
return err
Expand Down

0 comments on commit cf74fae

Please sign in to comment.