From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f175.google.com (mail-pd0-f175.google.com [209.85.192.175]) by dpdk.org (Postfix) with ESMTP id 6EE30DE6 for ; Fri, 3 Jul 2015 10:52:13 +0200 (CEST) Received: by pdbci14 with SMTP id ci14so60243496pdb.2 for ; Fri, 03 Jul 2015 01:52:12 -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=BqO86rzH8TNJWqIKb926J14D9nRdzPXYroSBE9jvpqo=; b=YDPx4MgjyvuMIK8mjIzmh9WGto++dDmA4i5ZMGaTzXtUyZCwlpf3LhPit2MOnbiTxa Ua3pEwbG/dPuMaauP/Ay9wiuma6neuGXR5dXdHKFbzj9TFg6cf21BlvmdlRMrbr4XqI2 XOvknTf1eYBkj4ZG8NMJrsKBhgvCnjzBhxBpofAkLA/kzfs+vIDMfp+HVCED/WrRlQBe ryPNOjNt0bQC4wx7NiOmyfd0bUkzXSB02zAs/iSclJ64W0BQqXys5X8dIA2jScx6i217 to4NRVeu8RiEmuoVdT6gr67kZEzsUG0E8/tp5/2dJzmifCRnZWiTOXLADCd8uPerM3vP c/eQ== X-Gm-Message-State: ALoCoQl8x25KTmaeedbYiu0uomlUgI2+pgyHzoAOASKjoMKSv/lKHx83DqP1AICvXSbNVff7ZuCc X-Received: by 10.70.103.10 with SMTP id fs10mr73934872pdb.141.1435913532895; Fri, 03 Jul 2015 01:52:12 -0700 (PDT) Received: from [10.16.129.101] (napt.igel.co.jp. [219.106.231.132]) by mx.google.com with ESMTPSA id bf5sm8287199pad.43.2015.07.03.01.52.11 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Jul 2015 01:52:12 -0700 (PDT) Message-ID: <55964D3B.6020507@igel.co.jp> Date: Fri, 03 Jul 2015 17:52:11 +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: Bruce Richardson 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> <20150702104637.GC3828@bricha3-MOBL3> In-Reply-To: <20150702104637.GC3828@bricha3-MOBL3> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit 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: Fri, 03 Jul 2015 08:52:13 -0000 On 2015/07/02 19:46, Bruce Richardson wrote: > 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 It might be difficult to do like above, because pci_uio_alloc_resource() returns 0, -1 and 1 as return value so far. Original pci_uio_map_resource() returns negative return value as error, and positive value as driver not found. So I follow this specification while implementing the function. Tetsuya