Skip to content

Commit

Permalink
netdev-linux: Reduce log level for ENODEV errors getting ifindex
Browse files Browse the repository at this point in the history
These are normal and unavoidable, because the vifs
disappear from the kernel before they are removed them from the OVS
database.

Signed-off-by: Roi Dayan <[email protected]>
Reviewed-by: Paul Blakey <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
roidayan authored and blp committed Aug 9, 2017
1 parent cfc1964 commit 580e115
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/netdev-linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -5438,8 +5438,12 @@ linux_get_ifindex(const char *netdev_name)

error = af_inet_ioctl(SIOCGIFINDEX, &ifr);
if (error) {
VLOG_WARN_RL(&rl, "ioctl(SIOCGIFINDEX) on %s device failed: %s",
netdev_name, ovs_strerror(error));
/* ENODEV probably means that a vif disappeared asynchronously and
* hasn't been removed from the database yet, so reduce the log level
* to INFO for that case. */
VLOG_RL(&rl, error == ENODEV ? VLL_INFO : VLL_ERR,
"ioctl(SIOCGIFINDEX) on %s device failed: %s",
netdev_name, ovs_strerror(error));
return -error;
}
return ifr.ifr_ifindex;
Expand Down

0 comments on commit 580e115

Please sign in to comment.