diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index ca8ad4f10b..e76abaaa6c 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -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