From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id C20112C31 for ; Fri, 30 Dec 2016 07:28:37 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP; 29 Dec 2016 22:28:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,428,1477983600"; d="scan'208";a="24307431" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by orsmga002.jf.intel.com with ESMTP; 29 Dec 2016 22:28:35 -0800 Date: Fri, 30 Dec 2016 14:30:22 +0800 From: Yuanhan Liu To: Jianfeng Tan Cc: dev@dpdk.org, stephen@networkplumber.org Message-ID: <20161230063022.GJ21789@yliu-dev.sh.intel.com> References: <1482996643-113253-1-git-send-email-jianfeng.tan@intel.com> <1482996643-113253-8-git-send-email-jianfeng.tan@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1482996643-113253-8-git-send-email-jianfeng.tan@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH v2 7/9] net/virtio: unmapping queue/irq when close device X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 06:28:38 -0000 On Thu, Dec 29, 2016 at 07:30:41AM +0000, Jianfeng Tan wrote: > When closing virtio devices, close eventfds, free the struct to > store queue/irq mapping. > > Signed-off-by: Jianfeng Tan > --- > drivers/net/virtio/virtio_ethdev.c | 27 ++++++++++++++++++++++++++- > 1 file changed, 26 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c > index 0754ba0..d1a0afb 100644 > --- a/drivers/net/virtio/virtio_ethdev.c > +++ b/drivers/net/virtio/virtio_ethdev.c > @@ -591,16 +591,30 @@ virtio_alloc_queues(struct rte_eth_dev *dev) > return 0; > } > > +static void virtio_queues_unbind_intr(struct rte_eth_dev *dev); > + > static void > virtio_dev_close(struct rte_eth_dev *dev) > { > struct virtio_hw *hw = dev->data->dev_private; > + struct rte_intr_conf *intr_conf = &dev->data->dev_conf.intr_conf; > + struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle; I saw quite many occurrence of the two, maybe you could define few macros for that, say VIRTIO_INTR_ENABLED, VIRTIO_RX_INTR_ENABLED, VIRTIO_LSC_INTR_ENABLED? --yliu