From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id C06AE1B921 for ; Wed, 25 Oct 2017 13:13:36 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 4964422595; Wed, 25 Oct 2017 07:13:36 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Wed, 25 Oct 2017 07:13:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=Mw1YXgk7skllIgRZA9TZkHzkMC 4DTRCsIlfGN9Tuk88=; b=TYa6cs5KXRLYFxSAZTxO7x1W7g5yei0UfgfKK1oEp9 PqPLjrUgYq13cLR8j7Oh9gfR4R5WO8GSRrF3szZjGaBiRNPmeHD3bQoC2Mz6Ihfi 9tzo7ReH/Kpf9zOtIomkUEsykqb2xdllH8pgWyfVZKeY8RCfVsrobvxctgGa0Qd2 4= 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-sender:x-me-sender:x-sasl-enc; s=fm1; bh=Mw1YXg k7skllIgRZA9TZkHzkMC4DTRCsIlfGN9Tuk88=; b=Z27FXDOOHGvAcy2aqRPHMO xSlOWQB+0xaVOw5bYXfbiHVk1hZjd7Qv9vmnoLAUMJRB8e1/WQADVTKxwlLFN5iy 0ZuL6TlIGVYI4Sg4DNMOtrqKQrmO9k2HgrKBcQKL6WLH1EZFa+DZ7kQPV0qJwibB co21UC6szHuMKhMYEvxVpP4ed7FNQ1eP3CZeNjnNpqGNjvNKZoj+X4Mf7TplO+eT +AqYG1Ybth86y9bHrLDuCCwtxyVDQRFh47Vjx3TYumgNZoiMukBieWLD0xSl71l4 ep05JIadCydKGveDRIschgXQcPkaSXWve2DKjOCzcYO0Tf82cT3jz70FZEf312Zg == X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id F07A824740; Wed, 25 Oct 2017 07:13:35 -0400 (EDT) From: Thomas Monjalon To: Gaetan Rivet Cc: dev@dpdk.org, Ferruh Yigit Date: Wed, 25 Oct 2017 13:13:35 +0200 Message-ID: <9158332.2t1W8VLTKN@xps> In-Reply-To: References: <1504023588-13085-1-git-send-email-gaetan.rivet@6wind.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] bus: skip useless iterations in rte_bus_find 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: Wed, 25 Oct 2017 11:13:36 -0000 24/10/2017 02:18, Ferruh Yigit: > On 8/29/2017 9:19 AM, Gaetan Rivet wrote: > > The starting point is known. The iterator can be directly set to it. > > > > The function rte_bus_find can easily be used with a comparison function > > always returning True. This would make it a regular bus iterator. > > > > Users doing so would however accomplish such iteration in > > > > O(N * N/2) = O(N^2) > > > > Which can be avoided. > > > > Signed-off-by: Gaetan Rivet > > --- > > > > In practice, such cost is entirely negligible of course. > > It is cleaner and more correct though. > > +1 for more clean approach > > Reviewed-by: Ferruh Yigit Applied, thanks