From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v3 1/4] ethdev: simplify port state comparisons Date: Mon, 01 Apr 2019 17:17:35 +0200 Message-ID: <21018304.OXf2jst79b@xps> References: <20181130002716.27325-1-thomas@monjalon.net> <20190401022700.1570-2-thomas@monjalon.net> <20190401075851.4908488a@shemminger-XPS-13-9360> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: gaetan.rivet@6wind.com, Ferruh Yigit , Andrew Rybchenko , dev@dpdk.org To: Stephen Hemminger Return-path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 06F9C3572 for ; Mon, 1 Apr 2019 17:17:39 +0200 (CEST) In-Reply-To: <20190401075851.4908488a@shemminger-XPS-13-9360> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 01/04/2019 16:58, Stephen Hemminger: > On Mon, 1 Apr 2019 04:26:57 +0200 > Thomas Monjalon wrote: > > > diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c > > index 10bdfb37e..33cffc498 100644 > > --- a/lib/librte_ethdev/rte_ethdev.c > > +++ b/lib/librte_ethdev/rte_ethdev.c > > @@ -330,8 +330,7 @@ uint16_t > > rte_eth_find_next(uint16_t port_id) > > { > > while (port_id < RTE_MAX_ETHPORTS && > > - rte_eth_devices[port_id].state != RTE_ETH_DEV_ATTACHED && > > - rte_eth_devices[port_id].state != RTE_ETH_DEV_REMOVED) > > + rte_eth_devices[port_id].state == RTE_ETH_DEV_UNUSED) > > For some applications that iterate over ports this is a hot path. Really? > What about keeping an unused port bit mask and using ffs (in the future)? I don't understand your proposal. Please could you elaborate? Do you agree on this patch anyway?