ofproto-dpif-xlate: Avoid MAC learning write lock on fast path.
Most of the trips through update_learning_table() do not actually change
the MAC learning table, but because some do the code there took the
MAC learning table's write lock. This commit changes the common case to
take only the read lock, falling back to the write lock if a change was
actually necessary.
Ethan reported that this gave a 3.3x performance improvement in one test
case due to reduced lock contention.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>