Skip to content
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

App-local statistics counters #931

Merged
merged 143 commits into from
Jul 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
b34c3ee
engine: Set shm path to "app/$name"
lukego Feb 22, 2016
80614e1
doc/git-workflow.md: Rewritten based on new experience
lukego Mar 18, 2016
12d0009
doc/git-workflow.md: Added section on upstreaming subsystems
lukego Mar 18, 2016
af8ae46
doc/git-workflow.md: Partly rewritten draft
lukego Mar 21, 2016
eccb614
doc/git-workflow.md: Created .src.md
lukego Mar 21, 2016
113b607
git-workflow.md: Rewrote section on becoming a maintainer
lukego Mar 21, 2016
4a37b98
git-workflow.md: Wrote about upstreaming subsystem branches
lukego Mar 22, 2016
94ff234
Amendments to #766:
eugeneia Apr 12, 2016
aac0c8c
Merge PR #766 (engine: Set shm path to "app/$name") into yang
eugeneia Apr 12, 2016
fad0f43
core.counter: Qualify counter names using `shm.resolve'.
eugeneia Apr 13, 2016
7ed4ed0
snabb top: add `--app' option to print app counters.
eugeneia Apr 12, 2016
eb9005b
snabb top: unlink own shm tree to avoid clutter.
eugeneia Apr 13, 2016
5fbe0d6
vhost_user: Add RFC 7223 app counters.
eugeneia Apr 14, 2016
8bb3215
Intel_app: Add RFC 7223 app counters.
eugeneia Apr 14, 2016
7a55478
snabb top: Add --link parameter to list link counters.
eugeneia Apr 14, 2016
dde5da2
core.app: Put app counters under "counters/<app>", update snabb top.
eugeneia Apr 14, 2016
7a6296f
Add a test demonstrating pci device ids, with capital A-F
petebristow Apr 14, 2016
924ff4e
lib.json: Import JSON4Lua 1.0.0, include encode functionality.
eugeneia Apr 18, 2016
8e34093
lib.macaddress: Support numeric initialization; add method to get num…
eugeneia Apr 18, 2016
5f9efd2
core.link: Create “discontinuity-time” counters.
eugeneia Apr 18, 2016
7b39148
snabb top: add `--yang' option to print YANG model as JSON.
eugeneia Apr 19, 2016
5d6baa4
remove superfluous syscall.sysctl
petebristow Apr 27, 2016
e457300
Update CONTRIBUTING.md.
eugeneia Apr 28, 2016
c3c69d2
Add 'start' method to apps
dpino Apr 29, 2016
9dabdd2
Call app.start instead of app_table[name].start
dpino Apr 29, 2016
6964969
Merge branch 'master' into doc-git-workflow-redux
lukego May 2, 2016
6c46b5d
doc: Remove stale .images/Branches.png file
lukego May 2, 2016
8984741
snabb top --yang: Represent uint64_t as decimal string.
eugeneia Apr 20, 2016
ee00d16
[core.lib] Generalize `timer' to optionally accept 'repeating'
eugeneia Apr 28, 2016
45490b8
Revert "Intel_app: Add RFC 7223 app counters."
eugeneia Apr 28, 2016
f0ed10b
intel_app: expose per-pciaddress statistics in `counters/<pciaddress>'.
eugeneia Apr 28, 2016
b853268
core.packet: document ctype and deprecate data and length functions.
eugeneia May 5, 2016
b11e375
core.packet: properly document shiftleft and shiftight.
eugeneia May 5, 2016
d0cc3c6
default.nix: enable parallel builds
domenkozar May 9, 2016
aca8064
Merge branch 'master' into yang-local
eugeneia May 13, 2016
c186591
lib.protocol.ethernet: Add n_mcast, branch-free Multicast predicate.
eugeneia Apr 25, 2016
b09e843
Fix for f0ed10b: require macaddress module.
eugeneia May 27, 2016
4eb21b6
virtio/net_device: Fix bug with mergeable rx buffers
lukego May 28, 2016
0a5bfac
Remove unassigned initialization
dpino May 30, 2016
80a7ee7
Trigger start event for each app
dpino May 30, 2016
c86ec3e
Call app:start only if defined
dpino May 30, 2016
62e2fbf
Revert "lib.json: Import JSON4Lua 1.0.0, include encode functionality."
eugeneia Jun 1, 2016
f4834a5
snabb top: revert --yang dump.
eugeneia Jun 1, 2016
793c394
snabbify statistics model.
eugeneia Jun 2, 2016
2b9ef2c
intel_app: add ifTable MIB related counters.
eugeneia Jun 2, 2016
e9f5dda
lib.macaddress: add bytes method.
eugeneia Jun 2, 2016
6b12e9c
spin out SNMP code from apps.intel.intel10 to lib.ipc.shmem.iftable_mib.
eugeneia Jun 2, 2016
7c697b6
main: fork into worker and supervisor; perform clean up.
eugeneia Jun 3, 2016
be09fe5
main: send HUP instead of KILL.
eugeneia Jun 6, 2016
3db174b
main: return correct exit code.
eugeneia Jun 6, 2016
ce2f220
main: supervise xpcall(main, hanlder).
eugeneia Jun 6, 2016
4950cbb
main: check status of S.waitpid.
eugeneia Jun 6, 2016
28c568c
main: cleanup after worker_pid.
eugeneia Jun 6, 2016
4af7091
Remove obsolete `snabb gc'.
eugeneia Jun 6, 2016
1c9f585
Move model.txt to src/doc/statistics.md.
eugeneia Jun 7, 2016
339f8f1
apps.intel_app: Revert rxerrors calculation, remove broken txerrors.
eugeneia Jun 7, 2016
7ec7f80
Revert "lib.macaddress: add bytes method." and remove int method.
eugeneia Jun 7, 2016
e5f23a9
vhost_user: Fix & comment "feature cache"
lukego Jun 8, 2016
b20cb17
core.memory: Add 'align' argument to dma_alloc()
lukego May 24, 2016
d347f65
Merge PR #936 (core.memory: Add 'align' argument to dma_alloc) into m…
eugeneia Jun 9, 2016
655bdf7
Merge PR #935 (virtio/net_device: Fix bug with mrg_rxbuf) into max-next
eugeneia Jun 9, 2016
cf002c5
Merge PR #934 (vhost_user: Fix & comment "feature cache") into max-next
eugeneia Jun 9, 2016
e1f02ac
Merge PR #904 (Update CONTRIBUTING.md) into documentation
eugeneia Jun 9, 2016
089d61a
Merge PR #866 (match pci addresses with uppercase hex) into max-next
eugeneia Jun 9, 2016
69f9dc2
Merge PR #889 (Fix race conditions) into max-next
eugeneia Jun 9, 2016
327804f
doc/statistics.md: remove duplicates.
eugeneia Jun 9, 2016
30fcbcb
Merge branch 'master' into statistics-superset
eugeneia Jun 9, 2016
daf4243
Merge branch 'master' into supervisor
eugeneia Jun 9, 2016
9b2df00
Merge branch 'master' into packet-abi
eugeneia Jun 9, 2016
2304e5b
Merge #935 branch 'lukego/vhost-user-mergeable-rx-fix' into next
lukego Jun 10, 2016
90fc893
core.app: fix bug in #766 introduced while merging 6cac870a.
eugeneia Jun 10, 2016
ceb080f
core.app: fix bug in #766, use app.shmpath during reconfig.
eugeneia Jun 10, 2016
0d4cf92
Merge branch 'master' into nix
domenkozar Jun 10, 2016
738ef31
Snabb version is now statically stored in .version
domenkozar Jun 10, 2016
a119aeb
release.nix: don't rely on SNABB_PCI* defaults
domenkozar Jun 10, 2016
1feb2c9
release.nix: by default use lugano servers
domenkozar Jun 10, 2016
307b1e1
default.nix: remove .git from source since it's not deterministic
domenkozar Jun 10, 2016
1d4e766
src/Makefile: silence grep
domenkozar Jun 10, 2016
d82729a
core.app: fix typo in previous commit.
eugeneia Jun 10, 2016
70b8967
intel1g: canonicalize env var name, document it in testing.md, pass it
eugeneia Jun 13, 2016
9f48b14
apps.intel.intel1g: use pci.map_pci_memory_locked.
eugeneia Jun 13, 2016
ed687f1
main: properly handle unsupported worker states (SIGSTOP/SIGCONT)-
eugeneia Jun 14, 2016
db9e343
main: comment syscall usage.
eugeneia Jun 14, 2016
c3b8672
Revert 'ed687f19f8459413145fabc56a462d7b38513ba8'.
eugeneia Jun 14, 2016
5eb0f69
core.main: handle SIGSTOP and SIGCONT to worker.
eugeneia Jun 15, 2016
76a5d6e
main: allow setting developer_debug/debug_on_error through environment.
eugeneia Jun 15, 2016
127d21f
main: do not unlink runtime directory in developer_debug mode.
eugeneia Jun 15, 2016
1befce4
remove packet.length/data.
eugeneia Jun 15, 2016
694b1c4
test_env.sh: output kernel console to stdout
domenkozar Jun 16, 2016
751cc28
apps.bridge.base: use `app:start()' to run post configuration.
eugeneia Jun 16, 2016
11890e6
core.app: edit documentation of app:start().
eugeneia Jun 16, 2016
2aa765f
Merge PR #905 (Add 'app:start()' method) into max-next
eugeneia Jun 16, 2016
ab6dd2c
Merge branch 'documentation' into max-next-v2016.07-1
eugeneia Jun 16, 2016
5488c68
lib.protocol.ethernet: add is_bcast and n_bcast.
eugeneia Jun 8, 2016
9044c6f
apps.vhost.vhost_user: count rxbcast/txbcast.
eugeneia Jun 8, 2016
5a01612
apps.tap.tap: add statistics counters.
eugeneia Jun 8, 2016
6233d15
core.packet: make max_payload public.
eugeneia Jun 13, 2016
788438e
apps.socket.raw: add statistics counters.
eugeneia Jun 8, 2016
7d5b973
Rename app:start from #905 to app:configure.
eugeneia Jun 16, 2016
4dec991
scripts/dock.sh: also pass through SNABB_PCI_INTEL1G1.
eugeneia Jun 16, 2016
a9f7011
lib.ipsec.esp: fix regression introduces by previous commit.
eugeneia Jun 20, 2016
e60226c
Rename app:configure to app:link.
eugeneia Jun 20, 2016
0f38505
lib.ipsec.esp: Test minimum packet sizes.
eugeneia May 18, 2016
b8cbd65
SnabbNFV: Add “crypto” tunnel option using lib.ipsec.esp.
eugeneia Jun 20, 2016
ab5d1af
scripts/dock.sh: use eugeneia/snabb-nfv-test-vanilla by default.
eugeneia Jun 20, 2016
19f2bc5
Merge branch 'nfv-esp2' into tunnel-stats
eugeneia Jun 21, 2016
626c6fc
apps.keyed_ipv6_tunnel: add diagnostics counters.
eugeneia Jun 21, 2016
21d79ed
Merge PR #941 (silence grep) into kbara-next
Jun 22, 2016
9906aca
Merge PR #931 (app-local stats counters) into kbara-next
Jun 22, 2016
e7a5471
Merge PR #835 (workflow docs) into kbara-next
Jun 22, 2016
1b60645
default.nix: don't hardcode the version
domenkozar Jun 23, 2016
c0f7076
apps.ipsec.esp: add statistics counters.
eugeneia Jun 23, 2016
fc7363c
apps.ipv6.nd_light: add statistics counters.
eugeneia Jun 23, 2016
272a0d1
apps.packet_filter: add statistics counters.
eugeneia Jun 23, 2016
506c66b
apps.rate_limiter: add statistics counters.
eugeneia Jun 23, 2016
7d76551
Merge PR #930 (Supervisor, no snabb gc) into kbara-next
Jun 27, 2016
7ad20fd
Merge #945 branch 'eugeneia/max-next-v2016.07-1' into next
lukego Jun 27, 2016
dd13ae7
Merge #955 branch 'kbara/kbara-next' into next
lukego Jun 29, 2016
60dc221
Merge PR #913 (Packet documentation) into kbara-next
Jun 30, 2016
00706ef
Merge #957 branch 'snabbco/kbara-next' into next
lukego Jul 1, 2016
398dd16
core.main: Fix bug in SNABB_DEBUG env var handling
lukego Jul 1, 2016
e81a192
core.timer: Inhibit debug messages
lukego Jul 1, 2016
07209ae
Merge PR #939 (Nix expr improvements) into kbara-next
Jul 1, 2016
d54fd69
Merge PR #958 (Inhibit timer debug) into kbara-next
Jul 1, 2016
ffaa105
Merge PR #942 (intel1g env var canon) into kbara-next
Jul 1, 2016
3701be1
Merge #959 branch 'snabbco/kbara-next' into next
lukego Jul 1, 2016
995f9d8
vhost-user: Support operation without MRG_RXBUF.
wingo Jun 8, 2016
e3fcbbf
Revert "lib.protocol.ethernet: Add n_mcast, branch-free Multicast pre…
eugeneia Jul 4, 2016
b3abaa0
Merge branch 'statistics-superset' into io-stats-1
eugeneia Jul 4, 2016
b418f8f
intel_app: fix wrong “speed” counter value.
eugeneia Jul 4, 2016
d52d89c
apps.ipv6.nd_light: revise counters, south = rx / north = tx.
eugeneia Jul 4, 2016
e99037a
Merge PR #944 (test_env.sh: output kernel console to stdout) into max…
eugeneia Jul 4, 2016
06bed19
Merge PR #948 (default to eugeneia/snabb-nfv-test-vanilla) into max-next
eugeneia Jul 4, 2016
9738d15
Merge PR #949 (ESP tunnel support for SnabbNFV) into max-next
eugeneia Jul 4, 2016
3549398
Merge #961 branch 'eugeneia/max-next-v2016.07-2' into next
lukego Jul 4, 2016
b31acfd
Merged #947 (RawSocket/TAP i/o stats counters)
Jul 4, 2016
900ff8e
Fix interface speed
alexandergall Jul 4, 2016
d9e52ab
Merge remote-tracking branch 'upstream/next' into kbara-next
Jul 5, 2016
51c9d51
Merge PR #953 (Misc NFV stats counters) into kbara-next
Jul 5, 2016
905bf8d
vhost/vhost_user: avoid callbacks.
eugeneia Jul 8, 2016
8317e61
Merge PR #963 (Fix interface speed) into statistics-superset
eugeneia Jul 8, 2016
cf1810e
Merge #947 branch 'snabbco/kbara-next' into next
lukego Jul 11, 2016
f891072
Merge branch 'next' into statistics-superset
eugeneia Jul 11, 2016
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
22 changes: 17 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
Whenever you create a Pull Request (PR), a maintainer will self-assign
# Hints for Contributors

* Whenever you create a Pull Request (PR), a maintainer will self-assign
themselves as the *upstream*. The upstream decides if your PR is accepted and
might require you to amend additional changes before merging. You can expect
the upstream to communicate clearly if there are any issues preventing your PR
from being merged, and how they can be fixed. Once merged, the upstream will
add the `merged` label to your PR.
add the `merged` label to your PR. More on [our Git workflow](https://github.com/snabbco/snabb/blob/master/src/doc/git-workflow.md).

* Target your PR against the branch you would like it to be merged into. Refer
to the [list of subsystem branches](https://github.com/snabbco/snabb/blob/master/src/doc/branches.md).
When in doubt use `master`.

You are also welcome to submit PRs you would like to receive feedback on, but
* Feel free to @ping the assignee if you feel like your PR has been overlooked,
and are waiting for a response.

* You are also welcome to submit PRs you would like to receive feedback on, but
which are not ready to be merged: include the labels `[wip]` in the title of
PRs that require further work, and `[sketch]` for PRs that are not meant to be
merged at all.

Our [Documentation Guide](https://github.com/SnabbCo/snabbswitch/blob/master/src/doc/documentation-guide.md)
* Please make sure your editor is configured to not emit tabs and use three
spaces for indentation.

* Our [Documentation Guide](https://github.com/SnabbCo/snabbswitch/blob/master/src/doc/documentation-guide.md)
gives pointers on how to contribute to the project's documentation.

If you wish to record a copyright notice with your contribution then you can
* If you wish to record a copyright notice with your contribution then you can
optionally do this in the file `src/COPYRIGHT`; copyright notices in other
files will be rejected.
13 changes: 8 additions & 5 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# Run like this:
# nix-build /path/to/this/directory
# ... and the files are produced in ./result/
# ... and the files are produced in ./result/bin/snabb

{ pkgs ? (import <nixpkgs> {})
, source ? ./.
, version ? "dev"
}:

with pkgs;

stdenv.mkDerivation rec {
# TODO: get the version from somewhere?
name = "snabb";

src = ./.;
name = "snabb-${version}";
inherit version;
src = lib.cleanSource source;

buildInputs = [ makeWrapper ];

Expand All @@ -36,4 +37,6 @@ stdenv.mkDerivation rec {
mkdir -p $out/bin
cp src/snabb $out/bin
'';

enableParallelBuilding = true;
}
15 changes: 7 additions & 8 deletions release.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ let
url = "http://lab1.snabb.co:2008/~max/assets/vm-ubuntu-trusty-14.04-dpdk-snabb.tar.gz";
sha256 = "0323591i925jhd6wv8h268wc3ildjpa6j57n4p9yg9d6ikwkw06j";
};
optionalGetEnv = first: default: let
maybeEnv = builtins.getEnv first;
in if (maybeEnv != "") then maybeEnv else default;
requiredGetEnv = var: let
maybeEnv = builtins.getEnv var;
in if (maybeEnv != "") then maybeEnv else throw "Please export shell variable ${var}";
in rec {
manual = import ./src/doc {};
snabb = import ./default.nix {};
Expand All @@ -26,7 +26,7 @@ in rec {

# allow sudo
__noChroot = true;
requiredSystemFeatures = [ "performance" ];
requiredSystemFeatures = [ "lugano" ];

buildInputs = [ git telnet tmux numactl bc iproute which qemu ];

Expand All @@ -45,10 +45,9 @@ in rec {

doCheck = true;
checkPhase = ''
export SNABB_PCI0=${ optionalGetEnv "SNABB_PCI0" "0000:01:00.0"}
export SNABB_PCI_INTEL0=${ optionalGetEnv "SNABB_PCI_INTEL0" "0000:01:00.0"}
export SNABB_PCI_INTEL1=${ optionalGetEnv "SNABB_PCI_INTEL1" "0000:01:00.1"}
export FAIL_ON_FIRST=true
export SNABB_PCI0=${ requiredGetEnv "SNABB_PCI0" }
export SNABB_PCI_INTEL0=${ requiredGetEnv "SNABB_PCI_INTEL0" }
export SNABB_PCI_INTEL1=${ requiredGetEnv "SNABB_PCI_INTEL1" }

# run tests
sudo -E make test -C src/
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ EXE := bin/snabb $(patsubst %,bin/%,$(PROGRAM))
# core.memory core.lib ...
# for each module that has a top-level selftest () function.
TESTMODS = $(shell find . -regex '[^\#]*\.lua' -printf '%P ' | \
xargs grep -l '^function selftest *[[:punct:]]' | \
xargs grep -s -l '^function selftest *[[:punct:]]' | \
sed -e 's_\.lua__' -e 's_/_._g')

# TESTSCRIPTS expands to:
Expand Down
88 changes: 62 additions & 26 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,18 @@ Tables of named input and output links. These tables are initialized by
the engine for use in processing and are *read-only*.


— Field **myapp.appname**

Name of the app. *Read-only*.


— Method **myapp:link**

*Optional*. Called any time the app’s links may have been changed (including on
start-up). Guaranteed to be called before `pull` and `push` are called with new
links.


— Method **myapp:pull**

*Optional*. Pull packets into the network.
Expand Down Expand Up @@ -303,35 +315,41 @@ Returns a structure holding ring statistics for the *link*:


## Packet (core.packet)

A *packet* is a data structure describing one of the network packets that
is currently being processed. The packet is used to explicitly manage the
life cycle of the packet. Packets are explicitly allocated and freed by
using `packet.allocate` and `packet.free`. When a packet is received
using `link.receive` its ownership is acquired by the calling app. The
app must then ensure to either transfer the packet ownership to another
app by calling `link.transmit` on the packet or free the packet using
`packet.free`. Apps may only use packets they own, e.g. packets that have
not been transmitted or freed. The number of allocatable packets is
limited by the size of the underlying "freelist", e.g. a pool of unused
packet objects from and to which packets are allocated and freed.

— Function **packet.allocate**
A *packet* is an FFI object of type `packet.packet_t` representing a network
packet that is currently being processed. The packet is used to explicitly
manage the life cycle of the packet. Packets are explicitly allocated and freed
by using `packet.allocate` and `packet.free`. When a packet is received using
`link.receive` its ownership is acquired by the calling app. The app must then
ensure to either transfer the packet ownership to another app by calling
`link.transmit` on the packet or free the packet using `packet.free`. Apps may
only use packets they own, e.g. packets that have not been transmitted or
freed. The number of allocatable packets is limited by the size of the
underlying “freelist”, e.g. a pool of unused packet objects from and to which
packets are allocated and freed.

Returns a new empty packet. An an error is raised if there are no packets
left on the freelist.
— Ctype **packet.packet_t**

— Function **packet.free** *packet*
```
struct packet {
uint8_t data[packet.max_payload];
uint16_t length;
};
```

Frees *packet* and puts in back onto the freelist.
— Constant **packet.max_payload**

— Function **packet.data** *packet*
The maximum payload length of a packet.

Returns a pointer to the payload of *packet*.
— Function **packet.allocate**

— Function **packet.length** *packet*
Returns a new empty packet. An an error is raised if there are no packets left
on the freelist. Initially the `length` of the allocated is 0, and its `data`
is uninitialized garbage.

Returns the payload length of *packet*.
— Function **packet.free** *packet*

Frees *packet* and puts in back onto the freelist.

— Function **packet.clone** *packet*

Expand All @@ -357,7 +375,14 @@ accomodate *length* additional bytes.

— Function **packet.shiftleft** *packet*, *length*

Truncates *packet* by *length* bytes from the front.
Truncates *packet* by *length* bytes from the front. *Length* must be less than
or equal to `length` of *packet*.

— Function **packet.shiftright** *packet*, *length*

Move *packet* payload to the right by *length* bytes, growing *packet* by
*length*. The sum of *length* and `length` of *packet* must be less than or
equal to `packet.max_payload`.

— Function **packet.from_pointer** *pointer*, *length*

Expand All @@ -376,10 +401,13 @@ can be accessed directly by network cards. The important
characteristic of DMA memory is being located in contiguous physical
memory at a stable address.

— Function **memory.dma_alloc** *bytes*
— Function **memory.dma_alloc** *bytes*, *[alignment]*

Returns a pointer to *bytes* of new DMA memory.

Optionally a specific *alignment* requirement can be provided (in
bytes). The default alignment is 128.

— Function **memory.virtual_to_physical** *pointer*

Returns the physical address (`uint64_t`) the DMA memory at *pointer*.
Expand Down Expand Up @@ -549,10 +577,18 @@ Returns a table that acts as a bounds checked wrapper around a C array of
ctype and the caller must ensure that the allocated memory region at
*base*/*offset* is at least `sizeof(type)*size` bytes long.

— Function **lib.timer** *s*
— Function **lib.timer** *duration*, *mode*, *timefun*

Returns a closure that will return `false` until *duration* has elapsed. If
*mode* is `'repeating'` the timer will reset itself after returning `true`,
thus implementing an interval timer. *Timefun* is used to get a monotonic time.
*Timefun* defaults to `C.get_time_ns`.

The “deadline” for a given *duration* is computed by adding *duration* to the
result of calling *timefun*, and is saved in the resulting closure. A
*duration* has elapsed when its deadline is less than or equal the value
obtained using *timefun* when calling the closure.

Returns a function that accepts no parameters and acts as a predicate to
test if *ns* nanoseconds have elapsed.

— Function **lib.waitfor** *condition*

Expand Down
8 changes: 1 addition & 7 deletions src/apps/bridge/base.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@
-- can access the configuration via self._conf.config. If config is
-- not set, it is initialiezed to an empty table.
--
-- Note that it is necessary to call the method post_config() after
-- the app has been configured with engine.configure() to complete the
-- initialization. This step will add the ringbuffers associated with
-- the ports to an internal data structure to save a lookup in the
-- input and output tables during packet processing.
--
-- To make processing in the fast path easier, each port and group is
-- assigned a unique integer greater than zero to serve as a "handle".
-- The group handle 0 is assigned to all free ports.
Expand Down Expand Up @@ -149,7 +143,7 @@ end
-- accessible via the keys l_in and l_out, respectively. This helps
-- to speed up packet forwarding by eliminating a lookup in the input
-- and output tables.
function bridge:post_config ()
function bridge:link ()
assert(self.input and self.output)
for _, port in ipairs(self._ports) do
port.l_in = self.input[port.name]
Expand Down
2 changes: 1 addition & 1 deletion src/apps/bridge/learning.lua
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ function bridge:push()
-- packet with one of the packet forwarding tables according
-- to the result.
local mac = self._mac
mac[0] = packet.data(p)
mac[0] = p.data
mac_table:lookup_pft(mac, ip, ig, p, self._pft_C, self._flood_pl[ip])
-- Associate the source MAC address with the ingress port and
-- group. Multicast addresses are forbidden to occur as
Expand Down
Loading