From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id AE390A0526; Tue, 21 Jul 2020 19:09:02 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0DC541BFE9; Tue, 21 Jul 2020 19:09:02 +0200 (CEST) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id D58531BFD4 for ; Tue, 21 Jul 2020 19:09:00 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 400F65C00A8; Tue, 21 Jul 2020 13:09:00 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Tue, 21 Jul 2020 13:09:00 -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=fm1; bh= 2gTj8EzpQ5/3iAXU7oZbebYVYL+7EYu5p/JzwPTTyQk=; b=n9uqbPbpt+6o9A4D rMCQ/2kod0XZfVLnbnD3TMo+9K1wh8QYrHRXYGSmCJ73VDwHu7+uwuCTC4mkouf7 ivn7awUCPhUeAxFNLT8sODk6zBVIRLbDpLhJPVTDBOsEJypahCCTQj7GJ7ICGNO+ 0Tb/8z1ckPMB3r5JKnajsMLdMjseHmdqMg1ESyxg/aFwmtuq+cw4+XA91Qdek+KI 63npYrw99PTzhDtOaKeqz7b5+6/9hIunY1RuSSdd+sOk1RK76MFMIqXlaVSk6DO7 31/PDBzT5DgpqInXN749l66X/XLDNtphgvI11TW1B6UwXxoz76rU0p9JrOdwSOCq VK2W7w== 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=fm3; bh=2gTj8EzpQ5/3iAXU7oZbebYVYL+7EYu5p/JzwPTTy Qk=; b=SrYrBCEeqAIJRnvmcupRzq6pftfQoF5YoACjZuRLF9qlyYwCRwiOqNWo8 KsBqMu+7WVqq55nUiVvnNNF5cTroiyl/H4LplVQf/NDJROqEEnj3M2MJY599owRm rpH3Ge717WrPYMC7fdBTsWM+zlkEdqjBAmHsuBmZdArL/r7/noBMxRzXOBJwnhkg u9vnbXUOAYwnZ2jUZVt8h2FY6Ci+8UKN3GjNqvNVGnvFoRmYOhRgmyFk85QMmcm2 E/KjxY4MITjTRYLh1lQwngi/MENMiFwQJshCzjdUH/ljMmXfdQBm4oP3XHuRtSHE BEWIZWlhS3Ti+nNkIOKH1SmrlrfBQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrgeeigddutdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu ieeivdffgeehnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl ohhnrdhnvght 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 503EE30600B4; Tue, 21 Jul 2020 13:08:59 -0400 (EDT) From: Thomas Monjalon To: Stephen Hemminger Cc: maryam.tahhan@intel.com, reshma.pattan@intel.com, hemant.agrawal@nxp.com, dev@dpdk.org Date: Tue, 21 Jul 2020 19:08:57 +0200 Message-ID: <3970844.9fo0LYaLg5@thomas> In-Reply-To: <20200721100521.62c556e7@hermes.lan> References: <20200506193741.24117-1-stephen@networkplumber.org> <9275553.NR17kIY6SJ@thomas> <20200721100521.62c556e7@hermes.lan> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v3 6/7] app/proc-info: provide way to request info on owned ports 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 21/07/2020 19:05, Stephen Hemminger: > On Fri, 17 Jul 2020 17:01:00 +0200 > Thomas Monjalon wrote: > > 15/07/2020 23:22, Stephen Hemminger: > > > + /* If no port mask was specified, one will be provided */ > > > > Would be nice to help the user by printing a port mask > > of owned and unowned ports. > > Not needed, since each display already has the port # By default, owned ports are not displayed at all. How are we supposed to find them? > > > + if (enabled_port_mask == 0) { > > > + RTE_ETH_FOREACH_DEV(i) { > > > + enabled_port_mask |= 1u << i; > > > } > > > } > > > > > > + for (port_mask = enabled_port_mask; port_mask != 0; > > > + port_mask &= ~(1u << i)) { > > > > Please would be good to help drunk or sleepy readers with few comments. > ok? Comments in the code I mean. > > > + /* ffs() first bit is 1 not 0 */ > > > + i = ffs(port_mask) - 1; > > > + > > > + if (i >= RTE_MAX_ETHPORTS) > > > + break; > > > > This check is already done in rte_eth_dev_is_valid_port(). > > Want to stop early if port is out of range, > but continue if hits a port that is owned. OK > > > + > > > + if (!rte_eth_dev_is_valid_port(i)) > > > + continue;