datapath: Add ref counting for flows.
authorJesse Gross <jesse@nicira.com>
Sun, 29 Aug 2010 16:49:51 +0000 (09:49 -0700)
committerJesse Gross <jesse@nicira.com>
Wed, 22 Sep 2010 20:43:01 +0000 (13:43 -0700)
commitfb8c93473efacd67a50117d0f2a3084f2d96ceca
tree7571fc5795d97e7e937bc3ae289ad9d183b558f2
parent560e802229f3028c02273435dd1c6efba33e0949
datapath: Add ref counting for flows.

Currently flows are only used within the confines of one
rcu_read_lock()/rcu_read_unlock() session.  However, with the
addition of header caching we will need to hold references to flows
for longer periods of time.  This adds support for that by adding
refcounts to flows.  RCU is still used for normal packet handling
to avoid a performance impact from constantly updating the refcount.
However, instead of directly freeing the flow after a grace period
we simply decrement the refcount.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Reviewed-by: Ben Pfaff <blp@nicira.com>
datapath/datapath.c
datapath/flow.c
datapath/flow.h