Patent ID: 7675928

Claim:
A method, comprising: performing packet processing operations on a network processor having multiple compute engines via execution of instruction threads on those compute engines; implementing a flow-based packet processing assignment mechanism that causes at least a portion of the packet processing operations for packets associated with common flows to be performed on compute engines assigned to perform packet processing operations for those flows; assigning flows of packets to scratch rings; assigning, for each scratch ring, at least one compute engine to consume packets from that scratch ring; classifying received packets into the flows based on attributes of those packets; and for a given packet of a given flow: producing the packet on the scratch ring to which the given flow is assigned; and performing the portion of the packet processing operations on the at least one compute engine assigned to the scratch ring; maintaining respective flow counters for the scratch rings, each flow counter identifying how many flows have been assigned to its associated scratch ring; determining a number of flows assigned to a given scratch ring has reached a predefined limit; and replacing one of the flows assigned to that scratch ring with a new flow, the flow that is replaced comprising a least recently used flow.