Skip to content

Commit

Permalink
Set GUID and MAC for VF with default driver loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
pliurh committed Feb 7, 2022
1 parent fb8ced0 commit f21f459
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions pkg/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,7 @@ func configSriovDevice(iface *sriovnetworkv1.Interface, ifaceStatus *sriovnetwor
break
}
}
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
}

if err = unbindDriverIfNeeded(addr, isRdma); err != nil {
return err
}
Expand All @@ -309,6 +303,15 @@ func configSriovDevice(iface *sriovnetworkv1.Interface, ifaceStatus *sriovnetwor
return err
}
}

// only set GUID and MAC for VF with default driver
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 := BindDpdkDriver(addr, driver); err != nil {
glog.Warningf("configSriovDevice(): fail to bind driver %s for device %s", driver, addr)
Expand Down

0 comments on commit f21f459

Please sign in to comment.