summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIlya Maximets <i.maximets@ovn.org>2022-10-25 18:37:41 +0200
committerIlya Maximets <i.maximets@ovn.org>2022-11-30 14:42:59 +0100
commitb22c4d84038c3eceab9486984e601b2f979ebe6d (patch)
tree665c770bd038c5164a10af761cd8c3c092a3283a /tests
parentd240f72ad2adb9932b59b8e01f47a93f76c5c93c (diff)
downloadopenvswitch-b22c4d84038c3eceab9486984e601b2f979ebe6d.tar.gz
netdev: Assume default link speed to be 10 Gbps instead of 100 Mbps.
100 Mbps was a fair assumption 13 years ago. Modern days 10 Gbps seems like a good value in case no information is available otherwise. The change mainly affects QoS which is currently limited to 100 Mbps if the user didn't specify 'max-rate' and the card doesn't report the speed or OVS doesn't have a predefined enumeration for the speed reported by the NIC. Calculation of the path cost for STP/RSTP is also affected if OVS is unable to determine the link speed. Lower link speed adapters are typically good at reporting their speed, so chances for overshoot should be low. But newer high-speed adapters, for which there is no speed enumeration or if there are some other issues, will not suffer that much. Acked-by: Mike Pattrick <mkp@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/stp.at14
-rw-r--r--tests/test-rstp.c7
2 files changed, 12 insertions, 9 deletions
diff --git a/tests/stp.at b/tests/stp.at
index 69475843e..a6b6465d1 100644
--- a/tests/stp.at
+++ b/tests/stp.at
@@ -620,10 +620,10 @@ ovs-appctl time/stop
ovs-appctl time/warp 31000 1000
AT_CHECK([ovs-appctl stp/show br0 | grep p1], [0], [dnl
- p1 designated forwarding 19 128.1
+ p1 designated forwarding 2 128.1
])
AT_CHECK([ovs-appctl stp/show br0 | grep p2], [0], [dnl
- p2 designated forwarding 19 128.2
+ p2 designated forwarding 2 128.2
])
# add a stp port
@@ -637,10 +637,10 @@ ovs-appctl netdev-dummy/set-admin-state p3 down
# We should not show the p3 because its link-state is down
AT_CHECK([ovs-appctl stp/show br0 | grep p1], [0], [dnl
- p1 designated forwarding 19 128.1
+ p1 designated forwarding 2 128.1
])
AT_CHECK([ovs-appctl stp/show br0 | grep p2], [0], [dnl
- p2 designated forwarding 19 128.2
+ p2 designated forwarding 2 128.2
])
AT_CHECK([ovs-appctl stp/show br0 | grep p3], [1], [dnl
])
@@ -648,13 +648,13 @@ AT_CHECK([ovs-appctl stp/show br0 | grep p3], [1], [dnl
ovs-appctl netdev-dummy/set-admin-state p3 up
AT_CHECK([ovs-appctl stp/show br0 | grep p1], [0], [dnl
- p1 designated forwarding 19 128.1
+ p1 designated forwarding 2 128.1
])
AT_CHECK([ovs-appctl stp/show br0 | grep p2], [0], [dnl
- p2 designated forwarding 19 128.2
+ p2 designated forwarding 2 128.2
])
AT_CHECK([ovs-appctl stp/show br0 | grep p3], [0], [dnl
- p3 designated listening 19 128.3
+ p3 designated listening 2 128.3
])
diff --git a/tests/test-rstp.c b/tests/test-rstp.c
index 01aeaf847..9c1026ec1 100644
--- a/tests/test-rstp.c
+++ b/tests/test-rstp.c
@@ -107,6 +107,8 @@ send_bpdu(struct dp_packet *pkt, void *port_, void *b_)
dp_packet_delete(pkt);
}
+#define RSTP_PORT_PATH_COST_100M 200000
+
static struct bridge *
new_bridge(struct test_case *tc, int id)
{
@@ -122,6 +124,7 @@ new_bridge(struct test_case *tc, int id)
for (i = 1; i < MAX_PORTS; i++) {
p = rstp_add_port(b->rstp);
rstp_port_set_aux(p, p);
+ rstp_port_set_path_cost(p, RSTP_PORT_PATH_COST_100M);
rstp_port_set_state(p, RSTP_DISABLED);
rstp_port_set_mac_operational(p, true);
}
@@ -544,8 +547,8 @@ test_rstp_main(int argc, char *argv[])
}
get_token();
- path_cost = match(":") ? must_get_int() :
- RSTP_DEFAULT_PORT_PATH_COST;
+ path_cost = match(":") ? must_get_int()
+ : RSTP_PORT_PATH_COST_100M;
if (port_no < bridge->n_ports) {
/* Enable port. */
reinitialize_port(p);