Adding starter code and solution for p4runtime exercise (#81)
Summary of changes: - Adding the p4runtime starter code and solution. - Adding NO_P4, BMV2_SWITCH_EXE and P4C_ARGS to utils/Makefile - Updated p4runtime/Makefile to use variables - Adding conversion functions for match and action param values - Separating P4Info and P4Runtime libraries - Updating global README and adding p4runtime/README.md - Disabling screen saver on VM GUI - Adding desktop icons for Terminal, Wireshare and Sublime Text - Updating topo.pdf -> png for Markdown viewing in basic_tunnel and p4runtime READMEs
This commit is contained in:
committed by
Robert Soule
parent
ce7c3c372b
commit
3d4a2f5748
@@ -11,10 +11,20 @@ outfile := $(source:.p4=.json)
|
||||
|
||||
compiled_json := $(BUILD_DIR)/$(outfile)
|
||||
|
||||
# Define NO_P4 to start BMv2 without a program
|
||||
ifndef NO_P4
|
||||
run_args += -j $(compiled_json)
|
||||
endif
|
||||
|
||||
# Set BMV2_SWITCH_EXE to override the BMv2 target
|
||||
ifdef BMV2_SWITCH_EXE
|
||||
run_args += -b $(BMV2_SWITCH_EXE)
|
||||
endif
|
||||
|
||||
all: run
|
||||
|
||||
run: build
|
||||
sudo python $(RUN_SCRIPT) -t $(TOPO) -j $(compiled_json)
|
||||
run: build
|
||||
sudo python $(RUN_SCRIPT) -t $(TOPO) $(run_args)
|
||||
|
||||
stop:
|
||||
sudo mn -c
|
||||
@@ -22,7 +32,7 @@ stop:
|
||||
build: dirs $(compiled_json)
|
||||
|
||||
$(BUILD_DIR)/%.json: %.p4
|
||||
$(P4C) --p4v 16 -o $@ $<
|
||||
$(P4C) --p4v 16 $(P4C_ARGS) -o $@ $<
|
||||
|
||||
dirs:
|
||||
mkdir -p $(BUILD_DIR) $(PCAP_DIR) $(LOG_DIR)
|
||||
|
||||
@@ -325,11 +325,11 @@ class ExerciseRunner:
|
||||
- A mininet instance is stored as self.net and self.net.start() has
|
||||
been called.
|
||||
"""
|
||||
self.logger("Starting mininet CLI")
|
||||
for s in self.net.switches:
|
||||
s.describe()
|
||||
for h in self.net.hosts:
|
||||
h.describe()
|
||||
self.logger("Starting mininet CLI")
|
||||
# Generate a message that will be printed by the Mininet CLI to make
|
||||
# interacting with the simple switch a little easier.
|
||||
print('')
|
||||
|
||||
Reference in New Issue
Block a user