From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 0128C11F5 for ; Thu, 2 Jul 2015 12:46:41 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP; 02 Jul 2015 03:46:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,391,1432623600"; d="scan'208";a="754703566" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.208.61]) by fmsmga002.fm.intel.com with SMTP; 02 Jul 2015 03:46:39 -0700 Received: by (sSMTP sendmail emulation); Thu, 02 Jul 2015 11:46:38 +0025 Date: Thu, 2 Jul 2015 11:46:37 +0100 From: Bruce Richardson To: Tetsuya Mukawa Message-ID: <20150702104637.GC3828@bricha3-MOBL3> References: <1435306705-11645-4-git-send-email-mukawa@igel.co.jp> <1435652668-3380-1-git-send-email-mukawa@igel.co.jp> <1435652668-3380-7-git-send-email-mukawa@igel.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1435652668-3380-7-git-send-email-mukawa@igel.co.jp> Organization: Intel Shannon Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v7 06/12] eal: Add pci_uio_alloc_resource() 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: Thu, 02 Jul 2015 10:46:42 -0000 On Tue, Jun 30, 2015 at 05:24:22PM +0900, Tetsuya Mukawa wrote: > From: "Tetsuya.Mukawa" > > This patch adds a new function called pci_uio_alloc_resource(). > The function hides how to prepare 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 | 70 +++++++++++++++++++--------- > lib/librte_eal/linuxapp/eal/eal_pci_uio.c | 77 ++++++++++++++++++++++--------- > 2 files changed, 104 insertions(+), 43 deletions(-) > > diff --git a/lib/librte_eal/bsdapp/eal/eal_pci.c b/lib/librte_eal/bsdapp/eal/eal_pci.c > index 06c564f..7d2f8b5 100644 > --- a/lib/librte_eal/bsdapp/eal/eal_pci.c > +++ b/lib/librte_eal/bsdapp/eal/eal_pci.c > @@ -189,28 +189,17 @@ pci_uio_map_secondary(struct rte_pci_device *dev) > return 1; > } > > -/* map the PCI resource of a PCI device in virtual memory */ > static int > -pci_uio_map_resource(struct rte_pci_device *dev) > +pci_uio_alloc_resource(struct rte_pci_device *dev, > + struct mapped_pci_resource **uio_res) Rather than having to pass in a pointer to a pointer, why not change the return type to be "struct mapped_pci_resource *"? The only return values currently are 0 and -1, so those could map to non-NULL and NULL respectively, for error checking. /Bruce