lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Sun, 3 Feb 2019 10:11:30 -0700 From: David Ahern <dsahern@...il.com> To: Davide Caratti <dcaratti@...hat.com>, David Ahern <dsahern@...il.com>, Stephen Hemminger <stephen@...workplumber.org> Cc: netdev@...r.kernel.org Subject: Re: [PATCH iproute2-next] tc: full JSON support for 'bpf' actions On 1/31/19 10:58 AM, Davide Caratti wrote: > Add full JSON output support in the dump of 'act_bpf'. > > Example using eBPF: > > # tc actions flush action bpf > # tc action add action bpf object bpf/action.o section 'action-ok' > # tc -j action list action bpf | jq > [ > { > "total acts": 1 > }, > { > "actions": [ > { > "order": 0, > "kind": "bpf", > "bpf_name": "action.o:[action-ok]", > "prog": { > "id": 33, > "tag": "a04f5eef06a7f555", > "jited": 1 > }, > "control_action": { > "type": "pipe" > }, > "index": 1, > "ref": 1, > "bind": 0 > } > ] > } > ] > > Example using cBPF: > > # tc actions flush action bpf > # a=$(mktemp) > # tcpdump -ddd not ether proto 0x888e >$a > # tc action add action bpf bytecode-file $a index 42 > # rm $a > # tc -j action list action bpf | jq > [ > { > "total acts": 1 > }, > { > "actions": [ > { > "order": 0, > "kind": "bpf", > "bytecode": { > "length": 4, > "insns": [ > { > "code": 40, > "jt": 0, > "jf": 0, > "k": 12 > }, > { > "code": 21, > "jt": 0, > "jf": 1, > "k": 34958 > }, > { > "code": 6, > "jt": 0, > "jf": 0, > "k": 0 > }, > { > "code": 6, > "jt": 0, > "jf": 0, > "k": 262144 > } > ] > }, > "control_action": { > "type": "pipe" > }, > "index": 42, > "ref": 1, > "bind": 0 > } > ] > } > ] > > Tested with: > # ./tdc.py -c bpf > > Cc: Andrea Claudi <aclaudi@...hat.com> > Signed-off-by: Davide Caratti <dcaratti@...hat.com> > --- > include/bpf_util.h | 2 +- > lib/bpf.c | 26 ++++++++++++++++++-------- > tc/f_bpf.c | 2 +- > tc/m_bpf.c | 32 +++++++++++++++++--------------- > 4 files changed, 37 insertions(+), 25 deletions(-) > applied to iproute2-next. Thanks
Powered by blists - more mailing lists