From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by dpdk.org (Postfix) with ESMTP id CBDFC5F2A for ; Tue, 27 Jan 2015 11:00:07 +0100 (CET) Received: by mail-wg0-f50.google.com with SMTP id b13so13728363wgh.9 for ; Tue, 27 Jan 2015 02:00:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=IE1yjVTgpuPmlEOfK3DJvD1iSPw+5+eLpyJ9OyHwZJE=; b=g5FLgjMAGilXJ3VjWWRPgGRj4S5e+PCm8I4xdFAMFS5JcKp679VqyaieqNc3L9jvPa f5HauYIgTLoZKdmm8Vnnexqpr8WUKGSWkXco4MuukOaKmjCu6HeBAyTesYCsFSmKq6TF OsVxv8UPrA/3/ZOsTtDKRN9FeSO0KIY50SQ6cguxCI7bp+BWZVmf+Vbzed3sBJ38KyLo GBkPe5Q7U5vJLngac64TLKzOuO3T3Q8YaVZDEmyY/6vltg5EUWqTcoBvyoMHFU+FzVP/ xLDAG6d/VMC0xvWW9KHOM43CW0EMhT14DHOusEqPXLj/+rCEm/WshzoK6YRKYsTEJPzv ATkA== X-Gm-Message-State: ALoCoQm1Nhd3jVwMC9fTk/qu2dTOmwHc10gsbcBrka+IKNSuZldqCUp0D4Fd2r8xEz+ofcoV8mXa X-Received: by 10.180.87.42 with SMTP id u10mr35193160wiz.51.1422352807545; Tue, 27 Jan 2015 02:00:07 -0800 (PST) Received: from uryu.home.lan ([109.231.227.156]) by mx.google.com with ESMTPSA id u18sm1093828wjq.42.2015.01.27.02.00.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Jan 2015 02:00:07 -0800 (PST) Date: Tue, 27 Jan 2015 10:00:06 +0000 From: Stephen Hemminger To: "Xie, Huawei" Message-ID: <20150127100006.007fbf8c@uryu.home.lan> In-Reply-To: References: <1421298930-15210-1-git-send-email-changchun.ouyang@intel.com> <1422326164-13697-1-git-send-email-changchun.ouyang@intel.com> <1422326164-13697-5-git-send-email-changchun.ouyang@intel.com> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v2 04/24] virtio: Add support for Link State interrupt X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jan 2015 10:00:08 -0000 On Tue, 27 Jan 2015 09:04:07 +0000 "Xie, Huawei" wrote: > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Ouyang Changchun > > Sent: Tuesday, January 27, 2015 10:36 AM > > To: dev@dpdk.org > > Subject: [dpdk-dev] [PATCH v2 04/24] virtio: Add support for Link State interrupt > > > > Virtio has link state interrupt which can be used. > > > > Signed-off-by: Stephen Hemminger > > Signed-off-by: Changchun Ouyang > > --- > > lib/librte_pmd_virtio/virtio_ethdev.c | 78 +++++++++++++++++++++++++++------ > > -- > > lib/librte_pmd_virtio/virtio_pci.c | 22 ++++++++++ > > lib/librte_pmd_virtio/virtio_pci.h | 4 ++ > > 3 files changed, 86 insertions(+), 18 deletions(-) > > > > diff --git a/lib/librte_pmd_virtio/virtio_ethdev.c > > b/lib/librte_pmd_virtio/virtio_ethdev.c > > index 5df3b54..ef87ff8 100644 > > --- a/lib/librte_pmd_virtio/virtio_ethdev.c > > +++ b/lib/librte_pmd_virtio/virtio_ethdev.c > > @@ -845,6 +845,34 @@ static int virtio_resource_init(struct rte_pci_device > > *pci_dev __rte_unused) > > #endif > > > > /* > > + * Process Virtio Config changed interrupt and call the callback > > + * if link state changed. > > + */ > > +static void > > +virtio_interrupt_handler(__rte_unused struct rte_intr_handle *handle, > > + void *param) > > +{ > > + struct rte_eth_dev *dev = param; > > + struct virtio_hw *hw = > > + VIRTIO_DEV_PRIVATE_TO_HW(dev->data->dev_private); > > + uint8_t isr; > > + > > + /* Read interrupt status which clears interrupt */ > > + isr = vtpci_isr(hw); > > + PMD_DRV_LOG(INFO, "interrupt status = %#x", isr); > > + > > + if (rte_intr_enable(&dev->pci_dev->intr_handle) < 0) > > + PMD_DRV_LOG(ERR, "interrupt enable failed"); > > + > > Is it better to put rte_intr_enable after we have handled the interrupt. > Is there the possibility of interrupt reentrant in uio intr framework? The UIO framework handles IRQ's via posix thread that is reading fd, then calling this code. Therefore it is always single threaded.