From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] bus: skip useless iterations in rte_bus_find Date: Wed, 25 Oct 2017 13:13:35 +0200 Message-ID: <9158332.2t1W8VLTKN@xps> References: <1504023588-13085-1-git-send-email-gaetan.rivet@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, Ferruh Yigit To: Gaetan Rivet 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) In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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