There is no need to refresh status and stats for existing devices
if the device mtu is zero as it will be done periodically by
vswitchd.

Signed-off-by: Pravin B Shelar <[email protected]>
---
 vswitchd/bridge.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index 4761cbf..d0f8e3b 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -1129,6 +1129,7 @@ bridge_add_ofproto_ports(struct bridge *br)
 
         LIST_FOR_EACH_SAFE (iface, next_iface, port_elem, &port->ifaces) {
             int error;
+            bool new_iface;
 
             /* Open the netdev. */
             if (!iface->netdev) {
@@ -1167,6 +1168,7 @@ bridge_add_ofproto_ports(struct bridge *br)
             }
 
             /* Add the port, if necessary. */
+            new_iface = false;
             if (iface->netdev && iface->ofp_port < 0) {
                 uint16_t ofp_port;
                 int error;
@@ -1175,6 +1177,7 @@ bridge_add_ofproto_ports(struct bridge *br)
                                          &ofp_port);
                 if (!error) {
                     iface_set_ofp_port(iface, ofp_port);
+                    new_iface = true;
                 } else {
                     netdev_close(iface->netdev);
                     iface->netdev = NULL;
@@ -1182,7 +1185,7 @@ bridge_add_ofproto_ports(struct bridge *br)
             }
 
             /* Populate stats columns in new Interface rows. */
-            if (iface->netdev && !iface->cfg->mtu) {
+            if (new_iface && iface->netdev && !iface->cfg->mtu) {
                 iface_refresh_stats(iface);
                 iface_refresh_status(iface);
             }
-- 
1.7.1

_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to