From patchwork Wed Nov 16 00:45:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniele Di Proietto X-Patchwork-Id: 695365 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tJQZ84wDbz9t10 for ; Wed, 16 Nov 2016 11:46:56 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id CFF85B8F; Wed, 16 Nov 2016 00:46:08 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 85CC9B79 for ; Wed, 16 Nov 2016 00:46:07 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from EX13-EDG-OU-002.vmware.com (ex13-edg-ou-002.vmware.com [208.91.0.190]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 41B3F206 for ; Wed, 16 Nov 2016 00:46:07 +0000 (UTC) Received: from sc9-mailhost3.vmware.com (10.113.161.73) by EX13-EDG-OU-002.vmware.com (10.113.208.156) with Microsoft SMTP Server id 15.0.1156.6; Tue, 15 Nov 2016 16:45:45 -0800 Received: from sc9-mailhost3.vmware.com (htb-1n-eng-dhcp161.eng.vmware.com [10.33.74.161]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id ADD3D4046A; Tue, 15 Nov 2016 16:46:05 -0800 (PST) From: Daniele Di Proietto To: Date: Tue, 15 Nov 2016 16:45:57 -0800 Message-ID: <20161116004612.79315-3-diproiettod@vmware.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20161116004612.79315-1-diproiettod@vmware.com> References: <20161116004612.79315-1-diproiettod@vmware.com> MIME-Version: 1.0 Received-SPF: None (EX13-EDG-OU-002.vmware.com: diproiettod@vmware.com does not designate permitted sender hosts) X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Daniele Di Proietto Subject: [ovs-dev] [PATCH 02/17] dpif-netdev: Take non_pmd_mutex to access tx cached ports. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org As documented in dp_netdev_pmd_thread, we must take non_pmd_mutex to access the tx port caches for the non pmd thread. Found by inspection. Signed-off-by: Daniele Di Proietto --- lib/dpif-netdev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index c19d3e8..7b67b42 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -3350,8 +3350,10 @@ dp_netdev_del_pmd(struct dp_netdev *dp, struct dp_netdev_pmd_thread *pmd) /* NON_PMD_CORE_ID doesn't have a thread, so we don't have to synchronize, * but extra cleanup is necessary */ if (pmd->core_id == NON_PMD_CORE_ID) { + ovs_mutex_lock(&dp->non_pmd_mutex); emc_cache_uninit(&pmd->flow_cache); pmd_free_cached_ports(pmd); + ovs_mutex_unlock(&dp->non_pmd_mutex); } else { latch_set(&pmd->exit_latch); dp_netdev_reload_pmd__(pmd);