From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH v3 2/4] ethdev: add siblings iterators Date: Wed, 3 Apr 2019 00:42:27 +0100 Message-ID: <09b6795e-9247-6599-1c5e-1d398739b1e6@intel.com> References: <20181130002716.27325-1-thomas@monjalon.net> <20190401022700.1570-1-thomas@monjalon.net> <20190401022700.1570-3-thomas@monjalon.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: Thomas Monjalon , gaetan.rivet@6wind.com, Andrew Rybchenko Return-path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 142E56CC1 for ; Wed, 3 Apr 2019 01:42:29 +0200 (CEST) In-Reply-To: <20190401022700.1570-3-thomas@monjalon.net> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 4/1/2019 3:26 AM, Thomas Monjalon wrote: > If multiple ports share the same hardware device (rte_device), > they are siblings and can be found thanks to the new functions > and loop macros. > One iterator takes a port id as reference, > while the other one directly refers to the parent device. > > The ownership is not checked because siblings may have > different owners. > > Signed-off-by: Thomas Monjalon <...> > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change without prior notice. > + * > + * Iterates over ethdev ports of a specified device. > + * > + * @param port_id_start > + * The id of the next possible valid port. > + * @param parent > + * The generic device behind the ports to iterate. > + * @return > + * Next port id of the device, possibly port_id_start, > + * RTE_MAX_ETHPORTS if there is none. > + */ > +__rte_experimental > +uint16_t rte_eth_find_next_of(uint16_t port_id_start, > + const struct rte_device *parent); Minor nit, but other instances using the tag as: uint16_t __rte_experimental rte_eth_find_next_of(uint16_t port_id_start, const struct rte_device *parent); What do you think updating it for consistency? Same for two APIs.