mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +00:00
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>
This commit is contained in:
@@ -2668,7 +2668,7 @@ htb_parse_qdisc_details__(struct netdev *netdev,
|
||||
enum netdev_features current;
|
||||
|
||||
netdev_get_features(netdev, ¤t, 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, ¤t, 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;
|
||||
|
Reference in New Issue
Block a user