From: Florian Fainelli <f.fainelli@gmail.com>
To: Yotam Gigi <yotamg@mellanox.com>,
stephen@networkplumber.org, netdev@vger.kernel.org,
jiri@mellanox.com, eladr@mellanox.com
Subject: Re: [PATCH iproute2/net-next 1/3] tc: Add support for the sample tc action
Date: Sun, 5 Feb 2017 10:36:59 -0800 [thread overview]
Message-ID: <18afef7b-22f4-e37f-4ea3-99d8307a1eb7@gmail.com> (raw)
In-Reply-To: <1486281534-61663-2-git-send-email-yotamg@mellanox.com>
On 02/04/2017 11:58 PM, Yotam Gigi wrote:
> The sample tc action allows sampling packets matching a classifier. It
> peeks randomly packets, and samples them using the psample netlink
> channel. The user can specify the psample group, which the packet will be
> sampled to, the sampling rate and the packet truncation (to save
> kernel-user traffic).
>
> The sampled packets contain informative metadata, for example, the input
> interface and the original packet length.
>
> The action syntax:
> tc filter add [...] \
> action sample rate <RATE> group <GROUP> [trunc <SIZE>]
> [...]
>
> Where:
> RATE := The sampling rate which is the ratio of packets observed at the
> data source to the samples generated
> GROUP := the psample module sampling group
> SIZE := optional truncation size
>
> An example for a common usecase of the sample tc action: to sample ingress
> traffic from interface eth1, one may use the commands:
>
> tc qdisc add dev eth1 handle ffff: ingress
>
> tc filter add dev eth1 parent ffff: \
> matchall action sample rate 12 group 4
>
> Where the first command adds an ingress qdisc and the second starts
> sampling randomly with an average of one sampled packet per 12 packets
> on dev eth1 to psample group 4.
The group argument seems to be mandatory from looking at the code, but
what if just wanted to have a port mirroring between, say sw0p1 and
sw0p2 with the sample rate specified instead (without using the psample
netlink channel at all)? Could we make this group an optional argument
instead?
Thanks!
--
Florian
next prev parent reply other threads:[~2017-02-05 18:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-05 7:58 [PATCH iproute2/net-next 0/3] Add the tc-sample action Yotam Gigi
2017-02-05 7:58 ` [PATCH iproute2/net-next 1/3] tc: Add support for the sample tc action Yotam Gigi
2017-02-05 18:36 ` Florian Fainelli [this message]
2017-02-05 20:22 ` Yotam Gigi
2017-02-05 20:55 ` Florian Fainelli
2017-02-06 7:38 ` Yotam Gigi
2017-02-05 7:58 ` [PATCH iproute2/net-next 2/3] tc: man: Add man entry for the tc-sample action Yotam Gigi
2017-02-05 7:58 ` [PATCH iproute2/net-next 3/3] tc: man: matchall: Update examples to include sample Yotam Gigi
2017-02-06 22:26 ` [PATCH iproute2/net-next 0/3] Add the tc-sample action Stephen Hemminger
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=18afef7b-22f4-e37f-4ea3-99d8307a1eb7@gmail.com \
--to=f.fainelli@gmail.com \
--cc=eladr@mellanox.com \
--cc=jiri@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
--cc=yotamg@mellanox.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 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).