From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH v4 2/6] ethdev: add iterator to match devargs input Date: Tue, 16 Oct 2018 11:58:47 +0100 Message-ID: <361f0884-e08c-d47c-4f14-0ca0dca83246@intel.com> References: <20181007222554.4886-1-thomas@monjalon.net> <20181009223338.18307-1-thomas@monjalon.net> <20181009223338.18307-3-thomas@monjalon.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: gaetan.rivet@6wind.com, ophirmu@mellanox.com, arybchenko@solarflare.com To: Thomas Monjalon , dev@dpdk.org Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 6BF734D27 for ; Tue, 16 Oct 2018 12:58:50 +0200 (CEST) In-Reply-To: <20181009223338.18307-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 10/9/2018 11:33 PM, Thomas Monjalon wrote: > The iterator will return the ethdev port ids matching a devargs string. > It is recommended to use the macro RTE_ETH_FOREACH_MATCHING_DEV() > for usage convenience. > > The class string is prefixed with '+' in order to skip the validation > of the parameter keys. It is tolerated for the compatibility with > the old (current) syntax where all parameters (bus, class and driver) > are mixed in the same string without any delimiter. > Thanks to this compatibility prefix, the driver parameters will be > skipped during the ethdev parsing, and not considered invalid. > > A macro is introduced in rte_common.h to workaround a const field. > This hack is needed to free const strings in the iterator. > It is preferred to keep the const for these fields, because it gives > a hint that they are not changed at each iteration. > > Signed-off-by: Thomas Monjalon > Reviewed-by: Andrew Rybchenko <...> > @@ -237,6 +237,9 @@ EXPERIMENTAL { > rte_eth_dev_owner_unset; > rte_eth_dev_rx_offload_name; > rte_eth_dev_tx_offload_name; > + rte_eth_iterator_cleanup; > + rte_eth_iterator_init; > + rte_eth_iterator_next; It would be great to add some unit test for these APIs, it would both show how they are used and verify this functionality with all that "+" trick etc.. Similar to previous patch, vdev iterator. Is it too late to add some unit test for these functionality?