From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) by dpdk.org (Postfix) with ESMTP id 26FB02EDA for ; Fri, 18 Dec 2015 13:55:17 +0100 (CET) Received: by mail-pa0-f44.google.com with SMTP id q3so40207805pav.3 for ; Fri, 18 Dec 2015 04:55:17 -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=XEvt/5X6LB3GMaWvuKTY76ve55LbQd4ZyvMMthBX8d4=; b=B3QUt9U+6OIet5wnIqO8ggyx7JO4xzMbv7YCxnCteM+euEctS6Kn5+6tlIlFSUtSlY n5vTJa/mi5sNS7js8mqWC+Or1cXgGhanUZkIzRuE8kty7qFesvVoj/4Mc6QEBhcQKORO cB2qqMqNW2pFc0i8t4Y46JhFbJGCUMAr4F3KXoFKSBaISimqr6SGByyrsH0PujhXfKgh XIT3G60s3hLUTh8pXpn1SEKa5VT9FMfBAcveQHhyW9MmEzY7hlt5SZkjw3RuwUMoQjjG OlDJjgq3fH+dpZdd7ALG6b8S0OBKITsA8CDQqpRUbRYqRGs+NhhQYbK8cv5iLI6BS8zc BubQ== 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=XEvt/5X6LB3GMaWvuKTY76ve55LbQd4ZyvMMthBX8d4=; b=YFZmbIksig0StSEc0Mgg9QCdN9MoW+mjkEC/bVnC2z6qyTAy53DTALOnTvmwutPI0H tDMbtfe2lfiO7D2NkJNXFHazxceNzE41vXHfYZrOyWVyhntd/+/LUasDDNCC4IvI8fz6 Wjcf4b2VqahSlWXlY5m9FoOVrJzFQ7dt7y3FcgYFASZ0wks3Qtr/T4Z/z+Gr8KT0GS/M c5F23bbW74oHH/8DKkgFAeCcg3NG9nTfojO3l5tufXHl6mUDRzVgQZcdpDcs7/P5faM7 s8T3SZGGWXIZZZkzNV/Ww47XMrD60knDb1wj9ECQQvlbqaT67BAgMjS+aZ9gK+agSZrY PGPA== X-Gm-Message-State: ALoCoQkjM8voTiztHp2PEmZAdS1eLGQMZ1AIxd42ibwYeCXNHiFHTlVkfmvCSC9cvtPjUVB+mDNbyNbQSUFEgUv9ggdJMvOE+HPr8e4S5mdnu8RfoLFb7ic= MIME-Version: 1.0 X-Received: by 10.66.140.79 with SMTP id re15mr4735503pab.127.1450443316418; Fri, 18 Dec 2015 04:55:16 -0800 (PST) Received: by 10.66.13.233 with HTTP; Fri, 18 Dec 2015 04:55:16 -0800 (PST) In-Reply-To: <20151218082139.GC18863@yliu-dev.sh.intel.com> References: <2241331.HNmyzf8foi@xps13> <2979402.yeVYlcCDUH@xps13> <20151218053053.GL29571@yliu-dev.sh.intel.com> <20151218082139.GC18863@yliu-dev.sh.intel.com> Date: Fri, 18 Dec 2015 18:25:16 +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 12:55:17 -0000 On Fri, Dec 18, 2015 at 1:51 PM, Yuanhan Liu wrote: > On Fri, Dec 18, 2015 at 01:24:41PM +0530, Santosh Shukla wrote: >> >> 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]. > > Oops, sorry, a bit busy, that I didn't look at it carefully. My bad, > anyway. > >> 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. > > I had a quick go through of the discussion. Both hpa and Arnd seem > to be fine with the ioctl interface on /dev/port. Have you tried > that? And if you want to restart it, ioctl might be a better option > than /dev/ioport, judging from the discussion. > I tried legacy patch and re-writing with ioctl-way; doing changes in dpdk port as well in kernel, had to test on quite other hw not only arm64 though! so it will take time for me, I am travelling tomorrow so bit delayed, We'll post patch to lkml and share dpdk-virtio feedback perhaps by Monday. >> >> 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. > > No idea, such check should have been there in the very beginning > for some reason. And here is a quote from Arnd: > > Only powerpc, microblaze, alpha, sparc and xtensa allow > users to mmap I/O space, even though a lot of others could. > >> >> 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! > > Xen is not a good example here; I'm even not sure it still works > or not :) > > --yliu >> [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 >> >> >