Skip to content

Commit

Permalink
logging: Reduce device discovering verbosity
Browse files Browse the repository at this point in the history
The `DiscoverSriovDevices` routine produces a huge amount of log entries,
making debugging problems hard.

Remove log entries that can produce a log line for each configured VF and which
does not produce any change in the environment.

Signed-off-by: Andrea Panattoni <[email protected]>
  • Loading branch information
zeeke committed Oct 23, 2024
1 parent 076b22d commit 4734e36
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/host/internal/network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (n *network) TryToGetVirtualInterfaceName(pciAddr string) string {
func (n *network) TryGetInterfaceName(pciAddr string) string {
names, err := n.dputilsLib.GetNetNames(pciAddr)
if err != nil || len(names) < 1 {
log.Log.Error(err, "TryGetInterfaceName(): failed to get interface name")
log.Log.Error(err, "TryGetInterfaceName(): failed to get interface name", "pciAddress", pciAddr)
return ""
}
netDevName := names[0]
Expand Down
2 changes: 0 additions & 2 deletions pkg/host/internal/vdpa/vdpa.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,9 @@ func (v *vdpa) DeleteVDPADevice(pciAddr string) error {
func (v *vdpa) DiscoverVDPAType(pciAddr string) string {
expectedVDPAName := generateVDPADevName(pciAddr)
funcLog := log.Log.WithValues("device", pciAddr, "name", expectedVDPAName)
funcLog.V(2).Info("DiscoverVDPAType() discover device type")
_, err := v.netlinkLib.VDPAGetDevByName(expectedVDPAName)
if err != nil {
if errors.Is(err, syscall.ENODEV) {
funcLog.V(2).Info("DiscoverVDPAType(): VDPA device for VF not found")
return ""
}
if errors.Is(err, syscall.ENOENT) {
Expand Down

0 comments on commit 4734e36

Please sign in to comment.