From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: Re: [PATCH v2 7/9] net/virtio: unmapping queue/irq when close device Date: Fri, 30 Dec 2016 14:30:22 +0800 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 Cc: dev@dpdk.org, stephen@networkplumber.org To: Jianfeng Tan 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) Content-Disposition: inline In-Reply-To: <1482996643-113253-8-git-send-email-jianfeng.tan@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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