vswitchd: Instrument lacp_update_ifaces().
[openvswitch] / vswitchd / bridge.c
index 0111040809f9c8658524c82012fe825e569234ec..b4f7a2ef90ab8e4b6414ec2da19fe693b08dfd7b 100644 (file)
@@ -76,6 +76,7 @@ VLOG_DEFINE_THIS_MODULE(bridge);
 COVERAGE_DEFINE(bridge_flush);
 COVERAGE_DEFINE(bridge_process_flow);
 COVERAGE_DEFINE(bridge_reconfigure);
+COVERAGE_DEFINE(bridge_lacp_update);
 
 enum lacp_status {
     LACP_STATUS_CURRENT,  /* Partner is up to date. */
@@ -3129,13 +3130,17 @@ lacp_update_ifaces(struct port *port)
     size_t i;
     struct iface *lead;
     struct lacp_info lead_pri;
+    static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 10);
 
     port->lacp_need_update = false;
+    COVERAGE_INC(bridge_lacp_update);
 
     if (!port->lacp) {
         return;
     }
 
+    VLOG_DBG_RL(&rl, "port %s: re-evaluating LACP link status", port->name);
+
     lead = NULL;
     for (i = 0; i < port->n_ifaces; i++) {
         struct iface *iface = port->ifaces[i];
@@ -3147,7 +3152,6 @@ lacp_update_ifaces(struct port *port)
         /* Don't allow loopback interfaces to send traffic or lead. */
         if (eth_addr_equals(iface->lacp_partner.sysid,
                             iface->lacp_actor.sysid)) {
-            static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 10);
             VLOG_WARN_RL(&rl, "iface %s: Loopback detected. Interface is "
                          "connected to its own bridge", iface->name);
             iface->lacp_attached = false;
@@ -3778,10 +3782,10 @@ bond_unixctl_show(struct unixctl_conn *conn,
                   bond_mode_to_string(port->bond_mode));
 
     if (port->lacp) {
-        ds_put_format(&ds, "\tlacp: %s\n",
+        ds_put_format(&ds, "lacp: %s\n",
                       port->lacp & LACP_ACTIVE ? "active" : "passive");
     } else {
-        ds_put_cstr(&ds, "\tlacp: off\n");
+        ds_put_cstr(&ds, "lacp: off\n");
     }
 
     if (port->bond_mode != BM_AB) {
@@ -3812,7 +3816,7 @@ bond_unixctl_show(struct unixctl_conn *conn,
         struct flow flow;
 
         /* Basic info. */
-        ds_put_format(&ds, "slave %s: %s\n",
+        ds_put_format(&ds, "\nslave %s: %s\n",
                       iface->name, iface->enabled ? "enabled" : "disabled");
         if (j == port->active_iface) {
             ds_put_cstr(&ds, "\tactive slave\n");
@@ -3880,7 +3884,7 @@ bond_unixctl_show(struct unixctl_conn *conn,
 
             ds_put_cstr(&ds, "\tpartner state: ");
             ds_put_lacp_state(&ds, iface->lacp_partner.state);
-            ds_put_cstr(&ds, "\n\n");
+            ds_put_cstr(&ds, "\n");
         }
 
         if (port->bond_mode == BM_AB) {