Skip to content

Commit

Permalink
Merge PR snabbco#829 (Markdown on demand) into max-next
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/Makefile
  • Loading branch information
eugeneia committed Mar 17, 2016
2 parents 0c1415a + 35a2422 commit fbe95a0
Show file tree
Hide file tree
Showing 68 changed files with 285 additions and 2,678 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ obj
/src/syscall
/deps/*.vsn
/src/programs.inc
.images
Binary file removed src/.images/Architecture.png
Binary file not shown.
Binary file removed src/.images/Network.png
Binary file not shown.
23 changes: 11 additions & 12 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ CSRC = $(shell find . -regex '[^\#]*\.c' -not -regex './arch/.*' -printf '%P '
CHDR = $(shell find . -regex '[^\#]*\.h' -printf '%P ')
ASM = $(shell find . -regex '[^\#]*\.dasl' -printf '%P ')
ARCHSRC= $(shell find . -regex '^./arch/[^\#]*\.c' -printf '%P ')
RMSRC = $(shell find . -name '*.src.md' -printf '%P ')
RMSRC = $(shell find . -name '*.md' -not -regex './obj.*' -printf '%P ')
# regexp is to include program/foo but not program/foo/bar
PROGRAM = $(shell find program -regex '^[^/]+/[^/]+' -type d -printf '%P ')
# sort to eliminate potential duplicate of programs.inc
Expand All @@ -30,7 +30,7 @@ ARCHOBJ:= $(patsubst %.c,obj/%_c.o, $(ARCHSRC))
ASMOBJ := $(patsubst %.dasl,obj/%_dasl.o, $(ASM))
JITOBJS:= $(patsubst %,obj/jit_%.o,$(JITSRC))
EXTRAOBJS := obj/jit_tprof.o obj/jit_vmprof.o obj/strict.o
RMOBJS := $(patsubst %.src.md,%.md,$(RMSRC))
RMOBJS := $(patsubst %,obj/%,$(RMSRC))
INCOBJ := $(patsubst %.inc,obj/%_inc.o, $(INCSRC))
EXE := bin/snabb $(patsubst %,bin/%,$(PROGRAM))

Expand Down Expand Up @@ -110,7 +110,7 @@ $(TESTSCRIPTS): testlog snabb
) \
)

$(OBJDIR) bin testlog:
$(OBJDIR) bin testlog $(OBJDIR/doc):
$(E) "DIR $@"
$(Q) mkdir -p $@

Expand Down Expand Up @@ -151,8 +151,7 @@ $(JITOBJS): obj/jit_%.o: ../lib/luajit/src/jit/%.lua $(OBJDIR)
$(E) "LUA $@"
$(Q) luajit -bg -n $(patsubst obj/jit_%.o, jit.%, $@) $< $@


$(RMOBJS): %.md: %.src.md
$(RMOBJS): obj/%: %
$(E) "MARKDOWN $@"
$(Q) scripts/process-markdown $< > $@

Expand Down Expand Up @@ -184,20 +183,20 @@ obj/jit_vmprof.o: extra/vmprof.c | $(OBJDIR)

book: doc/snabbswitch.pdf doc/snabbswitch.html doc/snabbswitch.epub

doc/snabbswitch.md: markdown Makefile doc/genbook.sh
obj/doc/snabbswitch.markdown: snabb markdown Makefile doc/genbook.sh
(cd doc; ./genbook.sh) > $@

doc/snabbswitch.pdf: doc/snabbswitch.md
obj/doc/snabbswitch.pdf: obj/doc/snabbswitch.markdown
$(E) "PANDOC $@"
$(Q) (cd doc; pandoc --template=template.latex --latex-engine=lualatex -V fontsize=10pt -V monofont=droidsansmono -V monoscale=.70 -V verbatimspacing=.85 -V mainfont=droidserif -V sansfont=droidsans -V documentclass:book -V geometry:top=1.0in -V geometry:bottom=0.75in -S --toc --chapters -o snabbswitch.pdf snabbswitch.md)
$(Q) (cd doc; pandoc --template=template.latex --latex-engine=lualatex -V fontsize=10pt -V monofont=droidsansmono -V monoscale=.70 -V verbatimspacing=.85 -V mainfont=droidserif -V sansfont=droidsans -V documentclass:book -V geometry:top=1.0in -V geometry:bottom=0.75in -S --toc --chapters -o ../$@ ../$<)

doc/snabbswitch.html: doc/snabbswitch.md
obj/doc/snabbswitch.html: obj/doc/snabbswitch.markdown
$(E) "PANDOC $@"
$(Q) (cd doc; pandoc --self-contained --css="style.css" -S -s --toc --chapters -o snabbswitch.html snabbswitch.md)
$(Q) (cd doc; pandoc --self-contained --css="style.css" -S -s --toc --chapters -o ../$@ ../$<)

doc/snabbswitch.epub: doc/snabbswitch.md
obj/doc/snabbswitch.epub: obj/doc/snabbswitch.markdown
$(E) "PANDOC $@"
$(Q) (cd doc; pandoc --self-contained --css="style.css" -S -s --toc --chapters -o snabbswitch.epub snabbswitch.md)
$(Q) (cd doc; pandoc --self-contained --css="style.css" -S -s --toc --chapters -o ../$@ ../$<)

CLEAN = snabb snabbswitch obj bin doc/snabbswitch.* doc/.images/* testlog programs.inc

Expand Down
30 changes: 28 additions & 2 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,18 @@ quickly realize your network designs and its really fast too!
Furthermore, Snabb Switch is extensible and encourages you to grow the
ecosystem to match your requirements.

![Architecture](.images/Architecture.png)
DIAGRAM: Architecture
+---------------------+
| Your Network Design |
+----*-----*-----*----+
| | |

(Built in and custom Apps and Libraries)

| | |
+-----*-----*-----*-----+
| Snabb Switch Core |
+-----------------------+

The Snabb Switch Core forms a runtime environment (*engine*) which
executes your *design*. A design is simply a Lua script used to drive the
Expand All @@ -22,7 +33,22 @@ you might expect. Apps, on the other hand, are code objects that
implement a specific interface, which is used by the Snabb Switch engine
to organize an *App Network*.

![Network](.images/Network.png)
DIAGRAM: Network
+---------+
| |
+->* Filter0 *--+
| | | |
| +---------+ |
+---+----+ | | +----+---+
| *--+ +->* |
| NIC0 | | NIC1 |
| *<-+ +--* |
+---+----+ | | +----+---+
| +---------+ |
| | | |
+--* Filter1 *<-+
| |
+---------+

Usually, a Snabb Switch design will create a series of apps, interconnect
these in a desired way using *links* and finally pass the resulting app
Expand Down
Loading

0 comments on commit fbe95a0

Please sign in to comment.