8000 Merge Igalia/lwaftr upstream by wingo · Pull Request #1133 · snabbco/snabb · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Merge Igalia/lwaftr upstream #1133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 778 commits into from
Jun 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
778 commits
Select commit Hold shift + click to select a range
2c6b469
Leader-follower protocol tweaks
wingo Dec 9, 2016
2a510e4
Merge pull request #664 from Igalia/unreadme
kbara Dec 9, 2016
3066149
Cache ctable entry types.
wingo Dec 9, 2016
d182dc5
Make follower not so thirsty
wingo Dec 9, 2016
314ee31
Merge pull request #666 from Igalia/follower-pacing
wingo Dec 9, 2016
951fff8
Show whether a PID is a worker in 'snabb ps'
dpino Dec 9, 2016
98216ef
Sort list of pids
dpino Dec 9, 2016
abb9372
Show PIDs as a tree
dpino Dec 9, 2016
e0c039d
Close pipes before execcing listen
wingo Dec 9, 2016
4fd4aa7
Sketch out Igalia's testing strategy
Dec 9, 2016
c1008a6
Remove useless pcap files (#667)
teknico Dec 9, 2016
10e84dd
Hard wrap at 80
Dec 9, 2016
58315b1
Explained how to test ARP in the wild
Dec 9, 2016
e99ad1a
Hard word wrap at 80 chars for filter perf doc
Dec 9, 2016
2c16488
Fix snabb config listen for get-state.
wingo Dec 9, 2016
3eaf558
Fixed typos, explained modular philosophy
Dec 9, 2016
def9ad0
Mark processes that are addressable by snabb config
dpino Dec 9, 2016
88f3fe7
Merge pull request #670 from Igalia/hardwrapperffilt
kbara Dec 9, 2016
2eb78f6
Merge pull request #669 from Igalia/doctesting
kbara Dec 9, 2016
df3484c
Snabb lwAFTR v3.1.5 change log
wingo Dec 9, 2016
0183f43
Snabb lwAFTR v3.1.5 change log
wingo Dec 9, 2016
d589cf1
Merge pull request #672 from Igalia/changelog-v3.1.5
wingo Dec 9, 2016
f89623d
Merge pull request #671 from Igalia/listen-tweak
wingo Dec 9, 2016
a61e682
Merge pull request #665 from dpino/print-out-worker-info
dpino Dec 9, 2016
1229706
Add basic error reporting to snabb-softwire-v1
Dec 20, 2016
8276021
Fix small cosmetic nits brought in in review
Dec 20, 2016
d1502dc
Merge pull request #685 from Igalia/config-error-reporting
xray7224 Dec 20, 2016
71fab70
Remove .dasl extension
dpino Dec 20, 2016
1533869
Refactor lwaftrctl
dpino Dec 21, 2016
f810dfe
Merge pull request #512 from Igalia/selftest-dasl
kbara Dec 29, 2016
c97fcae
Execute make clean in programs containing a Makefile
dpino Dec 29, 2016
e96d016
Reintroduce lwaftr command
dpino Jan 2, 2017
51290ee
Merge pull request #689 from dpino/refactor-lwaftrctl
dpino Jan 2, 2017
1773310
Replace tabs for spaces
dpino Jan 3, 2017
c00f2c3
Remove unneeded check
dpino Jan 3, 2017
b779a2b
Clean up
dpino Jan 3, 2017
8df0f23
Merge pull request #690 from dpino/clean-lwaftr-object-files
dpino Jan 3, 2017
fb52203
Fix tunnel-path-mtu and tunnel-payload-mtu in ietf-softwire
dpino Dec 30, 2016
86b9835
Remove end-addr in psid-map
dpino Jan 3, 2017
b3fdcaf
Remove end-addr from configuration files
dpino Jan 3, 2017
8f658ce
Merge pull request #696 from dpino/fix-issue-641
dpino Jan 4, 2017
73c6590
Add socket support for snabb config listen
Jan 6, 2017
5b1986d
Fix lwaftr query
Jan 11, 2017
cec2efa
Merge pull request #693 from dpino/parse-empty-string
dpino Jan 12, 2017
dd8ef6c
Add selftest
dpino Jan 11, 2017
ae54a7a
Merge pull request #694 from dpino/fix-issue-677
dpino Jan 12, 2017
6845bca
Fix error on valid 'snabb config set' invocation
dpino Jan 3, 2017
6f806a9
Disabled finding default Snabb instance
Jan 12, 2017
a9d3130
Fix byname printing of stats with --reconfigurable
Jan 12, 2017
8946b8f
Changed tests to work without load
Jan 12, 2017
c70c5a7
Allow querying follower by leader pid
Jan 12, 2017
21f6585
lwaftr query selftest
dpino Jan 13, 2017
7f5c8bb
Merge pull request #711 from dpino/new_fixquery_test
dpino Jan 13, 2017
f4543c1
Don't return bogus values when no pid specified
Jan 13, 2017
8000
407d051
Get the right pid, regardless of counter filters
Jan 13, 2017
6bf6084
Make filtering work with by-name
Jan 13, 2017
72a801e
Test counter name that does not exist
Jan 13, 2017
b051cf9
Addressed nits
Jan 13, 2017
b31d1db
removed print
Jan 13, 2017
2c36f52
Print NYI error for softwire-num-threshold
dpino Jan 13, 2017
13cfede
Merge pull request #710 from Igalia/new_fixquery
kbara Jan 13, 2017
884c938
Fix `snabb config remove` on arrays
takikawa Jan 16, 2017
c6e58c1
Fix typo in `snabb config` README
takikawa Jan 16, 2017
f65be30
Merge pull request #714 from takikawa/fix-typo
takikawa Jan 16, 2017
5b4a6d0
Add tests for snabb listen over unix socket
Jan 17, 2017
97eeef1
Add snabb config listen test to selftest.sh
Jan 17, 2017
0515451
test-config-listen.sh: use skipped test exit code
Jan 17, 2017
c0866eb
Re-trigger unit tests
Jan 17, 2017
a973261
Merge pull request #705 from Igalia/686-listen-over-socket
xray7224 Jan 17, 2017
8c401dc
Respond to ping6 packets in on-a-stick mode
dpino Jan 17, 2017
12e3e3a
Add test ping lwAFTR's V4 and V6 interfaces from a Linux kernel inter…
dpino Jan 17, 2017
18d635c
Add configuration file
dpino Jan 17, 2017
9d90e5d
Skip hw ping to lwAFTR test in CI
dpino Jan 17, 2017
bc9f2eb
Merge pull request #715 from dpino/issue-709
dpino Jan 17, 2017
b8ab988
Merge pull request #713 from takikawa/fix-config-remove
takikawa Jan 17, 2017
c281682
Property-based test: lwaftr run does not crash with get
Dec 7, 2016
4ad0c2e
Minor fix to selftest.sh
takikawa Dec 7, 2016
88e6d02
Close popens
Dec 8, 2016
c7f669c
Add $ to exit code
Dec 8, 2016
a28953b
Run property-check lwaftr longer
Dec 9, 2016
4d6b157
Sleep for longer before starting test
Dec 9, 2016
74bdc74
Generate xpath queries for `snabb config get` test
takikawa Dec 9, 2016
a0c779e
Add test ensuring two config runs yield the same result
takikawa Dec 10, 2016
56f53d8
Add cleanup code to shutdown lwaftr process for test
takikawa Dec 10, 2016
0002d5c
Produce "/" path instead of "" in base case
takikawa Dec 10, 2016
69146d2
Abstract out the common prop testing code
takikawa Dec 10, 2016
56d415b
Add generation of `snabb config set` commands
takikawa Dec 10, 2016
b5a863c
Add a new test for the get-state command
takikawa Dec 10, 2016
1c4a26f
Make get-state lookups use generated queries too
takikawa Dec 10, 2016
3b76638
Fix the get-state test to have non-empty query results
takikawa Dec 12, 2016
7e018bc
Bump get-state test duration
takikawa Dec 12, 2016
ae6c8b9
Add optional query parameter to generate functions
takikawa Dec 12, 2016
62f97a5
Improve sameval test to be resilient to missing fields
takikawa Dec 13, 2016
d350232
Abstract out the crash checking into common.lua
takikawa Dec 13, 2016
5cb065e
Generate selectors for list indexing in tests
takikawa Dec 14, 2016
65af1cd
Test the ietf-softwire config protocol too
takikawa Dec 14, 2016
8000
815c258
Traverse 'list' nodes for random generation better
takikawa Dec 16, 2016
e42ad26
Adjust how integer values are generated to prefer boundaries
takikawa Dec 17, 2016
905a151
Prefer lower position arguments
takikawa Dec 20, 2016
d746064
Start to add functions for generating set/add values
takikawa Dec 21, 2016
d938919
Use new set command generation for nocrash test
takikawa Jan 4, 2017
341cdeb
Initial attempt at generating compound values
takikawa Jan 5, 2017
ece5893
Generate more leaf data types
takikawa Jan 5, 2017
9b3baf6
Add some comments to genyang.lua
takikawa Jan 6, 2017
000ae61
Add comments, minor refactoring
takikawa Jan 6, 2017
4f73d09
Adjust weight for boundary values in number ranges
takikawa Jan 11, 2017
9f9b74b
Support decimal64 and binary types for test gen
takikawa Jan 12, 2017
b5b7aa1
Run more sameval get/set tests on occasion
takikawa Jan 12, 2017
854d7e6
Implement enum generation, change error behavior
takikawa Jan 13, 2017
fe83441
Use range statements in YANG types for value gen
takikawa Jan 13, 2017
c9e910f
Validate PCI address for property based tests
takikawa Jan 13, 2017
eaabeea
Don't fail if there isn't a range in the type
takikawa Jan 13, 2017
463a851
Add code to occasionally ignore bounds
takikawa Jan 13, 2017
521bdd3
Intentionally generate wrong types occasionally
takikawa Jan 15, 2017
aba11d0
Experiment with `snabb config add` testing
takikawa Jan 15, 2017
9520fa2
Generate `snabb config remove` commands too
takikawa Jan 16, 2017
f05dee6
Fix selftest for genyang
takikawa Jan 17, 2017
4b0892c
Generate values/paths for config add/remove better
takikawa Jan 17, 2017
41a3bcb
Adjust leaf-list case to not always use a selector
takikawa Jan 18, 2017
0b1417a
Tweak test iterations and timeout
takikawa Jan 18, 2017
f4dae60
Generate 64-bit ranges correctly
takikawa Jan 18, 2017
d2d3bd4
Simplify the function in f4dae60e08c521c8
takikawa Jan 18, 2017
f8a09a1
Delete outdated TODO comment
takikawa Jan 18, 2017
95395ce
Merge pull request #703 from takikawa/propyang
takikawa Jan 18, 2017
ffadf0f
Merge pull request #695 from dpino/real-fix-issue-667
dpino Jan 19, 2017
64539d4
Snabb lwAFTR v3.1.6 change log
dpino Jan 19, 2017
ccbdc57
Merge pull request #717 from dpino/changelog-v3.1.6
dpino Jan 19, 2017
fd46085
Revert "Remove end-addr in psid-map"
dpino Jan 20, 2017
57b438d
Merge pull request #722 from dpino/revert-remove-end-addr
dpino Jan 20, 2017
7f44e9e
Snabb lwAFTR v3.1.7 change log
dpino Jan 20, 2017
ca1488a
Merge pull request #724 from dpino/changelog-v3.1.7
dpino Jan 20, 2017
d1ae27e
Retry ARP and NDP resolution indefinitely
dpino Jan 25, 2017
21c6267
Merge pull request #726 from dpino/do-not-timeout-on-arp-ndp
dpino Jan 26, 2017
d4efeb7
lwaftrctl: allow setting QEMU_ARGS
domenkozar Feb 1, 2017
b9d1c93
lwaftrctl: fix docs
domenkozar Feb 1, 2017
13ed45f
lwaftr: replace tap interface with 9p share
domenkozar Feb 1, 2017
567239b
Merge pull request #728 from domenkozar/lwaftr-nix
dpino Feb 1, 2017
95e2a66
Added a regression test for end-addr
Feb 6, 2017
7f8d684
#700 - Allow for missing optional containers snabb set
Feb 6, 2017
de7c3ca
Merge pull request #730 from Igalia/700-ignore-optional-containers
xray7224 Feb 6, 2017
6a4cd40
Added vlan version of tests
Feb 7, 2017
54c1283
Remove busywait from main process when leader (#732)
teknico Feb 7, 2017
72ab481
Merge pull request #729 from Igalia/regressiontest_endaddr
kbara Feb 7, 2017
aa496be
Automate creation of tarball releases with Hydra (#733)
teknico Feb 8, 2017
074adda
Refactor query tests to use common test tooling (#741)
teknico Feb 13, 2017
68ec9a2
Rework config tests to use common test tooling (#740)
teknico Feb 13, 2017
343bd31
#737 - Add name leaf to snabb-softwire-v1
Feb 13, 2017
fae70ba
#737 - Support name by --name or snabb-softwire-v1
Feb 13, 2017
7eb419e
#737 - Add rename program support and fixes bug in claim_name
Feb 13, 2017
60af0b1
#737 - Add support for changing name via snabb set
Feb 13, 2017
0467caa
#737 - Add documentation for name leaf (inc. presidence)
Feb 13, 2017
5355f1b
#737 - Add support for name leaf in ietf-softwire translation
Feb 13, 2017
fd9d038
Add a selftest for the lwaftr bench command (#739)
teknico Feb 13, 2017
53d3d7a
Bench command: turn off leader busywait, mention --reconfigurable in …
teknico Feb 14, 2017
2e2b3d7
#737 - Move name claiming to setup_fn and add unclaim_name
Feb 14, 2017
99aff07
#737 - Remove test that successive calls to claim_name fails
Feb 14, 2017
f19182a
Change configuration.name and improve name changes
Feb 14, 2017
48e89aa
Merge pull request #742 from Igalia/737-configurable-name
xray7224 Feb 14, 2017
176773a
Enhance NUMA selftest (#734)
teknico Feb 15, 2017
56b9240
Refactor config and query tests (#744)
teknico Feb 17, 2017
76b6b19
Stop using tmux in query tests, use shell jobs instead (#746)
teknico Feb 20, 2017
9d15cdc
Fix #716 - allow / in yang strings
Feb 21, 2017
836ad56
#716 - Fix small nits brought up in review
Feb 22, 2017
92ac924
#716 - Fix a few more nits
Feb 22, 2017
a57d7e3
#716 - Add // comment handling in strings
Feb 22, 2017
44ddfab
Merge pull request #735 from Igalia/716-allow-slash
xray7224 Feb 27, 2017
0804101
Add v. 1.12.9 of the 'sh' Python library (#750)
teknico Feb 27, 2017
c1fcfd4
First Python integration test (#751)
teknico Feb 27, 2017
da1acc6
Add 'run' subcommand test, refactor the 'bench' one (#753)
teknico Feb 27, 2017
a80f481
#748 - Re-enabled broken tests
Feb 28, 2017
8589b56
Fix #748 - Move claim_name to lwaftr_app
Feb 28, 2017
73abb70
Fix indentation nit
Feb 28, 2017
13b9953
Merge pull request #757 from Igalia/748-named-unconfigurables
xray7224 Feb 28, 2017
40a980b
Add a selftest for the "lwaftr loadtest" command (#755)
teknico Feb 28, 2017
4c92a0e
Fix #702 - Error when neither of next-hop's leaves are specified
Feb 28, 2017
59b7c4f
Merge pull request #758 from Igalia/702-next-hop
xray7224 Feb 28, 2017
4ea06f2
Add test for 'lwaftr check' subcommand (#760)
teknico Mar 1, 2017
9f18b41
Add a selftest for the "lwaftr monitor" command (#762)
teknico Mar 2, 2017
fcaa19f
Add test for #727 - check softwires are matched
Mar 3, 2017
7236a67
Add validation for softwires using snabb config add
Mar 3, 2017
04d9605
Fix pervious config test with new validation
Mar 4, 2017
8e6b398
Improve tests for softwire validation
Mar 4, 2017
7733f20
Fix #638 - Validate path on snabb config get
Mar 6, 2017
c4e2a7e
Merge pull request #765 from Igalia/638-validate-path
xray7224 Mar 7, 2017
df96eac
Refactor selftest
dpino Jan 8, 2017
26dc11a
Set random destination port in IPv4 refresh packets
dpino Jan 8, 2017
1299a74
Set random source port in IPv4 payload of IPv6 refresh packets
dpino Jan 14, 2017
3249679
Remove unused variables
dpino Jan 14, 2017
78f88f6
Verify checksum of modified refresh packets
dpino Jan 14, 2017
1b192e0
Improve Python selftests (#763)
teknico Mar 9, 2017
519ce7a
Merge pull request #766 from dpino/backport-issue-476
dpino Mar 10, 2017
22f4a7f
Remove the 'sh' Python library (#771)
teknico Mar 13, 2017
44617fc
Convert the "lwaftr config" tests to Python (#768)
teknico Mar 13, 2017
6a4985b
Convert the "lwaftr query" tests to Python (#773)
teknico Mar 16, 2017
4fbaee1
Reduced the number of globals
Mar 20, 2017
971a5a2
Merge pull request #777 from Igalia/lwaftr_lint
kbara Mar 20, 2017
8824412
Require link and engine
Mar 20, 2017
f3cc411
Merge pull request #778 from Igalia/require_link_and_engine
kbara Mar 20, 2017
55defa6
Create the TAP interface in the "monitor" subcommand test (#776)
teknico Mar 21, 2017
cf290d1
Improve calling the superclass classmethod in monitor test (#780)
teknico Mar 22, 2017
aa8d105
Fix run_nohw
dpino Mar 22, 2017
88c3f7f
Fix pid in CSVStats
dpino Mar 22, 2017
22784fa
Clean up run_nohw
dpino Mar 22, 2017
c7eb0bd
Add option 'duration' in run_nohw
dpino Mar 22, 2017
f9d77e4
Rework verbosity option
dpino Mar 22, 2017
bc9e1bd
Update run_nohw README
dpino Mar 22, 2017
942cefd
Add run_nohw to the list of subprograms
dpino Mar 22, 2017
1c2c7d5
Add unit test for run_nohw
dpino Mar 22, 2017
f3a88c3
Update documentation
dpino Mar 22, 2017
248ec26
Rework unit test
dpino Mar 23, 2017
4a37969
Merge pull request #781 from dpino/fix-run_nohw
dpino Mar 23, 2017
fee3322
Use snabbvmx query instead of next_hop
dpino Feb 20, 2017
6edbd9d
Remove snabbvmx nexthop
dpino Mar 24, 2017
20ea537
Fix softwire validation for config and initial start
Mar 24, 2017
4fdd863
Add validation functions to generic leader support
Mar 24, 2017
85659dd
Fix config validation for non --reconfigurable too
Mar 24, 2017
6d5f80f
Append lwAFTR version number and date to help info
dpino Mar 24, 2017
bf7e6d6
Merge pull request #785 from dpino/print-version
dpino Mar 24, 2017
d895395
Remove the default bench.csv filename for benchmark data (#782)
teknico Mar 27, 2017
5079948
Reintroduce NDP secondary address test
dpino Mar 24, 2017
07f1702
Lookup psid entries using rangemap for range support
Mar 27, 2017
cb50c81
Merge pull request #783 from dpino/remove-snabbvmx-nexthop
dpino Mar 28, 2017
6993af8
Print out when VM setup is ready
dpino Feb 20, 2017
7b55781
Pass SnabbVMX PID to snabb monitor all
dpino Feb 14, 2017
ab43f22
Delete tap interface before creating it
dpino Feb 15, 2017
459e040
Make quickcheck a lwAFTR subprogram
dpino Mar 28, 2017
34bdf3e
Add quickcheck README
dpino Mar 28, 2017
76afdf7
Refactor quickcheck code
dpino Mar 28, 2017
e824130
Add quickcheck unit test
dpino Mar 28, 2017
f97be64
Merge pull request #790 from dpino/move-quickcheck
dpino Mar 28, 2017
23f7748
Merge pull request #787 from dpino/reintroduce-secondary
dpino Mar 28, 2017
3101ffb
Merge pull request #743 from dpino/improve-snabbvmx-test
dpino Mar 28, 2017
084bb44
Add snabb set test and fix get_binding_table
Mar 31, 2017
828e67a
Fix small nit with validate_config call
Apr 3, 2017
623efad
Merge pull request #784 from Igalia/727-validate-softwire-psid
xray7224 Apr 3, 2017
a08f527
Add test to check list with config false doesn't need "key"
Apr 10, 2017
4385676
Fix #789 - Make "keys" optional for list statements with config false
Apr 10, 2017
3db2896
Merge pull request #793 from Igalia/789-list-wo-keys
xray7224 Apr 10, 2017
b4d4eb3
Merge upstream v2017.04 release into lwaftr
wingo Apr 20, 2017
7753e04
Add yang objects to build.
wingo Apr 20, 2017
85d18c7
Skip snabbwall tests if libndpi isn't available.
wingo Apr 20, 2017
9c812cf
Fix libndpi check
wingo Apr 20, 2017
470f43e
Merge pull request #797 from Igalia/incorporate-2017-04
wingo Apr 20, 2017
92bfddb
Skip lib.multi_copy selftest if AVX2 unavailable
wingo Apr 27, 2017
08f3342
Temporarily disable snabbvmx selftest
wingo May 2, 2017
a38707c
Merge pull request #804 from Igalia/temporarily-disable-snabbvmx-test
wingo May 2, 2017
755353b
Merge branch 'lwaftr' into lwaftr-2017-04-24
wingo May 2, 2017
7c07e80
Add soaktest to "snabb lwaftr" usage.
wingo May 11, 2017
344e22a
Disable bus-mastering cleanup for intel_mp
wingo May 17, 2017
5e72f50
Merge pull request #809 from Igalia/no-supervisor-cleanup-for-intel_mp
wingo May 17, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ obj
*.so
*.o
*#
__pycache__
/src/snabbswitch
/src/snabb
/src/testlog
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ dist: all
mkdir "$(DISTDIR)"
git clone "$(BUILDDIR)" "$(DISTDIR)/snabbswitch"
rm -rf "$(DISTDIR)/snabbswitch/.git"
cp "$(BUILDDIR)/src/snabb" "$(DISTDIR)/$(DIST_BINARY)"
cp "$(BUILDDIR)/src/snabb" "$(DISTDIR)/"
if test "$(DIST_BINARY)" != "snabb"; then ln -s "snabb" "$(DISTDIR)/$(DIST_BINARY)"; fi
cd "$(DISTDIR)/.." && tar cJvf "`basename '$(DISTDIR)'`.tar.xz" "`basename '$(DISTDIR)'`"
rm -rf "$(DISTDIR)"

Expand Down
3 changes: 2 additions & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
{ pkgs ? (import <nixpkgs> {})
, source ? ./.
, version ? "dev"
, supportOpenstack ? true
}:

with pkgs;
Expand All @@ -23,7 +24,7 @@ stdenv.mkDerivation rec {
for f in $(find src/program/snabbnfv/ -type f); do
substituteInPlace $f --replace "/bin/bash" "${bash}/bin/bash"
done

'' + lib.optionalString supportOpenstack ''
# We need a way to pass $PATH to the scripts
sed -i '2iexport PATH=${git}/bin:${mariadb}/bin:${which}/bin:${procps}/bin:${coreutils}/bin' src/program/snabbnfv/neutron_sync_master/neutron_sync_master.sh.inc
sed -i '2iexport PATH=${git}/bin:${coreutils}/bin:${diffutils}/bin:${nettools}/bin' src/program/snabbnfv/neutron_sync_agent/neutron_sync_agent.sh.inc
Expand Down
8 changes: 7 additions & 1 deletion lib/ljsyscall/syscall/syscalls.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,13 @@ local function retiter(ret, err, array)
end

-- generic system calls
function S.close(fd) return retbool(C.close(getfd(fd))) end
function S.close(fd)
if fd == getfd(fd) then -- fd number
return retbool(C.close(getfd(fd)))
else -- fd object: avoid mulitple close
return fd:close()
end
end
function S.chdir(path) return retbool(C.chdir(path)) end
function S.fchdir(fd) return retbool(C.fchdir(getfd(fd))) end
function S.fchmod(fd, mode) return retbool(C.fchmod(getfd(fd), c.MODE[mode])) end
Expand Down
28 changes: 22 additions & 6 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ RMSRC = $(shell find . -name '*.md' -not -regex './obj.*' -printf '%P ')
PROGRAM = $(shell find program -regex '^[^/]+/[^/]+' -type d -printf '%P ')
# sort to eliminate potential duplicate of programs.inc
INCSRC = $(sort $(shell find . -regex '[^\#]*\.inc' -printf '%P ') programs.inc)
YANGSRC= $(shell find . -regex '[^\#]*\.yang' -printf '%P ')

LUAOBJ := $(patsubst %.lua,obj/%_lua.o,$(LUASRC))
PFLUAOBJ := $(patsubst %.lua,obj/%_lua.o,$(PFLUASRC))
Expand All @@ -36,14 +37,15 @@ JITOBJS:= $(patsubst %,obj/jit_%.o,$(JITSRC))
EXTRAOBJS := obj/jit_tprof.o obj/jit_vmprof.o obj/strict.o
RMOBJS := $(patsubst %,obj/%,$(RMSRC))
INCOBJ := $(patsubst %.inc,obj/%_inc.o, $(INCSRC))
YANGOBJ:= $(patsubst %.yang,obj/%_yang.o, $(YANGSRC))
EXE := bin/snabb $(patsubst %,bin/%,$(PROGRAM))

# TESTMODS expands to:
# core.memory core.lib ...
# for each module that has a top-level selftest () function.
TESTMODS = $(shell find . -regex '[^\#]*\.lua' -printf '%P ' | \
TESTMODS = $(shell find . -regex '[^\#]*\.\(lua\|dasl\)' -printf '%P ' | \
xargs grep -s -l '^function selftest *[[:punct:]]' | \
sed -e 's_\.lua__' -e 's_/_._g')
sed -e 's_\.lua__' -e 's_\.dasl__' -e 's_/_._g')

# TESTSCRIPTS expands to:
# lib/watchdog/selftest.sh ...
Expand All @@ -52,7 +54,7 @@ TESTSCRIPTS = $(shell find . -name "selftest.sh" -executable | xargs)

PATH := ../lib/luajit/usr/local/bin:$(PATH)

snabb: $(LUAOBJ) $(PFLUAOBJ) $(HOBJ) $(COBJ) $(ARCHOBJ) $(ASMOBJ) $(PFLUAASMOBJ) $(INCOBJ) $(LUAJIT_A)
snabb: $(LUAOBJ) $(PFLUAOBJ) $(HOBJ) $(COBJ) $(ARCHOBJ) $(ASMOBJ) $(PFLUAASMOBJ) $(INCOBJ) $(YANGOBJ) $(LUAJIT_A)
$(E) "LINK $@"
$(Q) $(CC) $(DEBUG) -Wl,--no-as-needed -Wl,-E -Werror -Wall -o $@ $^ \
../lib/luajit/src/libluajit.a \
Expand Down Expand Up @@ -171,6 +173,13 @@ $(INCOBJ): obj/%_inc.o: %.inc Makefile | $(OBJDIR)
echo "]=============]") > $(basename $@).luainc
$(Q) luajit -bg -n $(subst /,.,$*)_inc $(basename $@).luainc $@

$(YANGOBJ): obj/%_yang.o: %.yang Makefile | $(OBJDIR)
$(E) "YANG $@"
@(echo -n "return [=============["; \
cat $<; \
echo "]=============]") > $(basename $@).luayang
$(Q) luajit -bg -n $(subst /,.,$*)_yang $(basename $@).luayang $@

# Create list of programs that exist
programs.inc: program
@(for d in program/*/; do basename $$d; done) > $@
Expand Down Expand Up @@ -209,7 +218,15 @@ obj/doc/snabb.epub: obj/doc/snabb.markdown

CLEAN = snabb obj bin testlog programs.inc

clean:
clean_programs:
@(for d in program/*/; do \
if [ -f "$$d/Makefile" ]; then \
echo "CLEAN $$d"; \
make -s -C $$d clean; \
fi \
done)

clean: clean_programs
$(E) "RM $(CLEAN)"
$(Q)-rm -rf $(CLEAN)

Expand All @@ -220,5 +237,4 @@ mrproper: clean
benchmarks:
$(Q) (scripts/bench.sh)

.PHONY: clean $(TESTMODS) $(TESTSCRIPTS) benchmarks

.PHONY: clean_programs clean $(TESTMODS) $(TESTSCRIPTS) benchmarks
4 changes: 4 additions & 0 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,10 @@ If *readonly* is non-nil the shared object is mapped in read-only mode.
*Readonly* defaults to nil. Fails if the shared object does not already exist.
Returns a pointer to the mapped object.

— Function **shm.alias** *new-path* *existing-path*

Create an alias (symbolic link) for an object.

— Function **shm.exists** *name*

Returns a true value if shared object by *name* exists.
Expand Down
145 changes: 145 additions & 0 deletions src/apps/config/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
# Config leader and follower

Sometimes you want to query the state or configuration of a running
Snabb data plane, or reload its configuration, or incrementally update
that configuration. However, you want to minimize the impact of
configuration query and update on data plane performance. The
`Leader` and `Follower` apps are here to fulfill this need, while
minimizing performance overhead.

The high-level design is that a `Leader` app is responsible for
knowing the state and configuration of a data plane. The leader
offers an interface to allow the outside world to query the
configuration and state, and to request configuration updates. To
avoid data-plane overhead, the `Leader` app should be deployed in a
separate process. Because it knows the data-plane state, it can
respond to queries directly, without involving the data plane. It
processes update requests into a form that the data plane can handle,
and feeds those requests to the data plane via a high-performance
back-channel.

The data plane runs a `Follower` app that reads and applies update
messages sent to it from the leader. Checking for update availability
requires just a memory access, not a system call, so the overhead of
including a follower in the data plane is very low.

## Two protocols

The leader communicates with its followers using a private protocol.
Because the leader and the follower are from the same Snabb version,
the details of this protocol are subject to change. The private
protocol's only design constraint is that it should cause the lowest
overhead for the data plane.

The leader communicates with the world via a public protocol. The
"snabb config" command-line tool speaks this protocol. "snabb config
get foo /bar" will find the local Snabb instance named "foo", open the
UNIX socket that the "foo" instance is listening on, issue a request,
then read the response, then close the socket.

## Public protocol

The design constraint on the public protocol is that it be expressive
and future-proof. We also want to enable the leader to talk to more
than one "snabb config" at a time. In particular someone should be
able to have a long-lived "snabb config listen" session open, and that
shouldn't impede someone else from doing a "snabb config get" to read
state.

To this end the public protocol container is very simple:

```
Message = Length "\n" RPC*
```

Length is a base-10 string of characters indicating the length of the
message. There may be a maximum length restriction. This requires
that "snabb config" build up the whole message as a string and measure
its length, but that's OK. Knowing the length ahead of time allows
"snabb config" to use nonblocking operations to slurp up the whole
message as a string. A partial read can be resumed later. The
message can then be parsed without fear of blocking the main process.

The RPC is an RPC request or response for the
[`snabb-config-leader-v1` YANG
schema](../../lib/yang/snabb-config-leader-v1.yang), expressed in the
Snabb [textual data format for YANG data](../../lib/yang/README.md).
For example the `snabb-config-leader-v1` schema supports a
`get-config` RPC defined like this in the schema:

```yang
rpc get-config {
input {
leaf schema { type string; mandatory true; }
leaf revision { type string; }
leaf path { type string; default "/"; }
}
output {
leaf config { type string; }
}
}
```

A request to this RPC might look like:

```yang
get-config {
schema snabb-softwire-v1;
path "/foo";
}
```

As you can see, non-mandatory inputs can be left out. A response
might look like:

```yang
get-config {
config "blah blah blah";
}
```

Responses are prefixed by the RPC name. One message can include a
number of RPCs; the RPCs will be made in order. See the
[`snabb-config-leader-v1` YANG
schema](../../lib/yang/snabb-config-leader-v1.yang) for full details
of available RPCs.

## Private protocol

The leader maintains a configuration for the program as a whole. As
it gets requests, it computes the set of changes to app graphs that
would be needed to apply that configuration. These changes are then
passed through the private protocol to the follower. No response from
the follower is necessary.

In some remote or perhaps not so remote future, all Snabb apps will
have associated YANG schemas describing their individual
configurations. In this happy future, the generic way to ship
configurations from the leader to a follower is by the binary
serialization of YANG data, implemented already in the YANG modules.
Until then however, there is also generic Lua data without a schema.
The private protocol supports both kinds of information transfer.

In the meantime, the way to indicate that an app's configuration data
conforms to a YANG schema is to set the `schema_name` property on the
app's class.

The private protocol consists of binary messages passed over a ring
buffer. A follower's leader writes to the buffer, and the follower
reads from it. There are no other readers or writers. Given that a
message may in general be unbounded in size, whereas a ring buffer is
naturally fixed, messages which may include arbtrary-sized data may be
forced to put that data in the filesystem, and refer to it from the
messages in the ring buffer. Since this file system is backed by
`tmpfs`, stalls will be minimal.

## User interface

The above sections document how the leader and follower apps are
implemented so that a data-plane developer can understand the overhead
of run-time (re)configuration. End users won't be typing at a UNIX
socket though; we include the `snabb config` program as a command-line
interface to this functionality.

See [the `snabb config` documentation](../../program/config/README.md)
for full details.
Loading
0