From: David Ahern <dsahern@gmail.com>
To: Davide Caratti <dcaratti@redhat.com>,
David Ahern <dsahern@gmail.com>,
Stephen Hemminger <stephen@networkplumber.org>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH iproute2-next] tc: full JSON support for 'bpf' actions
Date: Sun, 3 Feb 2019 10:11:30 -0700 [thread overview]
Message-ID: <bcd1ab1c-62bc-ac06-1478-d16afdf95b23@gmail.com> (raw)
In-Reply-To: <c1bb8538298d24e302ef0e84ead3bfb97f2438dc.1548957196.git.dcaratti@redhat.com>
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@redhat.com>
> Signed-off-by: Davide Caratti <dcaratti@redhat.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
next prev parent reply other threads:[~2019-02-03 17:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-31 17:58 [PATCH iproute2-next] tc: full JSON support for 'bpf' actions Davide Caratti
2019-02-03 17:11 ` David Ahern [this message]
2019-02-05 22:53 ` Stephen Hemminger
2019-02-05 22:59 ` David Ahern
2019-02-06 9:14 ` Davide Caratti
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bcd1ab1c-62bc-ac06-1478-d16afdf95b23@gmail.com \
--to=dsahern@gmail.com \
--cc=dcaratti@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).