netdev: Don't log a warning for unsupported ethtool operations.
authorBen Pfaff <blp@nicira.com>
Fri, 6 Mar 2009 18:58:13 +0000 (10:58 -0800)
committerBen Pfaff <blp@nicira.com>
Fri, 6 Mar 2009 18:58:13 +0000 (10:58 -0800)
Plenty of devices don't support ethtool, and we don't use ethtool for
anything essential, so there's no point in logging a warning here.

lib/netdev.c

index 95d3d2c3ef7b7f5ce0a95ce31931f216faa62044..f754cad3b563506879c03c108354ba0ddb87444f 100644 (file)
@@ -203,8 +203,14 @@ do_ethtool(struct netdev *netdev, struct ethtool_cmd *ecmd,
     if (ioctl(netdev->netdev_fd, SIOCETHTOOL, &ifr) == 0) {
         return 0;
     } else {
-        VLOG_WARN_RL(&rl, "ethtool command %s on network device %s failed: %s",
-                     cmd_name, netdev->name, strerror(errno));
+        if (errno != EOPNOTSUPP) {
+            VLOG_WARN_RL(&rl, "ethtool command %s on network device %s "
+                         "failed: %s", cmd_name, netdev->name,
+                         strerror(errno));
+        } else {
+            /* The device doesn't support this operation.  That's pretty
+             * common, so there's no point in logging anything. */
+        }
         return errno;
     }
 }