History log of /external/iproute2/tc/m_sample.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
e67aba559581143f9bc34f0706b0c3feeeab08fa 16-May-2017 Jiri Pirko <jiri@mellanox.com> tc: actions: add helpers to parse and print control actions

Each tc action is terminated by a control action. Each action parses and
prints then intividually. Introduce set of helpers and allow to share
this code.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
/external/iproute2/tc/m_sample.c
0b1abd84fba51c2aa1d9f070e88c79aee5c1e802 05-Feb-2017 Yotam Gigi <yotamg@mellanox.com> tc: Add support for the sample tc action

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.

Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Yotam Gigi <yotamg@mellanox.com>
/external/iproute2/tc/m_sample.c