netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch net-next v2 0/8]  Add support for offloading packet-sampling
@ 2016-11-14 15:00 Jiri Pirko
  2016-11-14 15:00 ` [patch net-next v2 1/8] Introduce ife encapsulation module Jiri Pirko
                   ` (8 more replies)
  0 siblings, 9 replies; 16+ messages in thread
From: Jiri Pirko @ 2016-11-14 15:00 UTC (permalink / raw)
  To: netdev
  Cc: davem, yotamg, idosch, eladr, nogahf, ogerlitz, jhs,
	geert+renesas, stephen, xiyou.wangcong, linux, roopa,
	john.fastabend, simon.horman

From: Jiri Pirko <jiri@mellanox.com>

Add the sample tc action, which allows to sample packet matching
a classifier. The sample action peeks randomly packets, duplicates them,
truncates them and adds informative metadata on the packet, for example,
the input interface and the original packet length. The sampled packets
are marked to allow matching them and redirecting them to a specific
collector device.

The sampled packets metadata is packed using ife encapsulation. To do
that, this patch-set extracts ife logics from the tc_ife action into an
independent ife module, and uses that functionality to pack the metadata.
To include all the needed metadata, this patch-set introduces some new
IFE_META tlv types.

In addition, Add the support for offloading the macthall-sample tc command
in the Mellanox mlxsw driver, for ingress qdiscs.

Userspace examples for that code can be found in:
 - https://github.com/yotamgi/host-sflow: sflow client that uses the sample
   with combination of tap device to sample packets and send to a
   centralized sflow collector.
 - https://github.com/yotamgi/libife: a library for manipulating ife
   packets in userspace. The library is used in the host-sflow program to
   parse the sampled packets.

---
v1->v2:
- Change the sampling to be random by default, other than sampling exactly
  every n'th packet
- Change to use __be types in the ife module

rfc->v1:
- Change ifindex sampled packets metadatum to in_ifindex and out_ifindex
- Add sequence number metadatum to sampled packets
- Add sampler_id metadatum to sampled packets
- Make the user kernel interface extensible
- Move the sampling helper function to the ife module
- Fix ife header to be safe when CONFIG_NET_IFE is not set
- Made the sampled packets eth_type field mandatory other then optional
- Change the IFE_META* fields to be enum
- Remove the ife_packet_info struct and pass the parameters directly to
  the ife_packet_ifo_pack function
- Couple of more styling and cosmetic issues

Yotam Gigi (8):
  Introduce ife encapsulation module
  act_ife: Change to use ife module
  net: ife: Introduce new metadata tlv types
  net: ife: Introduce packet info packing method
  Introduce sample tc action
  tc: sample: Add sequence number and sampler_id fields
  mlxsw: reg: add the Monitoring Packet Sampling Configuration Register
  mlxsw: packet sample: Add packet sample offloading support

 MAINTAINERS                                    |   7 +
 drivers/net/ethernet/mellanox/mlxsw/reg.h      |  38 ++++
 drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 120 +++++++++-
 drivers/net/ethernet/mellanox/mlxsw/spectrum.h |  12 +
 drivers/net/ethernet/mellanox/mlxsw/trap.h     |   1 +
 include/net/ife.h                              |  63 ++++++
 include/net/tc_act/tc_ife.h                    |   3 -
 include/net/tc_act/tc_sample.h                 |  73 +++++++
 include/uapi/linux/Kbuild                      |   1 +
 include/uapi/linux/ife.h                       |  24 ++
 include/uapi/linux/tc_act/Kbuild               |   1 +
 include/uapi/linux/tc_act/tc_ife.h             |  10 +-
 include/uapi/linux/tc_act/tc_sample.h          |  29 +++
 net/Kconfig                                    |   1 +
 net/Makefile                                   |   1 +
 net/ife/Kconfig                                |  16 ++
 net/ife/Makefile                               |   5 +
 net/ife/ife.c                                  | 199 +++++++++++++++++
 net/sched/Kconfig                              |  14 ++
 net/sched/Makefile                             |   1 +
 net/sched/act_ife.c                            | 109 +++-------
 net/sched/act_sample.c                         | 290 +++++++++++++++++++++++++
 22 files changed, 921 insertions(+), 97 deletions(-)
 create mode 100644 include/net/ife.h
 create mode 100644 include/net/tc_act/tc_sample.h
 create mode 100644 include/uapi/linux/ife.h
 create mode 100644 include/uapi/linux/tc_act/tc_sample.h
 create mode 100644 net/ife/Kconfig
 create mode 100644 net/ife/Makefile
 create mode 100644 net/ife/ife.c
 create mode 100644 net/sched/act_sample.c

-- 
2.7.4

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2017-01-04 11:04 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-14 15:00 [patch net-next v2 0/8] Add support for offloading packet-sampling Jiri Pirko
2016-11-14 15:00 ` [patch net-next v2 1/8] Introduce ife encapsulation module Jiri Pirko
2016-11-14 15:00 ` [patch net-next v2 2/8] act_ife: Change to use ife module Jiri Pirko
2016-11-14 15:00 ` [patch net-next v2 3/8] net: ife: Introduce new metadata tlv types Jiri Pirko
2016-11-14 15:00 ` [patch net-next v2 4/8] net: ife: Introduce packet info packing method Jiri Pirko
2016-11-14 15:00 ` [patch net-next v2 5/8] Introduce sample tc action Jiri Pirko
2016-11-16 16:15   ` Roopa Prabhu
2016-11-16 16:26     ` Yotam Gigi
2017-01-04 10:42       ` Simon Horman
2017-01-04 11:01         ` Yotam Gigi
2017-01-04 11:04           ` Simon Horman
2016-11-14 15:00 ` [patch net-next v2 6/8] tc: sample: Add sequence number and sampler_id fields Jiri Pirko
2016-11-14 15:00 ` [patch net-next v2 7/8] mlxsw: reg: add the Monitoring Packet Sampling Configuration Register Jiri Pirko
2016-11-14 15:00 ` [patch net-next v2 8/8] mlxsw: packet sample: Add packet sample offloading support Jiri Pirko
2016-11-15  9:27 ` [patch net-next v2 0/8] Add support for offloading packet-sampling Jiri Pirko
2016-11-15 15:17   ` David Miller

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).