]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum: Add support in matchall mirror TC offloading
authorYotam Gigi <yotamg@mellanox.com>
Thu, 21 Jul 2016 10:03:17 +0000 (12:03 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 Jul 2016 06:12:00 +0000 (23:12 -0700)
commita25b2c9e6d131cf3730c18a3a6602e9f8e2e2f3c
tree37141c0835336fa9894b2a0ab30bde01b4088a69
parent5442106006c68fedb33313d119e520901aea1441
mlxsw: spectrum: Add support in matchall mirror TC offloading

This patch offloads port mirroring directives to hw using the matchall TC
with action mirror. It includes both the implementation of the
ndo_setup_tc function for the spectrum driver and the spectrum hardware
offload configuration code.

The hardware offload code is basically two new functions which are capable
of adding and removing a new mirror ports pair. It is done using the MPAT,
MPAR and SBIB registers:
 - A new Switch-Port Analyzer (SPAN) entry is added using MPAT to the 'to'
   port.
 - The 'to' port is bound to the SPAN entry using MPAR register.
 - In case of egress SPAN, the 'to' port gets a new internal shared
   buffer using SBIB register.

In addition, a new database was added to the mlxsw_sp struct to store all
the SPAN entries and their bound ports list. The number of supported SPAN
entries is determined by resource query.

Signed-off-by: Yotam Gigi <yotamg@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@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