aboutsummaryrefslogtreecommitdiff
path: root/lib/netdev-linux.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2012-11-03 18:00:39 -0700
committerBen Pfaff <blp@nicira.com>2012-11-03 18:00:39 -0700
commitd02a5f8ea4e1da19ccc4f903026b77649472b236 (patch)
tree103e396780d581af6e7f062400dfde59aa455ec6 /lib/netdev-linux.c
parent8087f5ff825cae3a699e5a60ca6dd0deb10fc8e5 (diff)
ofproto: Report 0 Mbps when speed not available instead of 100 Mbps.
When a link is down, or when a link has no speed because it is not a physical interface, Open vSwitch previously reported that its rate is 100 Mbps as a default. This is counterintuitive, however, so this commit changes Open vSwitch behavior to report 0 Mbps when a link is down or its speed is otherwise unavailable. Bug #13388. Reported-by: Hiroshi Tanaka <htanaka@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/netdev-linux.c')
-rw-r--r--lib/netdev-linux.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
index 412a92de..0460c069 100644
--- a/lib/netdev-linux.c
+++ b/lib/netdev-linux.c
@@ -2668,7 +2668,7 @@ htb_parse_qdisc_details__(struct netdev *netdev,
enum netdev_features current;
netdev_get_features(netdev, &current, NULL, NULL, NULL);
- hc->max_rate = netdev_features_to_bps(current) / 8;
+ hc->max_rate = netdev_features_to_bps(current, 100 * 1000 * 1000) / 8;
}
hc->min_rate = hc->max_rate;
hc->burst = 0;
@@ -3147,7 +3147,7 @@ hfsc_parse_qdisc_details__(struct netdev *netdev, const struct smap *details,
enum netdev_features current;
netdev_get_features(netdev, &current, NULL, NULL, NULL);
- max_rate = netdev_features_to_bps(current) / 8;
+ max_rate = netdev_features_to_bps(current, 100 * 1000 * 1000) / 8;
}
class->min_rate = max_rate;