When lb-output-action is toggled back to "false" buckets are not being
deleted. Delete them as they will no longer be used.

Add unit test to verify buckets are correctly deleted.

Fixes: 9df65060cf4c ("userspace: Avoid dp_hash recirculation for balance-tcp 
bond mode.")
Cc: vishal.deep.ajm...@ericsson.com

Signed-off-by: Adrian Moreno <amore...@redhat.com>
---
 ofproto/bond.c        | 3 +++
 tests/ofproto-dpif.at | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/ofproto/bond.c b/ofproto/bond.c
index 9947e7531..2466c4d02 100644
--- a/ofproto/bond.c
+++ b/ofproto/bond.c
@@ -490,6 +490,9 @@ bond_reconfigure(struct bond *bond, const struct 
bond_settings *s)
                       "disabled.", bond->name);
         } else {
             bond->use_lb_output_action = s->use_lb_output_action;
+            if (!bond->use_lb_output_action) {
+                bond_del_lb_output_buckets(bond);
+            }
             revalidate = true;
         }
     }
diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
index e3402e7b8..c1455d8aa 100644
--- a/tests/ofproto-dpif.at
+++ b/tests/ofproto-dpif.at
@@ -193,6 +193,10 @@ AT_CHECK([test $(grep -c in_port.5 br1_flows.txt) -gt 24])
 AT_CHECK([test $(grep -c in_port.6 br1_flows.txt) -gt 24])
 AT_CHECK([grep -q lb_output br0_flows.txt])
 
+AT_CHECK([test $(ovs-appctl dpif-netdev/bond-show | grep -c bucket) -eq 256])
+AT_CHECK([ovs-vsctl set Port bond0 other_config:lb-output-action=false])
+OVS_WAIT_UNTIL([test -z "$(ovs-appctl dpif-netdev/bond-show)"])
+
 OVS_VSWITCHD_STOP()
 AT_CLEANUP
 
-- 
2.26.2

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to