Patent ID: 8854996

Claim:
A network processor, comprising: a rules repository, the rules repository comprising a plurality of rules, each rule in the plurality of rules comprises a set of fields encoded in the rule identifying characteristics of the rule, wherein the plurality of rules of the rules repository comprise rules of at least a first rule type and a second rule type, a rule type of each rule being indicated in a rule type (RT) field in the set of fields encoded in the rule identifying the characteristics of the rule, wherein each rule of the first rule type is executed by the parser in normal operation mode, and wherein each rule of the second rule type is executed by the parser in normal operation mode when the rule is executed for the first time after the rule has been loaded to one or more registers of one or more processing units executing instructions of the parser and is executed in repeat operation mode when the rule is executed in an m th repeat time, m being an integer larger 1; and a parser, executed by one or more processing units in the network processor, being operable to work at least in a normal operation mode and in a repeat operation mode, wherein the parser in the normal operation mode loads at least one first rule from the rules repository in a first working cycle and executes an instruction of the loaded at least one first rule on a data packet in a second working cycle, wherein the at least one first rule being executed by the parser for analyzing the data packet, and wherein an analysis result is generated; wherein the parser in the repeat operation mode loads the at least one first rule from the rules repository in a first working cycle, executes the instruction of the loaded at least one first rule on the data packet in the second working cycle, and reapplies the instruction on the data packet in each of one or more repeats in one or more subsequent working cycles; wherein the parser is operable to dynamically switch from normal operation mode to repeat operation mode in dependence on the analysis result; and wherein the parser dynamically determines a number of the one or more repeats from a repeat count (RC) field in a set of fields encoded in the at least one first rule identifying characteristics of the at least one first rule.