From mboxrd@z Thu Jan 1 00:00:00 1970 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) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=TwEt2uyle8+nNuwprEpFyh5Q+ZmmGoOWAqnej/zKkmw=; b=Pa+wsvK6DjpKg0mOVf7uTfsIYHOhMaVQ23ehxsGEXlfB3Zoztkdw8QqTQZpLFdngeb pZ+6MXT8Zg2W/sPqFGf9ORNkuBawLyQnKkg1vsJzhBfT2oBB17oAAUEaj8bnwDXqU5Ob 23ckN8Po8KgFuL21cfjPI9CQB+VlPMpbXQnfSkZRfBZeks8nA20ebCTpxHVxII9Jez4M pqIvMaFGjcdBO9OesOyjj2u1cZDVIMxQgSLB9GHLFA5IR6I7pIv4h5SCRjV2a6dCr7if iLyqx27Bj9y1rBjIe4HgcCV5yEtjL0lqkUF7MYYD4uEhzZZEelMY1MpjDRiEsIRlrLlJ YI0w== X-Gm-Message-State: ALoCoQmckbgEMvcp5QydzPHTwo8KWnPg7LI7Y1FfdBduXkP4Vkyd5RUX8k0lTZNBYW+ksRhgpawL X-Received: by 10.69.19.129 with SMTP id gu1mr15386162pbd.162.1436323373893; Tue, 07 Jul 2015 19:42:53 -0700 (PDT) Received: from [10.16.129.101] (napt.igel.co.jp. [219.106.231.132]) by smtp.googlemail.com with ESMTPSA id sl9sm524465pac.41.2015.07.07.19.42.51 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Jul 2015 19:42:53 -0700 (PDT) Message-ID: <559C8E2A.5050500@igel.co.jp> Date: Wed, 08 Jul 2015 11:42:50 +0900 From: Tetsuya Mukawa User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: David Marchand 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> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v8 07/12] eal: Add pci_uio_map_resource_by_index() 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: Wed, 08 Jul 2015 02:42:55 -0000 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 >