From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 3E5025B2E for ; Tue, 16 Oct 2018 14:06:59 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id D375122276; Tue, 16 Oct 2018 08:06:58 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 16 Oct 2018 08:06:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=Wuz9+kBXA9H395j5b3nN+sfthjv8Ie40Me5hZhrCgSo=; b=gALSmWadJwDW sOSZu9K6RsNXdyXgk7qMv+jlAzbfRIfMAVUIjEM/og71Zb56YRE0Veut/CXWSJee PoBJA2yanjLtqJUfV9JkXPqLBQ04nZFXZFDlp6cS4aXAOVL6tsHLKZpIahoTiX1i Istf9/6mH53M7b1KYFfH/51xVqzC4Gc= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=Wuz9+kBXA9H395j5b3nN+sfthjv8Ie40Me5hZhrCg So=; b=YsqPZFk97BRkxdhC4EG0ugYI1J/Bc80A3diQqXU9rDh7lr2K9OnO0Tbr0 vf8jUm4wQjJ/BQY2Na/mC4ghq3FOCBAsLBojuL+OnaOljPCWOv2mJjY2cXCry3lo 4sJI5dG+qLPixsiVsd1EgCPfRORI+2O/k9xlHL2Ffbdmd0qhauHh1wfmR+vQASUp Cvvlj4mN9Z96lCcy+3jUkQPYKTFEfKY9C9HLLLOz+LBL3wukGbtXz8Z46JTYABlX WK0tzkgAFyXzdQdaGDdlkTLXgSCr1hRYLM6FslJG4QdEz9dpd8krk6vFoN1HP2qi V3uU4QQUeotXVjrLksN66ErJCbR3g== X-ME-Sender: X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id B4D16102DE; Tue, 16 Oct 2018 08:06:56 -0400 (EDT) From: Thomas Monjalon To: Ferruh Yigit Cc: dev@dpdk.org, gaetan.rivet@6wind.com, ophirmu@mellanox.com, arybchenko@solarflare.com Date: Tue, 16 Oct 2018 14:06:59 +0200 Message-ID: <6565113.fUpKjTsGKJ@xps> In-Reply-To: <361f0884-e08c-d47c-4f14-0ca0dca83246@intel.com> References: <20181007222554.4886-1-thomas@monjalon.net> <20181009223338.18307-3-thomas@monjalon.net> <361f0884-e08c-d47c-4f14-0ca0dca83246@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v4 2/6] ethdev: add iterator to match devargs input 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, 16 Oct 2018 12:06:59 -0000 16/10/2018 12:58, Ferruh Yigit: > 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 > > <...> > > + 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? We do not have similar ethdev unit test yet. So for -rc1, yes it is too late to introduce a new class of unit test. I will try to work on it for -rc2.