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 289BCA00C2; Sun, 20 Feb 2022 02:04:49 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BADDF40395; Sun, 20 Feb 2022 02:04:48 +0100 (CET) Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by mails.dpdk.org (Postfix) with ESMTP id 7BCD74014E for ; Sun, 20 Feb 2022 02:04:47 +0100 (CET) Received: by mail-pl1-f175.google.com with SMTP id 4so1460975pll.6 for ; Sat, 19 Feb 2022 17:04:47 -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=wUhT8cgjrOZo6XyLQ7uqvAG4cP6CI1EgtWxShjVQK38=; b=eE07ibvtReBFw5UVjsMzt1n7YtMQx+vCLdbvvmiWjmiOpTacA7VHfo9xfDA17gPDKq nA7mRf0BGgOb0TziPnhmwxx97SVON4L7u7bs9t8crP0SnnoM/bYLUGklPRWNZ8C/vZza Qur/0khdCojS8GWhLkR3xIAX14QlXu9uVXCLYhY4QueZNGx6EFzTTua4HmyRKWnUaTgP VK/RxU+xniBlUht8zFKH8UScMRKGth1ymb74M10j1mJjtBW6H/r/3lBEWiCoTmAL/MHD Yzx/wNPMy/x4w8/H8bALRvtZdK83HlXPuNCH8Vtbc5U1F5pIOuLvc5uRIJH4F6lD4OzJ HSBA== 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=wUhT8cgjrOZo6XyLQ7uqvAG4cP6CI1EgtWxShjVQK38=; b=N7rRFX1k9HoGxAUkbD+5FfgT+5UbObyN9+kqPCyIFeNAdzYJCnxXZUTwmH3yCy4EAh G/Y2W2wyltqL4U7fEcQIZICosjK6ljNhn29dFadWGAzjfYvAKjkHKR07hyEQIde3aNQo Ca/DtoW8u5NKWee4vBuLzHDJLKsf5HFR1CHiOhDY7La4lJZA2OskFpvgtm3si5cWjOuv E6BTSvq9WqLUCmLB/k+2AwWDERz6bZqy1DKGH+WniFTP9RoLoHqCcrWPFR+L3/F0hcV5 ccmmMUWpaAHG2qmHEknkLRwhu0OswL/GDctRusyKcxIvvTS57I/mlFGLrYsgXcsDKYOX vd+Q== X-Gm-Message-State: AOAM5310LJn+QcaP9gP9aaqQxWDFNzbxNMpbYs/KOBP7DXC8nIakLSVQ +JPv0tCsiYCqUrrhBQmYQ8clJQ== X-Google-Smtp-Source: ABdhPJzvc0T8Ny5nyzDKto7Otqj5hnx/89G+Ej7uJYObI3GcZhFO6TRy+aq0EeGAshAEqV4ZHxLq4g== X-Received: by 2002:a17:90b:1d0f:b0:1b9:fdb1:2994 with SMTP id on15-20020a17090b1d0f00b001b9fdb12994mr19380393pjb.53.1645319086458; Sat, 19 Feb 2022 17:04:46 -0800 (PST) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id m23sm7281956pff.201.2022.02.19.17.04.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Feb 2022 17:04:46 -0800 (PST) Date: Sat, 19 Feb 2022 17:04:43 -0800 From: Stephen Hemminger To: "Min Hu (Connor)" Cc: , , , , Subject: Re: [PATCH] app/procinfo: add device private info dump Message-ID: <20220219170443.074e608f@hermes.local> In-Reply-To: <20220219015916.46347-1-humin29@huawei.com> References: <20220219015916.46347-1-humin29@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 Sat, 19 Feb 2022 09:59:16 +0800 "Min Hu (Connor)" wrote: > +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 = 0; i < RTE_MAX_ETHPORTS; i++) { > + /* Skip if port is not in mask */ > + if ((enabled_port_mask & (1ul << i)) == 0) > + continue; > + > + /* Skip if port is unused */ > + if (!rte_eth_dev_is_valid_port(i)) > + continue; 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. 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?