ofproto-dpif: Remove pointers between rules and facets.
authorEthan Jackson <ethan@nicira.com>
Thu, 2 May 2013 22:22:19 +0000 (15:22 -0700)
committerEthan Jackson <ethan@nicira.com>
Sun, 7 Jul 2013 11:48:05 +0000 (04:48 -0700)
commitb7e2f6b3f5e35cc64349d900e3be9d1dc5167c73
tree884c4a61759abdc8f48ab54686bb1bb690a43461
parent46c88433b341c4d982c10d9de5bf3330bbcd621d
ofproto-dpif: Remove pointers between rules and facets.

Before this patch, facets maintained a pointer to the first rule
used when translating their actions, and rules maintained a pointer
to those facets.  This made sense before the resubmit actions which
each facet used precisely one rule.  However, today a facet may
require many rules to translate, and therefore it makes no
conceptual sense to designate one as the "owning rule".

Furthermore, as Open vSwitch becomes multithreaded, maintaining a
facet's rule pointer will become more difficult.  One thread will
do the action translation, while another will maintain the facets.
During the hand-off between these threads, it's possible the
"owning rule" will expire leaving us with a stale pointer.

This patch does have a disadvantage,  Pushing a facet's statistics
will become slightly less efficient as it will involve an
additional classifier lookup.  We can revisit this issue once
multithreading is complete, but I suspect there's much lower
hanging fruit to worry about.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
ofproto/ofproto-dpif.c
ofproto/ofproto-dpif.h