Hi Ethan,

I am wondering if it is expected for the following warnings to show up
when functions do not always take locks.

The reason that I as is that I am planning to use a similar scheme
in conjunction with a revised version of the recirculation code that
I am working on to take into account your recent changes to make miss
handling multithreaded and I it would be rather helpful if the
annotations worked with this scheme.


# clang --version
Debian clang version 3.4-1~exp1 (trunk) (based on LLVM 3.4)
Target: x86_64-pc-linux-gnu
Thread model: posix
# make
...
ofproto/ofproto-dpif.c:4788:5: warning: locking 'rule->up.evict' that is 
already locked [-Wthread-safety-analysis]
    ovs_rwlock_rdlock(&(*rule)->up.evict);
    ^
./lib/ovs-thread.h:103:9: note: expanded from macro 'ovs_rwlock_rdlock'
        ovs_rwlock_rdlock_at(rwlock, SOURCE_LOCATOR)
        ^
ofproto/ofproto-dpif.c:4835:5: warning: mutex 'rule->up.evict' is not locked on 
every path through here [-Wthread-safety-analysis]
    ovs_rwlock_unlock(&cls->rwlock);
    ^
ofproto/ofproto-dpif.c:4830:18: note: mutex acquired here
    if (*rule && ovs_rwlock_tryrdlock(&(*rule)->up.evict)) {
                 ^
./lib/ovs-thread.h:108:9: note: expanded from macro 'ovs_rwlock_tryrdlock'
        ovs_rwlock_tryrdlock_at(rwlock, SOURCE_LOCATOR)
        ^
ofproto/ofproto-dpif.c:4838:1: warning: expecting mutex 'rule->up.evict' to be 
locked at the end of function [-Wthread-safety-analysis]
}
^
ofproto/ofproto-dpif.c:4792:1: note: mutex acquired here
rule_dpif_lookup_in_table(struct ofproto_dpif *ofproto,
^

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to