cmap: ovsrcu postpone the cmap destroy.
authorAlex Wang <alexw@nicira.com>
Wed, 1 Oct 2014 18:49:10 +0000 (11:49 -0700)
committerAlex Wang <alexw@nicira.com>
Wed, 1 Oct 2014 20:02:50 +0000 (13:02 -0700)
commit7530fe0d8a69b0f9477f94f9883e9e31ad3630b1
tree999c23f5de7deaca5b613d9e9ab828502080278a
parent58f195398e4d457d2b83b760935a65a70d9b1384
cmap: ovsrcu postpone the cmap destroy.

Currently, the cmap_destroy() directly frees the cmap memory.
Some callers of cmap_destroy() (e.g. destroy_subtable()) still
allows other threads (e.g. pmd threads) accessing the cmap at
the same time (e.g. via classifier_lookup_miniflow_batch()),
which could cause segfault.

To fix the above issue, this commit use ovsrcu to postpone
the free of cmap memory.

Reported-by: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
lib/cmap.c