From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f178.google.com (mail-wr0-f178.google.com [209.85.128.178]) by dpdk.org (Postfix) with ESMTP id A88642A58 for ; Thu, 6 Jul 2017 14:30:21 +0200 (CEST) Received: by mail-wr0-f178.google.com with SMTP id c11so848538wrc.3 for ; Thu, 06 Jul 2017 05:30:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=RY7+yjuwGHn5H1HI08dNg0MVboP7HotxnFAy56FXko8=; b=pWt/SeyL+zIRB5A+Jrt2XBmzeDCRJ0D1Nx5um3IxTtvG2rb+be+NwddTi9HWTyseTG 8D7RZY/OjB+eHSDk5G7cbhy8eSt6Kxcn+YIMg4OBingxQwCd3IBPkLvnx5dU6r1cCMSK 7BkLeeWK0DGUWs/REORfEfqJVHfRgDLr5Q6qbn5k4ZntdItURfBoShILCQk+vwfWk4v5 sJ2QioOzVUyEIa/B2fz6YDQLtZeJKZOuU1RGEKj7icuDOyLJKVN0PiG6ff/CGpXbJ2zM GVSEcRuHcSuI6JRDRba/P0TkCpDbYIwF8QT6gRH3ljNaN2duadULx44HSx69lnTXlBjV lyww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=RY7+yjuwGHn5H1HI08dNg0MVboP7HotxnFAy56FXko8=; b=AKmnjcKj6lKjFlFGCL7b1nyKDiF+TZVVe0pSXyPHZgV4YLgj0YwuCI66/Xz4ZuC34n lQ1Dv6HOpU/+MnU5iGjSoP+0bADu+97LmIPUYQvKmf2UJUo75CxGfS5KwIwBD61RyS92 CgHhmwEK5/j9GThq5Ahkh0duzGs1oWOjx1zjHegA+9L2ilHiz7zsgw2qi3UqMOCrXQ+3 VWphMXcOzdtDEHXdRi8/pzRBTWEzi/WVcOF4wGFMrd8T4uCB/tZEcBnqqz0bpS+670IM /wf7OWPCvq1fA3Pjh3+92u4ILKF481wieN0TIkpTXZxSRQnW6VxTeER8qao0B4cPypYG hpjQ== X-Gm-Message-State: AIVw110Wt44Kkw9hAgYVWKOWzGNZVvzsJusPc7FPIoA0AtyJCopsQ41d 4pDXwL12ia1WRQ+Zbv8= X-Received: by 10.28.211.20 with SMTP id k20mr14781633wmg.123.1499344220939; Thu, 06 Jul 2017 05:30:20 -0700 (PDT) Received: from bidouze.vm.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id g5sm182461wmf.5.2017.07.06.05.30.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Jul 2017 05:30:20 -0700 (PDT) Date: Thu, 6 Jul 2017 14:30:12 +0200 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet To: santosh Cc: dev@dpdk.org Message-ID: <20170706123012.GL11154@bidouze.vm.6wind.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH v7 2/6] bus: introduce parsing functionality X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jul 2017 12:30:22 -0000 On Thu, Jul 06, 2017 at 02:49:41PM +0530, santosh wrote: > Hi Gaetan, > > On Wednesday 05 July 2017 05:25 AM, Gaetan Rivet wrote: > > > This operation can be used either to validate that a device > > representation can be understood by a bus, as well as store the resulting > > specialized device representation in any format determined by the bus. > > > > Signed-off-by: Gaetan Rivet > > --- > > lib/librte_eal/common/include/rte_bus.h | 21 +++++++++++++++++++++ > > 1 file changed, 21 insertions(+) > > > > diff --git a/lib/librte_eal/common/include/rte_bus.h b/lib/librte_eal/common/include/rte_bus.h > > index 773b0d7..aebf57e 100644 > > --- a/lib/librte_eal/common/include/rte_bus.h > > +++ b/lib/librte_eal/common/include/rte_bus.h > > @@ -138,6 +138,26 @@ typedef int (*rte_bus_plug_t)(struct rte_device *dev, > > typedef int (*rte_bus_unplug_t)(struct rte_device *dev); > > > > /** > > + * Bus specific parsing function. > > + * Validates the syntax used in the textual representation of a device, > > + * If the syntax is valid and ``addr`` is not NULL, writes the bus-specific > > + * device representation to ``addr``. > > + * > > + * @param[in] name > > + * device textual description > > + * > > + * @param[out] addr > > + * device information location address, into which parsed info > > + * should be written. If NULL, nothing should be written, which > > + * is not an error. > > + * > > r / is not a error/ is valid? > I'm partial to "is not an error" here, but it doesn't matter that much and I can change it if you prefer. > > + * @return > > + * 0 if parsing was successful. > > + * !0 for any error. > > + */ > > +typedef int (*rte_bus_parse_t)(const char *name, void *addr); > > + > > _parse handler in _common_vdev or common_pci file return boolean value > i.e..0 for success and 1 for error, right? if so then > !0 for any error would be like '1' for error case.. make sense? > I thought of that yes, and actually your suggestion was the first version I used. Ultimately however, this function is not only saying "can parse": it is not merely a test of being able to process the input, but also the process itself. The test value is then a byproduct. As such, I decided to settle on the standard "0 means nothing of note happened, carry on". -- Gaëtan Rivet 6WIND