From: Jiri Pirko <jiri@resnulli.us>
To: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org, jiri@mellanox.com,
paulb@mellanox.com, john.fastabend@gmail.com,
simon.horman@netronome.com, mrv@mojatatu.com,
hadarh@mellanox.com, ogerlitz@mellanox.com, roid@mellanox.com,
xiyou.wangcong@gmail.com, daniel@iogearbox.net
Subject: Re: [PATCH net-next v4 1/2] net sched actions: Add support for user cookies
Date: Tue, 17 Jan 2017 13:03:49 +0100 [thread overview]
Message-ID: <20170117120349.GA1807@nanopsycho.orion> (raw)
In-Reply-To: <1484651509-27500-2-git-send-email-jhs@emojatatu.com>
Tue, Jan 17, 2017 at 12:11:48PM CET, jhs@mojatatu.com wrote:
>From: Jamal Hadi Salim <jhs@mojatatu.com>
>
>Introduce optional 128-bit action cookie.
>Like all other cookie schemes in the networking world (eg in protocols
>like http or existing kernel fib protocol field, etc) the idea is to save
>user state that when retrieved serves as a correlator. The kernel
>_should not_ intepret it. The user can store whatever they wish in the
>128 bits.
>
>Sample exercise(showing variable length use of cookie)
>
>.. create an accept action with cookie a1b2c3d4
>sudo $TC actions add action ok index 1 cookie a1b2c3d4
>
>.. dump all gact actions..
>sudo $TC -s actions ls action gact
>
> action order 0: gact action pass
> random type none pass val 0
> index 1 ref 1 bind 0 installed 5 sec used 5 sec
> Action statistics:
> Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
> backlog 0b 0p requeues 0
> cookie a1b2c3d4
>
>.. bind the accept action to a filter..
>sudo $TC filter add dev lo parent ffff: protocol ip prio 1 \
>u32 match ip dst 127.0.0.1/32 flowid 1:1 action gact index 1
>
>... send some traffic..
>$ ping 127.0.0.1 -c 3
>PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
>64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.020 ms
>64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.027 ms
>64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.038 ms
>
>--- 127.0.0.1 ping statistics ---
>3 packets transmitted, 3 received, 0% packet loss, time 2109ms
>rtt min/avg/max/mdev = 0.020/0.028/0.038/0.008 ms 1
>
>... show some stats
>$ sudo $TC -s actions get action gact index 1
>
> action order 1: gact action pass
> random type none pass val 0
> index 1 ref 2 bind 1 installed 204 sec used 5 sec
> Action statistics:
> Sent 12168 bytes 164 pkt (dropped 0, overlimits 0 requeues 0)
> backlog 0b 0p requeues 0
> cookie a1b2c3d4
>
>.. try longer cookie...
>$ sudo $TC actions replace action ok index 1 cookie 1234567890abcdef
>.. dump..
>$ sudo $TC -s actions ls action gact
>
> action order 1: gact action pass
> random type none pass val 0
> index 1 ref 2 bind 1 installed 204 sec used 5 sec
> Action statistics:
> Sent 12168 bytes 164 pkt (dropped 0, overlimits 0 requeues 0)
> backlog 0b 0p requeues 0
> cookie 1234567890abcdef
>
>Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
next prev parent reply other threads:[~2017-01-17 12:05 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-17 11:11 [PATCH net-next v4 0/2] Add support for tc cookies Jamal Hadi Salim
2017-01-17 11:11 ` [PATCH net-next v4 1/2] net sched actions: Add support for user cookies Jamal Hadi Salim
2017-01-17 12:03 ` Jiri Pirko [this message]
2017-01-17 14:16 ` Daniel Borkmann
2017-01-17 16:50 ` Jamal Hadi Salim
2017-01-17 16:53 ` Jamal Hadi Salim
2017-01-17 16:57 ` Daniel Borkmann
2017-01-17 17:03 ` Jamal Hadi Salim
2017-01-17 17:05 ` Jiri Pirko
2017-01-18 11:00 ` Jamal Hadi Salim
2017-01-17 14:59 ` Simon Horman
2017-01-17 18:40 ` Cong Wang
2017-01-18 11:35 ` Jamal Hadi Salim
2017-01-18 11:47 ` Paul Blakey
2017-01-18 12:13 ` Jamal Hadi Salim
2017-01-17 11:11 ` [PATCH net-next v4 2/2] net sched: Trivial whitespace and stylistic changes Jamal Hadi Salim
2017-01-17 12:12 ` Jiri Pirko
2017-01-17 16:30 ` Jamal Hadi Salim
2017-01-17 12:17 ` [PATCH net-next v4 0/2] Add support for tc cookies Jiri Pirko
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=20170117120349.GA1807@nanopsycho.orion \
--to=jiri@resnulli.us \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=hadarh@mellanox.com \
--cc=jhs@mojatatu.com \
--cc=jiri@mellanox.com \
--cc=john.fastabend@gmail.com \
--cc=mrv@mojatatu.com \
--cc=netdev@vger.kernel.org \
--cc=ogerlitz@mellanox.com \
--cc=paulb@mellanox.com \
--cc=roid@mellanox.com \
--cc=simon.horman@netronome.com \
--cc=xiyou.wangcong@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.