3 ms·
All the jumps are only forward, which guarantees that there aren't any loops in the BPF program. In other words, BPF programs can be thought of as encoding a D
by userbinator 13y ago
All the jumps are only forward, which guarantees that there aren't any loops in the BPF program.
In other words, BPF programs can be thought of as encoding a DAG that represents a decision tree.
- bhickey 13y agoYes and no. It's important to keep in mind that BPF uses a register machine. If you look at the paper[0] describing BPF, the authors explicitly considered a decision tree model (CSPF). Turns out that trees perform redundant computation, can't deal with variable length headers, and are not memory efficient. [0] http://www.tcpdump.org/papers/bpf-usenix93.pdf http://www.tcpdump.org/papers/bpf-usenix93.pdf
- userbinator 13y agoRight, that's why I said it's a DAG -- a decision DAG -- instead of just a tree structure.