ofproto-dpif: Move "learn" actions into individual threads.
authorBen Pfaff <blp@nicira.com>
Fri, 13 Sep 2013 03:45:31 +0000 (20:45 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 13 Sep 2013 03:46:19 +0000 (20:46 -0700)
commit1b63b91eb085b381d0a765855a11a27d9d43c27d
tree3296afe2ff14c3c383e93d9d1666a7cde15c325e
parent8b81d1ef3ca5f1815267a12d44b6ebc96b5a45c1
ofproto-dpif: Move "learn" actions into individual threads.

Before OVS introduced threading, any given ``learn'' action took effect in
the flow table before the next incoming flow was set up.  This meant that
if a packet came in, used ``learn'' to set up a flow to handle replies, and
then a reply came in, the reply would always hit the flow set up by the
``learn'' action.  Until now, with the threading implementation, though,
the effects of ``learn'' actions happen asynchronously via a queue, which
means that the reply can arrive before the flow to handle it is set up.
This introduced an unacceptable regression in important use cases.

This commit fixes the problem by switching back to executing learn actions
before forwarding the packet that triggered it.

I imagine that there is considerable opportunity for optimization here.

Bug #19147.
Bug #19244.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
ofproto/ofproto-dpif-xlate.c
ofproto/ofproto-dpif.c
ofproto/ofproto.c