From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f182.google.com (mail-pf0-f182.google.com [209.85.192.182]) by dpdk.org (Postfix) with ESMTP id 498C8C5A0 for ; Fri, 29 Jan 2016 08:31:03 +0100 (CET) Received: by mail-pf0-f182.google.com with SMTP id n128so37546147pfn.3 for ; Thu, 28 Jan 2016 23:31:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mvista-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=xqq93r+O7ScD1iD3WX93x91z+iTs5X8l/HKeVSX1MM0=; b=vdbN33APeGe0PI5XH5EbHHKvpxSJtbvMBHzLwHaGgIR/nPlfFrIFU574uk0lSf44f0 uVJyR+5Iv5eyEAuj+UDFeAYi4ZRRJOWa6eBgKai6evyvGdC2HaCsZ43OUmBKg/7Q7JRP S1uN0i3mxMEjIfVEBK2qYx3X2T+heXIwvUH2UnPAiIj0giBhaenENAHO3ixmDeAtwxo0 SM5xhVrpSkrEwAczh071Zt+vqXEEAIVyjj+VYGdI/XNJ/5L+fDPBiYzDtei/7Nf9V8Bz dlcJfzgzcamS67negaUoo3w1bCMWR55+HZaQqf4usHNi2WDl5exTDgHBZALY4MspNz9r u6vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=xqq93r+O7ScD1iD3WX93x91z+iTs5X8l/HKeVSX1MM0=; b=hpGX4uaNxiIU8ldm4Uq28AOGqZewu2QirPFgLTEiYWBKZgaoesOky8VJN7jtdYrhNY Zfa02OJv93ETYDNfgwktQVFNJgKwwK4doaVuuQmFMPCnPHxvwg/pBJ1sv1Cf4LfudDgV GGqx9+mRhMtIYNSDtJmPVkxSpcxGZw/DTAMX44R67Q417vdZ5oeQuqS5/tUIUW0ofItt 5a2Ay5ye5U8fqClyFflmXuAfGWnmvqdHB4i7AA7UQj5k2UPpOmMeE+Vk7RaR6Lo1Kmlz gUIxRsW0Z+fFPWDC41T9PrS6n9IP/WBn4Djo7cmcvLSB8/k4vcG4TgcO2UnaOGsQRP3N Nrtw== X-Gm-Message-State: AG10YOR3mgOKNXt83amFufl2PuxLusjjb9ZfgDUO8/VwwuGhAGKsDV2epA1pgbxD7ZS7dqAmWCBXd6lQVHpOzW3p MIME-Version: 1.0 X-Received: by 10.98.12.131 with SMTP id 3mr11398985pfm.155.1454052662691; Thu, 28 Jan 2016 23:31:02 -0800 (PST) Received: by 10.66.196.81 with HTTP; Thu, 28 Jan 2016 23:31:02 -0800 (PST) In-Reply-To: <20160129070112.GO4257@yliu-dev.sh.intel.com> References: <1453203972-24855-1-git-send-email-sshukla@mvista.com> <1453203972-24855-11-git-send-email-sshukla@mvista.com> <20160129070112.GO4257@yliu-dev.sh.intel.com> Date: Fri, 29 Jan 2016 13:01:02 +0530 Message-ID: From: Santosh Shukla To: Yuanhan Liu Content-Type: text/plain; charset=UTF-8 Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v5 10/11] virtio: pci: add dummy func definition for in/outb for non-x86 arch 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: Fri, 29 Jan 2016 07:31:03 -0000 On Fri, Jan 29, 2016 at 12:31 PM, Yuanhan Liu wrote: > On Tue, Jan 19, 2016 at 05:16:11PM +0530, Santosh Shukla wrote: >> For non-x86 arch, Compiler will throw build error for in/out apis. Including >> dummy api function so to pass build. >> >> Note that: For virtio to work for non-x86 arch - RTE_EAL_VFIO is the only >> supported method. RTE_EAL_IGB_UIO is not supported for non-x86 arch. >> >> So, Virtio support for arch and supported interface by that arch: >> >> ARCH IGB_UIO VFIO >> x86 Y Y >> ARM64 N/A Y >> PPC_64 N/A Y (Not tested but likely should work, as vfio is >> arch independent) >> >> Note: Applicable for virtio spec 0.95 >> >> Signed-off-by: Santosh Shukla >> --- >> drivers/net/virtio/virtio_pci.h | 46 +++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 46 insertions(+) >> >> diff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h >> index f550d22..b88f9ec 100644 >> --- a/drivers/net/virtio/virtio_pci.h >> +++ b/drivers/net/virtio/virtio_pci.h >> @@ -46,6 +46,7 @@ >> #endif >> >> #include >> +#include "virtio_logs.h" >> >> struct virtqueue; >> >> @@ -320,6 +321,51 @@ outl_p(unsigned int data, unsigned int port) >> } >> #endif >> >> +#if !defined(RTE_ARCH_X86_64) && !defined(RTE_ARCH_I686) && \ >> + defined(RTE_EXEC_ENV_LINUXAPP) >> +static inline uint8_t >> +inb(unsigned long addr __rte_unused) >> +{ >> + PMD_INIT_LOG(ERR, "inb() not supported for this RTE_ARCH\n"); >> + return 0; >> +} > > The whole port read/write stuff is getting messy here: we not only have > to care the FreeBSD and Linux difference, but also the x86 and non-x86 > difference. And you just added yet another vfio layer. > > First of all, they are not belong here (virtio_pci.h). A new place like > virtio_io.h sounds much better to me. Therefore, I'd suggest you to > put all those stuff there, like the one I have just cooked up: > > > #ifndef __VIRTIO_IO_H__ > > #if defined(RTE_ARCH_X86_64) || defined(RTE_ARCH_I686) > > #ifdef __FreeBSD__ > #include > #include > > #define outb_p outb > #define outw_p outw > #define outl_p outl > #else > #include > #endif > > #else /* ! X86 */ > > static inline uint8_t > inb(unsigned long addr __rte_unused) > { > PMD_INIT_LOG(ERR, "inb() not supported for this RTE_ARCH\n"); > return 0; > } > > > .... > #endif /* X86 */ > > > /* And put the vfio io port read/write here */ > > #endif /* __VIRTIO_IO_H__ */ > > Note that you may need squash patch 4 (build fix for sys/io.h ...) > here. They both resolve one thing: to make it build on non-x86 platforms. > > Another minor note is that while you are trying this way, I'd suggest > you to make a patch to introduce virtio_io.h, and then make another > patch to fix build errors on non-x86 platforms. > Ok. > Another generic comment about this patchset is that it VERY okay to > include several components change in one set, but putting them in > order helps review a lot. > > Say, this patch set has dependence on VFIO stuff, therefore, it'd be > much better __IF__ you can put all VFIO related patches first, and > then virtio related patches follows, but not in an interleaved way > you did. If, for somereason, you can't do that, you should at least > try to minimise the chance of interleave. > I agree that, but this patch series dependent on other patches including virtio 1.0 and then vfio-noiommu, its was difficult for me to keep topic-wise sanity in patch series. V6 will take care patch ordering. Thanks > --yliu