Set OpenFlow 1.0, 1.3 and 1.4 by default on bridges

There is a bug in OVS 2.12 where it's impossible to change protocol on
a bridge. This patch should be reverted once OVS is fixed. More
information about the bug at [1].

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1782834

Related-Bug: #1852221

Change-Id: I1ead1eee48a0c56193f20797ab35be36a0458270
This commit is contained in:
Jakub Libosvar authored and Lucas Alvares Gomes committed 2020-01-16 22:13:22 +00:00
1 parent 91a72bdf3b
commit 0643ab44d8
2 files changed
+13 -4

No files matched your search

+9 -1
View File
@@ -237,6 +237,12 @@ class OVSBridge(BaseOVS):
self._default_cookie = generate_random_cookie()
self._highest_protocol_needed = constants.OPENFLOW10
self._min_bw_qos_id = uuidutils.generate_uuid()
# TODO(jlibosva): Revert initial_protocols once launchpad bug 1852221
# is fixed and new openvswitch containing the fix is
# released.
self.initial_protocols = {
constants.OPENFLOW10, constants.OPENFLOW13, constants.OPENFLOW14}
self.initial_protocols.add(self._highest_protocol_needed)
@property
def default_cookie(self):
@@ -275,6 +281,7 @@ class OVSBridge(BaseOVS):
self._highest_protocol_needed = max(self._highest_protocol_needed,
protocol,
key=version_from_protocol)
self.initial_protocols.add(self._highest_protocol_needed)
def set_igmp_snooping_state(self, state):
state = bool(state)
@@ -301,7 +308,8 @@ class OVSBridge(BaseOVS):
# transactions
txn.add(
self.ovsdb.db_add('Bridge', self.br_name,
'protocols', self._highest_protocol_needed))
'protocols',
*self.initial_protocols))
txn.add(
self.ovsdb.db_set('Bridge', self.br_name,
('other_config', other_config)))
@@ -483,11 +483,12 @@ class OVSBridgeTestCase(OVSBridgeTestBase):
def test_db_add_set(self):
protocols = ["OpenFlow10", "OpenFlow11"]
expected = self.br.initial_protocols.union(protocols)
self.br.ovsdb.db_add("Bridge", self.br.br_name, "protocols",
*protocols).execute(check_error=True)
self.assertEqual(protocols,
self.br.db_get_val('Bridge',
self.br.br_name, "protocols"))
self.assertItemsEqual(expected,
self.br.db_get_val('Bridge',
self.br.br_name, "protocols"))
def test_db_add_map(self):
key = "testdata"