cmap: Explain corner case in CMAP_FOR_EACH comment.
authorDaniele Di Proietto <diproiettod@vmware.com>
Wed, 3 Feb 2016 04:55:48 +0000 (20:55 -0800)
committerDaniele Di Proietto <diproiettod@vmware.com>
Thu, 4 Feb 2016 03:43:24 +0000 (19:43 -0800)
Commit d916785ce98c("dpif-netdev: Fix improper use of CMAP_FOR_EACH.")
fixes a problem that's worth documenting.

Requested-by: Jarno Rajahalme <jarno@ovn.org>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ben Pfaff <blp@ovn.org>
lib/cmap.h

index c653424..c7c65af 100644 (file)
@@ -169,6 +169,11 @@ unsigned long cmap_find_batch(const struct cmap *cmap, unsigned long map,
  *       node being deleted may be visited once or not at all.  Other nodes
  *       will be visited once.)
  *
+ *     - If the cmap is changing, it is not safe to quiesce while iterating.
+ *       Even if the changes are done by the same thread that's performing the
+ *       iteration (Corollary: it is not safe to call cmap_remove() and quiesce
+ *       in the loop body).
+ *
  *
  * Example
  * =======