From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 473EDA0352; Mon, 21 Feb 2022 18:05:03 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 050CC4068C; Mon, 21 Feb 2022 18:05:03 +0100 (CET) Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by mails.dpdk.org (Postfix) with ESMTP id E657E4013F for ; Mon, 21 Feb 2022 18:05:01 +0100 (CET) Received: by mail-pj1-f42.google.com with SMTP id m1-20020a17090a668100b001bc023c6f34so5599914pjj.3 for ; Mon, 21 Feb 2022 09:05:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wmb3HRYJv2S1NsRrjsbL1afBXsefOFpSIpgeqoIpjqk=; b=5RU5qgvJICibIFtXYSQpqZRG1BO7TGC7vzLzEvVq7hx39TYSabdOqjwdMrUH7kc8xr dMVRmeD5JxapjjxrL3ef5byMmU7PP5syup9+kEr0eMXZ6LxGH3e+pDVJr5uNVuUJoBy4 AV9GzUP9bsWMMFp/2UPBrGN8r3kBVYvDRekrUFPpXrosjyLfD35hA7ppRBQhIcE/Jrcd a8BGITNWSmW5mEmhjYxMON6fApF3U9K3JrqvF74C7Tdn+mjCWfFlX/hj0Wzq9o9XvGdZ r5obsT7OP3g9rzUxoptFHuYdLfzLYWxTU+ihkU1EkxvTUHepHQNwSSJ7K+IzQikz7dHo g8dA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wmb3HRYJv2S1NsRrjsbL1afBXsefOFpSIpgeqoIpjqk=; b=WN4dpgnK4cFPlfWwZieHIzltZ+zwgtcf0vifQhIcoz+3qb2EgUxqshamAUDKmi1qlS VmCxgKZuU3JTLGn258YB7rFX/PLUBmhCfoctpGXHCV8mx45diGj8Bt92zEbu8XVl5WcV eHgp7dTmn/xMtGgjwFF9ocFY+ueJ9VocYDNxlBDO/13uCFPr63pLh0xuXTtgnL235nY3 00Bysqym9Yfye2bxzTNTvr6SlmMHk9V3HAn555l8JZnBokve6an4tmr9c7QujbNsMHU2 5dW7XOBH+GfXAcpZ8KwnhzzrzP+FhqnNfjqjA/HZK0ln/H2rJfwQNOBkl/2rCYTlrtnw R05A== X-Gm-Message-State: AOAM530zHX6kodbG3g/uW0P++f5N+0+uMAaTZRtTZ3LwvMiLzNwMHbCH IzD1/WXovqK87Azi5ZR8jNXQMw== X-Google-Smtp-Source: ABdhPJzgxRAHPclKeN6kHnexJt5Kx8PdTqFC+2IrhscYD8Mbd0frL52L9A57HJ/ru6vVPsXX7kHi+g== X-Received: by 2002:a17:903:2c7:b0:14f:522c:d33c with SMTP id s7-20020a17090302c700b0014f522cd33cmr19719548plk.143.1645463100999; Mon, 21 Feb 2022 09:05:00 -0800 (PST) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id gz13-20020a17090b0ecd00b001bc5defa657sm1089855pjb.11.2022.02.21.09.04.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 09:05:00 -0800 (PST) Date: Mon, 21 Feb 2022 09:04:57 -0800 From: Stephen Hemminger To: "Min Hu (Connor)" Cc: Thomas Monjalon , , , , Subject: Re: [PATCH] app/procinfo: add device private info dump Message-ID: <20220221090457.3d6e6152@hermes.local> In-Reply-To: <2b87b25c-80ed-9f2b-7a18-01aceca10b24@huawei.com> References: <20220219015916.46347-1-humin29@huawei.com> <20220219170443.074e608f@hermes.local> <4253595.QZNE9M9tJY@thomas> <2b87b25c-80ed-9f2b-7a18-01aceca10b24@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Mon, 21 Feb 2022 10:26:38 +0800 "Min Hu (Connor)" wrote: > Hi, >=20 > =E5=9C=A8 2022/2/20 16:56, Thomas Monjalon =E5=86=99=E9=81=93: > > 20/02/2022 02:04, Stephen Hemminger: =20 > >> On Sat, 19 Feb 2022 09:59:16 +0800 > >> "Min Hu (Connor)" wrote: > >> =20 > >>> +static void > >>> +show_port_private_info(void) > >>> +{ > >>> + int i; > >>> + > >>> + snprintf(bdr_str, MAX_STRING_LEN, " show - Port PMD Private "); > >>> + STATS_BDR_STR(10, bdr_str); > >>> + > >>> + for (i =3D 0; i < RTE_MAX_ETHPORTS; i++) { > >>> + /* Skip if port is not in mask */ > >>> + if ((enabled_port_mask & (1ul << i)) =3D=3D 0) > >>> + continue; > >>> + > >>> + /* Skip if port is unused */ > >>> + if (!rte_eth_dev_is_valid_port(i)) > >>> + continue; =20 > >> > >> Maybe use RTE_ETH_FOREACH_DEV(i) here? > >> > >> Procinfo is somewhat inconsistent, some code uses, and some does not. > >> The difference is that FOREACH skips ports that are "owned" i.e > >> associated with another port. =20 > >=20 > > Yes RTE_ETH_FOREACH_DEV is for general usage, > > you get only the ports you are supposed to manage. > > =20 > >> There probably should be a clear policy in the comments about > >> how this command should handle ports. My preference would be > >> that it shows all valid ports, all the time since this is a diagnostic > >> command used to debug misconfiguration. > >> > >> There is RTE_ETH_FOREACH_VALID_DEV but it is marked internal? =20 > >=20 > > Yes, you get it right, RTE_ETH_FOREACH_VALID_DEV gets all ports > > and that should be used only internally or for debugging. > > If we expose it for debugging purpose, there is a risk of confusion. > > The goal was to "force" applications to adopt good behaviour, > > using RTE_ETH_FOREACH_DEV. =20 > Agree with using RTE_ETH_FOREACH_DEV, v2 has been sent out. >=20 > > It means RTE_MAX_ETHPORTS must be used for debugging. > > Is it a good decision? > >=20 > >=20 > > . > > =20 Maybe procinfo should have a flag (--all) to show all devices.