diff mbox series

[ovs-dev,v2] ofproto/bond: Preserve active bond member over restarts

Message ID 20240821200101.19082-1-jonathan.davies@nutanix.com
State Superseded
Headers show
Series [ovs-dev,v2] ofproto/bond: Preserve active bond member over restarts | expand

Checks

Context Check Description
ovsrobot/apply-robot warning apply and check: warning
ovsrobot/github-robot-_Build_and_Test success github build: passed

Commit Message

Jonathan Davies Aug. 21, 2024, 8:01 p.m. UTC
The OVS DB has a bond_active_slave field. This gets read by
port_configure_bond() into struct bond_settings' active_member_mac
field. See commit 3e5aeeb5 ("bridge: Keep bond active slave selection
across OVS restart") for the original rationale for preserving the
active bond member.

But since commit 30353934 ("ofproto/bond: Validate active-slave mac.")
the bond_settings' active_member_mac field is ignored by bond_create(),
which set bond->active_member_mac to eth_addr_zero.

Instead, set it to the value of the bond_settings' active_member_mac so
that the selection is preserved across OVS restarts.

Fixes: 3035393488 ("ofproto/bond: Validate active-slave mac.")
Signed-off-by: Jonathan Davies <jonathan.davies@nutanix.com>
---
 ofproto/bond.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/ofproto/bond.c b/ofproto/bond.c
index c31869a4c..0858de374 100644
--- a/ofproto/bond.c
+++ b/ofproto/bond.c
@@ -246,7 +246,7 @@  bond_create(const struct bond_settings *s, struct ofproto_dpif *ofproto)
     ovs_refcount_init(&bond->ref_cnt);
     hmap_init(&bond->pr_rule_ops);
 
-    bond->active_member_mac = eth_addr_zero;
+    bond->active_member_mac = s->active_member_mac;
     bond->active_member_changed = false;
     bond->primary = NULL;