1. A method comprising: accessing a primary lookup table defining packet classification rules, each classification rule having multiple fields; generating by one or more processors multiple secondary lookup tables from the primary lookup table by extracting, for each secondary lookup table, a selection of classification rules and a selection of fields from the multiple fields, based on a rule set identifying predefined entries; and grouping the multiple secondary lookup tables into secondary lookup table groups and generating a mapping table to map rule results of each of the secondary lookup tables into results for the secondary lookup table groups.