Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce config-daemon logging verbosity #468

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion pkg/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package utils

import (
"bytes"
"errors"
"fmt"
"io/ioutil"
"math/rand"
Expand Down Expand Up @@ -666,7 +667,7 @@ func unbindDriverIfNeeded(vfAddr string, isRdma bool) error {
}

func getLinkType(ifaceStatus sriovnetworkv1.InterfaceExt) string {
glog.Infof("getLinkType(): Device %s", ifaceStatus.PciAddress)
glog.V(2).Infof("getLinkType(): Device %s", ifaceStatus.PciAddress)
if ifaceStatus.Name != "" {
link, err := netlink.LinkByName(ifaceStatus.Name)
if err != nil {
Expand Down Expand Up @@ -720,10 +721,16 @@ func generateRandomGUID() net.HardwareAddr {

func GetNicSriovMode(pciAddress string) (string, error) {
glog.V(2).Infof("GetNicSriovMode(): device %s", pciAddress)

devLink, err := netlink.DevLinkGetDeviceByName("pci", pciAddress)
adrianchiris marked this conversation as resolved.
Show resolved Hide resolved
if err != nil {
if errors.Is(err, syscall.ENODEV) {
// the device doesn't support devlink
return "", nil
}
return "", err
}

return devLink.Attrs.Eswitch.Mode, nil
}

Expand Down
Loading