• Amit Cohen's avatar
    mlxsw: spectrum_acl_bloom_filter: Add support for Spectrum-4 calculation · 852ee419
    Amit Cohen authored
    Spectrum-4 will calculate hash function for bloom filter differently
    from the existing ASICs.
    
    First, two hash functions will be used to calculate 16 bits result.
    The final result will be combination of the two results - 6 bits which
    are result of CRC-6 will be used as MSB and 10 bits which are result of
    CRC-10 will be used as LSB.
    
    Second, while in Spectrum{2,3}, there is a padding in each chunk, so the
    chunks use a sequence of whole bytes, in Spectrum-4 there is no padding,
    so each chunk use 20 bytes minus 2 bits, so it is necessary to align the
    chunks to be without holes.
    
    Add dedicated 'mlxsw_sp_acl_bf_ops' for Spectrum-4 and add the required
    tables for CRC calculations.
    
    All the details are documented as part of the code for future use.
    Signed-off-by: default avatarAmit Cohen <amcohen@nvidia.com>
    Reviewed-by: default avatarPetr Machata <petrm@nvidia.com>
    Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    852ee419
spectrum.h 48.9 KB