ofproto-dpif-upcall: Fix a bug.
authorAlex Wang <alexw@nicira.com>
Fri, 25 Apr 2014 17:39:53 +0000 (10:39 -0700)
committerAlex Wang <alexw@nicira.com>
Fri, 25 Apr 2014 19:28:49 +0000 (12:28 -0700)
commit6f12bda359fb13fb2c0d6f958f56956bb76e47d7
tree265dde5b223a1c6ac56578252a945c54f678844c
parent5c09b672114fab2357c8ce71d608d486eb5ae1ae
ofproto-dpif-upcall: Fix a bug.

Commit 7d170098 (ofproto-dpif-upcall: Remove the flow_dumper thread.)
initialized the memory barrier inside the udpif_start_threads() function.
However, the udpif_start_threads() function does not check the number of
revalidator threads specified in udpif.  So, when the number is zero, it
causes the error in barrier initialization.  This could happen when the
other_config:flow-restore-wait is set and the udpif_flush() is called.

This commit fixes the issue, by checking the specified number of threads
in udpif_start_threads().

Reported-by: Gurucharan Shetty <gshetty@nicira.com>
Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Gurucharan Shetty <gshetty@nicira.com>
ofproto/ofproto-dpif-upcall.c