From patchwork Tue May 10 22:50:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Stringer X-Patchwork-Id: 620860 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (archives.nicira.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3r4Dy35DSbz9t3g for ; Wed, 11 May 2016 08:51:23 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 1792E10A90; Tue, 10 May 2016 15:51:21 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e3.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id B97BC10A8C for ; Tue, 10 May 2016 15:51:20 -0700 (PDT) Received: from bar5.cudamail.com (localhost [127.0.0.1]) by mx1e3.cudamail.com (Postfix) with ESMTPS id 311794201D8 for ; Tue, 10 May 2016 16:51:20 -0600 (MDT) X-ASG-Debug-ID: 1462920679-09eadd4da8576050001-byXFYA Received: from mx1-pf2.cudamail.com ([192.168.24.2]) by bar5.cudamail.com with ESMTP id xsUV2Yb0pyeAs9nX (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 10 May 2016 16:51:19 -0600 (MDT) X-Barracuda-Envelope-From: joe@ovn.org X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.2 Received: from unknown (HELO relay4-d.mail.gandi.net) (217.70.183.196) by mx1-pf2.cudamail.com with ESMTPS (DHE-RSA-AES256-SHA encrypted); 10 May 2016 22:51:19 -0000 Received-SPF: pass (mx1-pf2.cudamail.com: SPF record at ovn.org designates 217.70.183.196 as permitted sender) X-Barracuda-Apparent-Source-IP: 217.70.183.196 X-Barracuda-RBL-IP: 217.70.183.196 Received: from mfilter16-d.gandi.net (mfilter16-d.gandi.net [217.70.178.144]) by relay4-d.mail.gandi.net (Postfix) with ESMTP id D26AD17209D; Wed, 11 May 2016 00:51:17 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter16-d.gandi.net Received: from relay4-d.mail.gandi.net ([IPv6:::ffff:217.70.183.196]) by mfilter16-d.gandi.net (mfilter16-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id zaCUmHtCu4PL; Wed, 11 May 2016 00:51:16 +0200 (CEST) X-Originating-IP: 208.91.1.34 Received: from localhost.localdomain (unknown [208.91.1.34]) (Authenticated sender: joe@ovn.org) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 3AA1F1720A1; Wed, 11 May 2016 00:51:14 +0200 (CEST) X-CudaMail-Envelope-Sender: joe@ovn.org From: Joe Stringer To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-E2-509091473 X-CudaMail-DTE: 051016 X-CudaMail-Originating-IP: 217.70.183.196 Date: Tue, 10 May 2016 15:50:42 -0700 X-ASG-Orig-Subj: [##CM-E2-509091473##][PATCH] netdev-dpdk: Fix locking during get_stats. Message-Id: <1462920642-63370-1-git-send-email-joe@ovn.org> X-Mailer: git-send-email 2.1.4 X-Barracuda-Connect: UNKNOWN[192.168.24.2] X-Barracuda-Start-Time: 1462920679 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 Subject: [ovs-dev] [PATCH] netdev-dpdk: Fix locking during get_stats. X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" 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 Acked-by: Daniele Di Proietto --- 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; }