mlxsw: spectrum: Add policers for trap groups
authorNogah Frankel <nogahf@mellanox.com>
Fri, 25 Nov 2016 09:33:47 +0000 (10:33 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 26 Nov 2016 02:22:14 +0000 (21:22 -0500)
commit9148e7cf73ced9bf9d2a1104f6ab3b69303662a2
tree7bb70843f9279d31ad544cbf9bc87e10d1751c3b
parent76a4c7d32a0b0a5a4a072a56a3dc4a2850afd8d8
mlxsw: spectrum: Add policers for trap groups

Configure policers and connect them to trap groups.

While many trap groups share policer's configuration they don't share
the actual policer because each trap group represents a different
flow / protocol and we don't want one of them to be able to exceed its
rate on behalf of another.
For example, if STP and LLDP gets to send 128 packets/sec each, if we
put them in one 256 packets/sec policer, one can send 200 packets while
the other only 50.

Note that IP2ME covers lots of flows, so it's limit is set to match the
cpu ability to handle data.

Signed-off-by: Nogah Frankel <nogahf@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