From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tetsuya Mukawa Subject: Re: [PATCH v8 07/12] eal: Add pci_uio_map_resource_by_index() Date: Wed, 08 Jul 2015 11:42:50 +0900 Message-ID: <559C8E2A.5050500@igel.co.jp> References: <1435652668-3380-12-git-send-email-mukawa@igel.co.jp> <1436163861-3025-1-git-send-email-mukawa@igel.co.jp> <1436163861-3025-8-git-send-email-mukawa@igel.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: "dev@dpdk.org" To: David Marchand Return-path: Received: from mail-pa0-f49.google.com (mail-pa0-f49.google.com [209.85.220.49]) by dpdk.org (Postfix) with ESMTP id 7DFD35A63 for ; Wed, 8 Jul 2015 04:42:54 +0200 (CEST) Received: by pacgz10 with SMTP id gz10so49417842pac.3 for ; Tue, 07 Jul 2015 19:42:53 -0700 (PDT) In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 2015/07/07 17:05, David Marchand wrote: > > > On Mon, Jul 6, 2015 at 8:24 AM, Tetsuya Mukawa > wrote: > > From: "Tetsuya.Mukawa" > > > This patch adds a new function called pci_uio_map_resource_by_index(). > The function hides how to map uio resource in linuxapp and bsdapp. > With the function, pci_uio_map_resource() will be more abstracted. > > Signed-off-by: Tetsuya Mukawa > > --- > lib/librte_eal/bsdapp/eal/eal_pci.c | 107 > +++++++++++++++----------- > lib/librte_eal/linuxapp/eal/eal_pci_uio.c | 124 > +++++++++++++++++------------- > 2 files changed, 133 insertions(+), 98 deletions(-) > > diff --git a/lib/librte_eal/bsdapp/eal/eal_pci.c > b/lib/librte_eal/bsdapp/eal/eal_pci.c > index ce0ca07..c76f936 100644 > --- a/lib/librte_eal/bsdapp/eal/eal_pci.c > +++ b/lib/librte_eal/bsdapp/eal/eal_pci.c > @@ -241,20 +241,73 @@ error: > return -1; > } > > +static int > +pci_uio_map_resource_by_index(struct rte_pci_device *dev, int > res_idx, > + struct mapped_pci_resource *uio_res, int map_idx) > +{ > + int fd; > + char *devname; > + void *mapaddr; > + uint64_t offset; > + uint64_t pagesz; > + struct pci_map *maps; > + > + if ((dev == NULL) || (uio_res == NULL) || (uio_res->path > == NULL)) > + return -1; > > > No need for these checks. > I will fix it. > diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c > b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c > index f408bd3..cafabba 100644 > --- a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c > +++ b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c > @@ -333,19 +333,82 @@ error: > return -1; > } > > +static int > +pci_uio_map_resource_by_index(struct rte_pci_device *dev, int > res_idx, > + struct mapped_pci_resource *uio_res, int map_idx) > +{ > + int fd; > + char devname[PATH_MAX]; /* contains the /dev/uioX */ > + void *mapaddr; > + struct rte_pci_addr *loc; > + struct pci_map *maps; > + > + if ((dev == NULL) || (uio_res == NULL)) > + return -1; > > > Idem. > > Also, I will fix it. Tetsuya > Then, > Acked-by: David Marchand > > > > -- > David Marchand >