[ovs-dev] [PATCH] bond: Bonds never sleep if carrier changes.

Ethan Jackson ethan at nicira.com
Tue May 17 20:50:56 UTC 2011


The bonding code neglected to call netdev_monitor_poll() on its
monitor during bond_run().  Thus carrier changes would be
permanently queued in the monitor, preventing it from ever allowing
poll_loop to sleep.
---
 lib/bond.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/lib/bond.c b/lib/bond.c
index 2b54052..12cb3be 100644
--- a/lib/bond.c
+++ b/lib/bond.c
@@ -18,6 +18,7 @@
 
 #include "bond.h"
 
+#include <errno.h>
 #include <limits.h>
 #include <stdint.h>
 #include <stdlib.h>
@@ -466,6 +467,16 @@ bond_run(struct bond *bond, struct tag_set *tags, bool lacp_negotiated)
         bond->miimon_next_update = time_msec() + bond->miimon_interval;
     }
 
+    if (bond->monitor) {
+        char *name;
+
+        /* If bond->monitor is not cleared, netdev_monitor_poll_wait() will
+         * never sleep. */
+        while (netdev_monitor_poll(bond->monitor, &name) != EAGAIN) {
+            free(name);
+        }
+    }
+
     /* Enable slaves based on link status and LACP feedback. */
     HMAP_FOR_EACH (slave, hmap_node, &bond->slaves) {
         bond_link_status_update(slave, tags);
-- 
1.7.4.4




More information about the dev mailing list