Add dragonflow legacy node to new datapath

Treat all existing tables as a single legacy application, and add it as
a new application to the new framework.

A special property of this application is that all tables are entry
points and exit points

Change-Id: I1acc94d9800f5c3cb0ebbb8cd298a0b6b9fd94c5
Co-Authored-By: Lihi Wishnitzer <lihiwish@gmail.com>
This commit is contained in:
Dima Kuznetsov 2017-12-24 13:44:41 +02:00 committed by Omer Anson
parent 54ebf8c669
commit 6f94d70ec3
2 changed files with 20 additions and 0 deletions

View File

@ -17,6 +17,7 @@ import stevedore
from dragonflow._i18n import _
from dragonflow import conf as cfg
from dragonflow.controller import app_base
from dragonflow.controller import datapath_layout as dp_layout
LOG = log.getLogger(__name__)
@ -52,6 +53,22 @@ class Datapath(object):
self._dp_allocs = {}
self._public_variables = set()
self.apps = None
# FIXME(oanson) remove when done porting
self._dp_allocs[dp_layout.LEGACY_APP] = self._create_legacy_dp_alloc()
def _create_legacy_dp_alloc(self):
# Create all possible exits and entries
table_offset = cfg.CONF.df.datapath_autoalloc_table_offset
return app_base.DpAlloc(
states=(),
entrypoints={str(x): x for x in range(table_offset)},
exitpoints={str(x): x for x in range(table_offset)},
full_mapping={
'source_port_key': 'reg6',
'destination_port_key': 'reg7',
'network_key': 'metadata',
}
)
def set_up(self, ryu_base, vswitch_api, nb_api, notifier):
"""

View File

@ -15,6 +15,9 @@ import yaml
from dragonflow import conf as cfg
# FIXME(oanson) remove when done porting
LEGACY_APP = 'dragonflow-legacy'
Vertex = collections.namedtuple(
'Vertex',