Commit 467baf48 authored by Mihai Budiu's avatar Mihai Budiu Committed by Brenden Blanco

fixed bugs in control-flow generation

Signed-off-by: default avatarBrenden Blanco <bblanco@plumgrid.com>
parent 8a04fb39
......@@ -483,12 +483,10 @@ class EbpfProgram(object):
done = set()
while len(nodestoadd) > 0:
todo = nodestoadd.pop()
if todo is None:
todo = nextEntryPoint
if todo is None:
continue
if todo in done:
continue
if todo is None:
continue
print("Generating ", todo.name)
......@@ -503,3 +501,6 @@ class EbpfProgram(object):
for e in self.entryPoints:
todo.add(e)
self.generatePipelineInternal(serializer, todo, self.egressEntry)
todo = set()
todo.add(self.egressEntry)
self.generatePipelineInternal(serializer, todo, None)
......@@ -365,6 +365,12 @@ class EbpfTable(object):
serializer.newline()
serializer.blockEnd(True)
if not "hit" in nextNode:
# Catch-all
serializer.emitIndent()
serializer.appendFormat("goto end;")
serializer.newline()
serializer.blockEnd(True)
def runAction(self, serializer, tableName, valueName, program, nextNode):
......
......@@ -86,4 +86,3 @@ class Graph(object):
return None
return topo_sorting
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment