Thanks for the improvement, this looks much better.

I should keep reminding myself about using the thread-safety annotations.

In the V2 patch, the writer of 'enabled_slaves'  does not grab the mutex.
 I add the
following change to comply with the comments and will apply it soon,

diff --git a/ofproto/bond.c b/ofproto/bond.c
index 482f265..546e35b 100644
--- a/ofproto/bond.c
+++ b/ofproto/bond.c
@@ -1358,11 +1358,13 @@ bond_enable_slave(struct bond_slave *slave, bool
enable)
         slave->bond->bond_revalidate = true;
         slave->enabled = enable;

+        ovs_mutex_lock(&slave->bond->mutex);
         if (enable) {
             list_insert(&slave->bond->enabled_slaves, &slave->list_node);
         } else {
             list_remove(&slave->list_node);
         }
+        ovs_mutex_unlock(&slave->bond->mutex);

         VLOG_INFO("interface %s: %s", slave->name,
                   slave->enabled ? "enabled" : "disabled");
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to