From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f41.google.com (mail-pa0-f41.google.com [209.85.220.41]) by dpdk.org (Postfix) with ESMTP id 37C3A8D8C for ; Fri, 18 Dec 2015 08:54:42 +0100 (CET) Received: by mail-pa0-f41.google.com with SMTP id q3so36457730pav.3 for ; Thu, 17 Dec 2015 23:54:42 -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=KZ6PkS+nyrSWgOMhi5vNgZsN1PmlmBlqoETCzpt/Llw=; b=ZEz9cZYxykIc+Xls8A69o3jEoz1DAIaoXLIMjOQvqPfem0dfrRmIDpHvT5w153152Z o6S/b75nuXDJHu/f80j+2Hack6DV/k58/JyKRicaL1nGYdAimWsRUPtTZ/jQfvDsw0eS BIqTh4tN3vY32eUgZD4d4rG8fdoJleMsxCAvQnSecR7KjU/EAgCo54x/ClQpZVwdlAlo eJt5R7Xg7samv9U8lymuRQ/FqKWqj/2oBc5dL9FqlY1JytEdQoyZ6IctZ6nKtkBh4Dxu Hd0T1gkr34FYoACQhi/WebYNEbEK16b9QOLbzIEQbwrwq+2mG0xPpJF3aG0ngYt5e2ju Klfg== 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=KZ6PkS+nyrSWgOMhi5vNgZsN1PmlmBlqoETCzpt/Llw=; b=XESOC7XJNmCR8Mo7keN4yX1Cyk5082rLArUlfzEWqRodKko07WLKEdI4U5OJItCzQr rCSTKkqe+PvvGhTm3dRgs/v/qaAdMuL44+tZ/G+tN6DTpb8Z/kIvJ46fJfrFptcJYr3W vI//zwN9FVk9Ri3HaPz7cISyxqVy74wLr7tRe60YyYa+z9neebXywCTpxsQSjF/Nptp2 dsJtgPV8SH/7AcF++F+S25t1VPTm78lWp+7swPAnyAvgCUlmUbK1+4eii+ddNSRWTGNB oNaCHCysCy9SCg4HmyUWdYbv5gNpnjsi5oWKGgR4HCgbddKc7sMXHLd+HocXeJ8S3/hy zaeg== X-Gm-Message-State: ALoCoQmnwqBauJUMVElsKgRqRBT9tS7XukC9c+K329KZkMFMzRjMXI4TMmDP9ifJ3UTRkELFycNaMQ57rA1W/I2fyTPcSwY9dCZNzhyezvOcIM9g4S89lfc= MIME-Version: 1.0 X-Received: by 10.66.193.73 with SMTP id hm9mr3141192pac.117.1450425281556; Thu, 17 Dec 2015 23:54:41 -0800 (PST) Received: by 10.66.13.233 with HTTP; Thu, 17 Dec 2015 23:54:41 -0800 (PST) In-Reply-To: <20151218053053.GL29571@yliu-dev.sh.intel.com> References: <2241331.HNmyzf8foi@xps13> <2979402.yeVYlcCDUH@xps13> <20151218053053.GL29571@yliu-dev.sh.intel.com> Date: Fri, 18 Dec 2015 13:24:41 +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] eal: map io resources for non x86 architectures 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, 18 Dec 2015 07:54:42 -0000 On Fri, Dec 18, 2015 at 11:00 AM, Yuanhan Liu wrote: > On Thu, Dec 17, 2015 at 04:52:00PM +0530, Santosh Shukla wrote: >> >> >> IMO, it is worth keeping one special device file who could work across >> >> >> archs like arm/arm64/powerpc and others, who could map iopci bar to >> >> >> dpdk user-space. also this approach has no kernel version dependency >> >> >> too. BTW; I did mentioned in second approach in to add /dev/ioport >> >> >> interface in drivers/char/mem.c which could read more than byte in one >> >> >> single operation, but that has kernel dependency. However that >> >> >> approach too is arch agnostic. >> >> > >> >> > Your first approach use an out-of-tree kernel module (igb_uio), so we cannot >> >> > really say there is no kernel dependency. >> >> >> >> Agree but I mentioned kernel __version__ dependency. >> > >> > Yes you did. >> > One of the main issue with out-of-tree kernel modules is the version >> > dependency. Probably that igb_uio from DPDK 2.3 will not compile with >> > the kernel 5.0. >> > >> >> don't know kernel 5.0 feature list so I guess your may be right. is >> uio obsoleted for 5.0 kernel? > > Nope, Thomas meant to say that we should keep the old DPDK will work > with newer kernel, not just the newest DPDK work on newest linux kernel > only. The out-of-tree kernel makes no garantee on that. > >> >> > We should try to remove the need for any out-of-tree kernel module. >> >> > That's why the Linux upstream approach is a better solution. >> >> >> >> IIUC, your suggesting archs like arm/arm64 to support io_mappe_io in >> >> pci_mmap_page_range()? >> > >> > I don't know what is the best solution in the kernel. >> > First we need to be sure that there is absolutely no solution without >> > kernel changes. >> >> I guess we have done enough evaluation / investigation that suggest - >> so to map iopci region to userspace in arch agnostic-way - >> >> # either we need to modify kernel >> - Make sure all the non-x86 arch to support mapping for >> iopci region (i.e. pci_mmap_page_range). I don;t think its a correct >> approach though. >> or >> - include /dev/ioport char-mem device file who could do >> more than byte operation, Note that this implementation does not exist >> in kernel. I could send an RFC to lkml. > > Maybe you could propose the two to lkml, to get some feedbacks from > those kernel/ARM gurus? Please cc me if you do so. > The latter one I already shared old lkml thread, Pl. revisit my v1 0/6 patch [1] and in that refer [2]. Josh has already proposed to lkml but for some reason thread didn't went far. I can restart that discussion giving dpdk use-case as an example/ requirement. And for the former one, I'll have to check with linux-arm why iopci region not mappable. By grepping kernel source all i could see two commit - latest one is 415ae101 and older one 1da177e. Both has nothing to explain why if (mmap_state == pci_mmap_io) return -EINVAL; Setting pci io region to -EINVAL, should have fundamental reason for sure. But we'll have to check, for that I could post as a query rather a patch to lkml. Note that dpdk already has out-of-tree implementation for dom0/xen-case too, it creates special device file which maps pci resources. so keep one more igb_uio char device so to map iopci region wont hurt much though! [1] http://permalink.gmane.org/gmane.comp.networking.dpdk.devel/29531 > --yliu >> >> OR keep device file in user space (current approach) >> Right now Virtio-for-arm patches are blocked on this, let me know if >> someone has better approach/thought in mind. >> >> Thanks. >> >> > Then we can try a pci_mmap solution or, as you suggest, an interface in >> > drivers/char/mem.c >> >