2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 22:05:19 +00:00

netdev-dpdk: Fix locking during get_stats.

Clang complains:
lib/netdev-dpdk.c:1860:1: error: mutex 'dev->mutex' is not locked on every path
      through here [-Werror,-Wthread-safety-analysis]
}
^
lib/netdev-dpdk.c:1815:5: note: mutex acquired here
    ovs_mutex_lock(&dev->mutex);
    ^
./include/openvswitch/thread.h:60:9: note: expanded from macro 'ovs_mutex_lock'
        ovs_mutex_lock_at(mutex, OVS_SOURCE_LOCATOR)
        ^

Fixes: d6e3feb57c ("Add support for extended netdev statistics based on RFC 2819.")
Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
This commit is contained in:
Joe Stringer
2016-05-10 15:50:42 -07:00
parent 85ad3f0159
commit f925682252

View File

@@ -1819,6 +1819,7 @@ netdev_dpdk_get_stats(const struct netdev *netdev, struct netdev_stats *stats)
if (rte_eth_stats_get(dev->port_id, &rte_stats)) {
VLOG_ERR("Can't get ETH statistics for port: %i.", dev->port_id);
ovs_mutex_unlock(&dev->mutex);
return EPROTO;
}