[ovs-dev] [PATCH] netdev-dpdk: Fix locking during get_stats.
Daniele Di Proietto
diproiettod at ovn.org
Fri May 13 00:32:26 UTC 2016
Thanks for fixing this!
Acked-by: Daniele Di Proietto <diproiettod at vmware.com>
2016-05-10 15:50 GMT-07:00 Joe Stringer <joe at ovn.org>:
> 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: d6e3feb57c44 ("Add support for extended netdev statistics based on
> RFC 2819.")
> Signed-off-by: Joe Stringer <joe at ovn.org>
> ---
> lib/netdev-dpdk.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
> index af86d194f9bb..87879d5c6e4d 100644
> --- a/lib/netdev-dpdk.c
> +++ b/lib/netdev-dpdk.c
> @@ -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;
> }
>
> --
> 2.1.4
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>
More information about the dev
mailing list