diff mbox series

[ovs-dev,2/2] dpif-netdev : Fix ALB 'rebalance_intvl' max hard limit.

Message ID MEYP282MB3302EA29F1C81923CFCF9D12CDC49@MEYP282MB3302.AUSP282.PROD.OUTLOOK.COM
State Superseded
Headers show
Series Fix ALB parameters type and value mismatch. | expand

Checks

Context Check Description
ovsrobot/apply-robot fail apply and check: fail
ovsrobot/intel-ovs-compilation fail test: fail

Commit Message

lin huang May 7, 2022, 4:31 p.m. UTC
Currently the pmd-auto-lb-rebal-interval's value was not been
checked properly.
It maybe a negative, or too big value (>2 weeks between rebalances),
which will be lead to a big unsigned value. So reset it to default
if the value exceeds the max permitted as described in vswitchd.xml.

Fixes: 5bf84282482a ("Adding support for PMD auto load balancing")
Signed-off-by: Lin Huang linhuang@ruijie.com.cn<mailto:linhuang@ruijie.com.cn>
---
tests/alb.at | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/tests/alb.at b/tests/alb.at
index 2bef06f39..17bb754ae 100644
--- a/tests/alb.at
+++ b/tests/alb.at
@@ -197,7 +197,25 @@  get_log_next_line_num
AT_CHECK([ovs-vsctl set open_vswitch . other_config:pmd-auto-lb-rebal-interval="0"])
CHECK_ALB_PARAM([interval], [1 mins], [+$LINENUM])
-# No check for above max as it is only a documented max value and not a hard limit
+# Set new value
+get_log_next_line_num
+AT_CHECK([ovs-vsctl set open_vswitch . other_config:pmd-auto-lb-rebal-interval="100"])
+CHECK_ALB_PARAM([interval], [100 mins], [+$LINENUM])
+
+# Set above max value
+get_log_next_line_num
+AT_CHECK([ovs-vsctl set open_vswitch . other_config:pmd-auto-lb-rebal-interval="50000"])
+CHECK_ALB_PARAM([interval], [1 mins], [+$LINENUM])
+
+# Set new value
+get_log_next_line_num
+AT_CHECK([ovs-vsctl set open_vswitch . other_config:pmd-auto-lb-rebal-interval="1000"])
+CHECK_ALB_PARAM([interval], [1000 mins], [+$LINENUM])
+
+# Set Negative value
+get_log_next_line_num
+AT_CHECK([ovs-vsctl set open_vswitch . other_config:pmd-auto-lb-rebal-interval="-1"])
+CHECK_ALB_PARAM([interval], [1 mins], [+$LINENUM])
 OVS_VSWITCHD_STOP
AT_CLEANUP
--
2.27.0