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 5F0FCA0093; Sat, 21 May 2022 08:55:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F3FC240222; Sat, 21 May 2022 08:55:01 +0200 (CEST) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id 94CBE40156 for ; Sat, 21 May 2022 08:54:59 +0200 (CEST) Received: from kwepemi500012.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4L4vSW40n4zgY95; Sat, 21 May 2022 14:53:31 +0800 (CST) Received: from [10.67.103.128] (10.67.103.128) by kwepemi500012.china.huawei.com (7.221.188.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 21 May 2022 14:54:56 +0800 Subject: Re: [PATCH v2] app/procinfo: add devcie private info dump From: "Min Hu (Connor)" To: CC: , , , , , Ferruh Yigit References: <20220219015916.46347-1-humin29@huawei.com> <20220221022412.47258-1-humin29@huawei.com> Message-ID: Date: Sat, 21 May 2022 14:54:56 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <20220221022412.47258-1-humin29@huawei.com> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.128] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemi500012.china.huawei.com (7.221.188.12) X-CFilter-Loop: Reflected 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 Hi, Ferruh, what do you think of this patch? ÔÚ 2022/2/21 10:24, Min Hu (Connor) дµÀ: > This patch adds support for dump the device private info from a running > application. It can help developers locate the problem. > > Signed-off-by: Min Hu (Connor) > --- > v2: > * fix way of handling ports. > --- > app/proc-info/main.c | 28 ++++++++++++++++++++++++++++ > 1 file changed, 28 insertions(+) > > diff --git a/app/proc-info/main.c b/app/proc-info/main.c > index 56070a3317..accb5e716d 100644 > --- a/app/proc-info/main.c > +++ b/app/proc-info/main.c > @@ -84,6 +84,8 @@ static char bdr_str[MAX_STRING_LEN]; > > /**< Enable show port. */ > static uint32_t enable_shw_port; > +/**< Enable show port private info. */ > +static uint32_t enable_shw_port_priv; > /**< Enable show tm. */ > static uint32_t enable_shw_tm; > /**< Enable show crypto. */ > @@ -123,6 +125,7 @@ proc_info_usage(const char *prgname) > " --collectd-format: to print statistics to STDOUT in expected by collectd format\n" > " --host-id STRING: host id used to identify the system process is running on\n" > " --show-port: to display ports information\n" > + " --show-port-private: to display ports private information\n" > " --show-tm: to display traffic manager information for ports\n" > " --show-crypto: to display crypto information\n" > " --show-ring[=name]: to display ring information\n" > @@ -232,6 +235,7 @@ proc_info_parse_args(int argc, char **argv) > {"xstats-ids", 1, NULL, 1}, > {"host-id", 0, NULL, 0}, > {"show-port", 0, NULL, 0}, > + {"show-port-private", 0, NULL, 0}, > {"show-tm", 0, NULL, 0}, > {"show-crypto", 0, NULL, 0}, > {"show-ring", optional_argument, NULL, 0}, > @@ -284,6 +288,9 @@ proc_info_parse_args(int argc, char **argv) > else if (!strncmp(long_option[option_index].name, > "show-port", MAX_LONG_OPT_SZ)) > enable_shw_port = 1; > + else if (!strncmp(long_option[option_index].name, > + "show-port-private", MAX_LONG_OPT_SZ)) > + enable_shw_port_priv = 1; > else if (!strncmp(long_option[option_index].name, > "show-tm", MAX_LONG_OPT_SZ)) > enable_shw_tm = 1; > @@ -887,6 +894,25 @@ show_port(void) > } > } > > +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); > + > + RTE_ETH_FOREACH_DEV(i) { > + /* Skip if port is not in mask */ > + if ((enabled_port_mask & (1ul << i)) == 0) > + continue; > + > + snprintf(bdr_str, MAX_STRING_LEN, " Port %u ", i); > + STATS_BDR_STR(5, bdr_str); > + rte_eth_dev_priv_dump(i, stdout); > + } > +} > + > static void > display_nodecap_info(int is_leaf, struct rte_tm_node_capabilities *cap) > { > @@ -1549,6 +1575,8 @@ main(int argc, char **argv) > /* show information for PMD */ > if (enable_shw_port) > show_port(); > + if (enable_shw_port_priv) > + show_port_private_info(); > if (enable_shw_tm) > show_tm(); > if (enable_shw_crypto) >