mirror_iproute2/include
Yotam Gigi 0b1abd84fb 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>
2017-02-06 14:24:52 -08:00
..
iptables Update to current iptables headers 2016-01-03 15:14:27 -08:00
libiptc Update to current iptables headers 2016-01-03 15:14:27 -08:00
linux tc: Add support for the sample tc action 2017-02-06 14:24:52 -08:00
netinet ss: report ecnseen 2011-11-23 14:51:54 -08:00
bpf_api.h lwt: BPF support for LWT 2016-12-12 15:32:54 -08:00
bpf_elf.h bpf: add initial support for attaching xdp progs 2016-12-09 12:44:12 -08:00
bpf_scm.h tc, bpf: finalize eBPF support for cls and act front-end 2015-04-10 13:31:19 -07:00
bpf_util.h bpf: Add BPF_ macros 2016-12-13 10:20:15 -08:00
color.h color: introduce color helpers and COLOR_CLEAR 2016-03-27 10:37:34 -07:00
dlfcn.h remove unnecessary extern 2015-08-13 14:09:58 -07:00
ip6tables.h Update to current iptables headers 2016-01-03 15:14:27 -08:00
iptables_common.h fix build warnings 2007-06-20 10:55:18 -07:00
iptables.h Update to current iptables headers 2016-01-03 15:14:27 -08:00
json_writer.h provide common json output formatter 2015-08-23 10:05:29 -07:00
libgenl.h libgenl: introduce genl_init_handle 2016-08-17 13:59:21 -07:00
libnetlink.h libnetlink: Add variant of rtnl_talk that does not display RTNETLINK answers error 2016-12-13 10:20:16 -08:00
list.h list: add list_add_tail helper 2016-04-19 08:01:05 -07:00
ll_map.h remove unnecessary extern 2015-08-13 14:09:58 -07:00
names.h tc class: Ignore if default class name file does not exist 2015-04-07 08:31:56 -07:00
namespace.h remove unnecessary extern 2015-08-13 14:09:58 -07:00
rt_names.h make the addr argument of ll_addr_n2a const 2015-03-24 15:45:23 -07:00
rtm_map.h ip, realms: also allow to pass in raw realms value 2015-10-22 23:40:51 -07:00
SNAPSHOT.h v4.9.0 2016-12-12 15:07:42 -08:00
utils.h utils: make hex2mem available to all users 2017-01-17 08:45:22 -08:00
xt-internal.h Breakage noticed when debian upgraded to xtables (iptables > 1.4.1) 2009-02-19 09:02:13 -08:00
xtables.h Update to current iptables headers 2016-01-03 15:14:27 -08:00