[ovs-dev] [backer v2 1/3] mac-learning: Simplify mac_learning_changed().

Ben Pfaff blp at nicira.com
Wed Jun 12 22:05:30 UTC 2013

On Wed, Jun 12, 2013 at 02:45:47PM -0700, Ethan Jackson wrote:
> With this patch, the mac_learning module takes responsibility for
> remembering tags which need revalidation after a
> mac_learning_changed() call.  This removes one of
> ofproto-dpif-xlate's dpif_backer uses.
> Signed-off-by: Ethan Jackson <ethan at nicira.com>

Before, mac_learning_run() was happy with a NULL 'set' argument, and
lswitch_run() in lib/learning-switch.c takes advantage of that.  Now,
it potentially segfaults.  I would add "if (set)" around the
tag_set_union() call (but not the tag_set_init() call).

If mac_learning_run() is called at the wrong time, then the
mac_learning object could effectively be hoarding up tags until
something else wakes up poll_block().  So I would argue that it is
safer if we add something like "if (!tag_set_is_empty())
poll_immediate_wake();" to mac_learning_wait() to stave off future
potential for trouble.

It would be nice for mac_learning_changed() to mention that it affects
the next mac_learning_run().

More information about the dev mailing list