mlxsw: spectrum_policer: Add policer core
authorIdo Schimmel <idosch@mellanox.com>
Wed, 15 Jul 2020 08:27:25 +0000 (11:27 +0300)
committerJakub Kicinski <kuba@kernel.org>
Thu, 16 Jul 2020 01:10:00 +0000 (18:10 -0700)
commit8d3fbae70d8d7e5f75cf3cb79eb8f1ac9807c354
tree9d83237d11816589bea3ba87fe3bbde6d91292a1
parent1b744fc9f8d5372506d1a9b7aae2584b75d54e3b
mlxsw: spectrum_policer: Add policer core

Add common code to handle all policer-related functionality in mlxsw.
Currently, only policer for policy engines are supported, but it in the
future more policer families will be added such as CPU (trap) policers
and storm control policers.

The API allows different modules to add / delete policers and read their
drop counter.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlxsw/Makefile
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
drivers/net/ethernet/mellanox/mlxsw/spectrum.h
drivers/net/ethernet/mellanox/mlxsw/spectrum_policer.c [new file with mode: 0644]