Expose the struct ovs_list definition in <openvswitch/list.h>. Keep the
list access API private for now.
Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Ben Pfaff <blp@nicira.com>
struct list is a common name and can't be used in public headers.
Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Commit 6b59b543 (ovs-thread: Use fair (but nonrecursive)
rwlocks on glibc.) changed the rwlocks to nonrecursive,
writer-biased lock. It also made the following deadlock
possible.
Assume BFD is used on both end of a link. Consider the
following events:
1. Handler at one end received the BFD control packet with
POLL flag set while holding the read lock of 'xlate_rwlock'.
Since a BFD control packet with FINAL flag set should be
sent back immediately, it calls the
ofproto_dpif_monitor_port_send_soon(), in which, it tries
to grab the 'monitor_mutex'.
2. The main thread needs to configure the ofproto-dpif-xlate
module. It tries to grab the write lock of 'xlate_rwlock'
and is blocked by event 1.
3. The monitor thread, after acquired the 'monitor_mutex',
wants to acquire the read lock of 'xlate_rwlock'.
Since the rwlock is now writer-biased, the attempt of acquiring
read lock in event 3 will be blocked by event 2. This will
subsequently cause the block of event 1, since monitor thread
is holding the 'monitor_mutex'. So the deadlock happens.
This commit resolves the above issue by removing the requirement of
acquiring 'monitor_mutex' in ofproto_dpif_monitor_port_send_soon().
Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
We already had queues that were suitable for replacement by this data
structure, and I intend to add another one later on.
flow_miss_batch_ofproto_destroyed() did not work well with the guarded-list
structure (it required either adding a lot more functions or breaking the
abstraction) so I changed the caller to just use udpif_revalidate().
Checking reval_seq at the end of handle_miss_upcalls() also didn't work
well with the abstraction, so I decided that since this was a corner case
anyway it would be acceptable to just drop those in flow_miss_batch_next().
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>