Message ID | 1452184390-5994-10-git-send-email-sshukla@mvista.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 2EB7FC2FE; Thu, 7 Jan 2016 17:34:38 +0100 (CET) Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by dpdk.org (Postfix) with ESMTP id 14246C2FE for <dev@dpdk.org>; Thu, 7 Jan 2016 17:34:37 +0100 (CET) Received: by mail-pa0-f46.google.com with SMTP id yy13so169920650pab.3 for <dev@dpdk.org>; Thu, 07 Jan 2016 08:34:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mvista-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=s3f3ToPgKlz4jXW3B0obqNVvB4EwTvDVX5nCX44p3aE=; b=QD+fBbrLRkWhSutW14exnbnro7ocoiW/CAR+JMTfr+7cjMo2VtR56FShkQmv0uQD+J 0N9ZqvBsucbtQsEUZQyzZAFln+z6lb61RBP544omHNXEnhDljX4NwcQMGblTKG7SKwSR ZoJSvlL6yH2H+HA7ZGCFpLux1fifHnlnVmVj6AYESSK0v82ypQVXiNsiaPX/EKCOE220 rPqwJDDrnTYRF9Rx9oORd7VFqVALiTU3mcp2NkZYlNW53d8j9jedGVrlQ5/FXP9hidxa gp7NqL/NAHnDwkS87T7UxzbjYJinWupJceg4bKG1bo2wp2hhjjYBjVGBW92MpXnZLdur ORXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=s3f3ToPgKlz4jXW3B0obqNVvB4EwTvDVX5nCX44p3aE=; b=ePXPzE86diiWWRGW3V0nMffTSvxlYq4Kg44in0qJiny8vdXxUrBRHAn1AgZh5cZSx1 TFqCBH4szAJC49uyN5jwWvYDeJXNtyzZEMcDTuU681oW2uXauRYnmeRxmlRYQ4/1QgGA mmXhuPvevas9Lj8QgixBiLiL6tzApU4Vv1DRaD8iFmGD1C64rZzggYU+oOPYd1DH1q39 ekWKPuKERsm1jBtTl6AAzuajef6aRwr2WC66Rhrvw6rk480+u5FuRcgBD1XIPpao7qb0 69hIxkP/fA1PUjB4RmuySSeNur7rw08JdtrEsFHaeKDyTbA80u9EZIKxkM/SozXzCUlr WGXA== X-Gm-Message-State: ALoCoQnL6Ezt0Lshg9MVu7YDtsjQjKE7xkxpn2fPbpK7VmgPX4XMG00MAkKkeoxGmmpd81XgJ/i4omu6o2FZLEiVp2M9RG89LQ== X-Received: by 10.67.22.97 with SMTP id hr1mr140191639pad.49.1452184476488; Thu, 07 Jan 2016 08:34:36 -0800 (PST) Received: from santosh-Latitude-E5530-non-vPro.mvista.com ([111.93.218.67]) by smtp.gmail.com with ESMTPSA id yn8sm159454163pac.32.2016.01.07.08.34.33 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Jan 2016 08:34:35 -0800 (PST) From: Santosh Shukla <sshukla@mvista.com> To: dev@dpdk.org Date: Thu, 7 Jan 2016 22:03:06 +0530 Message-Id: <1452184390-5994-10-git-send-email-sshukla@mvista.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1452184390-5994-1-git-send-email-sshukla@mvista.com> References: <1452184390-5994-1-git-send-email-sshukla@mvista.com> Subject: [dpdk-dev] [PATCH v3 09/12] virtio: vfio: Enable RTE_PCI_DRV_NEED_MAPPING flag in driver X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Santosh Shukla
Jan. 7, 2016, 4:33 p.m. UTC
Flag required for vfio case, It helps to update vfio_dev_fd for each
virtio net interface.
Signed-off-by: Santosh Shukla <sshukla@mvista.com>
---
drivers/net/virtio/virtio_ethdev.c | 4 ++++
1 file changed, 4 insertions(+)
Comments
On Thu, 7 Jan 2016 22:03:06 +0530 Santosh Shukla <sshukla@mvista.com> wrote: > +#ifdef RTE_EAL_VFIO > + .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_DETACHABLE, > +#else > .drv_flags = RTE_PCI_DRV_DETACHABLE, > +#endif Since VFIO is determined at runtime not compile time, the flags should be updated at runtime not compile time.
On Thu, Jan 7, 2016 at 11:50 PM, Stephen Hemminger <stephen@networkplumber.org> wrote: > On Thu, 7 Jan 2016 22:03:06 +0530 > Santosh Shukla <sshukla@mvista.com> wrote: > >> +#ifdef RTE_EAL_VFIO >> + .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_DETACHABLE, >> +#else >> .drv_flags = RTE_PCI_DRV_DETACHABLE, >> +#endif > > Since VFIO is determined at runtime not compile time, the flags should > be updated at runtime not compile time. > > In general, Yes, Its a wrong approach i..e. Wrapping __need_mapping flag only for vfio case. I am thinking to add vfio parser routine something similar to virtio_xxx_xx_uio_xx() / virtio_xx_xx_ioport() currently exist. This will remove RTE_EAL_VFIO ifdef clutter for this patch and [08/12] patch and also virtio pmd driver can then initialize device for vfio mode.. _but_ I still need _MAPPING flag enabled for in virtio driver as because for vfio case - I want vfio_xx_mmap() routine to create vfio container/group_id and then create vfio_dev_fd for each virtio-net-pci interface. Let me know my approach aligned to your suggestion.
On Sat, Jan 09, 2016 at 06:08:46PM +0530, Santosh Shukla wrote: > On Thu, Jan 7, 2016 at 11:50 PM, Stephen Hemminger > <stephen@networkplumber.org> wrote: > > On Thu, 7 Jan 2016 22:03:06 +0530 > > Santosh Shukla <sshukla@mvista.com> wrote: > > > >> +#ifdef RTE_EAL_VFIO > >> + .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_DETACHABLE, > >> +#else > >> .drv_flags = RTE_PCI_DRV_DETACHABLE, > >> +#endif > > > > Since VFIO is determined at runtime not compile time, the flags should > > be updated at runtime not compile time. > > > > > In general, Yes, Its a wrong approach i..e. Wrapping __need_mapping > flag only for vfio case. I am thinking to add vfio parser routine > something similar to virtio_xxx_xx_uio_xx() / virtio_xx_xx_ioport() > currently exist. This will remove RTE_EAL_VFIO ifdef clutter for this > patch and [08/12] patch and also virtio pmd driver can then initialize > device for vfio mode.. > > _but_ I still need _MAPPING flag enabled for in virtio driver as > because for vfio case - I want vfio_xx_mmap() routine to create vfio > container/group_id and then create vfio_dev_fd for each virtio-net-pci > interface. I'm thinking my following patch will help: http://dpdk.org/dev/patchwork/patch/9814/ --yliu > Let me know my approach aligned to your suggestion.
On Tue, Jan 12, 2016 at 12:44 PM, Yuanhan Liu <yuanhan.liu@linux.intel.com> wrote: > On Sat, Jan 09, 2016 at 06:08:46PM +0530, Santosh Shukla wrote: >> On Thu, Jan 7, 2016 at 11:50 PM, Stephen Hemminger >> <stephen@networkplumber.org> wrote: >> > On Thu, 7 Jan 2016 22:03:06 +0530 >> > Santosh Shukla <sshukla@mvista.com> wrote: >> > >> >> +#ifdef RTE_EAL_VFIO >> >> + .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_DETACHABLE, >> >> +#else >> >> .drv_flags = RTE_PCI_DRV_DETACHABLE, >> >> +#endif >> > >> > Since VFIO is determined at runtime not compile time, the flags should >> > be updated at runtime not compile time. >> > >> > >> In general, Yes, Its a wrong approach i..e. Wrapping __need_mapping >> flag only for vfio case. I am thinking to add vfio parser routine >> something similar to virtio_xxx_xx_uio_xx() / virtio_xx_xx_ioport() >> currently exist. This will remove RTE_EAL_VFIO ifdef clutter for this >> patch and [08/12] patch and also virtio pmd driver can then initialize >> device for vfio mode.. >> >> _but_ I still need _MAPPING flag enabled for in virtio driver as >> because for vfio case - I want vfio_xx_mmap() routine to create vfio >> container/group_id and then create vfio_dev_fd for each virtio-net-pci >> interface. > > I'm thinking my following patch will help: > > http://dpdk.org/dev/patchwork/patch/9814/ > Yes, It works, so wont need NEED_MAPPING flag, Sending v4 patch series rebased on this patch.. > --yliu > >> Let me know my approach aligned to your suggestion.
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index 9ca99d5..8d55049 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1447,7 +1447,11 @@ static struct eth_driver rte_virtio_pmd = { .pci_drv = { .name = "rte_virtio_pmd", .id_table = pci_id_virtio_map, +#ifdef RTE_EAL_VFIO + .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_DETACHABLE, +#else .drv_flags = RTE_PCI_DRV_DETACHABLE, +#endif }, .eth_dev_init = eth_virtio_dev_init, .eth_dev_uninit = eth_virtio_dev_uninit,