From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by dpdk.org (Postfix) with ESMTP id B14F3271 for ; Tue, 27 Jun 2017 21:26:21 +0200 (CEST) Received: by mail-wm0-f66.google.com with SMTP id y5so7574249wmh.3 for ; Tue, 27 Jun 2017 12:26:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=AKWgnF9aULQyETSbDtstJaFAAw0IUeQ5wkPuuHksgXY=; b=KBlkfeVl00nsHYCqsPh8gAXPS5KU5TE+PPR+3PYpYZNxhv1rqwoHIseccQYBgqbw34 J+dANLSiXu+Di9MS2nt9GBkKtl37wa1eNNvgz3PSEjV+mmKMjOOZU4V6Gys2C6Czfy6j Tov9Zo5x9+k6+yjUAo305CbqDL2o3hPZeyRD4d8OhbLHw4Y6WyetiP5g9uEzX6trwpt+ Af+Hul0JeKrDZ3Q3vpXt43Sl5gzHzkhnQpDU9SRABom8ynomt8nOjTcIsdbTZGvsIfS/ hrj+ubn5raxne4vx32XEVpxz43pq9H46y6/vgNOkV5IIe2WrAhe+EFQNzMC6ZTsIOFle 8vjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=AKWgnF9aULQyETSbDtstJaFAAw0IUeQ5wkPuuHksgXY=; b=X1hcGS3BxG01zRkAAHEiaM/NuqsHJpyeGcKUg+SpZ/SY3RhUnzmMt3I5ikzoutowDl g5YbhdtLelN1lgXis2dljQD8ggEo549clk55RpK1ekjj7s3N5oguLNhnJQFxpTWsoyUw sBfvIlxyIURGBO0UCTebSZox++sgZU/EyUSCXKArFvmqP/+Z7IgWc7v4GEFvkPW5skXP Vj8nWcduSET40ndS/FfdldKWhAfx7geXiwfRZaUJGwEtho1EIACjfouy0vHywN4dAIsR kTaBQbjvpsDAakDfNRY9ZMVhWPBqQaVffnRBbu4YhosMAaD+Cwke7IbH/cmq6yKy+zw8 EXLw== X-Gm-Message-State: AKS2vOxjAVYN05bYzu861WT4YJXMDnG3Dcq6aqdFygSuHa17E4TvaZJ2 4vCldVLx6R7+681NYM2VWmknlamniQ== X-Received: by 10.28.168.10 with SMTP id r10mr1524029wme.36.1498591581270; Tue, 27 Jun 2017 12:26:21 -0700 (PDT) MIME-Version: 1.0 Sender: jblunck@gmail.com Received: by 10.28.158.200 with HTTP; Tue, 27 Jun 2017 12:26:20 -0700 (PDT) In-Reply-To: References: From: Jan Blunck Date: Tue, 27 Jun 2017 21:26:20 +0200 X-Google-Sender-Auth: uZf_Q2JvWfow6LR5ydI3tt7CFhE Message-ID: To: Gaetan Rivet Cc: dev Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v5 2/7] 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: Tue, 27 Jun 2017 19:26:22 -0000 On Wed, Jun 21, 2017 at 1:30 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. > Again, I don't think this makes sense to have. Also there is no user for this as far as I can see. The bus specific device representation should come from the scan function instead of this. > 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 b220299..05503ea 100644 > --- a/lib/librte_eal/common/include/rte_bus.h > +++ b/lib/librte_eal/common/include/rte_bus.h > @@ -117,6 +117,26 @@ typedef struct rte_device * (*rte_bus_plug_t)(struct rte_devargs *da); > 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. > + * > + * @return > + * 0 if parsing was successful. > + * !0 for any error. > + */ > +typedef int (*rte_bus_parse_t)(const char *name, void *addr); > + > +/** > * A structure describing a generic bus. > */ > struct rte_bus { > @@ -127,6 +147,7 @@ struct rte_bus { > rte_bus_find_device_t find_device; /**< Find device on bus */ > rte_bus_plug_t plug; /**< Probe single device for drivers */ > rte_bus_unplug_t unplug; /**< Remove single device from driver */ > + rte_bus_parse_t parse; /**< Parse a device name */ > }; > > /** > -- > 2.1.4 >