It should be an administrator task to bring up devices as they
are configured properly.

Currently, Fedora is deleting the bridges when the interface is
brought down. Therefore, there is no bridge on the next boot and
the initscripts can apply the networking configuration properly
for a new bridge.

However, if the system didn't execute ifdown for some reason, the
bridge is left in the ovsdb and since internal ports are brought
up by default, there is no way for initscripts to known if the
adminitrator has already configured it or not.

This patch reverts commit bef071a5fdf8e2dd87677b04b3cf7a8f5094edcb
(bridge: Always "up" internal devices.).

Signed-off-by: Flavio Leitner <f...@redhat.com>
---
 NEWS                  |  3 +++
 tests/ofproto-dpif.at |  4 ++--
 tests/ofproto.at      | 16 ++++++++--------
 vswitchd/bridge.c     |  3 +--
 4 files changed, 14 insertions(+), 12 deletions(-)

Changelog:
v3 - Moved NEWS entry to the top
     Used a more verbose explanation
     Fixed unit-tests

v2 - added a comment in the NEWS file

Extra info about status change:
http://www.sflow.org/sflow_version_5.txt
[...]
unsigned int ifStatus; /* bit field with the following bits assigned
                        bit 0 = ifAdminStatus (0 = down, 1 = up)
                        bit 1 = ifOperStatus (0 = down, 1 = up) */

diff --git a/NEWS b/NEWS
index 4f88e3b..9255778 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
 Post-v2.1.0
 ---------------------
+   - Internal ports are no longer brought up by default, because it
+     should be an administrator task to bring up devices as they are
+     configured properly.
    - ovs-vsctl now reports when ovs-vswitchd fails to create a new port or
      bridge.
    - The "ovsdbmonitor" graphical tool has been removed, because it was
diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
index af5fd8f..409ede6 100644
--- a/tests/ofproto-dpif.at
+++ b/tests/ofproto-dpif.at
@@ -2950,7 +2950,7 @@ IFCOUNTERS
        type=6
        ifspeed=100000000
        direction=0
-       status=3
+       status=0
        in_octets=0
        in_unicasts=0
        in_multicasts=0
@@ -3019,7 +3019,7 @@ IFCOUNTERS
        type=6
        ifspeed=100000000
        direction=0
-       status=3
+       status=0
        in_octets=0
        in_unicasts=0
        in_multicasts=0
diff --git a/tests/ofproto.at b/tests/ofproto.at
index 8656d98..63f7003 100644
--- a/tests/ofproto.at
+++ b/tests/ofproto.at
@@ -38,8 +38,8 @@ n_tables:254, n_buffers:256
 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
 actions: OUTPUT SET_VLAN_VID SET_VLAN_PCP STRIP_VLAN SET_DL_SRC SET_DL_DST 
SET_NW_SRC SET_NW_DST SET_NW_TOS SET_TP_SRC SET_TP_DST ENQUEUE
  LOCAL(br0): addr:aa:55:aa:55:00:00
-     config:     0
-     state:      0
+     config:     PORT_DOWN
+     state:      LINK_DOWN
      speed: 0 Mbps now, 0 Mbps max
 OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0
 ])
@@ -68,8 +68,8 @@ actions: OUTPUT SET_VLAN_VID SET_VLAN_PCP STRIP_VLAN 
SET_DL_SRC SET_DL_DST SET_N
      state:      LINK_DOWN
      speed: 0 Mbps now, 0 Mbps max
  LOCAL(br0): addr:aa:55:aa:55:00:0x
-     config:     0
-     state:      0
+     config:     PORT_DOWN
+     state:      LINK_DOWN
      speed: 0 Mbps now, 0 Mbps max
 OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0
 ])
@@ -109,8 +109,8 @@ AT_CHECK([ovs-ofctl -vwarn dump-ports-desc br0], [0], 
[stdout])
 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
 OFPST_PORT_DESC reply:
  LOCAL(br0): addr:aa:55:aa:55:00:00
-     config:     0
-     state:      0
+     config:     PORT_DOWN
+     state:      LINK_DOWN
      speed: 0 Mbps now, 0 Mbps max
 ])
 OVS_VSWITCHD_STOP
@@ -124,8 +124,8 @@ AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-ports-desc 
br0], [0], [stdout])
 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
 OFPST_PORT_DESC reply (OF1.2):
  LOCAL(br0): addr:aa:55:aa:55:00:00
-     config:     0
-     state:      0
+     config:     PORT_DOWN
+     state:      LINK_DOWN
      speed: 0 Mbps now, 0 Mbps max
 ])
 OVS_VSWITCHD_STOP
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index db85856..b2a81a7 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -1446,8 +1446,7 @@ iface_do_create(const struct bridge *br,
     VLOG_INFO("bridge %s: added interface %s on port %d",
               br->name, iface_cfg->name, *ofp_portp);
 
-    if ((port_cfg->vlan_mode && !strcmp(port_cfg->vlan_mode, "splinter"))
-        || iface_is_internal(iface_cfg, br->cfg)) {
+    if (port_cfg->vlan_mode && !strcmp(port_cfg->vlan_mode, "splinter")) {
         netdev_turn_flags_on(netdev, NETDEV_UP, NULL);
     }
 
-- 
1.8.5.3

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to