Patent ID: 8767540

Claim:
A method performed in a packet processor core for policing a packet through a runtime configurable hierarchical policer at line rate, the hierarchical policer coupled to one or more policing requestors, the method comprising the steps of: receiving, from one of the policing requestors, a policer request to perform hierarchical packet policing, wherein the policer request comprises packet characteristics and identifies request configuration information; retrieving a plurality of meter states from meter state storage, each meter state specified by the request configuration information for one of the plurality of meters, wherein the retrieving comprising the steps of: checking a meter state cache for the presence of each meter state; retrieving, from the meter cache, each meter state found in the meter cache; retrieving, from a meter state memory, each meter state not found in the meter cache; and loading, into the meter state cache, each meter state retrieved from the meter state memory; processing one or more of the packet characteristics through each meter to generate a meter result indicating how one or more of the packet characteristics compare to that meter's specified meter state; generating a hierarchical policer table lookup address using a plurality of meter types, a plurality of input color controls, one or more of the packet characteristics, the plurality of meter results, and the plurality of coupling algorithm identifiers; reading a hierarchical meter result from a hierarchical policer result table, wherein the hierarchical meter result contains at least a final output packet attribute that classifies the packet, and wherein the hierarchical meter result further comprises a meter state update indicator that indicates one or more meter states to be updated and the meter states are updated in the meter state cache; updating one or more of the meter states based, in part, on the plurality of meter state results; and returning the final packet output to the policing requestor.