From patchwork Wed Oct 21 13:18:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ciara Loftus X-Patchwork-Id: 533811 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (li376-54.members.linode.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 0CCAE14076E for ; Thu, 22 Oct 2015 00:19:15 +1100 (AEDT) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 2E44B106F6; Wed, 21 Oct 2015 06:19:14 -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 02CB2106F5 for ; Wed, 21 Oct 2015 06:19:13 -0700 (PDT) Received: from bar5.cudamail.com (localhost [127.0.0.1]) by mx1e3.cudamail.com (Postfix) with ESMTPS id 68BE3420360 for ; Wed, 21 Oct 2015 07:19:12 -0600 (MDT) X-ASG-Debug-ID: 1445433551-09eadd4c909efa0001-byXFYA Received: from mx1-pf1.cudamail.com ([192.168.24.1]) by bar5.cudamail.com with ESMTP id F8LSFV3G2egZx9he (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 21 Oct 2015 07:19:11 -0600 (MDT) X-Barracuda-Envelope-From: cloftus@ecsmtp.ir.intel.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.1 Received: from unknown (HELO mga09.intel.com) (134.134.136.24) by mx1-pf1.cudamail.com with SMTP; 21 Oct 2015 13:19:11 -0000 Received-SPF: none (mx1-pf1.cudamail.com: domain at ecsmtp.ir.intel.com does not designate permitted sender hosts) X-Barracuda-Apparent-Source-IP: 134.134.136.24 X-Barracuda-RBL-IP: 134.134.136.24 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP; 21 Oct 2015 06:18:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,712,1437462000"; d="scan'208";a="585317969" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by FMSMGA003.fm.intel.com with ESMTP; 21 Oct 2015 06:18:41 -0700 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t9LDIdox011930 for ; Wed, 21 Oct 2015 14:18:39 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id t9LDIdRb013142 for ; Wed, 21 Oct 2015 14:18:39 +0100 Received: (from cloftus@localhost) by sivswdev01.ir.intel.com with id t9LDId4X013138 for dev@openvswitch.org; Wed, 21 Oct 2015 14:18:39 +0100 X-CudaMail-Envelope-Sender: cloftus@ecsmtp.ir.intel.com From: Ciara Loftus To: dev@openvswitch.org X-CudaMail-MID: CM-E1-1020019168 X-CudaMail-DTE: 102115 X-CudaMail-Originating-IP: 134.134.136.24 Date: Wed, 21 Oct 2015 14:18:39 +0100 X-ASG-Orig-Subj: [##CM-E1-1020019168##][PATCH] netdev-dpdk: Clean-up after vHost User port delete Message-Id: <1445433519-13095-1-git-send-email-ciara.loftus@intel.com> X-Mailer: git-send-email 1.7.4.1 X-GBUdb-Analysis: 0, 134.134.136.24, Ugly c=0 p=0 Source New X-MessageSniffer-Rules: 0-0-0-3304-c X-Barracuda-Connect: UNKNOWN[192.168.24.1] X-Barracuda-Start-Time: 1445433551 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 X-ASG-Whitelist: EmailCat (corporate) Subject: [ovs-dev] [PATCH] netdev-dpdk: Clean-up after vHost User port delete 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" Unregister and delete the socket associated with a vhost-user port when the port is deleted and/or the switch is brought down. Do not delete the socket if the vhost-user device is still attached to the guest. Signed-off-by: Ciara Loftus --- lib/netdev-dpdk.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index 93b0589..131e23d 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -749,6 +749,9 @@ netdev_dpdk_vhost_destruct(struct netdev *netdev_) return; } + if (rte_vhost_driver_unregister(dev->vhost_id)) + VLOG_ERR("Unable to remove vhost-user socket %s", dev->vhost_id); + ovs_mutex_lock(&dpdk_mutex); list_remove(&dev->list_node); dpdk_mp_put(dev->dpdk_mp);