Mechanisms for reducing the number of block masks required for programming
multiple access control lists in an associative memory are disclosed. A
combined ordering of masks corresponding to multiple access control lists
(ACLs) is typically identified, with the multiple ACLs including n ACLs.
An n-dimensional array is generated, wherein each axis of the
n-dimensional array corresponds to masks in their requisite order of a
different one of the multiple ACLs. The n-dimensional array progressively
identifies numbers of different masks required for subset orderings of
masks required for subsets of the multiple ACLs. The n-dimensional array
is traversed to identify a sequence of masks corresponding to a single
ordering of masks including masks required for each of the multiple ACLs.