mlxsw: spectrum_acl: Add Bloom filter handling
authorNir Dotan <nird@mellanox.com>
Sun, 16 Dec 2018 08:49:28 +0000 (08:49 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 16 Dec 2018 23:20:34 +0000 (15:20 -0800)
commit7585cacdb978a0cd8d47bff9e5dcecdc9d903add
treefce0fbd6dc8609e4d77505b2c58cd7978590f45e
parent0487cfba866a7f985c51ce7553d37439e10e71c1
mlxsw: spectrum_acl: Add Bloom filter handling

Spectrum-2 HW uses Bloom filter in order to skip lookups on specific
eRPs. It uses crc-16-Msbit-first calculation over a specific layout
of a rule's key fields combined with eRP ID as well as region ID.
Per potential lookup, iff the Bloom filter entry of the calculated
index is empty, then the lookup can be skipped. Hence, the mlxsw
driver should update the Bloom filter entry per each rule insertion
or deletion when rules are part of an eRP.

Add functions for adding and deleting entries in the Bloom filter.
In order to do so also add crc-16 computation based on the specific
Spectrum-2 polynomial and a function for encoding the crc-16 input
in the manner dictated by HW implementation.

Signed-off-by: Nir Dotan <nird@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_bloom_filter.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.h