datapath: handle recirculation loop detection
authorAndy Zhou <azhou@nicira.com>
Wed, 30 Apr 2014 23:13:27 +0000 (16:13 -0700)
committerAndy Zhou <azhou@nicira.com>
Thu, 1 May 2014 22:00:23 +0000 (15:00 -0700)
Current datapath limits the number of times same packet can loop
through action execution to avoid blowing out the kernel stack.
Recirculation also adds to action execution count, but does not use
the same amount of stack compare to other services, such as IPsec.

This patch introduces the concept of stack cost. Recirculation has a
stack cost of 1 while other services have stack cost of 4. Datapath
packet process can accommodate packets that need both services and
recirculation as long as the total stack cost does not exceed the max
stack cost. Packets exceed the limit will be treated as looped packets
and dropped.

The max stack cost is set to allow up to 4 regular services, plus up
to 3 recirculation. The behavior of packets do not recirculate does
not change.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>

No differences found