From: David S. Miller Date: Sun, 16 Dec 2018 23:20:35 +0000 (-0800) Subject: Merge branch 'mlxsw-spectrum_acl-Add-Bloom-filter-support' X-Git-Tag: v5.4-rc1~1957^2~74 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ae6750e0a5ef3ec93b01008306183fd7a6d2721f;p=platform%2Fkernel%2Flinux-rpi.git Merge branch 'mlxsw-spectrum_acl-Add-Bloom-filter-support' Ido Schimmel says: ==================== mlxsw: spectrum_acl: Add Bloom filter support Nir says: Spectrum-2 uses Bloom filter to reduce the number of lookups in the algorithmic TCAM (A-TCAM). HW performs multiple exact match lookups in a given region using a key composed of { packet & mask, mask ID, region ID }. The masks which are used in a region are called rule patterns or RP. When such multiple masks are used, the A-TCAM region uses an eRP (extended RP) table that describes which rule patterns are in use and defines the order of the lookup. When eRP table is used in a region, one way to reduce the number of the lookups is to consult a Bloom filter before doing the lookup. A Bloom filter is a space-efficient probabilistic data structure, on which a query returns either "possibly in set" or "definitely not in set". HW can skip a lookup if a query on the Bloom filter results a "definitely not set" response. The mlxsw driver implements a "counting filter" and when either a new entry is marked or the last entry is removed it will update the HW. Update of this counting filter occurs when rule is configured or deleted from a region. Patch #1 adds PEABFE register which is used for setting Bloom filter entries. Patch #2 adds Bloom filter resources. Patch #3 and patch #4 provide Bloom filter handling within mlxsw, by adding initialization and logic for updating the Bloom bit vector in HW. Patch #5 and patch #6 add required calls for Bloom filter update as part of rule configuration flow. Patch #7 handles transitions to and from eRP table. It uses a list to keep A-TCAM rules in order to update rules in Bloom filter, in cases of transitions from master mask based A-TCAM region to an eRP table based region and vice versa. Patch #8 removes a trick done on master RP index to a remaining RP, since Bloom filter is updated on eRP transitions. Finally, patch #9 activates Bloom filter mechanism in HW, by cancelling the bypass that was configured before and the remaining three patches are selftests that exercise the new code. ==================== Signed-off-by: David S. Miller --- ae6750e0a5ef3ec93b01008306183fd7a6d2721f