GithubHelp home page GithubHelp logo

ebpf_map's Introduction

ebpf_map

This repo is for testing the performance of hash & trie map in ebpf.

build ebpf manually

export CLANG=clang
export CFLAGS="-O2 -g -Wall -Werror -target bpf"
export INCLUDE="./include"
$CLANG $CFLAGS -I$INCLUDE -c ebpf_map.c -o ebpf_map.o
# clang -O2 -g -Wall -Werror -target bpf -I./include -c ebpf_map.c -o ebpf_map.o

attach ebpf manually

tc qdisc add dev <device> clsact
tc filter add dev <device> <direction> bpf da obj <object-name> sec <section-name>
tc filter show dev <device> <direction>

# e.g
tc filter add dev lxc60294565d708 ingress bpf da obj ebpf_map.o sec trie
# tc filter show dev lxc60294565d708 ingress
filter protocol all pref 49152 bpf chain 0 
filter protocol all pref 49152 bpf chain 0 handle 0x1 ebpf_map.o:[trie] direct-action not_in_hw id 6814 tag 704c89c4edcf21bb jited 

test summary

match cnt hash (Gbps) lpm_trie (Gbps)
1 21.3 21.0
2 21.4 20.9
3 21.1 21.1
4 21.1 21.1
5 21.1 21.0
6 21.1 21.1
7 21.1 21.0
8 20.8 20.9
9 20.8 21.0
10 20.9 20.9
11 20.8 20.9
12 20.8 20.8
13 20.6 21.0
14 20.5 20.9
15 20.6 21.2
16 20.6 21.0
17 20.6 21.1
18 20.6 20.9
19 20.5 21.3
20 20.4 21.0
21 20.6 21.1
22 20.5 21.1
23 20.4 21.3
24 20.5 20.8
25 20.4 21.1
26 20.2 21.1
27 20.3 20.9
28 20.1 20.9
29 20.2 20.8
30 20.3 20.8
31 20.1 21.0
32 20.3 20.9
33 19.8 20.9

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.