ofproto-dpif-xlate: Cache xlate_actions() effects.
authorJoe Stringer <joestringer@nicira.com>
Thu, 10 Apr 2014 04:00:28 +0000 (16:00 +1200)
committerJoe Stringer <joestringer@nicira.com>
Fri, 18 Apr 2014 00:04:21 +0000 (12:04 +1200)
commitb256dc525c8ef663daf2330463e67a26207cc5f1
treede6c8805b2399f36412e616a9a56396c9bca239c
parent1ebeaaa7f0c3f0f94f28377404c52a11cca50d86
ofproto-dpif-xlate: Cache xlate_actions() effects.

This patch adds a new object called 'struct xlate_cache' which can be
set in 'struct xlate_in', and passed to xlate_actions() to cache the
modules affected by this flow translation. Subsequently, the caller can
pass the xcache to xlate_push_stats() to credit stats and perform side
effects for a lower cost than full flow translation.

These changes are aimed currently at long-lived flows, decreasing the
average dump duration for such flows by 50-80%. This allows more flows
to be supported in the datapath at a given time. Applying these changes
to short-lived flows is left for a later commit.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
---
v2: Acked.
v1: Add caching for fin_timeout action.
    Expire netflows on xlate_cache_clear().
    Account to bonds using a copy of 'flow' rather than hash.
    Always build XC_NORMAL entry (previously only if may_learn is true)
    Rename xlate_from_cache()->xlate_push_stats()
    Add may_learn parameter to xlate_push_stats()
    Tidy up xlate_actions__() mirror/netflow code.
    Fold in style fixups.
RFC: First post.
ofproto/ofproto-dpif-upcall.c
ofproto/ofproto-dpif-xlate.c
ofproto/ofproto-dpif-xlate.h