Stateful network packet processing system, comprising: a first stateful stage implemented in hardware including a hardware state table, HST, and a hardware finite state machine, FSM, table, HFSMT, and a second stateful stage implemented in software including a software state table, SST, and a software FSM table, SFSMT, wherein the HFSMT, by default, contains an entry that is associated with a software indicating state and that specifies an action that redirects matching packets to the SST, wherein the HST and the SST are configured to perform a key-value first-match-lookup to match some packet header(s) of packets belonging to an incoming flow against a state associated with this flow, wherein the HFSMT and the SFSMT are configured to perform a lookup using a combination of packet headers and a packet's state transferred from the HST and the SST, respectively, as a key for the lookup, and wherein the two tables (9, 11; 8, 10) of a stateful stage (6, 7) are configured, in case a state update for a flow is needed, to execute a feedback loop between each other that passes a message with a state update for that specific flow from the respective FSM table (11; 10) to the respective state table (9; 8), wherein at least one of said two stateful stages (6; 7) comprises an evaluation module configured to execute a distribution mechanism that defines when packets belonging to a specific flow should be processed by either said first or said second stateful stage or by a combination of said two stateful stages (6; 7), wherein said evaluation module is configured to translate an evaluation performed on flow and/or packet statistics into a binary variable that is provided as a criterion for moving a particular flow from one of the two stateful stages (6; 7) to the respective other stateful stage (7; 6), wherein at least one of said two FSM tables (11; 10) is extended with an additional field that matches against said binary variable. a first stateful stage implemented in hardware including a hardware state table, HST, and a hardware finite state machine, FSM, table, HFSMT, and a second stateful stage implemented in software including a software state table, SST, and a software FSM table, SFSMT, wherein the HFSMT, by default, contains an entry that is associated with a software indicating state and that specifies an action that redirects matching packets to the SST, wherein the HST and the SST are configured to perform a key-value first-match-lookup to match some packet header(s) of packets belonging to an incoming flow against a state associated with this flow, wherein the HFSMT and the SFSMT are configured to perform a lookup using a combination of packet headers and a packet's state transferred from the HST and the SST, respectively, as a key for the lookup, and wherein the two tables (9, 11; 8, 10) of a stateful stage (6, 7) are configured, in case a state update for a flow is needed, to execute a feedback loop between each other that passes a message with a state update for that specific flow from the respective FSM table (11; 10) to the respective state table (9; 8), wherein at least one of said two stateful stages (6; 7) comprises an evaluation module configured to execute a distribution mechanism that defines when packets belonging to a specific flow should be processed by either said first or said second stateful stage or by a combination of said two stateful stages (6; 7), wherein said evaluation module is configured to translate an evaluation performed on flow and/or packet statistics into a binary variable that is provided as a criterion for moving a particular flow from one of the two stateful stages (6; 7) to the respective other stateful stage (7; 6), wherein at least one of said two FSM tables (11; 10) is extended with an additional field that matches against said binary variable.