Skip to content

Commit

Permalink
Merge pull request #299 from adrianchiris/reset-vfs-on-error-u
Browse files Browse the repository at this point in the history
Generic Plugin Reset interface on error
  • Loading branch information
adrianchiris authored May 9, 2022
2 parents 26fb2b6 + facabb2 commit ca9bc8a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/utils/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func BindDefaultDriver(pciAddr string) error {
}
err = ioutil.WriteFile(sysBusPciDriversProbe, []byte(pciAddr), os.ModeAppend)
if err != nil {
glog.Errorf("BindDpdkDriver(): fail to bind driver for device %s: %s", pciAddr, err)
glog.Errorf("BindDefaultDriver(): fail to bind driver for device %s: %s", pciAddr, err)
return err
}

Expand Down
7 changes: 5 additions & 2 deletions pkg/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,10 @@ func SyncNodeState(newState *sriovnetworkv1.SriovNetworkNodeState) error {
break
}
if err = configSriovDevice(&iface, &ifaceStatus); err != nil {
glog.Errorf("SyncNodeState(): fail to config sriov interface %s: %v", iface.PciAddress, err)
glog.Errorf("SyncNodeState(): fail to configure sriov interface %s: %v. resetting interface.", iface.PciAddress, err)
if resetErr := resetSriovDevice(ifaceStatus); resetErr != nil {
glog.Errorf("SyncNodeState(): fail to reset on error SR-IOV interface: %s", resetErr)
}
return err
}
break
Expand Down Expand Up @@ -272,7 +275,7 @@ func configSriovDevice(iface *sriovnetworkv1.Interface, ifaceStatus *sriovnetwor
}
pfLink, err := netlink.LinkByName(iface.Name)
if err != nil {
glog.Errorf("setVfGuid(): unable to get PF link for device %+v %q", iface, err)
glog.Errorf("configSriovDevice(): unable to get PF link for device %+v %q", iface, err)
return err
}

Expand Down

0 comments on commit ca9bc8a

Please sign in to comment.