]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum: Add packet sample offloading support
authorYotam Gigi <yotamg@mellanox.com>
Mon, 23 Jan 2017 10:07:11 +0000 (11:07 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Jan 2017 18:44:28 +0000 (13:44 -0500)
commit31aa5ab3b8b0ec8f39f013fa7997244f5564fe29
treee6a1795a19f0932aaec4e74d4d06731a8ba3f6ee
parented938be87231c1c0d924c95e9e533523b62cade8
mlxsw: spectrum: Add packet sample offloading support

Using the MPSC register, add the functions that configure port-based
packet sampling in hardware and the necessary datatypes in the
mlxsw_sp_port struct. In addition, add the necessary trap for sampled
packets and integrate with matchall offloading to allow offloading of the
sample tc action.

The current offload support is for the tc command:

tc filter add dev <DEV> parent ffff: \
  matchall skip_sw \
  action sample rate <RATE> group <GROUP> [trunc <SIZE>]

Where only ingress qdiscs are supported, and only a combination of
matchall classifier and sample action will lead to activating hardware
packet sampling.

Signed-off-by: Yotam Gigi <yotamg@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
drivers/net/ethernet/mellanox/mlxsw/spectrum.h
drivers/net/ethernet/mellanox/mlxsw/trap.h