* [PATCH 0/6] app/procinfo: add some extended features @ 2022-07-22 9:12 Dongdong Liu 2022-07-22 9:12 ` [PATCH 1/6] app/procinfo: add version dump Dongdong Liu ` (13 more replies) 0 siblings, 14 replies; 89+ messages in thread From: Dongdong Liu @ 2022-07-22 9:12 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko; +Cc: Dongdong Liu [PATCH 1/6 2/6 3/6] support ethdev info about firmware version, RSS reta info, and module info, from the below link [1] that have been sent out in the earlier, wait for review. [PATCH 4/6] add dump of Rx/tx burst mode. [PATCH 5/6] fix some wrong doxygen syntax for procinfo suggested by Thomas. [PATCH 6/6] update the procinfo doc guide. [1] https://lore.kernel.org/dpdk-dev/20220527014259.38559-1-humin29@huawei.com/ Dongdong Liu (2): app/procinfo: fix some wrong doxygen syntax doc: add some extended features in procinfo guide Jie Hai (1): app/proc-info: add dump of Rx/Tx burst mode Min Hu (Connor) (3): app/procinfo: add version dump app/procinfo: add RSS RETA dump app/procinfo: add module info dump app/proc-info/main.c | 213 +++++++++++++++++++++++++++++---- doc/guides/tools/proc_info.rst | 12 ++ 2 files changed, 202 insertions(+), 23 deletions(-) -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH 1/6] app/procinfo: add version dump 2022-07-22 9:12 [PATCH 0/6] app/procinfo: add some extended features Dongdong Liu @ 2022-07-22 9:12 ` Dongdong Liu 2022-09-19 9:23 ` Pattan, Reshma 2022-07-22 9:12 ` [PATCH 2/6] app/procinfo: add RSS RETA dump Dongdong Liu ` (12 subsequent siblings) 13 siblings, 1 reply; 89+ messages in thread From: Dongdong Liu @ 2022-07-22 9:12 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Min Hu (Connor), Dongdong Liu, Maryam Tahhan From: "Min Hu (Connor)" <humin29@huawei.com> This patch add support for dump dpdk version and firmware version. The command is like: dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- -- show-version Signed-off-by: Min Hu (Connor) <humin29@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> --- app/proc-info/main.c | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 1bfba5f60d..223ff439a4 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -39,6 +39,7 @@ #include <rte_cryptodev.h> #include <rte_tm.h> #include <rte_hexdump.h> +#include <rte_version.h> /* Maximum long option length for option parsing. */ #define MAX_LONG_OPT_SZ 64 @@ -102,6 +103,8 @@ static char *mempool_iter_name; /**< Enable dump regs. */ static uint32_t enable_dump_regs; static char *dump_regs_file_prefix; +/* Enable show version. */ +static uint32_t enable_shw_version; /**< display usage */ static void @@ -130,6 +133,7 @@ proc_info_usage(const char *prgname) " --show-crypto: to display crypto information\n" " --show-ring[=name]: to display ring information\n" " --show-mempool[=name]: to display mempool information\n" + " --show-version: to display DPDK version and firmware version\n" " --iter-mempool=name: iterate mempool elements to display content\n" " --dump-regs=file-prefix: dump registers to file with the file-prefix\n", prgname); @@ -242,6 +246,7 @@ proc_info_parse_args(int argc, char **argv) {"show-mempool", optional_argument, NULL, 0}, {"iter-mempool", required_argument, NULL, 0}, {"dump-regs", required_argument, NULL, 0}, + {"show-version", 0, NULL, 0}, {NULL, 0, 0, 0} }; @@ -313,7 +318,9 @@ proc_info_parse_args(int argc, char **argv) "dump-regs", MAX_LONG_OPT_SZ)) { enable_dump_regs = 1; dump_regs_file_prefix = optarg; - } + } else if (!strncmp(long_option[option_index].name, + "show-version", MAX_LONG_OPT_SZ)) + enable_shw_version = 1; break; case 1: /* Print xstat single value given by name*/ @@ -1476,6 +1483,35 @@ dump_regs(char *file_prefix) } } +static void show_version(void) +{ +#define ETHDEV_FWVERS_LEN 32 + + char fw_version[ETHDEV_FWVERS_LEN]; + int i; + + snprintf(bdr_str, MAX_STRING_LEN, " show - version "); + STATS_BDR_STR(10, bdr_str); + printf("DPDK version: %s\n", rte_version()); + + RTE_ETH_FOREACH_DEV(i) { + /* Skip if port is not in mask */ + if ((enabled_port_mask & (1ul << i)) == 0) + continue; + + if (!rte_eth_dev_is_valid_port(i)) { + printf("Error: Invalid port number %u\n", i); + continue; + } + + if (rte_eth_dev_fw_version_get(i, fw_version, + ETHDEV_FWVERS_LEN) == 0) + printf("Firmware version: %s\n", fw_version); + else + printf("Firmware version: %s\n", "not available"); + } +} + int main(int argc, char **argv) { @@ -1589,7 +1625,8 @@ main(int argc, char **argv) iter_mempool(mempool_iter_name); if (enable_dump_regs) dump_regs(dump_regs_file_prefix); - + if (enable_shw_version) + show_version(); RTE_ETH_FOREACH_DEV(i) rte_eth_dev_close(i); -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* RE: [PATCH 1/6] app/procinfo: add version dump 2022-07-22 9:12 ` [PATCH 1/6] app/procinfo: add version dump Dongdong Liu @ 2022-09-19 9:23 ` Pattan, Reshma 2022-09-20 2:35 ` Dongdong Liu 0 siblings, 1 reply; 89+ messages in thread From: Pattan, Reshma @ 2022-09-19 9:23 UTC (permalink / raw) To: Dongdong Liu, dev, thomas, ferruh.yigit, andrew.rybchenko Cc: Min Hu (Connor), Maryam Tahhan > -----Original Message----- > From: Dongdong Liu <liudongdong3@huawei.com> > Subject: [PATCH 1/6] app/procinfo: add version dump If this is V2 version of patch, please add V2 in the patch heading. And can you mark the previous version of patches "Superseded" in the patchwork. > dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- -- show-version --show-version? But not -- show-version. > --- a/app/proc-info/main.c > + " --show-version: to display DPDK version and firmware > version\n" Say ethdev firmware version. Instead of just firmware version. > > +static void show_version(void) Divide this into 2 lines. "static void" should be in one line and "show_version(void)" should be in another line. Please check the other functions in the file for an example. > +{ > +#define ETHDEV_FWVERS_LEN 32 Can this definition be moved to top of the file along with the other #defines. > + > ETHDEV_FWVERS_LEN) == 0) > + printf("Firmware version: %s\n", fw_version); Better to include Ethdev <port id> Firmware version. Thanks, Reshma ^ permalink raw reply [flat|nested] 89+ messages in thread
* Re: [PATCH 1/6] app/procinfo: add version dump 2022-09-19 9:23 ` Pattan, Reshma @ 2022-09-20 2:35 ` Dongdong Liu 0 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-09-20 2:35 UTC (permalink / raw) To: Pattan, Reshma, dev, thomas, ferruh.yigit, andrew.rybchenko Cc: Min Hu (Connor), Maryam Tahhan Hi Pattan Many thanks for you review. On 2022/9/19 17:23, Pattan, Reshma wrote: > > >> -----Original Message----- >> From: Dongdong Liu <liudongdong3@huawei.com> >> Subject: [PATCH 1/6] app/procinfo: add version dump > > If this is V2 version of patch, please add V2 in the patch heading. > And can you mark the previous version of patches "Superseded" in the patchwork. Yes, will do, thanks for reminding this. > >> dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- -- show-version > > --show-version? But not -- show-version. Will fix. > > >> --- a/app/proc-info/main.c >> + " --show-version: to display DPDK version and firmware >> version\n" > > Say ethdev firmware version. Instead of just firmware version. Will fix. > >> >> +static void show_version(void) > > Divide this into 2 lines. "static void" should be in one line and "show_version(void)" should be in another line. > Please check the other functions in the file for an example. Will do. > > >> +{ >> +#define ETHDEV_FWVERS_LEN 32 > > Can this definition be moved to top of the file along with the other #defines. Yes, Will do. > > >> + >> ETHDEV_FWVERS_LEN) == 0) >> + printf("Firmware version: %s\n", fw_version); > > Better to include Ethdev <port id> Firmware version. Will do. Thanks, Dongdong > > Thanks, > Reshma > . > ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH 2/6] app/procinfo: add RSS RETA dump 2022-07-22 9:12 [PATCH 0/6] app/procinfo: add some extended features Dongdong Liu 2022-07-22 9:12 ` [PATCH 1/6] app/procinfo: add version dump Dongdong Liu @ 2022-07-22 9:12 ` Dongdong Liu 2022-07-22 9:12 ` [PATCH 3/6] app/procinfo: add module info dump Dongdong Liu ` (11 subsequent siblings) 13 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-07-22 9:12 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Min Hu (Connor), Dongdong Liu, Maryam Tahhan From: "Min Hu (Connor)" <humin29@huawei.com> This patch add support for RSS reta dump. The command is like: dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- -- show-rss-reta Signed-off-by: Min Hu (Connor) <humin29@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> --- app/proc-info/main.c | 60 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 223ff439a4..8174acfa9c 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -105,6 +105,8 @@ static uint32_t enable_dump_regs; static char *dump_regs_file_prefix; /* Enable show version. */ static uint32_t enable_shw_version; +/* Enable show RSS reta. */ +static uint32_t enable_shw_rss_reta; /**< display usage */ static void @@ -134,6 +136,7 @@ proc_info_usage(const char *prgname) " --show-ring[=name]: to display ring information\n" " --show-mempool[=name]: to display mempool information\n" " --show-version: to display DPDK version and firmware version\n" + " --show-rss-reta: to display ports redirection table\n" " --iter-mempool=name: iterate mempool elements to display content\n" " --dump-regs=file-prefix: dump registers to file with the file-prefix\n", prgname); @@ -247,6 +250,7 @@ proc_info_parse_args(int argc, char **argv) {"iter-mempool", required_argument, NULL, 0}, {"dump-regs", required_argument, NULL, 0}, {"show-version", 0, NULL, 0}, + {"show-rss-reta", 0, NULL, 0}, {NULL, 0, 0, 0} }; @@ -321,6 +325,9 @@ proc_info_parse_args(int argc, char **argv) } else if (!strncmp(long_option[option_index].name, "show-version", MAX_LONG_OPT_SZ)) enable_shw_version = 1; + else if (!strncmp(long_option[option_index].name, + "show-rss-reta", MAX_LONG_OPT_SZ)) + enable_shw_rss_reta = 1; break; case 1: /* Print xstat single value given by name*/ @@ -1512,6 +1519,57 @@ static void show_version(void) } } +static void show_port_rss_reta_info(void) +{ +#define RTE_RETA_CONF_GROUP_NUM 32 +#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) + + struct rte_eth_rss_reta_entry64 reta_conf[RTE_RETA_CONF_GROUP_NUM + 1]; + struct rte_eth_dev_info dev_info; + uint16_t i, idx, shift; + uint16_t num; + uint16_t id; + int ret; + + RTE_ETH_FOREACH_DEV(id) { + /* Skip if port is not in mask */ + if ((enabled_port_mask & (1ul << id)) == 0) + continue; + + snprintf(bdr_str, MAX_STRING_LEN, " Port %u ", id); + STATS_BDR_STR(5, bdr_str); + + if (!rte_eth_dev_is_valid_port(id)) { + printf("Error: Invalid port number %u\n", id); + continue; + } + + ret = rte_eth_dev_info_get(id, &dev_info); + if (ret < 0) { + printf("get device info fail, ret = %d\n", ret); + return; + } + + num = DIV_ROUND_UP(dev_info.reta_size, RTE_ETH_RETA_GROUP_SIZE); + memset(reta_conf, 0, sizeof(reta_conf)); + for (i = 0; i < num; i++) + reta_conf[i].mask = ~0ULL; + + ret = rte_eth_dev_rss_reta_query(id, reta_conf, dev_info.reta_size); + if (ret < 0) { + printf("failed to get RSS RETA info, ret = %d\n", ret); + return; + } + + for (i = 0; i < dev_info.reta_size; i++) { + idx = i / RTE_ETH_RETA_GROUP_SIZE; + shift = i % RTE_ETH_RETA_GROUP_SIZE; + printf("RSS RETA configuration: hash index=%u, queue=%u\n", + i, reta_conf[idx].reta[shift]); + } + } +} + int main(int argc, char **argv) { @@ -1627,6 +1685,8 @@ main(int argc, char **argv) dump_regs(dump_regs_file_prefix); if (enable_shw_version) show_version(); + if (enable_shw_rss_reta) + show_port_rss_reta_info(); RTE_ETH_FOREACH_DEV(i) rte_eth_dev_close(i); -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH 3/6] app/procinfo: add module info dump 2022-07-22 9:12 [PATCH 0/6] app/procinfo: add some extended features Dongdong Liu 2022-07-22 9:12 ` [PATCH 1/6] app/procinfo: add version dump Dongdong Liu 2022-07-22 9:12 ` [PATCH 2/6] app/procinfo: add RSS RETA dump Dongdong Liu @ 2022-07-22 9:12 ` Dongdong Liu 2022-07-22 9:12 ` [PATCH 4/6] app/proc-info: add dump of Rx/Tx burst mode Dongdong Liu ` (10 subsequent siblings) 13 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-07-22 9:12 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Min Hu (Connor), Dongdong Liu, Maryam Tahhan From: "Min Hu (Connor)" <humin29@huawei.com> This patch add support for module info dump. The command is like: dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- -- show-module-info Signed-off-by: Min Hu (Connor) <humin29@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> --- app/proc-info/main.c | 55 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 8174acfa9c..1e06394370 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -107,6 +107,8 @@ static char *dump_regs_file_prefix; static uint32_t enable_shw_version; /* Enable show RSS reta. */ static uint32_t enable_shw_rss_reta; +/* Enable show module info. */ +static uint32_t enable_shw_module_info; /**< display usage */ static void @@ -137,6 +139,7 @@ proc_info_usage(const char *prgname) " --show-mempool[=name]: to display mempool information\n" " --show-version: to display DPDK version and firmware version\n" " --show-rss-reta: to display ports redirection table\n" + " --show-module-info: to display ports module info\n" " --iter-mempool=name: iterate mempool elements to display content\n" " --dump-regs=file-prefix: dump registers to file with the file-prefix\n", prgname); @@ -251,6 +254,7 @@ proc_info_parse_args(int argc, char **argv) {"dump-regs", required_argument, NULL, 0}, {"show-version", 0, NULL, 0}, {"show-rss-reta", 0, NULL, 0}, + {"show-module-info", 0, NULL, 0}, {NULL, 0, 0, 0} }; @@ -328,6 +332,9 @@ proc_info_parse_args(int argc, char **argv) else if (!strncmp(long_option[option_index].name, "show-rss-reta", MAX_LONG_OPT_SZ)) enable_shw_rss_reta = 1; + else if (!strncmp(long_option[option_index].name, + "show-module-info", MAX_LONG_OPT_SZ)) + enable_shw_module_info = 1; break; case 1: /* Print xstat single value given by name*/ @@ -1570,6 +1577,52 @@ static void show_port_rss_reta_info(void) } } +static void show_module_eeprom_info(void) +{ +#define EEPROM_DUMP_CHUNKSIZE 1024 + + unsigned char bytes_eeprom[EEPROM_DUMP_CHUNKSIZE]; + struct rte_eth_dev_module_info module_info; + struct rte_dev_eeprom_info eeprom_info; + uint16_t i; + int ret; + + 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); + + if (!rte_eth_dev_is_valid_port(i)) { + printf("Error: Invalid port number %u\n", i); + continue; + } + + ret = rte_eth_dev_get_module_info(i, &module_info); + if (ret != 0) { + printf("Module EEPROM information read error %d\n", ret); + return; + } + + eeprom_info.offset = 0; + eeprom_info.length = module_info.eeprom_len; + eeprom_info.data = bytes_eeprom; + + ret = rte_eth_dev_get_module_eeprom(i, &eeprom_info); + if (ret != 0) { + printf("Module EEPROM read error %d\n", ret); + return; + } + + rte_hexdump(stdout, "hexdump", eeprom_info.data, + eeprom_info.length); + printf("Finish -- Port: %d MODULE EEPROM length: %d bytes\n", + i, eeprom_info.length); + } +} + int main(int argc, char **argv) { @@ -1687,6 +1740,8 @@ main(int argc, char **argv) show_version(); if (enable_shw_rss_reta) show_port_rss_reta_info(); + if (enable_shw_module_info) + show_module_eeprom_info(); RTE_ETH_FOREACH_DEV(i) rte_eth_dev_close(i); -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH 4/6] app/proc-info: add dump of Rx/Tx burst mode 2022-07-22 9:12 [PATCH 0/6] app/procinfo: add some extended features Dongdong Liu ` (2 preceding siblings ...) 2022-07-22 9:12 ` [PATCH 3/6] app/procinfo: add module info dump Dongdong Liu @ 2022-07-22 9:12 ` Dongdong Liu 2022-07-22 9:12 ` [PATCH 5/6] app/procinfo: fix some wrong doxygen syntax Dongdong Liu ` (9 subsequent siblings) 13 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-07-22 9:12 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Jie Hai, Dongdong Liu, Maryam Tahhan From: Jie Hai <haijie1@huawei.com> Add dump of Rx/Tx burst mode in --show-port. Sample output changes: - rx queue - -- 0 descriptors 0/1024 drop_en rx buffer size 2048 \ mempool mb_pool_0 socket 0 + -- 0 descriptors 0/1024 drop_en rx buffer size 2048 \ mempool mb_pool_0 socket 0 burst mode : Vector Neon - tx queue - -- 0 descriptors 1024 thresh 32/928 \ offloads : MBUF_FAST_FREE + -- 0 descriptors 1024 thresh 32/928 \ offloads : MBUF_FAST_FREE burst mode : Scalar Signed-off-by: Jie Hai <haijie1@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> --- app/proc-info/main.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 1e06394370..de55da310e 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -833,6 +833,7 @@ show_port(void) for (j = 0; j < dev_info.nb_rx_queues; j++) { struct rte_eth_rxq_info queue_info; + struct rte_eth_burst_mode mode; int count; ret = rte_eth_rx_queue_info_get(i, j, &queue_info); @@ -868,11 +869,18 @@ show_port(void) if (queue_info.conf.offloads != 0) show_offloads(queue_info.conf.offloads, rte_eth_dev_rx_offload_name); + if (rte_eth_rx_burst_mode_get(i, j, &mode) == 0) + printf(" burst mode : %s%s", + mode.info, + mode.flags & RTE_ETH_BURST_FLAG_PER_QUEUE ? + " (per queue)" : ""); + printf("\n"); } for (j = 0; j < dev_info.nb_tx_queues; j++) { struct rte_eth_txq_info queue_info; + struct rte_eth_burst_mode mode; ret = rte_eth_tx_queue_info_get(i, j, &queue_info); if (ret != 0) @@ -893,6 +901,13 @@ show_port(void) if (queue_info.conf.offloads != 0) show_offloads(queue_info.conf.offloads, rte_eth_dev_tx_offload_name); + + if (rte_eth_tx_burst_mode_get(i, j, &mode) == 0) + printf(" burst mode : %s%s", + mode.info, + mode.flags & RTE_ETH_BURST_FLAG_PER_QUEUE ? + " (per queue)" : ""); + printf("\n"); } -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH 5/6] app/procinfo: fix some wrong doxygen syntax 2022-07-22 9:12 [PATCH 0/6] app/procinfo: add some extended features Dongdong Liu ` (3 preceding siblings ...) 2022-07-22 9:12 ` [PATCH 4/6] app/proc-info: add dump of Rx/Tx burst mode Dongdong Liu @ 2022-07-22 9:12 ` Dongdong Liu 2022-07-22 9:12 ` [PATCH 6/6] doc: add some extended features in procinfo guide Dongdong Liu ` (8 subsequent siblings) 13 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-07-22 9:12 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Dongdong Liu, Maryam Tahhan This code is to do cleanup for the wrong doxygen syntax comments. Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> --- app/proc-info/main.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index de55da310e..c888c50b28 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -49,33 +49,33 @@ #define STATS_BDR_STR(w, s) printf("%.*s%s%.*s\n", w, \ STATS_BDR_FMT, s, w, STATS_BDR_FMT) -/**< mask of enabled ports */ +/* mask of enabled ports */ static unsigned long enabled_port_mask; -/**< Enable stats. */ +/* Enable stats. */ static uint32_t enable_stats; -/**< Enable xstats. */ +/* Enable xstats. */ static uint32_t enable_xstats; -/**< Enable collectd format*/ +/* Enable collectd format */ static uint32_t enable_collectd_format; -/**< FD to send collectd format messages to STDOUT*/ +/* FD to send collectd format messages to STDOUT */ static int stdout_fd; -/**< Host id process is running on */ +/* Host id process is running on */ static char host_id[MAX_LONG_OPT_SZ]; #ifdef RTE_LIB_METRICS -/**< Enable metrics. */ +/* Enable metrics. */ static uint32_t enable_metrics; #endif -/**< Enable stats reset. */ +/* Enable stats reset. */ static uint32_t reset_stats; -/**< Enable xstats reset. */ +/* Enable xstats reset. */ static uint32_t reset_xstats; -/**< Enable memory info. */ +/* Enable memory info. */ static uint32_t mem_info; -/**< Enable displaying xstat name. */ +/* Enable displaying xstat name. */ static uint32_t enable_xstats_name; static char *xstats_name; -/**< Enable xstats by ids. */ +/* Enable xstats by ids. */ #define MAX_NB_XSTATS_IDS 1024 static uint32_t nb_xstats_ids; static uint64_t xstats_ids[MAX_NB_XSTATS_IDS]; @@ -83,24 +83,24 @@ static uint64_t xstats_ids[MAX_NB_XSTATS_IDS]; /* show border */ static char bdr_str[MAX_STRING_LEN]; -/**< Enable show port. */ +/* Enable show port. */ static uint32_t enable_shw_port; /* Enable show port private info. */ static uint32_t enable_shw_port_priv; -/**< Enable show tm. */ +/* Enable show tm. */ static uint32_t enable_shw_tm; -/**< Enable show crypto. */ +/* Enable show crypto. */ static uint32_t enable_shw_crypto; -/**< Enable show ring. */ +/* Enable show ring. */ static uint32_t enable_shw_ring; static char *ring_name; -/**< Enable show mempool. */ +/* Enable show mempool. */ static uint32_t enable_shw_mempool; static char *mempool_name; -/**< Enable iter mempool. */ +/* Enable iter mempool. */ static uint32_t enable_iter_mempool; static char *mempool_iter_name; -/**< Enable dump regs. */ +/* Enable dump regs. */ static uint32_t enable_dump_regs; static char *dump_regs_file_prefix; /* Enable show version. */ @@ -110,7 +110,7 @@ static uint32_t enable_shw_rss_reta; /* Enable show module info. */ static uint32_t enable_shw_module_info; -/**< display usage */ +/* display usage */ static void proc_info_usage(const char *prgname) { -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH 6/6] doc: add some extended features in procinfo guide 2022-07-22 9:12 [PATCH 0/6] app/procinfo: add some extended features Dongdong Liu ` (4 preceding siblings ...) 2022-07-22 9:12 ` [PATCH 5/6] app/procinfo: fix some wrong doxygen syntax Dongdong Liu @ 2022-07-22 9:12 ` Dongdong Liu 2022-07-22 10:03 ` [PATCH 0/6] app/procinfo: add some extended features David Marchand ` (7 subsequent siblings) 13 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-07-22 9:12 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Dongdong Liu, Maryam Tahhan Add the below extended features in procinfo guide. --show-port-private --show-version --show-rss-reta --show-module-info Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> --- doc/guides/tools/proc_info.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/guides/tools/proc_info.rst b/doc/guides/tools/proc_info.rst index 9772d97ef0..f2f3c28edd 100644 --- a/doc/guides/tools/proc_info.rst +++ b/doc/guides/tools/proc_info.rst @@ -69,6 +69,18 @@ mempool. For invalid or no mempool name, whole list is dump. The iter-mempool parameter iterates and displays mempool elements specified by name. For invalid or no mempool name no elements are displayed. +**--show-port-private** +The show-port-private parameter displays ports private information. + +**--show-version** +The show-version parameter displays DPDK version and firmware version. + +**--show-rss-reta** +The show-rss-reta parameter displays ports rss redirection table. + +**--show-module-info** +The show-module-info parameter displays ports module eeprom information. + Limitations ----------- -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* Re: [PATCH 0/6] app/procinfo: add some extended features 2022-07-22 9:12 [PATCH 0/6] app/procinfo: add some extended features Dongdong Liu ` (5 preceding siblings ...) 2022-07-22 9:12 ` [PATCH 6/6] doc: add some extended features in procinfo guide Dongdong Liu @ 2022-07-22 10:03 ` David Marchand 2022-07-25 11:03 ` Dongdong Liu 2022-09-17 1:12 ` Dongdong Liu ` (6 subsequent siblings) 13 siblings, 1 reply; 89+ messages in thread From: David Marchand @ 2022-07-22 10:03 UTC (permalink / raw) To: Dongdong Liu Cc: dev, Pattan, Reshma, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko On Fri, Jul 22, 2022 at 11:13 AM Dongdong Liu <liudongdong3@huawei.com> wrote: > > [PATCH 1/6 2/6 3/6] support ethdev info about firmware version, RSS reta info, > and module info, from the below link [1] that have been sent out in the > earlier, wait for review. > [PATCH 4/6] add dump of Rx/tx burst mode. > [PATCH 5/6] fix some wrong doxygen syntax for procinfo suggested by Thomas. > [PATCH 6/6] update the procinfo doc guide. > > [1] https://lore.kernel.org/dpdk-dev/20220527014259.38559-1-humin29@huawei.com/ Some applications may not want to use multiprocess. Do you know if those added informations are available through telemetry? -- David Marchand ^ permalink raw reply [flat|nested] 89+ messages in thread
* Re: [PATCH 0/6] app/procinfo: add some extended features 2022-07-22 10:03 ` [PATCH 0/6] app/procinfo: add some extended features David Marchand @ 2022-07-25 11:03 ` Dongdong Liu 0 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-07-25 11:03 UTC (permalink / raw) To: David Marchand Cc: dev, Pattan, Reshma, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko Hi David Many thanks for your review. On 2022/7/22 18:03, David Marchand wrote: > On Fri, Jul 22, 2022 at 11:13 AM Dongdong Liu <liudongdong3@huawei.com> wrote: >> >> [PATCH 1/6 2/6 3/6] support ethdev info about firmware version, RSS reta info, >> and module info, from the below link [1] that have been sent out in the >> earlier, wait for review. >> [PATCH 4/6] add dump of Rx/tx burst mode. >> [PATCH 5/6] fix some wrong doxygen syntax for procinfo suggested by Thomas. >> [PATCH 6/6] update the procinfo doc guide. >> >> [1] https://lore.kernel.org/dpdk-dev/20220527014259.38559-1-humin29@huawei.com/ > > Some applications may not want to use multiprocess. > Do you know if those added informations are available through telemetry? After a quick look at telemetry doc guide and do some telemetry test. --> /info It displays dpdk version but not include ethdev firmware version. The ethdev firmware version maybe better to be added for /ethdev/info cmd. --> /ethdev/module_eeprom,0 It displays ports module eeprom information. RSS reta info, Rx/Tx burst mode have not been supported by telemetry. It is a good idea to add these features through telemetry. This patchset add some extended features for procinfo, we can also apply them, later will add these features through telemetry. Current some features have been supported by procinfo in dpdk mainline code, but not supported by telemetry, maybe we can also implement them through telemetry. Thanks, Dongdong > > ^ permalink raw reply [flat|nested] 89+ messages in thread
* Re: [PATCH 0/6] app/procinfo: add some extended features 2022-07-22 9:12 [PATCH 0/6] app/procinfo: add some extended features Dongdong Liu ` (6 preceding siblings ...) 2022-07-22 10:03 ` [PATCH 0/6] app/procinfo: add some extended features David Marchand @ 2022-09-17 1:12 ` Dongdong Liu 2022-09-20 10:51 ` [PATCH v2 " Dongdong Liu ` (5 subsequent siblings) 13 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-09-17 1:12 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Hi Reshma Kindly ping. Please help to have a look at these patches. Thanks, Dongdong On 2022/7/22 17:12, Dongdong Liu wrote: > [PATCH 1/6 2/6 3/6] support ethdev info about firmware version, RSS reta info, > and module info, from the below link [1] that have been sent out in the > earlier, wait for review. > [PATCH 4/6] add dump of Rx/tx burst mode. > [PATCH 5/6] fix some wrong doxygen syntax for procinfo suggested by Thomas. > [PATCH 6/6] update the procinfo doc guide. > > [1] https://lore.kernel.org/dpdk-dev/20220527014259.38559-1-humin29@huawei.com/ > > Dongdong Liu (2): > app/procinfo: fix some wrong doxygen syntax > doc: add some extended features in procinfo guide > > Jie Hai (1): > app/proc-info: add dump of Rx/Tx burst mode > > Min Hu (Connor) (3): > app/procinfo: add version dump > app/procinfo: add RSS RETA dump > app/procinfo: add module info dump > > app/proc-info/main.c | 213 +++++++++++++++++++++++++++++---- > doc/guides/tools/proc_info.rst | 12 ++ > 2 files changed, 202 insertions(+), 23 deletions(-) > > -- > 2.22.0 > > . > ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v2 0/6] app/procinfo: add some extended features 2022-07-22 9:12 [PATCH 0/6] app/procinfo: add some extended features Dongdong Liu ` (7 preceding siblings ...) 2022-09-17 1:12 ` Dongdong Liu @ 2022-09-20 10:51 ` Dongdong Liu 2022-09-20 10:51 ` [PATCH v2 1/6] app/procinfo: add version dump Dongdong Liu ` (5 more replies) 2022-09-21 14:26 ` [PATCH v3 0/7] app/procinfo: add some extended features Dongdong Liu ` (4 subsequent siblings) 13 siblings, 6 replies; 89+ messages in thread From: Dongdong Liu @ 2022-09-20 10:51 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko; +Cc: Dongdong Liu This patchset is to add some extended features for dpdk-proc-info. v1->v2: Fix some comments from Reshma. Dongdong Liu (2): app/procinfo: fix some wrong doxygen syntax doc: add some extended features in procinfo guide Jie Hai (1): app/proc-info: add dump of Rx/Tx burst mode Min Hu (Connor) (3): app/procinfo: add version dump app/procinfo: add RSS RETA dump app/procinfo: add module info dump app/proc-info/main.c | 208 +++++++++++++++++++++++++++++---- doc/guides/tools/proc_info.rst | 12 ++ 2 files changed, 197 insertions(+), 23 deletions(-) -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v2 1/6] app/procinfo: add version dump 2022-09-20 10:51 ` [PATCH v2 " Dongdong Liu @ 2022-09-20 10:51 ` Dongdong Liu 2022-09-20 15:21 ` Stephen Hemminger 2022-09-20 10:51 ` [PATCH v2 2/6] app/procinfo: add RSS RETA dump Dongdong Liu ` (4 subsequent siblings) 5 siblings, 1 reply; 89+ messages in thread From: Dongdong Liu @ 2022-09-20 10:51 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Min Hu (Connor), Dongdong Liu, Maryam Tahhan From: "Min Hu (Connor)" <humin29@huawei.com> This patch add support for dump dpdk version and ethdev firmware version. The command is like: dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --show-version Signed-off-by: Min Hu (Connor) <humin29@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> --- app/proc-info/main.c | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 1bfba5f60d..da67155007 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -39,11 +39,14 @@ #include <rte_cryptodev.h> #include <rte_tm.h> #include <rte_hexdump.h> +#include <rte_version.h> /* Maximum long option length for option parsing. */ #define MAX_LONG_OPT_SZ 64 #define MAX_STRING_LEN 256 +#define ETHDEV_FWVERS_LEN 32 + #define STATS_BDR_FMT "========================================" #define STATS_BDR_STR(w, s) printf("%.*s%s%.*s\n", w, \ STATS_BDR_FMT, s, w, STATS_BDR_FMT) @@ -102,6 +105,8 @@ static char *mempool_iter_name; /**< Enable dump regs. */ static uint32_t enable_dump_regs; static char *dump_regs_file_prefix; +/* Enable show version. */ +static uint32_t enable_shw_version; /**< display usage */ static void @@ -130,6 +135,7 @@ proc_info_usage(const char *prgname) " --show-crypto: to display crypto information\n" " --show-ring[=name]: to display ring information\n" " --show-mempool[=name]: to display mempool information\n" + " --show-version: to display DPDK version and ethdev firmware version\n" " --iter-mempool=name: iterate mempool elements to display content\n" " --dump-regs=file-prefix: dump registers to file with the file-prefix\n", prgname); @@ -242,6 +248,7 @@ proc_info_parse_args(int argc, char **argv) {"show-mempool", optional_argument, NULL, 0}, {"iter-mempool", required_argument, NULL, 0}, {"dump-regs", required_argument, NULL, 0}, + {"show-version", 0, NULL, 0}, {NULL, 0, 0, 0} }; @@ -313,7 +320,9 @@ proc_info_parse_args(int argc, char **argv) "dump-regs", MAX_LONG_OPT_SZ)) { enable_dump_regs = 1; dump_regs_file_prefix = optarg; - } + } else if (!strncmp(long_option[option_index].name, + "show-version", MAX_LONG_OPT_SZ)) + enable_shw_version = 1; break; case 1: /* Print xstat single value given by name*/ @@ -1476,6 +1485,32 @@ dump_regs(char *file_prefix) } } +static void +show_version(void) +{ + char fw_version[ETHDEV_FWVERS_LEN]; + uint16_t i; + + snprintf(bdr_str, MAX_STRING_LEN, " show - version "); + STATS_BDR_STR(10, bdr_str); + printf("DPDK version: %s\n", rte_version()); + + RTE_ETH_FOREACH_DEV(i) { + /* Skip if port is not in mask */ + if ((enabled_port_mask & (1ul << i)) == 0) + continue; + + if (!rte_eth_dev_is_valid_port(i)) + continue; + + if (rte_eth_dev_fw_version_get(i, fw_version, + ETHDEV_FWVERS_LEN) == 0) + printf("Ethdev port %u firmware version: %s\n", i, fw_version); + else + printf("Ethdev port %u firmware version: %s\n", i, "not available"); + } +} + int main(int argc, char **argv) { @@ -1589,7 +1624,8 @@ main(int argc, char **argv) iter_mempool(mempool_iter_name); if (enable_dump_regs) dump_regs(dump_regs_file_prefix); - + if (enable_shw_version) + show_version(); RTE_ETH_FOREACH_DEV(i) rte_eth_dev_close(i); -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* Re: [PATCH v2 1/6] app/procinfo: add version dump 2022-09-20 10:51 ` [PATCH v2 1/6] app/procinfo: add version dump Dongdong Liu @ 2022-09-20 15:21 ` Stephen Hemminger 2022-09-21 11:11 ` Dongdong Liu 0 siblings, 1 reply; 89+ messages in thread From: Stephen Hemminger @ 2022-09-20 15:21 UTC (permalink / raw) To: Dongdong Liu Cc: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko, Min Hu (Connor), Maryam Tahhan On Tue, 20 Sep 2022 18:51:42 +0800 Dongdong Liu <liudongdong3@huawei.com> wrote: > From: "Min Hu (Connor)" <humin29@huawei.com> > > This patch add support for dump dpdk version and ethdev firmware version. > > The command is like: > dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --show-version > > Signed-off-by: Min Hu (Connor) <humin29@huawei.com> > Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> > --- Why mix DPDK and firmware version in one option? Why not use semi-standard convention of -V --version option for DPDK version and add --firmware-version option to show firmware. ^ permalink raw reply [flat|nested] 89+ messages in thread
* Re: [PATCH v2 1/6] app/procinfo: add version dump 2022-09-20 15:21 ` Stephen Hemminger @ 2022-09-21 11:11 ` Dongdong Liu 0 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-09-21 11:11 UTC (permalink / raw) To: Stephen Hemminger Cc: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko, Min Hu (Connor), Maryam Tahhan Hi Stephen Many thanks for your review. On 2022/9/20 23:21, Stephen Hemminger wrote: > On Tue, 20 Sep 2022 18:51:42 +0800 > Dongdong Liu <liudongdong3@huawei.com> wrote: > >> From: "Min Hu (Connor)" <humin29@huawei.com> >> >> This patch add support for dump dpdk version and ethdev firmware version. >> >> The command is like: >> dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --show-version >> >> Signed-off-by: Min Hu (Connor) <humin29@huawei.com> >> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> >> --- > > Why mix DPDK and firmware version in one option? Like ethtool -i command, one command can show kernel version and ethdev firmware version. ethtool -i eth0 driver: hns3 version: 5.13.0-rc4+ firmware-version: 1.20.0.17 > > Why not use semi-standard convention of -V --version option for DPDK version > and add --firmware-version option to show firmware. Looks good, will do. Thanks, Dongdong > . > ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v2 2/6] app/procinfo: add RSS RETA dump 2022-09-20 10:51 ` [PATCH v2 " Dongdong Liu 2022-09-20 10:51 ` [PATCH v2 1/6] app/procinfo: add version dump Dongdong Liu @ 2022-09-20 10:51 ` Dongdong Liu 2022-09-20 15:24 ` Stephen Hemminger 2022-09-20 10:51 ` [PATCH v2 3/6] app/procinfo: add module info dump Dongdong Liu ` (3 subsequent siblings) 5 siblings, 1 reply; 89+ messages in thread From: Dongdong Liu @ 2022-09-20 10:51 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Min Hu (Connor), Dongdong Liu, Maryam Tahhan From: "Min Hu (Connor)" <humin29@huawei.com> This patch add support for RSS reta dump. The command is like: dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --show-rss-reta Signed-off-by: Min Hu (Connor) <humin29@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> --- app/proc-info/main.c | 58 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index da67155007..a718c201ce 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -46,6 +46,8 @@ #define MAX_STRING_LEN 256 #define ETHDEV_FWVERS_LEN 32 +#define RTE_RETA_CONF_GROUP_NUM 32 +#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) #define STATS_BDR_FMT "========================================" #define STATS_BDR_STR(w, s) printf("%.*s%s%.*s\n", w, \ @@ -107,6 +109,8 @@ static uint32_t enable_dump_regs; static char *dump_regs_file_prefix; /* Enable show version. */ static uint32_t enable_shw_version; +/* Enable show RSS reta. */ +static uint32_t enable_shw_rss_reta; /**< display usage */ static void @@ -136,6 +140,7 @@ proc_info_usage(const char *prgname) " --show-ring[=name]: to display ring information\n" " --show-mempool[=name]: to display mempool information\n" " --show-version: to display DPDK version and ethdev firmware version\n" + " --show-rss-reta: to display ports redirection table\n" " --iter-mempool=name: iterate mempool elements to display content\n" " --dump-regs=file-prefix: dump registers to file with the file-prefix\n", prgname); @@ -249,6 +254,7 @@ proc_info_parse_args(int argc, char **argv) {"iter-mempool", required_argument, NULL, 0}, {"dump-regs", required_argument, NULL, 0}, {"show-version", 0, NULL, 0}, + {"show-rss-reta", 0, NULL, 0}, {NULL, 0, 0, 0} }; @@ -323,6 +329,9 @@ proc_info_parse_args(int argc, char **argv) } else if (!strncmp(long_option[option_index].name, "show-version", MAX_LONG_OPT_SZ)) enable_shw_version = 1; + else if (!strncmp(long_option[option_index].name, + "show-rss-reta", MAX_LONG_OPT_SZ)) + enable_shw_rss_reta = 1; break; case 1: /* Print xstat single value given by name*/ @@ -1511,6 +1520,53 @@ show_version(void) } } +static void +show_port_rss_reta_info(void) +{ + struct rte_eth_rss_reta_entry64 reta_conf[RTE_RETA_CONF_GROUP_NUM + 1]; + struct rte_eth_dev_info dev_info; + uint16_t i, idx, shift; + uint16_t num; + uint16_t id; + int ret; + + RTE_ETH_FOREACH_DEV(id) { + /* Skip if port is not in mask */ + if ((enabled_port_mask & (1ul << id)) == 0) + continue; + + if (!rte_eth_dev_is_valid_port(id)) + continue; + + snprintf(bdr_str, MAX_STRING_LEN, " Port %u ", id); + STATS_BDR_STR(5, bdr_str); + + ret = rte_eth_dev_info_get(id, &dev_info); + if (ret < 0) { + printf("Error getting device info, ret = %d\n", ret); + return; + } + + num = DIV_ROUND_UP(dev_info.reta_size, RTE_ETH_RETA_GROUP_SIZE); + memset(reta_conf, 0, sizeof(reta_conf)); + for (i = 0; i < num; i++) + reta_conf[i].mask = ~0ULL; + + ret = rte_eth_dev_rss_reta_query(id, reta_conf, dev_info.reta_size); + if (ret < 0) { + printf("Failed to get RSS RETA info, ret = %d\n", ret); + return; + } + + for (i = 0; i < dev_info.reta_size; i++) { + idx = i / RTE_ETH_RETA_GROUP_SIZE; + shift = i % RTE_ETH_RETA_GROUP_SIZE; + printf("RSS RETA configuration: hash index=%u, queue=%u\n", + i, reta_conf[idx].reta[shift]); + } + } +} + int main(int argc, char **argv) { @@ -1626,6 +1682,8 @@ main(int argc, char **argv) dump_regs(dump_regs_file_prefix); if (enable_shw_version) show_version(); + if (enable_shw_rss_reta) + show_port_rss_reta_info(); RTE_ETH_FOREACH_DEV(i) rte_eth_dev_close(i); -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* Re: [PATCH v2 2/6] app/procinfo: add RSS RETA dump 2022-09-20 10:51 ` [PATCH v2 2/6] app/procinfo: add RSS RETA dump Dongdong Liu @ 2022-09-20 15:24 ` Stephen Hemminger 2022-09-21 11:21 ` Dongdong Liu 0 siblings, 1 reply; 89+ messages in thread From: Stephen Hemminger @ 2022-09-20 15:24 UTC (permalink / raw) To: Dongdong Liu Cc: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko, Min Hu (Connor), Maryam Tahhan On Tue, 20 Sep 2022 18:51:43 +0800 Dongdong Liu <liudongdong3@huawei.com> wrote: > + ret = rte_eth_dev_info_get(id, &dev_info); > + if (ret < 0) { > + printf("Error getting device info, ret = %d\n", ret); Proc-info should be showing all errors on stderr, not stdout. And in case of error should exit with non-zero status. But this maybe a generic problem in lots of places in the application. ^ permalink raw reply [flat|nested] 89+ messages in thread
* Re: [PATCH v2 2/6] app/procinfo: add RSS RETA dump 2022-09-20 15:24 ` Stephen Hemminger @ 2022-09-21 11:21 ` Dongdong Liu 0 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-09-21 11:21 UTC (permalink / raw) To: Stephen Hemminger Cc: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko, Min Hu (Connor), Maryam Tahhan On 2022/9/20 23:24, Stephen Hemminger wrote: > On Tue, 20 Sep 2022 18:51:43 +0800 > Dongdong Liu <liudongdong3@huawei.com> wrote: > >> + ret = rte_eth_dev_info_get(id, &dev_info); >> + if (ret < 0) { >> + printf("Error getting device info, ret = %d\n", ret); > > Proc-info should be showing all errors on stderr, not stdout. > And in case of error should exit with non-zero status. Will fix as below code. ret = rte_eth_dev_info_get(i, &dev_info); if (ret != 0) { fprintf(stderr, "Error during getting device info: %s\n", strerror(-ret)); return; } > > But this maybe a generic problem in lots of places in the application. Yes, we can do this later with a seperate patch. Thanks, Dongdong > . > ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v2 3/6] app/procinfo: add module info dump 2022-09-20 10:51 ` [PATCH v2 " Dongdong Liu 2022-09-20 10:51 ` [PATCH v2 1/6] app/procinfo: add version dump Dongdong Liu 2022-09-20 10:51 ` [PATCH v2 2/6] app/procinfo: add RSS RETA dump Dongdong Liu @ 2022-09-20 10:51 ` Dongdong Liu 2022-09-20 15:22 ` Stephen Hemminger 2022-09-20 10:51 ` [PATCH v2 4/6] app/proc-info: add dump of Rx/Tx burst mode Dongdong Liu ` (2 subsequent siblings) 5 siblings, 1 reply; 89+ messages in thread From: Dongdong Liu @ 2022-09-20 10:51 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Min Hu (Connor), Dongdong Liu, Maryam Tahhan From: "Min Hu (Connor)" <humin29@huawei.com> This patch add support for module info dump. The command is like: dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --show-module-info Signed-off-by: Min Hu (Connor) <humin29@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> --- app/proc-info/main.c | 53 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index a718c201ce..bc93af51df 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -48,6 +48,7 @@ #define ETHDEV_FWVERS_LEN 32 #define RTE_RETA_CONF_GROUP_NUM 32 #define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) +#define EEPROM_DUMP_CHUNKSIZE 1024 #define STATS_BDR_FMT "========================================" #define STATS_BDR_STR(w, s) printf("%.*s%s%.*s\n", w, \ @@ -111,6 +112,8 @@ static char *dump_regs_file_prefix; static uint32_t enable_shw_version; /* Enable show RSS reta. */ static uint32_t enable_shw_rss_reta; +/* Enable show module info. */ +static uint32_t enable_shw_module_info; /**< display usage */ static void @@ -141,6 +144,7 @@ proc_info_usage(const char *prgname) " --show-mempool[=name]: to display mempool information\n" " --show-version: to display DPDK version and ethdev firmware version\n" " --show-rss-reta: to display ports redirection table\n" + " --show-module-info: to display ports module info\n" " --iter-mempool=name: iterate mempool elements to display content\n" " --dump-regs=file-prefix: dump registers to file with the file-prefix\n", prgname); @@ -255,6 +259,7 @@ proc_info_parse_args(int argc, char **argv) {"dump-regs", required_argument, NULL, 0}, {"show-version", 0, NULL, 0}, {"show-rss-reta", 0, NULL, 0}, + {"show-module-info", 0, NULL, 0}, {NULL, 0, 0, 0} }; @@ -332,6 +337,9 @@ proc_info_parse_args(int argc, char **argv) else if (!strncmp(long_option[option_index].name, "show-rss-reta", MAX_LONG_OPT_SZ)) enable_shw_rss_reta = 1; + else if (!strncmp(long_option[option_index].name, + "show-module-info", MAX_LONG_OPT_SZ)) + enable_shw_module_info = 1; break; case 1: /* Print xstat single value given by name*/ @@ -1567,6 +1575,49 @@ show_port_rss_reta_info(void) } } +static void +show_module_eeprom_info(void) +{ + unsigned char bytes_eeprom[EEPROM_DUMP_CHUNKSIZE]; + struct rte_eth_dev_module_info module_info; + struct rte_dev_eeprom_info eeprom_info; + uint16_t i; + int ret; + + RTE_ETH_FOREACH_DEV(i) { + /* Skip if port is not in mask */ + if ((enabled_port_mask & (1ul << i)) == 0) + continue; + + if (!rte_eth_dev_is_valid_port(i)) + continue; + + snprintf(bdr_str, MAX_STRING_LEN, " Port %u ", i); + STATS_BDR_STR(5, bdr_str); + + ret = rte_eth_dev_get_module_info(i, &module_info); + if (ret != 0) { + printf("Module EEPROM information read error %d\n", ret); + return; + } + + eeprom_info.offset = 0; + eeprom_info.length = module_info.eeprom_len; + eeprom_info.data = bytes_eeprom; + + ret = rte_eth_dev_get_module_eeprom(i, &eeprom_info); + if (ret != 0) { + printf("Module EEPROM read error %d\n", ret); + return; + } + + rte_hexdump(stdout, "hexdump", eeprom_info.data, + eeprom_info.length); + printf("Finish -- Port: %u MODULE EEPROM length: %d bytes\n", + i, eeprom_info.length); + } +} + int main(int argc, char **argv) { @@ -1684,6 +1735,8 @@ main(int argc, char **argv) show_version(); if (enable_shw_rss_reta) show_port_rss_reta_info(); + if (enable_shw_module_info) + show_module_eeprom_info(); RTE_ETH_FOREACH_DEV(i) rte_eth_dev_close(i); -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* Re: [PATCH v2 3/6] app/procinfo: add module info dump 2022-09-20 10:51 ` [PATCH v2 3/6] app/procinfo: add module info dump Dongdong Liu @ 2022-09-20 15:22 ` Stephen Hemminger 2022-09-21 11:22 ` Dongdong Liu 0 siblings, 1 reply; 89+ messages in thread From: Stephen Hemminger @ 2022-09-20 15:22 UTC (permalink / raw) To: Dongdong Liu Cc: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko, Min Hu (Connor), Maryam Tahhan On Tue, 20 Sep 2022 18:51:44 +0800 Dongdong Liu <liudongdong3@huawei.com> wrote: > + > + RTE_ETH_FOREACH_DEV(i) { > + /* Skip if port is not in mask */ > + if ((enabled_port_mask & (1ul << i)) == 0) > + continue; > + > + if (!rte_eth_dev_is_valid_port(i)) > + continue; There is no way RTE_ETH_FOREACH_DEV would iterate over an invalid port. If it did the macro would be seriously broken. That code is unnecessary. ^ permalink raw reply [flat|nested] 89+ messages in thread
* Re: [PATCH v2 3/6] app/procinfo: add module info dump 2022-09-20 15:22 ` Stephen Hemminger @ 2022-09-21 11:22 ` Dongdong Liu 0 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-09-21 11:22 UTC (permalink / raw) To: Stephen Hemminger Cc: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko, Min Hu (Connor), Maryam Tahhan On 2022/9/20 23:22, Stephen Hemminger wrote: > On Tue, 20 Sep 2022 18:51:44 +0800 > Dongdong Liu <liudongdong3@huawei.com> wrote: > >> + >> + RTE_ETH_FOREACH_DEV(i) { >> + /* Skip if port is not in mask */ >> + if ((enabled_port_mask & (1ul << i)) == 0) >> + continue; >> + >> + if (!rte_eth_dev_is_valid_port(i)) >> + continue; > > There is no way RTE_ETH_FOREACH_DEV would iterate > over an invalid port. If it did the macro would be seriously > broken. > > That code is unnecessary. Good point, will delete the code. Thanks, Dongdong > . > ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v2 4/6] app/proc-info: add dump of Rx/Tx burst mode 2022-09-20 10:51 ` [PATCH v2 " Dongdong Liu ` (2 preceding siblings ...) 2022-09-20 10:51 ` [PATCH v2 3/6] app/procinfo: add module info dump Dongdong Liu @ 2022-09-20 10:51 ` Dongdong Liu 2022-09-20 10:51 ` [PATCH v2 5/6] app/procinfo: fix some wrong doxygen syntax Dongdong Liu 2022-09-20 10:51 ` [PATCH v2 6/6] doc: add some extended features in procinfo guide Dongdong Liu 5 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-09-20 10:51 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Jie Hai, Dongdong Liu, Maryam Tahhan From: Jie Hai <haijie1@huawei.com> Add dump of Rx/Tx burst mode in --show-port. Sample output changes: - rx queue - -- 0 descriptors 0/1024 drop_en rx buffer size 2048 \ mempool mb_pool_0 socket 0 + -- 0 descriptors 0/1024 drop_en rx buffer size 2048 \ mempool mb_pool_0 socket 0 burst mode : Vector Neon - tx queue - -- 0 descriptors 1024 thresh 32/928 \ offloads : MBUF_FAST_FREE + -- 0 descriptors 1024 thresh 32/928 \ offloads : MBUF_FAST_FREE burst mode : Scalar Signed-off-by: Jie Hai <haijie1@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> --- app/proc-info/main.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index bc93af51df..9f708421c5 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -838,6 +838,7 @@ show_port(void) for (j = 0; j < dev_info.nb_rx_queues; j++) { struct rte_eth_rxq_info queue_info; + struct rte_eth_burst_mode mode; int count; ret = rte_eth_rx_queue_info_get(i, j, &queue_info); @@ -873,11 +874,18 @@ show_port(void) if (queue_info.conf.offloads != 0) show_offloads(queue_info.conf.offloads, rte_eth_dev_rx_offload_name); + if (rte_eth_rx_burst_mode_get(i, j, &mode) == 0) + printf(" burst mode : %s%s", + mode.info, + mode.flags & RTE_ETH_BURST_FLAG_PER_QUEUE ? + " (per queue)" : ""); + printf("\n"); } for (j = 0; j < dev_info.nb_tx_queues; j++) { struct rte_eth_txq_info queue_info; + struct rte_eth_burst_mode mode; ret = rte_eth_tx_queue_info_get(i, j, &queue_info); if (ret != 0) @@ -898,6 +906,13 @@ show_port(void) if (queue_info.conf.offloads != 0) show_offloads(queue_info.conf.offloads, rte_eth_dev_tx_offload_name); + + if (rte_eth_tx_burst_mode_get(i, j, &mode) == 0) + printf(" burst mode : %s%s", + mode.info, + mode.flags & RTE_ETH_BURST_FLAG_PER_QUEUE ? + " (per queue)" : ""); + printf("\n"); } -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v2 5/6] app/procinfo: fix some wrong doxygen syntax 2022-09-20 10:51 ` [PATCH v2 " Dongdong Liu ` (3 preceding siblings ...) 2022-09-20 10:51 ` [PATCH v2 4/6] app/proc-info: add dump of Rx/Tx burst mode Dongdong Liu @ 2022-09-20 10:51 ` Dongdong Liu 2022-09-20 10:51 ` [PATCH v2 6/6] doc: add some extended features in procinfo guide Dongdong Liu 5 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-09-20 10:51 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Dongdong Liu, Maryam Tahhan This code is to do cleanup for the wrong doxygen syntax comments. Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> --- app/proc-info/main.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 9f708421c5..d8d8c843d1 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -54,33 +54,33 @@ #define STATS_BDR_STR(w, s) printf("%.*s%s%.*s\n", w, \ STATS_BDR_FMT, s, w, STATS_BDR_FMT) -/**< mask of enabled ports */ +/* mask of enabled ports */ static unsigned long enabled_port_mask; -/**< Enable stats. */ +/* Enable stats. */ static uint32_t enable_stats; -/**< Enable xstats. */ +/* Enable xstats. */ static uint32_t enable_xstats; -/**< Enable collectd format*/ +/* Enable collectd format */ static uint32_t enable_collectd_format; -/**< FD to send collectd format messages to STDOUT*/ +/* FD to send collectd format messages to STDOUT */ static int stdout_fd; -/**< Host id process is running on */ +/* Host id process is running on */ static char host_id[MAX_LONG_OPT_SZ]; #ifdef RTE_LIB_METRICS -/**< Enable metrics. */ +/* Enable metrics. */ static uint32_t enable_metrics; #endif -/**< Enable stats reset. */ +/* Enable stats reset. */ static uint32_t reset_stats; -/**< Enable xstats reset. */ +/* Enable xstats reset. */ static uint32_t reset_xstats; -/**< Enable memory info. */ +/* Enable memory info. */ static uint32_t mem_info; -/**< Enable displaying xstat name. */ +/* Enable displaying xstat name. */ static uint32_t enable_xstats_name; static char *xstats_name; -/**< Enable xstats by ids. */ +/* Enable xstats by ids. */ #define MAX_NB_XSTATS_IDS 1024 static uint32_t nb_xstats_ids; static uint64_t xstats_ids[MAX_NB_XSTATS_IDS]; @@ -88,24 +88,24 @@ static uint64_t xstats_ids[MAX_NB_XSTATS_IDS]; /* show border */ static char bdr_str[MAX_STRING_LEN]; -/**< Enable show port. */ +/* Enable show port. */ static uint32_t enable_shw_port; /* Enable show port private info. */ static uint32_t enable_shw_port_priv; -/**< Enable show tm. */ +/* Enable show tm. */ static uint32_t enable_shw_tm; -/**< Enable show crypto. */ +/* Enable show crypto. */ static uint32_t enable_shw_crypto; -/**< Enable show ring. */ +/* Enable show ring. */ static uint32_t enable_shw_ring; static char *ring_name; -/**< Enable show mempool. */ +/* Enable show mempool. */ static uint32_t enable_shw_mempool; static char *mempool_name; -/**< Enable iter mempool. */ +/* Enable iter mempool. */ static uint32_t enable_iter_mempool; static char *mempool_iter_name; -/**< Enable dump regs. */ +/* Enable dump regs. */ static uint32_t enable_dump_regs; static char *dump_regs_file_prefix; /* Enable show version. */ @@ -115,7 +115,7 @@ static uint32_t enable_shw_rss_reta; /* Enable show module info. */ static uint32_t enable_shw_module_info; -/**< display usage */ +/* display usage */ static void proc_info_usage(const char *prgname) { -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v2 6/6] doc: add some extended features in procinfo guide 2022-09-20 10:51 ` [PATCH v2 " Dongdong Liu ` (4 preceding siblings ...) 2022-09-20 10:51 ` [PATCH v2 5/6] app/procinfo: fix some wrong doxygen syntax Dongdong Liu @ 2022-09-20 10:51 ` Dongdong Liu 5 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-09-20 10:51 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Dongdong Liu, Maryam Tahhan Add the below extended features in procinfo guide. --show-port-private --show-version --show-rss-reta --show-module-info Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> --- doc/guides/tools/proc_info.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/guides/tools/proc_info.rst b/doc/guides/tools/proc_info.rst index 9772d97ef0..417fb9f308 100644 --- a/doc/guides/tools/proc_info.rst +++ b/doc/guides/tools/proc_info.rst @@ -69,6 +69,18 @@ mempool. For invalid or no mempool name, whole list is dump. The iter-mempool parameter iterates and displays mempool elements specified by name. For invalid or no mempool name no elements are displayed. +**--show-port-private** +The show-port-private parameter displays ports private information. + +**--show-version** +The show-version parameter displays DPDK version and ethdev firmware version. + +**--show-rss-reta** +The show-rss-reta parameter displays ports rss redirection table. + +**--show-module-info** +The show-module-info parameter displays ports module eeprom information. + Limitations ----------- -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v3 0/7] app/procinfo: add some extended features 2022-07-22 9:12 [PATCH 0/6] app/procinfo: add some extended features Dongdong Liu ` (8 preceding siblings ...) 2022-09-20 10:51 ` [PATCH v2 " Dongdong Liu @ 2022-09-21 14:26 ` Dongdong Liu 2022-09-21 14:26 ` [PATCH v3 1/7] app/procinfo: add dpdk version dump Dongdong Liu ` (6 more replies) 2022-09-24 8:13 ` [PATCH v7 0/7] app/procinfo: add some extended features Dongdong Liu ` (3 subsequent siblings) 13 siblings, 7 replies; 89+ messages in thread From: Dongdong Liu @ 2022-09-21 14:26 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko; +Cc: Dongdong Liu This patchset is to add some extended features for dpdk-proc-info. v2->v3: Fix some comments from Stephen. 1. Use --version option for DPDK version and add --firmware-version option to show firmware. 2. Use errors on stderr, not stdout. 3. Delete some unnecessary code. v1->v2: Fix some comments from Reshma. Dongdong Liu (3): app/procinfo: add firmware version dump app/procinfo: fix some wrong doxygen syntax doc: add some extended features in procinfo guide Jie Hai (1): app/procinfo: add dump of Rx/Tx burst mode Min Hu (Connor) (3): app/procinfo: add dpdk version dump app/procinfo: add RSS RETA dump app/procinfo: add module info dump app/proc-info/main.c | 220 +++++++++++++++++++++++++++++---- doc/guides/tools/proc_info.rst | 15 +++ 2 files changed, 213 insertions(+), 22 deletions(-) -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v3 1/7] app/procinfo: add dpdk version dump 2022-09-21 14:26 ` [PATCH v3 0/7] app/procinfo: add some extended features Dongdong Liu @ 2022-09-21 14:26 ` Dongdong Liu 2022-09-23 9:11 ` Pattan, Reshma 2022-09-21 14:26 ` [PATCH v3 2/7] app/procinfo: add firmware " Dongdong Liu ` (5 subsequent siblings) 6 siblings, 1 reply; 89+ messages in thread From: Dongdong Liu @ 2022-09-21 14:26 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Min Hu (Connor), Dongdong Liu, Maryam Tahhan From: "Min Hu (Connor)" <humin29@huawei.com> Add support for dump dpdk version. The command is like: dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --version Signed-off-by: Min Hu (Connor) <humin29@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> --- app/proc-info/main.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 1bfba5f60d..3f6d011049 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -39,6 +39,7 @@ #include <rte_cryptodev.h> #include <rte_tm.h> #include <rte_hexdump.h> +#include <rte_version.h> /* Maximum long option length for option parsing. */ #define MAX_LONG_OPT_SZ 64 @@ -102,6 +103,8 @@ static char *mempool_iter_name; /**< Enable dump regs. */ static uint32_t enable_dump_regs; static char *dump_regs_file_prefix; +/* Enable show DPDK version. */ +static uint32_t enable_shw_version; /**< display usage */ static void @@ -130,6 +133,7 @@ proc_info_usage(const char *prgname) " --show-crypto: to display crypto information\n" " --show-ring[=name]: to display ring information\n" " --show-mempool[=name]: to display mempool information\n" + " --version: to display DPDK version\n" " --iter-mempool=name: iterate mempool elements to display content\n" " --dump-regs=file-prefix: dump registers to file with the file-prefix\n", prgname); @@ -242,6 +246,7 @@ proc_info_parse_args(int argc, char **argv) {"show-mempool", optional_argument, NULL, 0}, {"iter-mempool", required_argument, NULL, 0}, {"dump-regs", required_argument, NULL, 0}, + {"version", 0, NULL, 0}, {NULL, 0, 0, 0} }; @@ -313,7 +318,9 @@ proc_info_parse_args(int argc, char **argv) "dump-regs", MAX_LONG_OPT_SZ)) { enable_dump_regs = 1; dump_regs_file_prefix = optarg; - } + } else if (!strncmp(long_option[option_index].name, + "version", MAX_LONG_OPT_SZ)) + enable_shw_version = 1; break; case 1: /* Print xstat single value given by name*/ @@ -1476,6 +1483,14 @@ dump_regs(char *file_prefix) } } +static void +show_version(void) +{ + snprintf(bdr_str, MAX_STRING_LEN, " show - DPDK version "); + STATS_BDR_STR(10, bdr_str); + printf("DPDK version: %s\n", rte_version()); +} + int main(int argc, char **argv) { @@ -1589,6 +1604,8 @@ main(int argc, char **argv) iter_mempool(mempool_iter_name); if (enable_dump_regs) dump_regs(dump_regs_file_prefix); + if (enable_shw_version) + show_version(); RTE_ETH_FOREACH_DEV(i) rte_eth_dev_close(i); -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* RE: [PATCH v3 1/7] app/procinfo: add dpdk version dump 2022-09-21 14:26 ` [PATCH v3 1/7] app/procinfo: add dpdk version dump Dongdong Liu @ 2022-09-23 9:11 ` Pattan, Reshma 0 siblings, 0 replies; 89+ messages in thread From: Pattan, Reshma @ 2022-09-23 9:11 UTC (permalink / raw) To: Dongdong Liu, dev, thomas, ferruh.yigit, andrew.rybchenko Cc: Min Hu (Connor), Maryam Tahhan > -----Original Message----- > From: Dongdong Liu <liudongdong3@huawei.com> > Subject: [PATCH v3 1/7] app/procinfo: add dpdk version dump > Add support for dump dpdk version. > > The command is like: > dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --version > > Signed-off-by: Min Hu (Connor) <humin29@huawei.com> > Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> > --- Acked-by: Reshma Pattan <reshma.pattan@intel.com> You can keep my ack in the acked patches, in case if you are spinning next versions. ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v3 2/7] app/procinfo: add firmware version dump 2022-09-21 14:26 ` [PATCH v3 0/7] app/procinfo: add some extended features Dongdong Liu 2022-09-21 14:26 ` [PATCH v3 1/7] app/procinfo: add dpdk version dump Dongdong Liu @ 2022-09-21 14:26 ` Dongdong Liu 2022-09-23 9:22 ` Pattan, Reshma 2022-09-21 14:26 ` [PATCH v3 3/7] app/procinfo: add RSS RETA dump Dongdong Liu ` (4 subsequent siblings) 6 siblings, 1 reply; 89+ messages in thread From: Dongdong Liu @ 2022-09-21 14:26 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Dongdong Liu, Min Hu, Maryam Tahhan Add support for dump ethdev firmware version. The command is like: dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --firmware-version Signed-off-by: Min Hu (Connor) <humin29@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> --- app/proc-info/main.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 3f6d011049..ab4fee1138 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -45,6 +45,8 @@ #define MAX_LONG_OPT_SZ 64 #define MAX_STRING_LEN 256 +#define ETHDEV_FWVERS_LEN 32 + #define STATS_BDR_FMT "========================================" #define STATS_BDR_STR(w, s) printf("%.*s%s%.*s\n", w, \ STATS_BDR_FMT, s, w, STATS_BDR_FMT) @@ -105,6 +107,8 @@ static uint32_t enable_dump_regs; static char *dump_regs_file_prefix; /* Enable show DPDK version. */ static uint32_t enable_shw_version; +/* Enable show ethdev firmware version. */ +static uint32_t enable_shw_fw_version; /**< display usage */ static void @@ -134,6 +138,7 @@ proc_info_usage(const char *prgname) " --show-ring[=name]: to display ring information\n" " --show-mempool[=name]: to display mempool information\n" " --version: to display DPDK version\n" + " --firmware-version: to display ethdev firmware version\n" " --iter-mempool=name: iterate mempool elements to display content\n" " --dump-regs=file-prefix: dump registers to file with the file-prefix\n", prgname); @@ -247,6 +252,7 @@ proc_info_parse_args(int argc, char **argv) {"iter-mempool", required_argument, NULL, 0}, {"dump-regs", required_argument, NULL, 0}, {"version", 0, NULL, 0}, + {"firmware-version", 0, NULL, 0}, {NULL, 0, 0, 0} }; @@ -321,6 +327,9 @@ proc_info_parse_args(int argc, char **argv) } else if (!strncmp(long_option[option_index].name, "version", MAX_LONG_OPT_SZ)) enable_shw_version = 1; + else if (!strncmp(long_option[option_index].name, + "firmware-version", MAX_LONG_OPT_SZ)) + enable_shw_fw_version = 1; break; case 1: /* Print xstat single value given by name*/ @@ -1491,6 +1500,30 @@ show_version(void) printf("DPDK version: %s\n", rte_version()); } +static void +show_firmware_version(void) +{ + char fw_version[ETHDEV_FWVERS_LEN]; + uint16_t i; + + snprintf(bdr_str, MAX_STRING_LEN, " show - firmware version "); + 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; + + if (rte_eth_dev_fw_version_get(i, fw_version, + ETHDEV_FWVERS_LEN) == 0) + printf("Ethdev port %u firmware version: %s\n", i, + fw_version); + else + printf("Ethdev port %u firmware version: %s\n", i, + "not available"); + } +} + int main(int argc, char **argv) { @@ -1606,6 +1639,8 @@ main(int argc, char **argv) dump_regs(dump_regs_file_prefix); if (enable_shw_version) show_version(); + if (enable_shw_fw_version) + show_firmware_version(); RTE_ETH_FOREACH_DEV(i) rte_eth_dev_close(i); -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* RE: [PATCH v3 2/7] app/procinfo: add firmware version dump 2022-09-21 14:26 ` [PATCH v3 2/7] app/procinfo: add firmware " Dongdong Liu @ 2022-09-23 9:22 ` Pattan, Reshma 2022-09-24 8:03 ` Dongdong Liu 0 siblings, 1 reply; 89+ messages in thread From: Pattan, Reshma @ 2022-09-23 9:22 UTC (permalink / raw) To: Dongdong Liu, dev, thomas, ferruh.yigit, andrew.rybchenko Cc: Min Hu, Maryam Tahhan > -----Original Message----- > From: Dongdong Liu <liudongdong3@huawei.com> > Subject: [PATCH v3 2/7] app/procinfo: add firmware version dump > > Add support for dump ethdev firmware version. > > The command is like: > dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --firmware-version > > Signed-off-by: Min Hu (Connor) <humin29@huawei.com> > Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> > + if (rte_eth_dev_fw_version_get(i, fw_version, > + ETHDEV_FWVERS_LEN) == 0) > + printf("Ethdev port %u firmware version: %s\n", i, > + fw_version); > + else > + printf("Ethdev port %u firmware version: %s\n", i, > + "not available"); Small question, do you want to show generic msg "Not available" ? instead of different printing messages based on what is returned from the " rte_eth_dev_fw_version_get" . Acked-by: Reshma Pattan <reshma.pattan@intel.com> ^ permalink raw reply [flat|nested] 89+ messages in thread
* Re: [PATCH v3 2/7] app/procinfo: add firmware version dump 2022-09-23 9:22 ` Pattan, Reshma @ 2022-09-24 8:03 ` Dongdong Liu 0 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-09-24 8:03 UTC (permalink / raw) To: Pattan, Reshma, dev, thomas, ferruh.yigit, andrew.rybchenko Cc: Min Hu, Maryam Tahhan Hi Reshma Many thanks for your review. On 2022/9/23 17:22, Pattan, Reshma wrote: > > >> -----Original Message----- >> From: Dongdong Liu <liudongdong3@huawei.com> >> Subject: [PATCH v3 2/7] app/procinfo: add firmware version dump >> >> Add support for dump ethdev firmware version. >> >> The command is like: >> dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --firmware-version >> >> Signed-off-by: Min Hu (Connor) <humin29@huawei.com> >> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> > >> + if (rte_eth_dev_fw_version_get(i, fw_version, >> + ETHDEV_FWVERS_LEN) == 0) >> + printf("Ethdev port %u firmware version: %s\n", i, >> + fw_version); >> + else >> + printf("Ethdev port %u firmware version: %s\n", i, >> + "not available"); > > Small question, do you want to show generic msg "Not available" ? instead of different printing messages based on what is returned from the " rte_eth_dev_fw_version_get" . Tt is ok to show generic msg "Not available". Thanks, Dongdong > > > Acked-by: Reshma Pattan <reshma.pattan@intel.com> > > > . > ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v3 3/7] app/procinfo: add RSS RETA dump 2022-09-21 14:26 ` [PATCH v3 0/7] app/procinfo: add some extended features Dongdong Liu 2022-09-21 14:26 ` [PATCH v3 1/7] app/procinfo: add dpdk version dump Dongdong Liu 2022-09-21 14:26 ` [PATCH v3 2/7] app/procinfo: add firmware " Dongdong Liu @ 2022-09-21 14:26 ` Dongdong Liu 2022-09-23 9:42 ` Pattan, Reshma 2022-09-21 14:26 ` [PATCH v3 4/7] app/procinfo: add module info dump Dongdong Liu ` (3 subsequent siblings) 6 siblings, 1 reply; 89+ messages in thread From: Dongdong Liu @ 2022-09-21 14:26 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Min Hu (Connor), Dongdong Liu, Maryam Tahhan From: "Min Hu (Connor)" <humin29@huawei.com> This patch add support for RSS reta dump. The command is like: dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --show-rss-reta Signed-off-by: Min Hu (Connor) <humin29@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> --- app/proc-info/main.c | 57 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index ab4fee1138..84fe93a3cb 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -46,6 +46,8 @@ #define MAX_STRING_LEN 256 #define ETHDEV_FWVERS_LEN 32 +#define RTE_RETA_CONF_GROUP_NUM 32 +#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) #define STATS_BDR_FMT "========================================" #define STATS_BDR_STR(w, s) printf("%.*s%s%.*s\n", w, \ @@ -109,6 +111,8 @@ static char *dump_regs_file_prefix; static uint32_t enable_shw_version; /* Enable show ethdev firmware version. */ static uint32_t enable_shw_fw_version; +/* Enable show RSS reta. */ +static uint32_t enable_shw_rss_reta; /**< display usage */ static void @@ -139,6 +143,7 @@ proc_info_usage(const char *prgname) " --show-mempool[=name]: to display mempool information\n" " --version: to display DPDK version\n" " --firmware-version: to display ethdev firmware version\n" + " --show-rss-reta: to display ports redirection table\n" " --iter-mempool=name: iterate mempool elements to display content\n" " --dump-regs=file-prefix: dump registers to file with the file-prefix\n", prgname); @@ -253,6 +258,7 @@ proc_info_parse_args(int argc, char **argv) {"dump-regs", required_argument, NULL, 0}, {"version", 0, NULL, 0}, {"firmware-version", 0, NULL, 0}, + {"show-rss-reta", 0, NULL, 0}, {NULL, 0, 0, 0} }; @@ -330,6 +336,9 @@ proc_info_parse_args(int argc, char **argv) else if (!strncmp(long_option[option_index].name, "firmware-version", MAX_LONG_OPT_SZ)) enable_shw_fw_version = 1; + else if (!strncmp(long_option[option_index].name, + "show-rss-reta", MAX_LONG_OPT_SZ)) + enable_shw_rss_reta = 1; break; case 1: /* Print xstat single value given by name*/ @@ -1524,6 +1533,52 @@ show_firmware_version(void) } } +static void +show_port_rss_reta_info(void) +{ + struct rte_eth_rss_reta_entry64 reta_conf[RTE_RETA_CONF_GROUP_NUM + 1]; + struct rte_eth_dev_info dev_info; + uint16_t i, idx, shift; + uint16_t num; + uint16_t id; + int ret; + + RTE_ETH_FOREACH_DEV(id) { + /* Skip if port is not in mask */ + if ((enabled_port_mask & (1ul << id)) == 0) + continue; + + snprintf(bdr_str, MAX_STRING_LEN, " Port %u ", id); + STATS_BDR_STR(5, bdr_str); + + ret = rte_eth_dev_info_get(id, &dev_info); + if (ret != 0) { + fprintf(stderr, "Error getting device info: %s\n", + strerror(-ret)); + return; + } + + num = DIV_ROUND_UP(dev_info.reta_size, RTE_ETH_RETA_GROUP_SIZE); + memset(reta_conf, 0, sizeof(reta_conf)); + for (i = 0; i < num; i++) + reta_conf[i].mask = ~0ULL; + + ret = rte_eth_dev_rss_reta_query(id, reta_conf, dev_info.reta_size); + if (ret != 0) { + fprintf(stderr, "Error getting RSS RETA info: %s\n", + strerror(-ret)); + return; + } + + for (i = 0; i < dev_info.reta_size; i++) { + idx = i / RTE_ETH_RETA_GROUP_SIZE; + shift = i % RTE_ETH_RETA_GROUP_SIZE; + printf("RSS RETA configuration: hash index=%u, queue=%u\n", + i, reta_conf[idx].reta[shift]); + } + } +} + int main(int argc, char **argv) { @@ -1641,6 +1696,8 @@ main(int argc, char **argv) show_version(); if (enable_shw_fw_version) show_firmware_version(); + if (enable_shw_rss_reta) + show_port_rss_reta_info(); RTE_ETH_FOREACH_DEV(i) rte_eth_dev_close(i); -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* RE: [PATCH v3 3/7] app/procinfo: add RSS RETA dump 2022-09-21 14:26 ` [PATCH v3 3/7] app/procinfo: add RSS RETA dump Dongdong Liu @ 2022-09-23 9:42 ` Pattan, Reshma 0 siblings, 0 replies; 89+ messages in thread From: Pattan, Reshma @ 2022-09-23 9:42 UTC (permalink / raw) To: Dongdong Liu, dev, thomas, ferruh.yigit, andrew.rybchenko Cc: Min Hu (Connor), Maryam Tahhan > -----Original Message----- > From: Dongdong Liu <liudongdong3@huawei.com> > Subject: [PATCH v3 3/7] app/procinfo: add RSS RETA dump > > From: "Min Hu (Connor)" <humin29@huawei.com> > > This patch add support for RSS reta dump. > > The command is like: > dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --show-rss-reta > > Signed-off-by: Min Hu (Connor) <humin29@huawei.com> > Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> Acked-by: Reshma Pattan <reshma.pattan@intel.com> ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v3 4/7] app/procinfo: add module info dump 2022-09-21 14:26 ` [PATCH v3 0/7] app/procinfo: add some extended features Dongdong Liu ` (2 preceding siblings ...) 2022-09-21 14:26 ` [PATCH v3 3/7] app/procinfo: add RSS RETA dump Dongdong Liu @ 2022-09-21 14:26 ` Dongdong Liu 2022-09-23 9:51 ` Pattan, Reshma 2022-09-21 14:26 ` [PATCH v3 5/7] app/procinfo: add dump of Rx/Tx burst mode Dongdong Liu ` (2 subsequent siblings) 6 siblings, 1 reply; 89+ messages in thread From: Dongdong Liu @ 2022-09-21 14:26 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Min Hu (Connor), Dongdong Liu, Maryam Tahhan From: "Min Hu (Connor)" <humin29@huawei.com> This patch add support for module info dump. The command is like: dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --show-module-info Signed-off-by: Min Hu (Connor) <humin29@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> --- app/proc-info/main.c | 52 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 84fe93a3cb..0e78f8b75f 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -48,6 +48,7 @@ #define ETHDEV_FWVERS_LEN 32 #define RTE_RETA_CONF_GROUP_NUM 32 #define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) +#define EEPROM_DUMP_CHUNKSIZE 1024 #define STATS_BDR_FMT "========================================" #define STATS_BDR_STR(w, s) printf("%.*s%s%.*s\n", w, \ @@ -113,6 +114,8 @@ static uint32_t enable_shw_version; static uint32_t enable_shw_fw_version; /* Enable show RSS reta. */ static uint32_t enable_shw_rss_reta; +/* Enable show module info. */ +static uint32_t enable_shw_module_info; /**< display usage */ static void @@ -144,6 +147,7 @@ proc_info_usage(const char *prgname) " --version: to display DPDK version\n" " --firmware-version: to display ethdev firmware version\n" " --show-rss-reta: to display ports redirection table\n" + " --show-module-info: to display ports module info\n" " --iter-mempool=name: iterate mempool elements to display content\n" " --dump-regs=file-prefix: dump registers to file with the file-prefix\n", prgname); @@ -259,6 +263,7 @@ proc_info_parse_args(int argc, char **argv) {"version", 0, NULL, 0}, {"firmware-version", 0, NULL, 0}, {"show-rss-reta", 0, NULL, 0}, + {"show-module-info", 0, NULL, 0}, {NULL, 0, 0, 0} }; @@ -339,6 +344,9 @@ proc_info_parse_args(int argc, char **argv) else if (!strncmp(long_option[option_index].name, "show-rss-reta", MAX_LONG_OPT_SZ)) enable_shw_rss_reta = 1; + else if (!strncmp(long_option[option_index].name, + "show-module-info", MAX_LONG_OPT_SZ)) + enable_shw_module_info = 1; break; case 1: /* Print xstat single value given by name*/ @@ -1579,6 +1587,48 @@ show_port_rss_reta_info(void) } } +static void +show_module_eeprom_info(void) +{ + unsigned char bytes_eeprom[EEPROM_DUMP_CHUNKSIZE]; + struct rte_eth_dev_module_info module_info; + struct rte_dev_eeprom_info eeprom_info; + uint16_t i; + int ret; + + 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); + + ret = rte_eth_dev_get_module_info(i, &module_info); + if (ret != 0) { + fprintf(stderr, "Module EEPROM information read error: %s\n", + strerror(-ret)); + return; + } + + eeprom_info.offset = 0; + eeprom_info.length = module_info.eeprom_len; + eeprom_info.data = bytes_eeprom; + + ret = rte_eth_dev_get_module_eeprom(i, &eeprom_info); + if (ret != 0) { + fprintf(stderr, "Module EEPROM read error: %s\n", + strerror(-ret)); + return; + } + + rte_hexdump(stdout, "hexdump", eeprom_info.data, + eeprom_info.length); + printf("Finish -- Port: %u MODULE EEPROM length: %d bytes\n", + i, eeprom_info.length); + } +} + int main(int argc, char **argv) { @@ -1698,6 +1748,8 @@ main(int argc, char **argv) show_firmware_version(); if (enable_shw_rss_reta) show_port_rss_reta_info(); + if (enable_shw_module_info) + show_module_eeprom_info(); RTE_ETH_FOREACH_DEV(i) rte_eth_dev_close(i); -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* RE: [PATCH v3 4/7] app/procinfo: add module info dump 2022-09-21 14:26 ` [PATCH v3 4/7] app/procinfo: add module info dump Dongdong Liu @ 2022-09-23 9:51 ` Pattan, Reshma 2022-09-24 8:07 ` Dongdong Liu 0 siblings, 1 reply; 89+ messages in thread From: Pattan, Reshma @ 2022-09-23 9:51 UTC (permalink / raw) To: Dongdong Liu, dev, thomas, ferruh.yigit, andrew.rybchenko Cc: Min Hu (Connor), Maryam Tahhan > -----Original Message----- > From: Dongdong Liu <liudongdong3@huawei.com> > Subject: [PATCH v3 4/7] app/procinfo: add module info dump > > From: "Min Hu (Connor)" <humin29@huawei.com> > > This patch add support for module info dump. > > The command is like: > dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --show-module-info You are displaying EEPROM info, good to rename the new parameter to include eeprom in it. > + " --show-module-info: to display ports module info\n" You are displaying EEPROM info, good to mention that in the help text too. And change parameter too here and in other places. Thanks, Reshma ^ permalink raw reply [flat|nested] 89+ messages in thread
* Re: [PATCH v3 4/7] app/procinfo: add module info dump 2022-09-23 9:51 ` Pattan, Reshma @ 2022-09-24 8:07 ` Dongdong Liu 0 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-09-24 8:07 UTC (permalink / raw) To: Pattan, Reshma, dev, thomas, ferruh.yigit, andrew.rybchenko Cc: Min Hu (Connor), Maryam Tahhan On 2022/9/23 17:51, Pattan, Reshma wrote: > > >> -----Original Message----- >> From: Dongdong Liu <liudongdong3@huawei.com> >> Subject: [PATCH v3 4/7] app/procinfo: add module info dump >> >> From: "Min Hu (Connor)" <humin29@huawei.com> >> >> This patch add support for module info dump. >> >> The command is like: >> dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --show-module-info > > You are displaying EEPROM info, good to rename the new parameter to include eeprom in it. Good catch, will do. > >> + " --show-module-info: to display ports module info\n" > You are displaying EEPROM info, good to mention that in the help text too. And change parameter too here and in other places. Will do. Thanks, Dongdong > > Thanks, > Reshma > . > ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v3 5/7] app/procinfo: add dump of Rx/Tx burst mode 2022-09-21 14:26 ` [PATCH v3 0/7] app/procinfo: add some extended features Dongdong Liu ` (3 preceding siblings ...) 2022-09-21 14:26 ` [PATCH v3 4/7] app/procinfo: add module info dump Dongdong Liu @ 2022-09-21 14:26 ` Dongdong Liu 2022-09-23 10:02 ` Pattan, Reshma 2022-09-21 14:26 ` [PATCH v3 6/7] app/procinfo: fix some wrong doxygen syntax Dongdong Liu 2022-09-21 14:26 ` [PATCH v3 7/7] doc: add some extended features in procinfo guide Dongdong Liu 6 siblings, 1 reply; 89+ messages in thread From: Dongdong Liu @ 2022-09-21 14:26 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Jie Hai, Dongdong Liu, Maryam Tahhan From: Jie Hai <haijie1@huawei.com> Add dump of Rx/Tx burst mode in --show-port. Sample output changes: - rx queue - -- 0 descriptors 0/1024 drop_en rx buffer size 2048 \ mempool mb_pool_0 socket 0 + -- 0 descriptors 0/1024 drop_en rx buffer size 2048 \ mempool mb_pool_0 socket 0 burst mode : Vector Neon - tx queue - -- 0 descriptors 1024 thresh 32/928 \ offloads : MBUF_FAST_FREE + -- 0 descriptors 1024 thresh 32/928 \ offloads : MBUF_FAST_FREE burst mode : Scalar Signed-off-by: Jie Hai <haijie1@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> --- app/proc-info/main.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 0e78f8b75f..e1a153c934 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -845,6 +845,7 @@ show_port(void) for (j = 0; j < dev_info.nb_rx_queues; j++) { struct rte_eth_rxq_info queue_info; + struct rte_eth_burst_mode mode; int count; ret = rte_eth_rx_queue_info_get(i, j, &queue_info); @@ -880,11 +881,18 @@ show_port(void) if (queue_info.conf.offloads != 0) show_offloads(queue_info.conf.offloads, rte_eth_dev_rx_offload_name); + if (rte_eth_rx_burst_mode_get(i, j, &mode) == 0) + printf(" burst mode : %s%s", + mode.info, + mode.flags & RTE_ETH_BURST_FLAG_PER_QUEUE ? + " (per queue)" : ""); + printf("\n"); } for (j = 0; j < dev_info.nb_tx_queues; j++) { struct rte_eth_txq_info queue_info; + struct rte_eth_burst_mode mode; ret = rte_eth_tx_queue_info_get(i, j, &queue_info); if (ret != 0) @@ -905,6 +913,13 @@ show_port(void) if (queue_info.conf.offloads != 0) show_offloads(queue_info.conf.offloads, rte_eth_dev_tx_offload_name); + + if (rte_eth_tx_burst_mode_get(i, j, &mode) == 0) + printf(" burst mode : %s%s", + mode.info, + mode.flags & RTE_ETH_BURST_FLAG_PER_QUEUE ? + " (per queue)" : ""); + printf("\n"); } -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* RE: [PATCH v3 5/7] app/procinfo: add dump of Rx/Tx burst mode 2022-09-21 14:26 ` [PATCH v3 5/7] app/procinfo: add dump of Rx/Tx burst mode Dongdong Liu @ 2022-09-23 10:02 ` Pattan, Reshma 2022-09-24 8:06 ` Dongdong Liu 0 siblings, 1 reply; 89+ messages in thread From: Pattan, Reshma @ 2022-09-23 10:02 UTC (permalink / raw) To: Dongdong Liu, dev, thomas, ferruh.yigit, andrew.rybchenko Cc: Jie Hai, Maryam Tahhan > -----Original Message----- > From: Dongdong Liu <liudongdong3@huawei.com> > Subject: [PATCH v3 5/7] app/procinfo: add dump of Rx/Tx burst mode > > Signed-off-by: Jie Hai <haijie1@huawei.com> > Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> > --- > + if (rte_eth_rx_burst_mode_get(i, j, &mode) == 0) > + printf(" burst mode : %s%s", > + mode.info, > + mode.flags & > RTE_ETH_BURST_FLAG_PER_QUEUE ? > + " (per queue)" : ""); Small question: What if mode is not per queue that does that mean is it per port? Acked-by: Reshma Pattan <reshma.pattan@intel.com> ^ permalink raw reply [flat|nested] 89+ messages in thread
* Re: [PATCH v3 5/7] app/procinfo: add dump of Rx/Tx burst mode 2022-09-23 10:02 ` Pattan, Reshma @ 2022-09-24 8:06 ` Dongdong Liu 0 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-09-24 8:06 UTC (permalink / raw) To: Pattan, Reshma, dev, thomas, ferruh.yigit, andrew.rybchenko Cc: Jie Hai, Maryam Tahhan On 2022/9/23 18:02, Pattan, Reshma wrote: > > >> -----Original Message----- >> From: Dongdong Liu <liudongdong3@huawei.com> >> Subject: [PATCH v3 5/7] app/procinfo: add dump of Rx/Tx burst mode >> >> Signed-off-by: Jie Hai <haijie1@huawei.com> >> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> > > >> --- >> + if (rte_eth_rx_burst_mode_get(i, j, &mode) == 0) >> + printf(" burst mode : %s%s", >> + mode.info, >> + mode.flags & >> RTE_ETH_BURST_FLAG_PER_QUEUE ? >> + " (per queue)" : ""); > > Small question: What if mode is not per queue that does that mean is it per port? Yes, I think it is. > > Acked-by: Reshma Pattan <reshma.pattan@intel.com> > . > ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v3 6/7] app/procinfo: fix some wrong doxygen syntax 2022-09-21 14:26 ` [PATCH v3 0/7] app/procinfo: add some extended features Dongdong Liu ` (4 preceding siblings ...) 2022-09-21 14:26 ` [PATCH v3 5/7] app/procinfo: add dump of Rx/Tx burst mode Dongdong Liu @ 2022-09-21 14:26 ` Dongdong Liu 2022-09-23 7:53 ` Pattan, Reshma 2022-09-21 14:26 ` [PATCH v3 7/7] doc: add some extended features in procinfo guide Dongdong Liu 6 siblings, 1 reply; 89+ messages in thread From: Dongdong Liu @ 2022-09-21 14:26 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Dongdong Liu, Maryam Tahhan This code is to do cleanup for the wrong doxygen syntax comments. Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> --- app/proc-info/main.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index e1a153c934..00ba52cd53 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -54,33 +54,33 @@ #define STATS_BDR_STR(w, s) printf("%.*s%s%.*s\n", w, \ STATS_BDR_FMT, s, w, STATS_BDR_FMT) -/**< mask of enabled ports */ +/* mask of enabled ports */ static unsigned long enabled_port_mask; -/**< Enable stats. */ +/* Enable stats. */ static uint32_t enable_stats; -/**< Enable xstats. */ +/* Enable xstats. */ static uint32_t enable_xstats; -/**< Enable collectd format*/ +/* Enable collectd format */ static uint32_t enable_collectd_format; -/**< FD to send collectd format messages to STDOUT*/ +/* FD to send collectd format messages to STDOUT */ static int stdout_fd; -/**< Host id process is running on */ +/* Host id process is running on */ static char host_id[MAX_LONG_OPT_SZ]; #ifdef RTE_LIB_METRICS -/**< Enable metrics. */ +/* Enable metrics. */ static uint32_t enable_metrics; #endif -/**< Enable stats reset. */ +/* Enable stats reset. */ static uint32_t reset_stats; -/**< Enable xstats reset. */ +/* Enable xstats reset. */ static uint32_t reset_xstats; -/**< Enable memory info. */ +/* Enable memory info. */ static uint32_t mem_info; -/**< Enable displaying xstat name. */ +/* Enable displaying xstat name. */ static uint32_t enable_xstats_name; static char *xstats_name; -/**< Enable xstats by ids. */ +/* Enable xstats by ids. */ #define MAX_NB_XSTATS_IDS 1024 static uint32_t nb_xstats_ids; static uint64_t xstats_ids[MAX_NB_XSTATS_IDS]; @@ -88,24 +88,24 @@ static uint64_t xstats_ids[MAX_NB_XSTATS_IDS]; /* show border */ static char bdr_str[MAX_STRING_LEN]; -/**< Enable show port. */ +/* Enable show port. */ static uint32_t enable_shw_port; /* Enable show port private info. */ static uint32_t enable_shw_port_priv; -/**< Enable show tm. */ +/* Enable show tm. */ static uint32_t enable_shw_tm; -/**< Enable show crypto. */ +/* Enable show crypto. */ static uint32_t enable_shw_crypto; -/**< Enable show ring. */ +/* Enable show ring. */ static uint32_t enable_shw_ring; static char *ring_name; -/**< Enable show mempool. */ +/* Enable show mempool. */ static uint32_t enable_shw_mempool; static char *mempool_name; -/**< Enable iter mempool. */ +/* Enable iter mempool. */ static uint32_t enable_iter_mempool; static char *mempool_iter_name; -/**< Enable dump regs. */ +/* Enable dump regs. */ static uint32_t enable_dump_regs; static char *dump_regs_file_prefix; /* Enable show DPDK version. */ @@ -117,7 +117,7 @@ static uint32_t enable_shw_rss_reta; /* Enable show module info. */ static uint32_t enable_shw_module_info; -/**< display usage */ +/* display usage */ static void proc_info_usage(const char *prgname) { -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* RE: [PATCH v3 6/7] app/procinfo: fix some wrong doxygen syntax 2022-09-21 14:26 ` [PATCH v3 6/7] app/procinfo: fix some wrong doxygen syntax Dongdong Liu @ 2022-09-23 7:53 ` Pattan, Reshma 2022-09-24 8:12 ` Dongdong Liu 0 siblings, 1 reply; 89+ messages in thread From: Pattan, Reshma @ 2022-09-23 7:53 UTC (permalink / raw) To: Dongdong Liu, dev, thomas, ferruh.yigit, andrew.rybchenko; +Cc: Maryam Tahhan > -----Original Message----- > From: Dongdong Liu <liudongdong3@huawei.com> > Sent: Wednesday, September 21, 2022 3:27 PM > To: dev@dpdk.org; Pattan, Reshma <reshma.pattan@intel.com>; > thomas@monjalon.net; ferruh.yigit@xilinx.com; > andrew.rybchenko@oktetlabs.ru > Cc: Dongdong Liu <liudongdong3@huawei.com>; Maryam Tahhan > <maryam.tahhan@intel.com> > Subject: [PATCH v3 6/7] app/procinfo: fix some wrong doxygen syntax > -/**< mask of enabled ports */ > +/* mask of enabled ports */ > static unsigned long enabled_port_mask; Ok you are using the prefix comments, so as per documentation . the comment should look like below. So you can consider using this style in the rest of the places. /** Mask of enabled ports. */ https://doc.dpdk.org/guides/contributing/documentation.html Thanks, Reshma ^ permalink raw reply [flat|nested] 89+ messages in thread
* Re: [PATCH v3 6/7] app/procinfo: fix some wrong doxygen syntax 2022-09-23 7:53 ` Pattan, Reshma @ 2022-09-24 8:12 ` Dongdong Liu 0 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-09-24 8:12 UTC (permalink / raw) To: Pattan, Reshma, dev, thomas, ferruh.yigit, andrew.rybchenko; +Cc: Maryam Tahhan On 2022/9/23 15:53, Pattan, Reshma wrote: > > >> -----Original Message----- >> From: Dongdong Liu <liudongdong3@huawei.com> >> Sent: Wednesday, September 21, 2022 3:27 PM >> To: dev@dpdk.org; Pattan, Reshma <reshma.pattan@intel.com>; >> thomas@monjalon.net; ferruh.yigit@xilinx.com; >> andrew.rybchenko@oktetlabs.ru >> Cc: Dongdong Liu <liudongdong3@huawei.com>; Maryam Tahhan >> <maryam.tahhan@intel.com> >> Subject: [PATCH v3 6/7] app/procinfo: fix some wrong doxygen syntax > >> -/**< mask of enabled ports */ >> +/* mask of enabled ports */ >> static unsigned long enabled_port_mask; > > Ok you are using the prefix comments, so as per documentation . the comment should look like below. So you can consider using this style in the rest of the places. > /** Mask of enabled ports. */ > https://doc.dpdk.org/guides/contributing/documentation.html 5.6. Doxygen Guidelines The DPDK API is documented using Doxygen comment annotations in the header files It seems the DPDK API need to use doxygen syntax. The procinfo code maybe not need to use doxygen syntax. Thanks, Dongdong > > > > Thanks, > Reshma > . > ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v3 7/7] doc: add some extended features in procinfo guide 2022-09-21 14:26 ` [PATCH v3 0/7] app/procinfo: add some extended features Dongdong Liu ` (5 preceding siblings ...) 2022-09-21 14:26 ` [PATCH v3 6/7] app/procinfo: fix some wrong doxygen syntax Dongdong Liu @ 2022-09-21 14:26 ` Dongdong Liu 2022-09-23 8:57 ` Pattan, Reshma 6 siblings, 1 reply; 89+ messages in thread From: Dongdong Liu @ 2022-09-21 14:26 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Dongdong Liu, Maryam Tahhan Add the below extended features in procinfo guide. --show-port-private --version --firmware-version --show-rss-reta --show-module-info Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> --- doc/guides/tools/proc_info.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/doc/guides/tools/proc_info.rst b/doc/guides/tools/proc_info.rst index 9772d97ef0..a6f0afe23a 100644 --- a/doc/guides/tools/proc_info.rst +++ b/doc/guides/tools/proc_info.rst @@ -69,6 +69,21 @@ mempool. For invalid or no mempool name, whole list is dump. The iter-mempool parameter iterates and displays mempool elements specified by name. For invalid or no mempool name no elements are displayed. +**--show-port-private** +The show-port-private parameter displays ports private information. + +**--version** +The version parameter displays DPDK version. + +**--firmware-version** +The firmware-version parameter displays ethdev firmware version. + +**--show-rss-reta** +The show-rss-reta parameter displays ports rss redirection table. + +**--show-module-info** +The show-module-info parameter displays ports module eeprom information. + Limitations ----------- -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* RE: [PATCH v3 7/7] doc: add some extended features in procinfo guide 2022-09-21 14:26 ` [PATCH v3 7/7] doc: add some extended features in procinfo guide Dongdong Liu @ 2022-09-23 8:57 ` Pattan, Reshma 0 siblings, 0 replies; 89+ messages in thread From: Pattan, Reshma @ 2022-09-23 8:57 UTC (permalink / raw) To: Dongdong Liu, dev, thomas, ferruh.yigit, andrew.rybchenko; +Cc: Maryam Tahhan > -----Original Message----- > From: Dongdong Liu <liudongdong3@huawei.com> > Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> Acked-by: Reshma Pattan <reshma.pattan@intel.com> ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v7 0/7] app/procinfo: add some extended features 2022-07-22 9:12 [PATCH 0/6] app/procinfo: add some extended features Dongdong Liu ` (9 preceding siblings ...) 2022-09-21 14:26 ` [PATCH v3 0/7] app/procinfo: add some extended features Dongdong Liu @ 2022-09-24 8:13 ` Dongdong Liu 2022-09-24 8:13 ` [PATCH v7 1/7] app/procinfo: add dpdk version dump Dongdong Liu ` (7 more replies) 2022-10-08 9:39 ` [PATCH v8 0/8] " Dongdong Liu ` (2 subsequent siblings) 13 siblings, 8 replies; 89+ messages in thread From: Dongdong Liu @ 2022-09-24 8:13 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko; +Cc: Dongdong Liu This patchset is to add some extended features for dpdk-proc-info. Thanks to Reshma and Stephen help to review the patchset and give many useful comments. v3->v4: - Add Acked-by: Reshma Pattan for PATCH 1,2,3,5,7. - Rename show-module-info to show-module-eeprom to make more clear. v2->v3: Fix some comments from Stephen. - Use --version option for DPDK version. - add --firmware-version option to show firmware. - Use errors on stderr, not stdout. - Delete some unnecessary code. v1->v2: Fix some comments from Reshma. Dongdong Liu (3): app/procinfo: add firmware version dump app/procinfo: fix some wrong doxygen syntax doc: add some extended features in procinfo guide Jie Hai (1): app/procinfo: add dump of Rx/Tx burst mode Min Hu (Connor) (3): app/procinfo: add dpdk version dump app/procinfo: add RSS RETA dump app/procinfo: add module eeprom info dump app/proc-info/main.c | 221 +++++++++++++++++++++++++++++---- doc/guides/tools/proc_info.rst | 15 +++ 2 files changed, 214 insertions(+), 22 deletions(-) -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v7 1/7] app/procinfo: add dpdk version dump 2022-09-24 8:13 ` [PATCH v7 0/7] app/procinfo: add some extended features Dongdong Liu @ 2022-09-24 8:13 ` Dongdong Liu 2022-09-24 8:13 ` [PATCH v7 2/7] app/procinfo: add firmware " Dongdong Liu ` (6 subsequent siblings) 7 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-09-24 8:13 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Min Hu (Connor), Dongdong Liu, Maryam Tahhan From: "Min Hu (Connor)" <humin29@huawei.com> Add support for dump dpdk version. The command is like: dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --version Signed-off-by: Min Hu (Connor) <humin29@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> Acked-by: Reshma Pattan <reshma.pattan@intel.com> --- app/proc-info/main.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 1bfba5f60d..3f6d011049 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -39,6 +39,7 @@ #include <rte_cryptodev.h> #include <rte_tm.h> #include <rte_hexdump.h> +#include <rte_version.h> /* Maximum long option length for option parsing. */ #define MAX_LONG_OPT_SZ 64 @@ -102,6 +103,8 @@ static char *mempool_iter_name; /**< Enable dump regs. */ static uint32_t enable_dump_regs; static char *dump_regs_file_prefix; +/* Enable show DPDK version. */ +static uint32_t enable_shw_version; /**< display usage */ static void @@ -130,6 +133,7 @@ proc_info_usage(const char *prgname) " --show-crypto: to display crypto information\n" " --show-ring[=name]: to display ring information\n" " --show-mempool[=name]: to display mempool information\n" + " --version: to display DPDK version\n" " --iter-mempool=name: iterate mempool elements to display content\n" " --dump-regs=file-prefix: dump registers to file with the file-prefix\n", prgname); @@ -242,6 +246,7 @@ proc_info_parse_args(int argc, char **argv) {"show-mempool", optional_argument, NULL, 0}, {"iter-mempool", required_argument, NULL, 0}, {"dump-regs", required_argument, NULL, 0}, + {"version", 0, NULL, 0}, {NULL, 0, 0, 0} }; @@ -313,7 +318,9 @@ proc_info_parse_args(int argc, char **argv) "dump-regs", MAX_LONG_OPT_SZ)) { enable_dump_regs = 1; dump_regs_file_prefix = optarg; - } + } else if (!strncmp(long_option[option_index].name, + "version", MAX_LONG_OPT_SZ)) + enable_shw_version = 1; break; case 1: /* Print xstat single value given by name*/ @@ -1476,6 +1483,14 @@ dump_regs(char *file_prefix) } } +static void +show_version(void) +{ + snprintf(bdr_str, MAX_STRING_LEN, " show - DPDK version "); + STATS_BDR_STR(10, bdr_str); + printf("DPDK version: %s\n", rte_version()); +} + int main(int argc, char **argv) { @@ -1589,6 +1604,8 @@ main(int argc, char **argv) iter_mempool(mempool_iter_name); if (enable_dump_regs) dump_regs(dump_regs_file_prefix); + if (enable_shw_version) + show_version(); RTE_ETH_FOREACH_DEV(i) rte_eth_dev_close(i); -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v7 2/7] app/procinfo: add firmware version dump 2022-09-24 8:13 ` [PATCH v7 0/7] app/procinfo: add some extended features Dongdong Liu 2022-09-24 8:13 ` [PATCH v7 1/7] app/procinfo: add dpdk version dump Dongdong Liu @ 2022-09-24 8:13 ` Dongdong Liu 2022-09-24 8:13 ` [PATCH v7 3/7] app/procinfo: add RSS RETA dump Dongdong Liu ` (5 subsequent siblings) 7 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-09-24 8:13 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Dongdong Liu, Min Hu, Maryam Tahhan Add support for dump ethdev firmware version. The command is like: dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --firmware-version Signed-off-by: Min Hu (Connor) <humin29@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> Acked-by: Reshma Pattan <reshma.pattan@intel.com> --- app/proc-info/main.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 3f6d011049..ab4fee1138 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -45,6 +45,8 @@ #define MAX_LONG_OPT_SZ 64 #define MAX_STRING_LEN 256 +#define ETHDEV_FWVERS_LEN 32 + #define STATS_BDR_FMT "========================================" #define STATS_BDR_STR(w, s) printf("%.*s%s%.*s\n", w, \ STATS_BDR_FMT, s, w, STATS_BDR_FMT) @@ -105,6 +107,8 @@ static uint32_t enable_dump_regs; static char *dump_regs_file_prefix; /* Enable show DPDK version. */ static uint32_t enable_shw_version; +/* Enable show ethdev firmware version. */ +static uint32_t enable_shw_fw_version; /**< display usage */ static void @@ -134,6 +138,7 @@ proc_info_usage(const char *prgname) " --show-ring[=name]: to display ring information\n" " --show-mempool[=name]: to display mempool information\n" " --version: to display DPDK version\n" + " --firmware-version: to display ethdev firmware version\n" " --iter-mempool=name: iterate mempool elements to display content\n" " --dump-regs=file-prefix: dump registers to file with the file-prefix\n", prgname); @@ -247,6 +252,7 @@ proc_info_parse_args(int argc, char **argv) {"iter-mempool", required_argument, NULL, 0}, {"dump-regs", required_argument, NULL, 0}, {"version", 0, NULL, 0}, + {"firmware-version", 0, NULL, 0}, {NULL, 0, 0, 0} }; @@ -321,6 +327,9 @@ proc_info_parse_args(int argc, char **argv) } else if (!strncmp(long_option[option_index].name, "version", MAX_LONG_OPT_SZ)) enable_shw_version = 1; + else if (!strncmp(long_option[option_index].name, + "firmware-version", MAX_LONG_OPT_SZ)) + enable_shw_fw_version = 1; break; case 1: /* Print xstat single value given by name*/ @@ -1491,6 +1500,30 @@ show_version(void) printf("DPDK version: %s\n", rte_version()); } +static void +show_firmware_version(void) +{ + char fw_version[ETHDEV_FWVERS_LEN]; + uint16_t i; + + snprintf(bdr_str, MAX_STRING_LEN, " show - firmware version "); + 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; + + if (rte_eth_dev_fw_version_get(i, fw_version, + ETHDEV_FWVERS_LEN) == 0) + printf("Ethdev port %u firmware version: %s\n", i, + fw_version); + else + printf("Ethdev port %u firmware version: %s\n", i, + "not available"); + } +} + int main(int argc, char **argv) { @@ -1606,6 +1639,8 @@ main(int argc, char **argv) dump_regs(dump_regs_file_prefix); if (enable_shw_version) show_version(); + if (enable_shw_fw_version) + show_firmware_version(); RTE_ETH_FOREACH_DEV(i) rte_eth_dev_close(i); -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v7 3/7] app/procinfo: add RSS RETA dump 2022-09-24 8:13 ` [PATCH v7 0/7] app/procinfo: add some extended features Dongdong Liu 2022-09-24 8:13 ` [PATCH v7 1/7] app/procinfo: add dpdk version dump Dongdong Liu 2022-09-24 8:13 ` [PATCH v7 2/7] app/procinfo: add firmware " Dongdong Liu @ 2022-09-24 8:13 ` Dongdong Liu 2022-09-24 8:13 ` [PATCH v7 4/7] app/procinfo: add module eeprom info dump Dongdong Liu ` (4 subsequent siblings) 7 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-09-24 8:13 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Min Hu (Connor), Dongdong Liu, Maryam Tahhan From: "Min Hu (Connor)" <humin29@huawei.com> This patch add support for RSS reta dump. The command is like: dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --show-rss-reta Signed-off-by: Min Hu (Connor) <humin29@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> Acked-by: Reshma Pattan <reshma.pattan@intel.com> --- app/proc-info/main.c | 57 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index ab4fee1138..84fe93a3cb 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -46,6 +46,8 @@ #define MAX_STRING_LEN 256 #define ETHDEV_FWVERS_LEN 32 +#define RTE_RETA_CONF_GROUP_NUM 32 +#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) #define STATS_BDR_FMT "========================================" #define STATS_BDR_STR(w, s) printf("%.*s%s%.*s\n", w, \ @@ -109,6 +111,8 @@ static char *dump_regs_file_prefix; static uint32_t enable_shw_version; /* Enable show ethdev firmware version. */ static uint32_t enable_shw_fw_version; +/* Enable show RSS reta. */ +static uint32_t enable_shw_rss_reta; /**< display usage */ static void @@ -139,6 +143,7 @@ proc_info_usage(const char *prgname) " --show-mempool[=name]: to display mempool information\n" " --version: to display DPDK version\n" " --firmware-version: to display ethdev firmware version\n" + " --show-rss-reta: to display ports redirection table\n" " --iter-mempool=name: iterate mempool elements to display content\n" " --dump-regs=file-prefix: dump registers to file with the file-prefix\n", prgname); @@ -253,6 +258,7 @@ proc_info_parse_args(int argc, char **argv) {"dump-regs", required_argument, NULL, 0}, {"version", 0, NULL, 0}, {"firmware-version", 0, NULL, 0}, + {"show-rss-reta", 0, NULL, 0}, {NULL, 0, 0, 0} }; @@ -330,6 +336,9 @@ proc_info_parse_args(int argc, char **argv) else if (!strncmp(long_option[option_index].name, "firmware-version", MAX_LONG_OPT_SZ)) enable_shw_fw_version = 1; + else if (!strncmp(long_option[option_index].name, + "show-rss-reta", MAX_LONG_OPT_SZ)) + enable_shw_rss_reta = 1; break; case 1: /* Print xstat single value given by name*/ @@ -1524,6 +1533,52 @@ show_firmware_version(void) } } +static void +show_port_rss_reta_info(void) +{ + struct rte_eth_rss_reta_entry64 reta_conf[RTE_RETA_CONF_GROUP_NUM + 1]; + struct rte_eth_dev_info dev_info; + uint16_t i, idx, shift; + uint16_t num; + uint16_t id; + int ret; + + RTE_ETH_FOREACH_DEV(id) { + /* Skip if port is not in mask */ + if ((enabled_port_mask & (1ul << id)) == 0) + continue; + + snprintf(bdr_str, MAX_STRING_LEN, " Port %u ", id); + STATS_BDR_STR(5, bdr_str); + + ret = rte_eth_dev_info_get(id, &dev_info); + if (ret != 0) { + fprintf(stderr, "Error getting device info: %s\n", + strerror(-ret)); + return; + } + + num = DIV_ROUND_UP(dev_info.reta_size, RTE_ETH_RETA_GROUP_SIZE); + memset(reta_conf, 0, sizeof(reta_conf)); + for (i = 0; i < num; i++) + reta_conf[i].mask = ~0ULL; + + ret = rte_eth_dev_rss_reta_query(id, reta_conf, dev_info.reta_size); + if (ret != 0) { + fprintf(stderr, "Error getting RSS RETA info: %s\n", + strerror(-ret)); + return; + } + + for (i = 0; i < dev_info.reta_size; i++) { + idx = i / RTE_ETH_RETA_GROUP_SIZE; + shift = i % RTE_ETH_RETA_GROUP_SIZE; + printf("RSS RETA configuration: hash index=%u, queue=%u\n", + i, reta_conf[idx].reta[shift]); + } + } +} + int main(int argc, char **argv) { @@ -1641,6 +1696,8 @@ main(int argc, char **argv) show_version(); if (enable_shw_fw_version) show_firmware_version(); + if (enable_shw_rss_reta) + show_port_rss_reta_info(); RTE_ETH_FOREACH_DEV(i) rte_eth_dev_close(i); -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v7 4/7] app/procinfo: add module eeprom info dump 2022-09-24 8:13 ` [PATCH v7 0/7] app/procinfo: add some extended features Dongdong Liu ` (2 preceding siblings ...) 2022-09-24 8:13 ` [PATCH v7 3/7] app/procinfo: add RSS RETA dump Dongdong Liu @ 2022-09-24 8:13 ` Dongdong Liu 2022-09-26 11:54 ` Pattan, Reshma 2022-09-24 8:13 ` [PATCH v7 5/7] app/procinfo: add dump of Rx/Tx burst mode Dongdong Liu ` (3 subsequent siblings) 7 siblings, 1 reply; 89+ messages in thread From: Dongdong Liu @ 2022-09-24 8:13 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Min Hu (Connor), Dongdong Liu, Maryam Tahhan From: "Min Hu (Connor)" <humin29@huawei.com> This patch add support for module eeprom info dump. The command is like: dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --show-module-eeprom Signed-off-by: Min Hu (Connor) <humin29@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> --- app/proc-info/main.c | 53 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 84fe93a3cb..0e932f0245 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -48,6 +48,7 @@ #define ETHDEV_FWVERS_LEN 32 #define RTE_RETA_CONF_GROUP_NUM 32 #define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) +#define EEPROM_DUMP_CHUNKSIZE 1024 #define STATS_BDR_FMT "========================================" #define STATS_BDR_STR(w, s) printf("%.*s%s%.*s\n", w, \ @@ -113,6 +114,9 @@ static uint32_t enable_shw_version; static uint32_t enable_shw_fw_version; /* Enable show RSS reta. */ static uint32_t enable_shw_rss_reta; +/* Enable show module eeprom information . */ +static uint32_t enable_shw_module_eeprom +; /**< display usage */ static void @@ -144,6 +148,7 @@ proc_info_usage(const char *prgname) " --version: to display DPDK version\n" " --firmware-version: to display ethdev firmware version\n" " --show-rss-reta: to display ports redirection table\n" + " --show-module-eeprom: to display ports module eeprom information\n" " --iter-mempool=name: iterate mempool elements to display content\n" " --dump-regs=file-prefix: dump registers to file with the file-prefix\n", prgname); @@ -259,6 +264,7 @@ proc_info_parse_args(int argc, char **argv) {"version", 0, NULL, 0}, {"firmware-version", 0, NULL, 0}, {"show-rss-reta", 0, NULL, 0}, + {"show-module-eeprom", 0, NULL, 0}, {NULL, 0, 0, 0} }; @@ -339,6 +345,9 @@ proc_info_parse_args(int argc, char **argv) else if (!strncmp(long_option[option_index].name, "show-rss-reta", MAX_LONG_OPT_SZ)) enable_shw_rss_reta = 1; + else if (!strncmp(long_option[option_index].name, + "show-module-eeprom", MAX_LONG_OPT_SZ)) + enable_shw_module_eeprom = 1; break; case 1: /* Print xstat single value given by name*/ @@ -1579,6 +1588,48 @@ show_port_rss_reta_info(void) } } +static void +show_module_eeprom_info(void) +{ + unsigned char bytes_eeprom[EEPROM_DUMP_CHUNKSIZE]; + struct rte_eth_dev_module_info module_info; + struct rte_dev_eeprom_info eeprom_info; + uint16_t i; + int ret; + + 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); + + ret = rte_eth_dev_get_module_info(i, &module_info); + if (ret != 0) { + fprintf(stderr, "Module EEPROM information read error: %s\n", + strerror(-ret)); + return; + } + + eeprom_info.offset = 0; + eeprom_info.length = module_info.eeprom_len; + eeprom_info.data = bytes_eeprom; + + ret = rte_eth_dev_get_module_eeprom(i, &eeprom_info); + if (ret != 0) { + fprintf(stderr, "Module EEPROM read error: %s\n", + strerror(-ret)); + return; + } + + rte_hexdump(stdout, "hexdump", eeprom_info.data, + eeprom_info.length); + printf("Finish -- Port: %u MODULE EEPROM length: %d bytes\n", + i, eeprom_info.length); + } +} + int main(int argc, char **argv) { @@ -1698,6 +1749,8 @@ main(int argc, char **argv) show_firmware_version(); if (enable_shw_rss_reta) show_port_rss_reta_info(); + if (enable_shw_module_eeprom) + show_module_eeprom_info(); RTE_ETH_FOREACH_DEV(i) rte_eth_dev_close(i); -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* RE: [PATCH v7 4/7] app/procinfo: add module eeprom info dump 2022-09-24 8:13 ` [PATCH v7 4/7] app/procinfo: add module eeprom info dump Dongdong Liu @ 2022-09-26 11:54 ` Pattan, Reshma 0 siblings, 0 replies; 89+ messages in thread From: Pattan, Reshma @ 2022-09-26 11:54 UTC (permalink / raw) To: Dongdong Liu, dev, thomas, ferruh.yigit, andrew.rybchenko Cc: Min Hu (Connor), Maryam Tahhan > -----Original Message----- > From: Dongdong Liu <liudongdong3@huawei.com> > Subject: [PATCH v7 4/7] app/procinfo: add module eeprom info dump > > From: "Min Hu (Connor)" <humin29@huawei.com> > > This patch add support for module eeprom info dump. > > The command is like: > dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --show-module-eeprom > > Signed-off-by: Min Hu (Connor) <humin29@huawei.com> > Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> Acked-by: Reshma Pattan <reshma.pattan@intel.com> ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v7 5/7] app/procinfo: add dump of Rx/Tx burst mode 2022-09-24 8:13 ` [PATCH v7 0/7] app/procinfo: add some extended features Dongdong Liu ` (3 preceding siblings ...) 2022-09-24 8:13 ` [PATCH v7 4/7] app/procinfo: add module eeprom info dump Dongdong Liu @ 2022-09-24 8:13 ` Dongdong Liu 2022-09-24 8:13 ` [PATCH v7 6/7] app/procinfo: fix some wrong doxygen syntax Dongdong Liu ` (2 subsequent siblings) 7 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-09-24 8:13 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Jie Hai, Dongdong Liu, Maryam Tahhan From: Jie Hai <haijie1@huawei.com> Add dump of Rx/Tx burst mode in --show-port. Sample output changes: - rx queue - -- 0 descriptors 0/1024 drop_en rx buffer size 2048 \ mempool mb_pool_0 socket 0 + -- 0 descriptors 0/1024 drop_en rx buffer size 2048 \ mempool mb_pool_0 socket 0 burst mode : Vector Neon - tx queue - -- 0 descriptors 1024 thresh 32/928 \ offloads : MBUF_FAST_FREE + -- 0 descriptors 1024 thresh 32/928 \ offloads : MBUF_FAST_FREE burst mode : Scalar Signed-off-by: Jie Hai <haijie1@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> Acked-by: Reshma Pattan <reshma.pattan@intel.com> --- app/proc-info/main.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 0e932f0245..be0e0c65f9 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -846,6 +846,7 @@ show_port(void) for (j = 0; j < dev_info.nb_rx_queues; j++) { struct rte_eth_rxq_info queue_info; + struct rte_eth_burst_mode mode; int count; ret = rte_eth_rx_queue_info_get(i, j, &queue_info); @@ -881,11 +882,18 @@ show_port(void) if (queue_info.conf.offloads != 0) show_offloads(queue_info.conf.offloads, rte_eth_dev_rx_offload_name); + if (rte_eth_rx_burst_mode_get(i, j, &mode) == 0) + printf(" burst mode : %s%s", + mode.info, + mode.flags & RTE_ETH_BURST_FLAG_PER_QUEUE ? + " (per queue)" : ""); + printf("\n"); } for (j = 0; j < dev_info.nb_tx_queues; j++) { struct rte_eth_txq_info queue_info; + struct rte_eth_burst_mode mode; ret = rte_eth_tx_queue_info_get(i, j, &queue_info); if (ret != 0) @@ -906,6 +914,13 @@ show_port(void) if (queue_info.conf.offloads != 0) show_offloads(queue_info.conf.offloads, rte_eth_dev_tx_offload_name); + + if (rte_eth_tx_burst_mode_get(i, j, &mode) == 0) + printf(" burst mode : %s%s", + mode.info, + mode.flags & RTE_ETH_BURST_FLAG_PER_QUEUE ? + " (per queue)" : ""); + printf("\n"); } -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v7 6/7] app/procinfo: fix some wrong doxygen syntax 2022-09-24 8:13 ` [PATCH v7 0/7] app/procinfo: add some extended features Dongdong Liu ` (4 preceding siblings ...) 2022-09-24 8:13 ` [PATCH v7 5/7] app/procinfo: add dump of Rx/Tx burst mode Dongdong Liu @ 2022-09-24 8:13 ` Dongdong Liu 2022-09-26 12:09 ` Pattan, Reshma 2022-09-24 8:13 ` [PATCH v7 7/7] doc: add some extended features in procinfo guide Dongdong Liu 2022-09-24 8:21 ` [PATCH v7 0/7] app/procinfo: add some extended features Dongdong Liu 7 siblings, 1 reply; 89+ messages in thread From: Dongdong Liu @ 2022-09-24 8:13 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Dongdong Liu, Maryam Tahhan This code is to do cleanup for the wrong doxygen syntax comments The DPDK API is documented using doxygen comment annotations in the header files. The procinfo code seems no need to use doxygen comment. Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> --- app/proc-info/main.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index be0e0c65f9..55704d2dd1 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -54,33 +54,33 @@ #define STATS_BDR_STR(w, s) printf("%.*s%s%.*s\n", w, \ STATS_BDR_FMT, s, w, STATS_BDR_FMT) -/**< mask of enabled ports */ +/* mask of enabled ports */ static unsigned long enabled_port_mask; -/**< Enable stats. */ +/* Enable stats. */ static uint32_t enable_stats; -/**< Enable xstats. */ +/* Enable xstats. */ static uint32_t enable_xstats; -/**< Enable collectd format*/ +/* Enable collectd format */ static uint32_t enable_collectd_format; -/**< FD to send collectd format messages to STDOUT*/ +/* FD to send collectd format messages to STDOUT */ static int stdout_fd; -/**< Host id process is running on */ +/* Host id process is running on */ static char host_id[MAX_LONG_OPT_SZ]; #ifdef RTE_LIB_METRICS -/**< Enable metrics. */ +/* Enable metrics. */ static uint32_t enable_metrics; #endif -/**< Enable stats reset. */ +/* Enable stats reset. */ static uint32_t reset_stats; -/**< Enable xstats reset. */ +/* Enable xstats reset. */ static uint32_t reset_xstats; -/**< Enable memory info. */ +/* Enable memory info. */ static uint32_t mem_info; -/**< Enable displaying xstat name. */ +/* Enable displaying xstat name. */ static uint32_t enable_xstats_name; static char *xstats_name; -/**< Enable xstats by ids. */ +/* Enable xstats by ids. */ #define MAX_NB_XSTATS_IDS 1024 static uint32_t nb_xstats_ids; static uint64_t xstats_ids[MAX_NB_XSTATS_IDS]; @@ -88,24 +88,24 @@ static uint64_t xstats_ids[MAX_NB_XSTATS_IDS]; /* show border */ static char bdr_str[MAX_STRING_LEN]; -/**< Enable show port. */ +/* Enable show port. */ static uint32_t enable_shw_port; /* Enable show port private info. */ static uint32_t enable_shw_port_priv; -/**< Enable show tm. */ +/* Enable show tm. */ static uint32_t enable_shw_tm; -/**< Enable show crypto. */ +/* Enable show crypto. */ static uint32_t enable_shw_crypto; -/**< Enable show ring. */ +/* Enable show ring. */ static uint32_t enable_shw_ring; static char *ring_name; -/**< Enable show mempool. */ +/* Enable show mempool. */ static uint32_t enable_shw_mempool; static char *mempool_name; -/**< Enable iter mempool. */ +/* Enable iter mempool. */ static uint32_t enable_iter_mempool; static char *mempool_iter_name; -/**< Enable dump regs. */ +/* Enable dump regs. */ static uint32_t enable_dump_regs; static char *dump_regs_file_prefix; /* Enable show DPDK version. */ @@ -118,7 +118,7 @@ static uint32_t enable_shw_rss_reta; static uint32_t enable_shw_module_eeprom ; -/**< display usage */ +/* display usage */ static void proc_info_usage(const char *prgname) { -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* RE: [PATCH v7 6/7] app/procinfo: fix some wrong doxygen syntax 2022-09-24 8:13 ` [PATCH v7 6/7] app/procinfo: fix some wrong doxygen syntax Dongdong Liu @ 2022-09-26 12:09 ` Pattan, Reshma 0 siblings, 0 replies; 89+ messages in thread From: Pattan, Reshma @ 2022-09-26 12:09 UTC (permalink / raw) To: Dongdong Liu, dev, thomas, ferruh.yigit, andrew.rybchenko; +Cc: Maryam Tahhan > -----Original Message----- > From: Dongdong Liu <liudongdong3@huawei.com> > Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> If no need to follow style of API comments I am fine with the changes. Acked-by: Reshma Pattan <reshma.pattan@intel.com> ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v7 7/7] doc: add some extended features in procinfo guide 2022-09-24 8:13 ` [PATCH v7 0/7] app/procinfo: add some extended features Dongdong Liu ` (5 preceding siblings ...) 2022-09-24 8:13 ` [PATCH v7 6/7] app/procinfo: fix some wrong doxygen syntax Dongdong Liu @ 2022-09-24 8:13 ` Dongdong Liu 2022-09-24 8:21 ` [PATCH v7 0/7] app/procinfo: add some extended features Dongdong Liu 7 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-09-24 8:13 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Dongdong Liu, Maryam Tahhan Add the below extended features in procinfo guide. --show-port-private --version --firmware-version --show-rss-reta --show-module-eeprom Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> Acked-by: Reshma Pattan <reshma.pattan@intel.com> --- doc/guides/tools/proc_info.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/doc/guides/tools/proc_info.rst b/doc/guides/tools/proc_info.rst index 9772d97ef0..7c73a33093 100644 --- a/doc/guides/tools/proc_info.rst +++ b/doc/guides/tools/proc_info.rst @@ -69,6 +69,21 @@ mempool. For invalid or no mempool name, whole list is dump. The iter-mempool parameter iterates and displays mempool elements specified by name. For invalid or no mempool name no elements are displayed. +**--show-port-private** +The show-port-private parameter displays ports private information. + +**--version** +The version parameter displays DPDK version. + +**--firmware-version** +The firmware-version parameter displays ethdev firmware version. + +**--show-rss-reta** +The show-rss-reta parameter displays ports rss redirection table. + +**--show-module-eeprom** +The show-module-eeprom parameter displays ports module eeprom information. + Limitations ----------- -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* Re: [PATCH v7 0/7] app/procinfo: add some extended features 2022-09-24 8:13 ` [PATCH v7 0/7] app/procinfo: add some extended features Dongdong Liu ` (6 preceding siblings ...) 2022-09-24 8:13 ` [PATCH v7 7/7] doc: add some extended features in procinfo guide Dongdong Liu @ 2022-09-24 8:21 ` Dongdong Liu 7 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-09-24 8:21 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko I made a mistake, The subtile shoud be [PATCH v4]. Others is ok. Thanks, Dongdong On 2022/9/24 16:13, Dongdong Liu wrote: > This patchset is to add some extended features for dpdk-proc-info. > > Thanks to Reshma and Stephen help to review the patchset and give many > useful comments. > > v3->v4: > - Add Acked-by: Reshma Pattan for PATCH 1,2,3,5,7. > - Rename show-module-info to show-module-eeprom to make more clear. > > v2->v3: Fix some comments from Stephen. > - Use --version option for DPDK version. > - add --firmware-version option to show firmware. > - Use errors on stderr, not stdout. > - Delete some unnecessary code. > > v1->v2: Fix some comments from Reshma. > > Dongdong Liu (3): > app/procinfo: add firmware version dump > app/procinfo: fix some wrong doxygen syntax > doc: add some extended features in procinfo guide > > Jie Hai (1): > app/procinfo: add dump of Rx/Tx burst mode > > Min Hu (Connor) (3): > app/procinfo: add dpdk version dump > app/procinfo: add RSS RETA dump > app/procinfo: add module eeprom info dump > > app/proc-info/main.c | 221 +++++++++++++++++++++++++++++---- > doc/guides/tools/proc_info.rst | 15 +++ > 2 files changed, 214 insertions(+), 22 deletions(-) > > -- > 2.22.0 > > . > ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v8 0/8] app/procinfo: add some extended features 2022-07-22 9:12 [PATCH 0/6] app/procinfo: add some extended features Dongdong Liu ` (10 preceding siblings ...) 2022-09-24 8:13 ` [PATCH v7 0/7] app/procinfo: add some extended features Dongdong Liu @ 2022-10-08 9:39 ` Dongdong Liu 2022-10-08 9:39 ` [PATCH v8 1/8] app/procinfo: add dpdk version dump Dongdong Liu ` (7 more replies) 2022-10-08 10:53 ` [PATCH v9 0/8] app/procinfo: add some extended features Dongdong Liu 2022-10-11 11:18 ` [PATCH v10 0/8] app/procinfo: add some extended features Dongdong Liu 13 siblings, 8 replies; 89+ messages in thread From: Dongdong Liu @ 2022-10-08 9:39 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko; +Cc: Dongdong Liu Thiss patchset is to add some extended features for dpdk-proc-info. Thanks to Reshma and Stephen help to review the patchset. v7(v4)->v8: - Add Acked-by: Reshma Pattan for PATCH 4,6. - add Rx/Tx descriptor dump. - adjust procinfo doc guide. v3->v4: - Add Acked-by: Reshma Pattan for PATCH 1,2,3,5,7. - Rename show-module-info to show-module-eeprom to make more clear. v2->v3: Fix some comments from Stephen. - Use --version option for DPDK version. - add --firmware-version option to show firmware. - Use errors on stderr, not stdout. - Delete some unnecessary code. v1->v2: Fix some comments from Reshma. Dongdong Liu (4): app/procinfo: add firmware version dump app/procinfo: fix some wrong doxygen syntax app/procinfo: support descriptor dump doc: add some extended features in procinfo guide Jie Hai (1): app/procinfo: add dump of Rx/Tx burst mode Min Hu (Connor) (3): app/procinfo: add dpdk version dump app/procinfo: add RSS RETA dump app/procinfo: add module eeprom info dump app/proc-info/main.c | 301 ++++++++++++++++++++++++++++++--- doc/guides/tools/proc_info.rst | 36 +++- 2 files changed, 313 insertions(+), 24 deletions(-) -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v8 1/8] app/procinfo: add dpdk version dump 2022-10-08 9:39 ` [PATCH v8 0/8] " Dongdong Liu @ 2022-10-08 9:39 ` Dongdong Liu 2022-10-08 9:39 ` [PATCH v8 2/8] app/procinfo: add firmware " Dongdong Liu ` (6 subsequent siblings) 7 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-10-08 9:39 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Min Hu (Connor), Dongdong Liu, Maryam Tahhan From: "Min Hu (Connor)" <humin29@huawei.com> Add support for dump dpdk version. The command is like: dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --version Signed-off-by: Min Hu (Connor) <humin29@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> Acked-by: Reshma Pattan <reshma.pattan@intel.com> --- app/proc-info/main.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index d52ac8a038..d459c706d1 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -39,6 +39,7 @@ #include <rte_cryptodev.h> #include <rte_tm.h> #include <rte_hexdump.h> +#include <rte_version.h> /* Maximum long option length for option parsing. */ #define MAX_LONG_OPT_SZ 64 @@ -102,6 +103,8 @@ static char *mempool_iter_name; /**< Enable dump regs. */ static uint32_t enable_dump_regs; static char *dump_regs_file_prefix; +/* Enable show DPDK version. */ +static uint32_t enable_shw_version; /**< display usage */ static void @@ -130,6 +133,7 @@ proc_info_usage(const char *prgname) " --show-crypto: to display crypto information\n" " --show-ring[=name]: to display ring information\n" " --show-mempool[=name]: to display mempool information\n" + " --version: to display DPDK version\n" " --iter-mempool=name: iterate mempool elements to display content\n" " --dump-regs=file-prefix: dump registers to file with the file-prefix\n", prgname); @@ -242,6 +246,7 @@ proc_info_parse_args(int argc, char **argv) {"show-mempool", optional_argument, NULL, 0}, {"iter-mempool", required_argument, NULL, 0}, {"dump-regs", required_argument, NULL, 0}, + {"version", 0, NULL, 0}, {NULL, 0, 0, 0} }; @@ -313,7 +318,9 @@ proc_info_parse_args(int argc, char **argv) "dump-regs", MAX_LONG_OPT_SZ)) { enable_dump_regs = 1; dump_regs_file_prefix = optarg; - } + } else if (!strncmp(long_option[option_index].name, + "version", MAX_LONG_OPT_SZ)) + enable_shw_version = 1; break; case 1: /* Print xstat single value given by name*/ @@ -1476,6 +1483,14 @@ dump_regs(char *file_prefix) } } +static void +show_version(void) +{ + snprintf(bdr_str, MAX_STRING_LEN, " show - DPDK version "); + STATS_BDR_STR(10, bdr_str); + printf("DPDK version: %s\n", rte_version()); +} + int main(int argc, char **argv) { @@ -1589,6 +1604,8 @@ main(int argc, char **argv) iter_mempool(mempool_iter_name); if (enable_dump_regs) dump_regs(dump_regs_file_prefix); + if (enable_shw_version) + show_version(); RTE_ETH_FOREACH_DEV(i) rte_eth_dev_close(i); -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v8 2/8] app/procinfo: add firmware version dump 2022-10-08 9:39 ` [PATCH v8 0/8] " Dongdong Liu 2022-10-08 9:39 ` [PATCH v8 1/8] app/procinfo: add dpdk version dump Dongdong Liu @ 2022-10-08 9:39 ` Dongdong Liu 2022-10-08 9:39 ` [PATCH v8 3/8] app/procinfo: add RSS RETA dump Dongdong Liu ` (5 subsequent siblings) 7 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-10-08 9:39 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Dongdong Liu, Min Hu, Maryam Tahhan Add support for dump ethdev firmware version. The command is like: dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --firmware-version Signed-off-by: Min Hu (Connor) <humin29@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> Acked-by: Reshma Pattan <reshma.pattan@intel.com> --- app/proc-info/main.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index d459c706d1..7b407c47d0 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -45,6 +45,8 @@ #define MAX_LONG_OPT_SZ 64 #define MAX_STRING_LEN 256 +#define ETHDEV_FWVERS_LEN 32 + #define STATS_BDR_FMT "========================================" #define STATS_BDR_STR(w, s) printf("%.*s%s%.*s\n", w, \ STATS_BDR_FMT, s, w, STATS_BDR_FMT) @@ -105,6 +107,8 @@ static uint32_t enable_dump_regs; static char *dump_regs_file_prefix; /* Enable show DPDK version. */ static uint32_t enable_shw_version; +/* Enable show ethdev firmware version. */ +static uint32_t enable_shw_fw_version; /**< display usage */ static void @@ -134,6 +138,7 @@ proc_info_usage(const char *prgname) " --show-ring[=name]: to display ring information\n" " --show-mempool[=name]: to display mempool information\n" " --version: to display DPDK version\n" + " --firmware-version: to display ethdev firmware version\n" " --iter-mempool=name: iterate mempool elements to display content\n" " --dump-regs=file-prefix: dump registers to file with the file-prefix\n", prgname); @@ -247,6 +252,7 @@ proc_info_parse_args(int argc, char **argv) {"iter-mempool", required_argument, NULL, 0}, {"dump-regs", required_argument, NULL, 0}, {"version", 0, NULL, 0}, + {"firmware-version", 0, NULL, 0}, {NULL, 0, 0, 0} }; @@ -321,6 +327,9 @@ proc_info_parse_args(int argc, char **argv) } else if (!strncmp(long_option[option_index].name, "version", MAX_LONG_OPT_SZ)) enable_shw_version = 1; + else if (!strncmp(long_option[option_index].name, + "firmware-version", MAX_LONG_OPT_SZ)) + enable_shw_fw_version = 1; break; case 1: /* Print xstat single value given by name*/ @@ -1491,6 +1500,30 @@ show_version(void) printf("DPDK version: %s\n", rte_version()); } +static void +show_firmware_version(void) +{ + char fw_version[ETHDEV_FWVERS_LEN]; + uint16_t i; + + snprintf(bdr_str, MAX_STRING_LEN, " show - firmware version "); + 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; + + if (rte_eth_dev_fw_version_get(i, fw_version, + ETHDEV_FWVERS_LEN) == 0) + printf("Ethdev port %u firmware version: %s\n", i, + fw_version); + else + printf("Ethdev port %u firmware version: %s\n", i, + "not available"); + } +} + int main(int argc, char **argv) { @@ -1606,6 +1639,8 @@ main(int argc, char **argv) dump_regs(dump_regs_file_prefix); if (enable_shw_version) show_version(); + if (enable_shw_fw_version) + show_firmware_version(); RTE_ETH_FOREACH_DEV(i) rte_eth_dev_close(i); -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v8 3/8] app/procinfo: add RSS RETA dump 2022-10-08 9:39 ` [PATCH v8 0/8] " Dongdong Liu 2022-10-08 9:39 ` [PATCH v8 1/8] app/procinfo: add dpdk version dump Dongdong Liu 2022-10-08 9:39 ` [PATCH v8 2/8] app/procinfo: add firmware " Dongdong Liu @ 2022-10-08 9:39 ` Dongdong Liu 2022-10-08 9:39 ` [PATCH v8 4/8] app/procinfo: add module eeprom info dump Dongdong Liu ` (4 subsequent siblings) 7 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-10-08 9:39 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Min Hu (Connor), Dongdong Liu, Maryam Tahhan From: "Min Hu (Connor)" <humin29@huawei.com> This patch add support for RSS reta dump. The command is like: dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --show-rss-reta Signed-off-by: Min Hu (Connor) <humin29@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> Acked-by: Reshma Pattan <reshma.pattan@intel.com> --- app/proc-info/main.c | 57 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 7b407c47d0..4021279b17 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -46,6 +46,8 @@ #define MAX_STRING_LEN 256 #define ETHDEV_FWVERS_LEN 32 +#define RTE_RETA_CONF_GROUP_NUM 32 +#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) #define STATS_BDR_FMT "========================================" #define STATS_BDR_STR(w, s) printf("%.*s%s%.*s\n", w, \ @@ -109,6 +111,8 @@ static char *dump_regs_file_prefix; static uint32_t enable_shw_version; /* Enable show ethdev firmware version. */ static uint32_t enable_shw_fw_version; +/* Enable show RSS reta. */ +static uint32_t enable_shw_rss_reta; /**< display usage */ static void @@ -139,6 +143,7 @@ proc_info_usage(const char *prgname) " --show-mempool[=name]: to display mempool information\n" " --version: to display DPDK version\n" " --firmware-version: to display ethdev firmware version\n" + " --show-rss-reta: to display ports redirection table\n" " --iter-mempool=name: iterate mempool elements to display content\n" " --dump-regs=file-prefix: dump registers to file with the file-prefix\n", prgname); @@ -253,6 +258,7 @@ proc_info_parse_args(int argc, char **argv) {"dump-regs", required_argument, NULL, 0}, {"version", 0, NULL, 0}, {"firmware-version", 0, NULL, 0}, + {"show-rss-reta", 0, NULL, 0}, {NULL, 0, 0, 0} }; @@ -330,6 +336,9 @@ proc_info_parse_args(int argc, char **argv) else if (!strncmp(long_option[option_index].name, "firmware-version", MAX_LONG_OPT_SZ)) enable_shw_fw_version = 1; + else if (!strncmp(long_option[option_index].name, + "show-rss-reta", MAX_LONG_OPT_SZ)) + enable_shw_rss_reta = 1; break; case 1: /* Print xstat single value given by name*/ @@ -1524,6 +1533,52 @@ show_firmware_version(void) } } +static void +show_port_rss_reta_info(void) +{ + struct rte_eth_rss_reta_entry64 reta_conf[RTE_RETA_CONF_GROUP_NUM + 1]; + struct rte_eth_dev_info dev_info; + uint16_t i, idx, shift; + uint16_t num; + uint16_t id; + int ret; + + RTE_ETH_FOREACH_DEV(id) { + /* Skip if port is not in mask */ + if ((enabled_port_mask & (1ul << id)) == 0) + continue; + + snprintf(bdr_str, MAX_STRING_LEN, " Port %u ", id); + STATS_BDR_STR(5, bdr_str); + + ret = rte_eth_dev_info_get(id, &dev_info); + if (ret != 0) { + fprintf(stderr, "Error getting device info: %s\n", + strerror(-ret)); + return; + } + + num = DIV_ROUND_UP(dev_info.reta_size, RTE_ETH_RETA_GROUP_SIZE); + memset(reta_conf, 0, sizeof(reta_conf)); + for (i = 0; i < num; i++) + reta_conf[i].mask = ~0ULL; + + ret = rte_eth_dev_rss_reta_query(id, reta_conf, dev_info.reta_size); + if (ret != 0) { + fprintf(stderr, "Error getting RSS RETA info: %s\n", + strerror(-ret)); + return; + } + + for (i = 0; i < dev_info.reta_size; i++) { + idx = i / RTE_ETH_RETA_GROUP_SIZE; + shift = i % RTE_ETH_RETA_GROUP_SIZE; + printf("RSS RETA configuration: hash index=%u, queue=%u\n", + i, reta_conf[idx].reta[shift]); + } + } +} + int main(int argc, char **argv) { @@ -1641,6 +1696,8 @@ main(int argc, char **argv) show_version(); if (enable_shw_fw_version) show_firmware_version(); + if (enable_shw_rss_reta) + show_port_rss_reta_info(); RTE_ETH_FOREACH_DEV(i) rte_eth_dev_close(i); -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v8 4/8] app/procinfo: add module eeprom info dump 2022-10-08 9:39 ` [PATCH v8 0/8] " Dongdong Liu ` (2 preceding siblings ...) 2022-10-08 9:39 ` [PATCH v8 3/8] app/procinfo: add RSS RETA dump Dongdong Liu @ 2022-10-08 9:39 ` Dongdong Liu 2022-10-08 9:39 ` [PATCH v8 5/8] app/procinfo: add dump of Rx/Tx burst mode Dongdong Liu ` (3 subsequent siblings) 7 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-10-08 9:39 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Min Hu (Connor), Dongdong Liu, Maryam Tahhan From: "Min Hu (Connor)" <humin29@huawei.com> This patch add support for module eeprom info dump. The command is like: dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --show-module-eeprom Signed-off-by: Min Hu (Connor) <humin29@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> Acked-by: Reshma Pattan <reshma.pattan@intel.com> --- app/proc-info/main.c | 52 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 4021279b17..90e7e41e38 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -48,6 +48,7 @@ #define ETHDEV_FWVERS_LEN 32 #define RTE_RETA_CONF_GROUP_NUM 32 #define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) +#define EEPROM_DUMP_CHUNKSIZE 1024 #define STATS_BDR_FMT "========================================" #define STATS_BDR_STR(w, s) printf("%.*s%s%.*s\n", w, \ @@ -113,6 +114,8 @@ static uint32_t enable_shw_version; static uint32_t enable_shw_fw_version; /* Enable show RSS reta. */ static uint32_t enable_shw_rss_reta; +/* Enable show module eeprom information. */ +static uint32_t enable_shw_module_eeprom; /**< display usage */ static void @@ -144,6 +147,7 @@ proc_info_usage(const char *prgname) " --version: to display DPDK version\n" " --firmware-version: to display ethdev firmware version\n" " --show-rss-reta: to display ports redirection table\n" + " --show-module-eeprom: to display ports module eeprom information\n" " --iter-mempool=name: iterate mempool elements to display content\n" " --dump-regs=file-prefix: dump registers to file with the file-prefix\n", prgname); @@ -259,6 +263,7 @@ proc_info_parse_args(int argc, char **argv) {"version", 0, NULL, 0}, {"firmware-version", 0, NULL, 0}, {"show-rss-reta", 0, NULL, 0}, + {"show-module-eeprom", 0, NULL, 0}, {NULL, 0, 0, 0} }; @@ -339,6 +344,9 @@ proc_info_parse_args(int argc, char **argv) else if (!strncmp(long_option[option_index].name, "show-rss-reta", MAX_LONG_OPT_SZ)) enable_shw_rss_reta = 1; + else if (!strncmp(long_option[option_index].name, + "show-module-eeprom", MAX_LONG_OPT_SZ)) + enable_shw_module_eeprom = 1; break; case 1: /* Print xstat single value given by name*/ @@ -1579,6 +1587,48 @@ show_port_rss_reta_info(void) } } +static void +show_module_eeprom_info(void) +{ + unsigned char bytes_eeprom[EEPROM_DUMP_CHUNKSIZE]; + struct rte_eth_dev_module_info module_info; + struct rte_dev_eeprom_info eeprom_info; + uint16_t i; + int ret; + + 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); + + ret = rte_eth_dev_get_module_info(i, &module_info); + if (ret != 0) { + fprintf(stderr, "Module EEPROM information read error: %s\n", + strerror(-ret)); + return; + } + + eeprom_info.offset = 0; + eeprom_info.length = module_info.eeprom_len; + eeprom_info.data = bytes_eeprom; + + ret = rte_eth_dev_get_module_eeprom(i, &eeprom_info); + if (ret != 0) { + fprintf(stderr, "Module EEPROM read error: %s\n", + strerror(-ret)); + return; + } + + rte_hexdump(stdout, "hexdump", eeprom_info.data, + eeprom_info.length); + printf("Finish -- Port: %u MODULE EEPROM length: %d bytes\n", + i, eeprom_info.length); + } +} + int main(int argc, char **argv) { @@ -1698,6 +1748,8 @@ main(int argc, char **argv) show_firmware_version(); if (enable_shw_rss_reta) show_port_rss_reta_info(); + if (enable_shw_module_eeprom) + show_module_eeprom_info(); RTE_ETH_FOREACH_DEV(i) rte_eth_dev_close(i); -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v8 5/8] app/procinfo: add dump of Rx/Tx burst mode 2022-10-08 9:39 ` [PATCH v8 0/8] " Dongdong Liu ` (3 preceding siblings ...) 2022-10-08 9:39 ` [PATCH v8 4/8] app/procinfo: add module eeprom info dump Dongdong Liu @ 2022-10-08 9:39 ` Dongdong Liu 2022-10-08 9:39 ` [PATCH v8 6/8] app/procinfo: fix some wrong doxygen syntax Dongdong Liu ` (2 subsequent siblings) 7 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-10-08 9:39 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Jie Hai, Dongdong Liu, Maryam Tahhan From: Jie Hai <haijie1@huawei.com> Add dump of Rx/Tx burst mode in --show-port. Sample output changes: - rx queue - -- 0 descriptors 0/1024 drop_en rx buffer size 2048 \ mempool mb_pool_0 socket 0 + -- 0 descriptors 0/1024 drop_en rx buffer size 2048 \ mempool mb_pool_0 socket 0 burst mode : Vector Neon - tx queue - -- 0 descriptors 1024 thresh 32/928 \ offloads : MBUF_FAST_FREE + -- 0 descriptors 1024 thresh 32/928 \ offloads : MBUF_FAST_FREE burst mode : Scalar Signed-off-by: Jie Hai <haijie1@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> Acked-by: Reshma Pattan <reshma.pattan@intel.com> --- app/proc-info/main.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 90e7e41e38..67217ab68b 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -845,6 +845,7 @@ show_port(void) for (j = 0; j < dev_info.nb_rx_queues; j++) { struct rte_eth_rxq_info queue_info; + struct rte_eth_burst_mode mode; int count; ret = rte_eth_rx_queue_info_get(i, j, &queue_info); @@ -880,11 +881,18 @@ show_port(void) if (queue_info.conf.offloads != 0) show_offloads(queue_info.conf.offloads, rte_eth_dev_rx_offload_name); + if (rte_eth_rx_burst_mode_get(i, j, &mode) == 0) + printf(" burst mode : %s%s", + mode.info, + mode.flags & RTE_ETH_BURST_FLAG_PER_QUEUE ? + " (per queue)" : ""); + printf("\n"); } for (j = 0; j < dev_info.nb_tx_queues; j++) { struct rte_eth_txq_info queue_info; + struct rte_eth_burst_mode mode; ret = rte_eth_tx_queue_info_get(i, j, &queue_info); if (ret != 0) @@ -905,6 +913,13 @@ show_port(void) if (queue_info.conf.offloads != 0) show_offloads(queue_info.conf.offloads, rte_eth_dev_tx_offload_name); + + if (rte_eth_tx_burst_mode_get(i, j, &mode) == 0) + printf(" burst mode : %s%s", + mode.info, + mode.flags & RTE_ETH_BURST_FLAG_PER_QUEUE ? + " (per queue)" : ""); + printf("\n"); } -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v8 6/8] app/procinfo: fix some wrong doxygen syntax 2022-10-08 9:39 ` [PATCH v8 0/8] " Dongdong Liu ` (4 preceding siblings ...) 2022-10-08 9:39 ` [PATCH v8 5/8] app/procinfo: add dump of Rx/Tx burst mode Dongdong Liu @ 2022-10-08 9:39 ` Dongdong Liu 2022-10-08 9:39 ` [PATCH v8 7/8] app/procinfo: support descriptor dump Dongdong Liu 2022-10-08 9:39 ` [PATCH v8 8/8] doc: add some extended features in procinfo guide Dongdong Liu 7 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-10-08 9:39 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Dongdong Liu, Maryam Tahhan This code is to do cleanup for the wrong doxygen syntax comments The DPDK API is documented using doxygen comment annotations in the header files. The procinfo code seems no need to use doxygen comment. Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> Acked-by: Reshma Pattan <reshma.pattan@intel.com> --- app/proc-info/main.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 67217ab68b..fe8285d2ce 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -54,33 +54,33 @@ #define STATS_BDR_STR(w, s) printf("%.*s%s%.*s\n", w, \ STATS_BDR_FMT, s, w, STATS_BDR_FMT) -/**< mask of enabled ports */ +/* mask of enabled ports */ static unsigned long enabled_port_mask; -/**< Enable stats. */ +/* Enable stats. */ static uint32_t enable_stats; -/**< Enable xstats. */ +/* Enable xstats. */ static uint32_t enable_xstats; -/**< Enable collectd format*/ +/* Enable collectd format */ static uint32_t enable_collectd_format; -/**< FD to send collectd format messages to STDOUT*/ +/* FD to send collectd format messages to STDOUT */ static int stdout_fd; -/**< Host id process is running on */ +/* Host id process is running on */ static char host_id[MAX_LONG_OPT_SZ]; #ifdef RTE_LIB_METRICS -/**< Enable metrics. */ +/* Enable metrics. */ static uint32_t enable_metrics; #endif -/**< Enable stats reset. */ +/* Enable stats reset. */ static uint32_t reset_stats; -/**< Enable xstats reset. */ +/* Enable xstats reset. */ static uint32_t reset_xstats; -/**< Enable memory info. */ +/* Enable memory info. */ static uint32_t mem_info; -/**< Enable displaying xstat name. */ +/* Enable displaying xstat name. */ static uint32_t enable_xstats_name; static char *xstats_name; -/**< Enable xstats by ids. */ +/* Enable xstats by ids. */ #define MAX_NB_XSTATS_IDS 1024 static uint32_t nb_xstats_ids; static uint64_t xstats_ids[MAX_NB_XSTATS_IDS]; @@ -88,24 +88,24 @@ static uint64_t xstats_ids[MAX_NB_XSTATS_IDS]; /* show border */ static char bdr_str[MAX_STRING_LEN]; -/**< Enable show port. */ +/* Enable show port. */ static uint32_t enable_shw_port; /* Enable show port private info. */ static uint32_t enable_shw_port_priv; -/**< Enable show tm. */ +/* Enable show tm. */ static uint32_t enable_shw_tm; -/**< Enable show crypto. */ +/* Enable show crypto. */ static uint32_t enable_shw_crypto; -/**< Enable show ring. */ +/* Enable show ring. */ static uint32_t enable_shw_ring; static char *ring_name; -/**< Enable show mempool. */ +/* Enable show mempool. */ static uint32_t enable_shw_mempool; static char *mempool_name; -/**< Enable iter mempool. */ +/* Enable iter mempool. */ static uint32_t enable_iter_mempool; static char *mempool_iter_name; -/**< Enable dump regs. */ +/* Enable dump regs. */ static uint32_t enable_dump_regs; static char *dump_regs_file_prefix; /* Enable show DPDK version. */ @@ -117,7 +117,7 @@ static uint32_t enable_shw_rss_reta; /* Enable show module eeprom information. */ static uint32_t enable_shw_module_eeprom; -/**< display usage */ +/* display usage */ static void proc_info_usage(const char *prgname) { -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v8 7/8] app/procinfo: support descriptor dump 2022-10-08 9:39 ` [PATCH v8 0/8] " Dongdong Liu ` (5 preceding siblings ...) 2022-10-08 9:39 ` [PATCH v8 6/8] app/procinfo: fix some wrong doxygen syntax Dongdong Liu @ 2022-10-08 9:39 ` Dongdong Liu 2022-10-08 9:39 ` [PATCH v8 8/8] doc: add some extended features in procinfo guide Dongdong Liu 7 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-10-08 9:39 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Dongdong Liu, Min Hu, Maryam Tahhan This patch support Rx/Tx descriptor dump The command is like: dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --show-rx-descriptor queue_id:offset:num dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --show-tx-descriptor queue_id:offset:num queue_id: A queue identifier on this port. offset: The offset of the descriptor starting from tail. num: The number of the descriptors to dump. Signed-off-by: Min Hu (Connor) <humin29@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> --- app/proc-info/main.c | 81 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index fe8285d2ce..1558f4b7d1 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -54,6 +54,9 @@ #define STATS_BDR_STR(w, s) printf("%.*s%s%.*s\n", w, \ STATS_BDR_FMT, s, w, STATS_BDR_FMT) +typedef int (*desc_dump_t)(uint16_t port_id, uint16_t queue_id, + uint16_t offset, uint16_t num, FILE *file); + /* mask of enabled ports */ static unsigned long enabled_port_mask; /* Enable stats. */ @@ -117,6 +120,21 @@ static uint32_t enable_shw_rss_reta; /* Enable show module eeprom information. */ static uint32_t enable_shw_module_eeprom; +/* Enable dump Rx/Tx descriptor. */ +static uint32_t enable_shw_rx_desc_dump; +static uint32_t enable_shw_tx_desc_dump; + +#define DESC_PARAM_NUM 3 + +struct desc_param { + uint16_t queue_id; /* A queue identifier on this port. */ + uint16_t offset; /* The offset of the descriptor starting from tail. */ + uint16_t num; /* The number of the descriptors to dump. */ +}; + +static struct desc_param rx_desc_param; +static struct desc_param tx_desc_param; + /* display usage */ static void proc_info_usage(const char *prgname) @@ -148,6 +166,14 @@ proc_info_usage(const char *prgname) " --firmware-version: to display ethdev firmware version\n" " --show-rss-reta: to display ports redirection table\n" " --show-module-eeprom: to display ports module eeprom information\n" + " --show-rx-descriptor queue_id:offset:num to display ports Rx descriptor information. " + "queue_id: A Rx queue identifier on this port. " + "offset: The offset of the descriptor starting from tail. " + "num: The number of the descriptors to dump.\n" + " --show-tx-descriptor queue_id:offset:num to display ports Tx descriptor information. " + "queue_id: A Tx queue identifier on this port. " + "offset: The offset of the descriptor starting from tail. " + "num: The number of the descriptors to dump.\n" " --iter-mempool=name: iterate mempool elements to display content\n" " --dump-regs=file-prefix: dump registers to file with the file-prefix\n", prgname); @@ -200,6 +226,20 @@ parse_xstats_ids(char *list, uint64_t *ids, int limit) { return length; } +static int +parse_descriptor_param(char *list, struct desc_param *desc) +{ + int ret; + + ret = sscanf(list, "%hu:%hu:%hu", &desc->queue_id, &desc->offset, + &desc->num); + if (ret != DESC_PARAM_NUM) { + return -EINVAL; + } + + return 0; +} + static int proc_info_preparse_args(int argc, char **argv) { @@ -264,6 +304,8 @@ proc_info_parse_args(int argc, char **argv) {"firmware-version", 0, NULL, 0}, {"show-rss-reta", 0, NULL, 0}, {"show-module-eeprom", 0, NULL, 0}, + {"show-rx-descriptor", required_argument, NULL, 1}, + {"show-tx-descriptor", required_argument, NULL, 1}, {NULL, 0, 0, 0} }; @@ -367,6 +409,24 @@ proc_info_parse_args(int argc, char **argv) return -1; } nb_xstats_ids = ret; + } else if (!strncmp(long_option[option_index].name, + "show-rx-descriptor", MAX_LONG_OPT_SZ)) { + int ret = parse_descriptor_param(optarg, + &rx_desc_param); + if (ret < 0) { + printf("Rx descriptor param parse error.\n"); + return -1; + } + enable_shw_rx_desc_dump = 1; + } else if (!strncmp(long_option[option_index].name, + "show-tx-descriptor", MAX_LONG_OPT_SZ)) { + int ret = parse_descriptor_param(optarg, + &tx_desc_param); + if (ret < 0) { + printf("Tx descriptor param parse error.\n"); + return -1; + } + enable_shw_tx_desc_dump = 1; } break; default: @@ -1644,6 +1704,21 @@ show_module_eeprom_info(void) } } +static void +nic_descriptor_display(uint16_t port_id, struct desc_param *desc, + desc_dump_t desc_dump) +{ + static const char *nic_desc_border = "###"; + uint16_t queue_id = desc->queue_id; + uint16_t offset = desc->offset; + uint16_t num = desc->num; + + printf("%s NIC descriptor for port %u %s\n", + nic_desc_border, port_id, nic_desc_border); + + desc_dump(port_id, queue_id, offset, num, stdout); +} + int main(int argc, char **argv) { @@ -1732,6 +1807,12 @@ main(int argc, char **argv) metrics_display(i); #endif + if (enable_shw_rx_desc_dump) + nic_descriptor_display(i, &rx_desc_param, + rte_eth_rx_descriptor_dump); + if (enable_shw_tx_desc_dump) + nic_descriptor_display(i, &tx_desc_param, + rte_eth_tx_descriptor_dump); } #ifdef RTE_LIB_METRICS -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v8 8/8] doc: add some extended features in procinfo guide 2022-10-08 9:39 ` [PATCH v8 0/8] " Dongdong Liu ` (6 preceding siblings ...) 2022-10-08 9:39 ` [PATCH v8 7/8] app/procinfo: support descriptor dump Dongdong Liu @ 2022-10-08 9:39 ` Dongdong Liu 7 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-10-08 9:39 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Dongdong Liu, Maryam Tahhan Add the below extended features in procinfo guide. --show-port-private --version --firmware-version --show-rss-reta --show-module-eeprom --show-rx-descriptor --show-tx-descriptor Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> Acked-by: Reshma Pattan <reshma.pattan@intel.com> --- doc/guides/tools/proc_info.rst | 36 ++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/doc/guides/tools/proc_info.rst b/doc/guides/tools/proc_info.rst index 9772d97ef0..ceb069f55e 100644 --- a/doc/guides/tools/proc_info.rst +++ b/doc/guides/tools/proc_info.rst @@ -17,9 +17,12 @@ The application has a number of command line options: .. code-block:: console - ./<build_dir>/app/dpdk-procinfo -- -m | [-p PORTMASK] [--stats | --xstats | + ./<build_dir>/app/dpdk-proc-info -- -m | [-p PORTMASK] [--stats | --xstats | --stats-reset | --xstats-reset] [ --show-port | --show-tm | --show-crypto | - --show-ring[=name] | --show-mempool[=name] | --iter-mempool=name ] + --show-ring[=name] | --show-mempool[=name] | --iter-mempool=name | + --show-port-private | --version | --firmware-version | --show-rss-reta | + --show-module-eeprom | --show-rx-descriptor queue_id:offset:num | + --show-rx-descriptor queue_id:offset:num] Parameters ~~~~~~~~~~ @@ -69,6 +72,35 @@ mempool. For invalid or no mempool name, whole list is dump. The iter-mempool parameter iterates and displays mempool elements specified by name. For invalid or no mempool name no elements are displayed. +**--show-port-private** +The show-port-private parameter displays ports private information. + +**--version** +The version parameter displays DPDK version. + +**--firmware-version** +The firmware-version parameter displays ethdev firmware version. + +**--show-rss-reta** +The show-rss-reta parameter displays ports rss redirection table. + +**--show-module-eeprom** +The show-module-eeprom parameter displays ports module eeprom information. + +**--show-rx-descriptor queue_id:offset:num** +The show-rx-descriptor parameter displays ports Rx descriptor information +specfied by queue_id, offset and num. +queue_id: A Rx queue identifier on this port. +offset: The offset of the descriptor starting from tail. +num: The number of the descriptors to dump. + +**--show-tx-descriptor queue_id:offset:num** +The show-tx-descriptor parameter displays ports Tx descriptor information +specfied by queue_id, offset and num. +queue_id: A Tx queue identifier on this port. +offset: The offset of the descriptor starting from tail. +num: The number of the descriptors to dump. + Limitations ----------- -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v9 0/8] app/procinfo: add some extended features 2022-07-22 9:12 [PATCH 0/6] app/procinfo: add some extended features Dongdong Liu ` (11 preceding siblings ...) 2022-10-08 9:39 ` [PATCH v8 0/8] " Dongdong Liu @ 2022-10-08 10:53 ` Dongdong Liu 2022-10-08 10:53 ` [PATCH v9 1/8] app/procinfo: add dpdk version dump Dongdong Liu ` (7 more replies) 2022-10-11 11:18 ` [PATCH v10 0/8] app/procinfo: add some extended features Dongdong Liu 13 siblings, 8 replies; 89+ messages in thread From: Dongdong Liu @ 2022-10-08 10:53 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko; +Cc: Dongdong Liu This patchset is to add some extended features for dpdk-proc-info. Thanks to Reshma and Stephen help to review the patchset. v8->v9: - Fixed some checkpatch warnings. v7(v4)->v8: - Add Acked-by: Reshma Pattan for PATCH 4,6. - Add Rx/Tx descriptor dump. - Adjust procinfo doc guide. v3->v4: - Add Acked-by: Reshma Pattan for PATCH 1,2,3,5,7. - Rename show-module-info to show-module-eeprom to make more clear. v2->v3: Fix some comments from Stephen. - Use --version option for DPDK version. - Add --firmware-version option to show firmware. - Use errors on stderr, not stdout. - Delete some unnecessary code. v1->v2: Fix some comments from Reshma. Dongdong Liu (4): app/procinfo: add firmware version dump app/procinfo: fix some wrong doxygen syntax app/procinfo: support descriptor dump doc: add some extended features in procinfo guide Jie Hai (1): app/procinfo: add dump of Rx/Tx burst mode Min Hu (Connor) (3): app/procinfo: add dpdk version dump app/procinfo: add RSS RETA dump app/procinfo: add module eeprom info dump app/proc-info/main.c | 300 ++++++++++++++++++++++++++++++--- doc/guides/tools/proc_info.rst | 36 +++- 2 files changed, 312 insertions(+), 24 deletions(-) -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v9 1/8] app/procinfo: add dpdk version dump 2022-10-08 10:53 ` [PATCH v9 0/8] app/procinfo: add some extended features Dongdong Liu @ 2022-10-08 10:53 ` Dongdong Liu 2022-10-08 10:53 ` [PATCH v9 2/8] app/procinfo: add firmware " Dongdong Liu ` (6 subsequent siblings) 7 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-10-08 10:53 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Min Hu (Connor), Dongdong Liu, Maryam Tahhan From: "Min Hu (Connor)" <humin29@huawei.com> Add support for dump dpdk version. The command is like: dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --version Signed-off-by: Min Hu (Connor) <humin29@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> Acked-by: Reshma Pattan <reshma.pattan@intel.com> --- app/proc-info/main.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index d52ac8a038..d459c706d1 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -39,6 +39,7 @@ #include <rte_cryptodev.h> #include <rte_tm.h> #include <rte_hexdump.h> +#include <rte_version.h> /* Maximum long option length for option parsing. */ #define MAX_LONG_OPT_SZ 64 @@ -102,6 +103,8 @@ static char *mempool_iter_name; /**< Enable dump regs. */ static uint32_t enable_dump_regs; static char *dump_regs_file_prefix; +/* Enable show DPDK version. */ +static uint32_t enable_shw_version; /**< display usage */ static void @@ -130,6 +133,7 @@ proc_info_usage(const char *prgname) " --show-crypto: to display crypto information\n" " --show-ring[=name]: to display ring information\n" " --show-mempool[=name]: to display mempool information\n" + " --version: to display DPDK version\n" " --iter-mempool=name: iterate mempool elements to display content\n" " --dump-regs=file-prefix: dump registers to file with the file-prefix\n", prgname); @@ -242,6 +246,7 @@ proc_info_parse_args(int argc, char **argv) {"show-mempool", optional_argument, NULL, 0}, {"iter-mempool", required_argument, NULL, 0}, {"dump-regs", required_argument, NULL, 0}, + {"version", 0, NULL, 0}, {NULL, 0, 0, 0} }; @@ -313,7 +318,9 @@ proc_info_parse_args(int argc, char **argv) "dump-regs", MAX_LONG_OPT_SZ)) { enable_dump_regs = 1; dump_regs_file_prefix = optarg; - } + } else if (!strncmp(long_option[option_index].name, + "version", MAX_LONG_OPT_SZ)) + enable_shw_version = 1; break; case 1: /* Print xstat single value given by name*/ @@ -1476,6 +1483,14 @@ dump_regs(char *file_prefix) } } +static void +show_version(void) +{ + snprintf(bdr_str, MAX_STRING_LEN, " show - DPDK version "); + STATS_BDR_STR(10, bdr_str); + printf("DPDK version: %s\n", rte_version()); +} + int main(int argc, char **argv) { @@ -1589,6 +1604,8 @@ main(int argc, char **argv) iter_mempool(mempool_iter_name); if (enable_dump_regs) dump_regs(dump_regs_file_prefix); + if (enable_shw_version) + show_version(); RTE_ETH_FOREACH_DEV(i) rte_eth_dev_close(i); -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v9 2/8] app/procinfo: add firmware version dump 2022-10-08 10:53 ` [PATCH v9 0/8] app/procinfo: add some extended features Dongdong Liu 2022-10-08 10:53 ` [PATCH v9 1/8] app/procinfo: add dpdk version dump Dongdong Liu @ 2022-10-08 10:53 ` Dongdong Liu 2022-10-08 10:53 ` [PATCH v9 3/8] app/procinfo: add RSS RETA dump Dongdong Liu ` (5 subsequent siblings) 7 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-10-08 10:53 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Dongdong Liu, Min Hu, Maryam Tahhan Add support for dump ethdev firmware version. The command is like: dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --firmware-version Signed-off-by: Min Hu (Connor) <humin29@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> Acked-by: Reshma Pattan <reshma.pattan@intel.com> --- app/proc-info/main.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index d459c706d1..7b407c47d0 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -45,6 +45,8 @@ #define MAX_LONG_OPT_SZ 64 #define MAX_STRING_LEN 256 +#define ETHDEV_FWVERS_LEN 32 + #define STATS_BDR_FMT "========================================" #define STATS_BDR_STR(w, s) printf("%.*s%s%.*s\n", w, \ STATS_BDR_FMT, s, w, STATS_BDR_FMT) @@ -105,6 +107,8 @@ static uint32_t enable_dump_regs; static char *dump_regs_file_prefix; /* Enable show DPDK version. */ static uint32_t enable_shw_version; +/* Enable show ethdev firmware version. */ +static uint32_t enable_shw_fw_version; /**< display usage */ static void @@ -134,6 +138,7 @@ proc_info_usage(const char *prgname) " --show-ring[=name]: to display ring information\n" " --show-mempool[=name]: to display mempool information\n" " --version: to display DPDK version\n" + " --firmware-version: to display ethdev firmware version\n" " --iter-mempool=name: iterate mempool elements to display content\n" " --dump-regs=file-prefix: dump registers to file with the file-prefix\n", prgname); @@ -247,6 +252,7 @@ proc_info_parse_args(int argc, char **argv) {"iter-mempool", required_argument, NULL, 0}, {"dump-regs", required_argument, NULL, 0}, {"version", 0, NULL, 0}, + {"firmware-version", 0, NULL, 0}, {NULL, 0, 0, 0} }; @@ -321,6 +327,9 @@ proc_info_parse_args(int argc, char **argv) } else if (!strncmp(long_option[option_index].name, "version", MAX_LONG_OPT_SZ)) enable_shw_version = 1; + else if (!strncmp(long_option[option_index].name, + "firmware-version", MAX_LONG_OPT_SZ)) + enable_shw_fw_version = 1; break; case 1: /* Print xstat single value given by name*/ @@ -1491,6 +1500,30 @@ show_version(void) printf("DPDK version: %s\n", rte_version()); } +static void +show_firmware_version(void) +{ + char fw_version[ETHDEV_FWVERS_LEN]; + uint16_t i; + + snprintf(bdr_str, MAX_STRING_LEN, " show - firmware version "); + 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; + + if (rte_eth_dev_fw_version_get(i, fw_version, + ETHDEV_FWVERS_LEN) == 0) + printf("Ethdev port %u firmware version: %s\n", i, + fw_version); + else + printf("Ethdev port %u firmware version: %s\n", i, + "not available"); + } +} + int main(int argc, char **argv) { @@ -1606,6 +1639,8 @@ main(int argc, char **argv) dump_regs(dump_regs_file_prefix); if (enable_shw_version) show_version(); + if (enable_shw_fw_version) + show_firmware_version(); RTE_ETH_FOREACH_DEV(i) rte_eth_dev_close(i); -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v9 3/8] app/procinfo: add RSS RETA dump 2022-10-08 10:53 ` [PATCH v9 0/8] app/procinfo: add some extended features Dongdong Liu 2022-10-08 10:53 ` [PATCH v9 1/8] app/procinfo: add dpdk version dump Dongdong Liu 2022-10-08 10:53 ` [PATCH v9 2/8] app/procinfo: add firmware " Dongdong Liu @ 2022-10-08 10:53 ` Dongdong Liu 2022-10-08 10:53 ` [PATCH v9 4/8] app/procinfo: add module eeprom info dump Dongdong Liu ` (4 subsequent siblings) 7 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-10-08 10:53 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Min Hu (Connor), Dongdong Liu, Maryam Tahhan From: "Min Hu (Connor)" <humin29@huawei.com> This patch add support for RSS reta dump. The command is like: dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --show-rss-reta Signed-off-by: Min Hu (Connor) <humin29@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> Acked-by: Reshma Pattan <reshma.pattan@intel.com> --- app/proc-info/main.c | 57 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 7b407c47d0..4021279b17 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -46,6 +46,8 @@ #define MAX_STRING_LEN 256 #define ETHDEV_FWVERS_LEN 32 +#define RTE_RETA_CONF_GROUP_NUM 32 +#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) #define STATS_BDR_FMT "========================================" #define STATS_BDR_STR(w, s) printf("%.*s%s%.*s\n", w, \ @@ -109,6 +111,8 @@ static char *dump_regs_file_prefix; static uint32_t enable_shw_version; /* Enable show ethdev firmware version. */ static uint32_t enable_shw_fw_version; +/* Enable show RSS reta. */ +static uint32_t enable_shw_rss_reta; /**< display usage */ static void @@ -139,6 +143,7 @@ proc_info_usage(const char *prgname) " --show-mempool[=name]: to display mempool information\n" " --version: to display DPDK version\n" " --firmware-version: to display ethdev firmware version\n" + " --show-rss-reta: to display ports redirection table\n" " --iter-mempool=name: iterate mempool elements to display content\n" " --dump-regs=file-prefix: dump registers to file with the file-prefix\n", prgname); @@ -253,6 +258,7 @@ proc_info_parse_args(int argc, char **argv) {"dump-regs", required_argument, NULL, 0}, {"version", 0, NULL, 0}, {"firmware-version", 0, NULL, 0}, + {"show-rss-reta", 0, NULL, 0}, {NULL, 0, 0, 0} }; @@ -330,6 +336,9 @@ proc_info_parse_args(int argc, char **argv) else if (!strncmp(long_option[option_index].name, "firmware-version", MAX_LONG_OPT_SZ)) enable_shw_fw_version = 1; + else if (!strncmp(long_option[option_index].name, + "show-rss-reta", MAX_LONG_OPT_SZ)) + enable_shw_rss_reta = 1; break; case 1: /* Print xstat single value given by name*/ @@ -1524,6 +1533,52 @@ show_firmware_version(void) } } +static void +show_port_rss_reta_info(void) +{ + struct rte_eth_rss_reta_entry64 reta_conf[RTE_RETA_CONF_GROUP_NUM + 1]; + struct rte_eth_dev_info dev_info; + uint16_t i, idx, shift; + uint16_t num; + uint16_t id; + int ret; + + RTE_ETH_FOREACH_DEV(id) { + /* Skip if port is not in mask */ + if ((enabled_port_mask & (1ul << id)) == 0) + continue; + + snprintf(bdr_str, MAX_STRING_LEN, " Port %u ", id); + STATS_BDR_STR(5, bdr_str); + + ret = rte_eth_dev_info_get(id, &dev_info); + if (ret != 0) { + fprintf(stderr, "Error getting device info: %s\n", + strerror(-ret)); + return; + } + + num = DIV_ROUND_UP(dev_info.reta_size, RTE_ETH_RETA_GROUP_SIZE); + memset(reta_conf, 0, sizeof(reta_conf)); + for (i = 0; i < num; i++) + reta_conf[i].mask = ~0ULL; + + ret = rte_eth_dev_rss_reta_query(id, reta_conf, dev_info.reta_size); + if (ret != 0) { + fprintf(stderr, "Error getting RSS RETA info: %s\n", + strerror(-ret)); + return; + } + + for (i = 0; i < dev_info.reta_size; i++) { + idx = i / RTE_ETH_RETA_GROUP_SIZE; + shift = i % RTE_ETH_RETA_GROUP_SIZE; + printf("RSS RETA configuration: hash index=%u, queue=%u\n", + i, reta_conf[idx].reta[shift]); + } + } +} + int main(int argc, char **argv) { @@ -1641,6 +1696,8 @@ main(int argc, char **argv) show_version(); if (enable_shw_fw_version) show_firmware_version(); + if (enable_shw_rss_reta) + show_port_rss_reta_info(); RTE_ETH_FOREACH_DEV(i) rte_eth_dev_close(i); -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v9 4/8] app/procinfo: add module eeprom info dump 2022-10-08 10:53 ` [PATCH v9 0/8] app/procinfo: add some extended features Dongdong Liu ` (2 preceding siblings ...) 2022-10-08 10:53 ` [PATCH v9 3/8] app/procinfo: add RSS RETA dump Dongdong Liu @ 2022-10-08 10:53 ` Dongdong Liu 2022-10-08 10:53 ` [PATCH v9 5/8] app/procinfo: add dump of Rx/Tx burst mode Dongdong Liu ` (3 subsequent siblings) 7 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-10-08 10:53 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Min Hu (Connor), Dongdong Liu, Maryam Tahhan From: "Min Hu (Connor)" <humin29@huawei.com> This patch add support for module eeprom info dump. The command is like: dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --show-module-eeprom Signed-off-by: Min Hu (Connor) <humin29@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> Acked-by: Reshma Pattan <reshma.pattan@intel.com> --- app/proc-info/main.c | 52 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 4021279b17..90e7e41e38 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -48,6 +48,7 @@ #define ETHDEV_FWVERS_LEN 32 #define RTE_RETA_CONF_GROUP_NUM 32 #define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) +#define EEPROM_DUMP_CHUNKSIZE 1024 #define STATS_BDR_FMT "========================================" #define STATS_BDR_STR(w, s) printf("%.*s%s%.*s\n", w, \ @@ -113,6 +114,8 @@ static uint32_t enable_shw_version; static uint32_t enable_shw_fw_version; /* Enable show RSS reta. */ static uint32_t enable_shw_rss_reta; +/* Enable show module eeprom information. */ +static uint32_t enable_shw_module_eeprom; /**< display usage */ static void @@ -144,6 +147,7 @@ proc_info_usage(const char *prgname) " --version: to display DPDK version\n" " --firmware-version: to display ethdev firmware version\n" " --show-rss-reta: to display ports redirection table\n" + " --show-module-eeprom: to display ports module eeprom information\n" " --iter-mempool=name: iterate mempool elements to display content\n" " --dump-regs=file-prefix: dump registers to file with the file-prefix\n", prgname); @@ -259,6 +263,7 @@ proc_info_parse_args(int argc, char **argv) {"version", 0, NULL, 0}, {"firmware-version", 0, NULL, 0}, {"show-rss-reta", 0, NULL, 0}, + {"show-module-eeprom", 0, NULL, 0}, {NULL, 0, 0, 0} }; @@ -339,6 +344,9 @@ proc_info_parse_args(int argc, char **argv) else if (!strncmp(long_option[option_index].name, "show-rss-reta", MAX_LONG_OPT_SZ)) enable_shw_rss_reta = 1; + else if (!strncmp(long_option[option_index].name, + "show-module-eeprom", MAX_LONG_OPT_SZ)) + enable_shw_module_eeprom = 1; break; case 1: /* Print xstat single value given by name*/ @@ -1579,6 +1587,48 @@ show_port_rss_reta_info(void) } } +static void +show_module_eeprom_info(void) +{ + unsigned char bytes_eeprom[EEPROM_DUMP_CHUNKSIZE]; + struct rte_eth_dev_module_info module_info; + struct rte_dev_eeprom_info eeprom_info; + uint16_t i; + int ret; + + 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); + + ret = rte_eth_dev_get_module_info(i, &module_info); + if (ret != 0) { + fprintf(stderr, "Module EEPROM information read error: %s\n", + strerror(-ret)); + return; + } + + eeprom_info.offset = 0; + eeprom_info.length = module_info.eeprom_len; + eeprom_info.data = bytes_eeprom; + + ret = rte_eth_dev_get_module_eeprom(i, &eeprom_info); + if (ret != 0) { + fprintf(stderr, "Module EEPROM read error: %s\n", + strerror(-ret)); + return; + } + + rte_hexdump(stdout, "hexdump", eeprom_info.data, + eeprom_info.length); + printf("Finish -- Port: %u MODULE EEPROM length: %d bytes\n", + i, eeprom_info.length); + } +} + int main(int argc, char **argv) { @@ -1698,6 +1748,8 @@ main(int argc, char **argv) show_firmware_version(); if (enable_shw_rss_reta) show_port_rss_reta_info(); + if (enable_shw_module_eeprom) + show_module_eeprom_info(); RTE_ETH_FOREACH_DEV(i) rte_eth_dev_close(i); -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v9 5/8] app/procinfo: add dump of Rx/Tx burst mode 2022-10-08 10:53 ` [PATCH v9 0/8] app/procinfo: add some extended features Dongdong Liu ` (3 preceding siblings ...) 2022-10-08 10:53 ` [PATCH v9 4/8] app/procinfo: add module eeprom info dump Dongdong Liu @ 2022-10-08 10:53 ` Dongdong Liu 2022-10-08 10:53 ` [PATCH v9 6/8] app/procinfo: fix some wrong doxygen syntax Dongdong Liu ` (2 subsequent siblings) 7 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-10-08 10:53 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Jie Hai, Dongdong Liu, Maryam Tahhan From: Jie Hai <haijie1@huawei.com> Add dump of Rx/Tx burst mode in --show-port. Sample output changes: - rx queue - -- 0 descriptors 0/1024 drop_en rx buffer size 2048 \ mempool mb_pool_0 socket 0 + -- 0 descriptors 0/1024 drop_en rx buffer size 2048 \ mempool mb_pool_0 socket 0 burst mode : Vector Neon - tx queue - -- 0 descriptors 1024 thresh 32/928 \ offloads : MBUF_FAST_FREE + -- 0 descriptors 1024 thresh 32/928 \ offloads : MBUF_FAST_FREE burst mode : Scalar Signed-off-by: Jie Hai <haijie1@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> Acked-by: Reshma Pattan <reshma.pattan@intel.com> --- app/proc-info/main.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 90e7e41e38..67217ab68b 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -845,6 +845,7 @@ show_port(void) for (j = 0; j < dev_info.nb_rx_queues; j++) { struct rte_eth_rxq_info queue_info; + struct rte_eth_burst_mode mode; int count; ret = rte_eth_rx_queue_info_get(i, j, &queue_info); @@ -880,11 +881,18 @@ show_port(void) if (queue_info.conf.offloads != 0) show_offloads(queue_info.conf.offloads, rte_eth_dev_rx_offload_name); + if (rte_eth_rx_burst_mode_get(i, j, &mode) == 0) + printf(" burst mode : %s%s", + mode.info, + mode.flags & RTE_ETH_BURST_FLAG_PER_QUEUE ? + " (per queue)" : ""); + printf("\n"); } for (j = 0; j < dev_info.nb_tx_queues; j++) { struct rte_eth_txq_info queue_info; + struct rte_eth_burst_mode mode; ret = rte_eth_tx_queue_info_get(i, j, &queue_info); if (ret != 0) @@ -905,6 +913,13 @@ show_port(void) if (queue_info.conf.offloads != 0) show_offloads(queue_info.conf.offloads, rte_eth_dev_tx_offload_name); + + if (rte_eth_tx_burst_mode_get(i, j, &mode) == 0) + printf(" burst mode : %s%s", + mode.info, + mode.flags & RTE_ETH_BURST_FLAG_PER_QUEUE ? + " (per queue)" : ""); + printf("\n"); } -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v9 6/8] app/procinfo: fix some wrong doxygen syntax 2022-10-08 10:53 ` [PATCH v9 0/8] app/procinfo: add some extended features Dongdong Liu ` (4 preceding siblings ...) 2022-10-08 10:53 ` [PATCH v9 5/8] app/procinfo: add dump of Rx/Tx burst mode Dongdong Liu @ 2022-10-08 10:53 ` Dongdong Liu 2022-10-08 10:53 ` [PATCH v9 7/8] app/procinfo: support descriptor dump Dongdong Liu 2022-10-08 10:53 ` [PATCH v9 8/8] doc: add some extended features in procinfo guide Dongdong Liu 7 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-10-08 10:53 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Dongdong Liu, Maryam Tahhan This code is to do cleanup for the wrong doxygen syntax comments The DPDK API is documented using doxygen comment annotations in the header files. The procinfo code seems no need to use doxygen comment. Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> Acked-by: Reshma Pattan <reshma.pattan@intel.com> --- app/proc-info/main.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 67217ab68b..fe8285d2ce 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -54,33 +54,33 @@ #define STATS_BDR_STR(w, s) printf("%.*s%s%.*s\n", w, \ STATS_BDR_FMT, s, w, STATS_BDR_FMT) -/**< mask of enabled ports */ +/* mask of enabled ports */ static unsigned long enabled_port_mask; -/**< Enable stats. */ +/* Enable stats. */ static uint32_t enable_stats; -/**< Enable xstats. */ +/* Enable xstats. */ static uint32_t enable_xstats; -/**< Enable collectd format*/ +/* Enable collectd format */ static uint32_t enable_collectd_format; -/**< FD to send collectd format messages to STDOUT*/ +/* FD to send collectd format messages to STDOUT */ static int stdout_fd; -/**< Host id process is running on */ +/* Host id process is running on */ static char host_id[MAX_LONG_OPT_SZ]; #ifdef RTE_LIB_METRICS -/**< Enable metrics. */ +/* Enable metrics. */ static uint32_t enable_metrics; #endif -/**< Enable stats reset. */ +/* Enable stats reset. */ static uint32_t reset_stats; -/**< Enable xstats reset. */ +/* Enable xstats reset. */ static uint32_t reset_xstats; -/**< Enable memory info. */ +/* Enable memory info. */ static uint32_t mem_info; -/**< Enable displaying xstat name. */ +/* Enable displaying xstat name. */ static uint32_t enable_xstats_name; static char *xstats_name; -/**< Enable xstats by ids. */ +/* Enable xstats by ids. */ #define MAX_NB_XSTATS_IDS 1024 static uint32_t nb_xstats_ids; static uint64_t xstats_ids[MAX_NB_XSTATS_IDS]; @@ -88,24 +88,24 @@ static uint64_t xstats_ids[MAX_NB_XSTATS_IDS]; /* show border */ static char bdr_str[MAX_STRING_LEN]; -/**< Enable show port. */ +/* Enable show port. */ static uint32_t enable_shw_port; /* Enable show port private info. */ static uint32_t enable_shw_port_priv; -/**< Enable show tm. */ +/* Enable show tm. */ static uint32_t enable_shw_tm; -/**< Enable show crypto. */ +/* Enable show crypto. */ static uint32_t enable_shw_crypto; -/**< Enable show ring. */ +/* Enable show ring. */ static uint32_t enable_shw_ring; static char *ring_name; -/**< Enable show mempool. */ +/* Enable show mempool. */ static uint32_t enable_shw_mempool; static char *mempool_name; -/**< Enable iter mempool. */ +/* Enable iter mempool. */ static uint32_t enable_iter_mempool; static char *mempool_iter_name; -/**< Enable dump regs. */ +/* Enable dump regs. */ static uint32_t enable_dump_regs; static char *dump_regs_file_prefix; /* Enable show DPDK version. */ @@ -117,7 +117,7 @@ static uint32_t enable_shw_rss_reta; /* Enable show module eeprom information. */ static uint32_t enable_shw_module_eeprom; -/**< display usage */ +/* display usage */ static void proc_info_usage(const char *prgname) { -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v9 7/8] app/procinfo: support descriptor dump 2022-10-08 10:53 ` [PATCH v9 0/8] app/procinfo: add some extended features Dongdong Liu ` (5 preceding siblings ...) 2022-10-08 10:53 ` [PATCH v9 6/8] app/procinfo: fix some wrong doxygen syntax Dongdong Liu @ 2022-10-08 10:53 ` Dongdong Liu 2022-10-10 9:08 ` Pattan, Reshma 2022-10-08 10:53 ` [PATCH v9 8/8] doc: add some extended features in procinfo guide Dongdong Liu 7 siblings, 1 reply; 89+ messages in thread From: Dongdong Liu @ 2022-10-08 10:53 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Dongdong Liu, Min Hu, Maryam Tahhan This patch support Rx/Tx descriptor dump The command is like: dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --show-rx-descriptor queue_id:offset:num dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --show-tx-descriptor queue_id:offset:num queue_id: A queue identifier on this port. offset: The offset of the descriptor starting from tail. num: The number of the descriptors to dump. Signed-off-by: Min Hu (Connor) <humin29@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> --- app/proc-info/main.c | 80 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index fe8285d2ce..3ab97a0127 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -54,6 +54,9 @@ #define STATS_BDR_STR(w, s) printf("%.*s%s%.*s\n", w, \ STATS_BDR_FMT, s, w, STATS_BDR_FMT) +typedef int (*desc_dump_t)(uint16_t port_id, uint16_t queue_id, + uint16_t offset, uint16_t num, FILE *file); + /* mask of enabled ports */ static unsigned long enabled_port_mask; /* Enable stats. */ @@ -117,6 +120,21 @@ static uint32_t enable_shw_rss_reta; /* Enable show module eeprom information. */ static uint32_t enable_shw_module_eeprom; +/* Enable dump Rx/Tx descriptor. */ +static uint32_t enable_shw_rx_desc_dump; +static uint32_t enable_shw_tx_desc_dump; + +#define DESC_PARAM_NUM 3 + +struct desc_param { + uint16_t queue_id; /* A queue identifier on this port. */ + uint16_t offset; /* The offset of the descriptor starting from tail. */ + uint16_t num; /* The number of the descriptors to dump. */ +}; + +static struct desc_param rx_desc_param; +static struct desc_param tx_desc_param; + /* display usage */ static void proc_info_usage(const char *prgname) @@ -148,6 +166,14 @@ proc_info_usage(const char *prgname) " --firmware-version: to display ethdev firmware version\n" " --show-rss-reta: to display ports redirection table\n" " --show-module-eeprom: to display ports module eeprom information\n" + " --show-rx-descriptor queue_id:offset:num to display ports Rx descriptor information. " + "queue_id: A Rx queue identifier on this port. " + "offset: The offset of the descriptor starting from tail. " + "num: The number of the descriptors to dump.\n" + " --show-tx-descriptor queue_id:offset:num to display ports Tx descriptor information. " + "queue_id: A Tx queue identifier on this port. " + "offset: The offset of the descriptor starting from tail. " + "num: The number of the descriptors to dump.\n" " --iter-mempool=name: iterate mempool elements to display content\n" " --dump-regs=file-prefix: dump registers to file with the file-prefix\n", prgname); @@ -200,6 +226,19 @@ parse_xstats_ids(char *list, uint64_t *ids, int limit) { return length; } +static int +parse_descriptor_param(char *list, struct desc_param *desc) +{ + int ret; + + ret = sscanf(list, "%hu:%hu:%hu", &desc->queue_id, &desc->offset, + &desc->num); + if (ret != DESC_PARAM_NUM) + return -EINVAL; + + return 0; +} + static int proc_info_preparse_args(int argc, char **argv) { @@ -264,6 +303,8 @@ proc_info_parse_args(int argc, char **argv) {"firmware-version", 0, NULL, 0}, {"show-rss-reta", 0, NULL, 0}, {"show-module-eeprom", 0, NULL, 0}, + {"show-rx-descriptor", required_argument, NULL, 1}, + {"show-tx-descriptor", required_argument, NULL, 1}, {NULL, 0, 0, 0} }; @@ -367,6 +408,24 @@ proc_info_parse_args(int argc, char **argv) return -1; } nb_xstats_ids = ret; + } else if (!strncmp(long_option[option_index].name, + "show-rx-descriptor", MAX_LONG_OPT_SZ)) { + int ret = parse_descriptor_param(optarg, + &rx_desc_param); + if (ret < 0) { + printf("Rx descriptor param parse error.\n"); + return -1; + } + enable_shw_rx_desc_dump = 1; + } else if (!strncmp(long_option[option_index].name, + "show-tx-descriptor", MAX_LONG_OPT_SZ)) { + int ret = parse_descriptor_param(optarg, + &tx_desc_param); + if (ret < 0) { + printf("Tx descriptor param parse error.\n"); + return -1; + } + enable_shw_tx_desc_dump = 1; } break; default: @@ -1644,6 +1703,21 @@ show_module_eeprom_info(void) } } +static void +nic_descriptor_display(uint16_t port_id, struct desc_param *desc, + desc_dump_t desc_dump) +{ + static const char *nic_desc_border = "###"; + uint16_t queue_id = desc->queue_id; + uint16_t offset = desc->offset; + uint16_t num = desc->num; + + printf("%s NIC descriptor for port %u %s\n", + nic_desc_border, port_id, nic_desc_border); + + desc_dump(port_id, queue_id, offset, num, stdout); +} + int main(int argc, char **argv) { @@ -1732,6 +1806,12 @@ main(int argc, char **argv) metrics_display(i); #endif + if (enable_shw_rx_desc_dump) + nic_descriptor_display(i, &rx_desc_param, + rte_eth_rx_descriptor_dump); + if (enable_shw_tx_desc_dump) + nic_descriptor_display(i, &tx_desc_param, + rte_eth_tx_descriptor_dump); } #ifdef RTE_LIB_METRICS -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* RE: [PATCH v9 7/8] app/procinfo: support descriptor dump 2022-10-08 10:53 ` [PATCH v9 7/8] app/procinfo: support descriptor dump Dongdong Liu @ 2022-10-10 9:08 ` Pattan, Reshma 2022-10-10 13:13 ` Dongdong Liu 0 siblings, 1 reply; 89+ messages in thread From: Pattan, Reshma @ 2022-10-10 9:08 UTC (permalink / raw) To: Dongdong Liu, dev, thomas, ferruh.yigit, andrew.rybchenko Cc: Min Hu, Maryam Tahhan > -----Original Message----- > From: Dongdong Liu <liudongdong3@huawei.com> > +static void > +nic_descriptor_display(uint16_t port_id, struct desc_param *desc, > + desc_dump_t desc_dump) > +{ > + static const char *nic_desc_border = "###"; > + uint16_t queue_id = desc->queue_id; > + uint16_t offset = desc->offset; > + uint16_t num = desc->num; > + > + printf("%s NIC descriptor for port %u %s\n", > + nic_desc_border, port_id, nic_desc_border); > + > + desc_dump(port_id, queue_id, offset, num, stdout); } > + > int > main(int argc, char **argv) > { > @@ -1732,6 +1806,12 @@ main(int argc, char **argv) > metrics_display(i); > #endif > > + if (enable_shw_rx_desc_dump) > + nic_descriptor_display(i, &rx_desc_param, > + rte_eth_rx_descriptor_dump); I don't think you need the function nic_descriptor_display() to dump the descriptors. You can call the rte_eth_rx_descriptor_dump() directly here. And same comment for below code too. This way you can have the RX/TX descriptor scase specific dump printfs in these sections. Also, the printf in the nic_descriptor_display() is not telling if your dumping TX descriptors or Rx descriptors. If you want to keep nic_descriptor_display() that's fine but you need to make sure printf to be RX/TX specific. > + if (enable_shw_tx_desc_dump) > + nic_descriptor_display(i, &tx_desc_param, > + rte_eth_tx_descriptor_dump); > } > > #ifdef RTE_LIB_METRICS > -- > 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* Re: [PATCH v9 7/8] app/procinfo: support descriptor dump 2022-10-10 9:08 ` Pattan, Reshma @ 2022-10-10 13:13 ` Dongdong Liu 0 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-10-10 13:13 UTC (permalink / raw) To: Pattan, Reshma, dev, thomas, ferruh.yigit, andrew.rybchenko Cc: Min Hu, Maryam Tahhan Hi Reshma Many thanks for your review. On 2022/10/10 17:08, Pattan, Reshma wrote: > > >> -----Original Message----- >> From: Dongdong Liu <liudongdong3@huawei.com> >> +static void >> +nic_descriptor_display(uint16_t port_id, struct desc_param *desc, >> + desc_dump_t desc_dump) >> +{ >> + static const char *nic_desc_border = "###"; >> + uint16_t queue_id = desc->queue_id; >> + uint16_t offset = desc->offset; >> + uint16_t num = desc->num; >> + >> + printf("%s NIC descriptor for port %u %s\n", >> + nic_desc_border, port_id, nic_desc_border); >> + >> + desc_dump(port_id, queue_id, offset, num, stdout); } >> + > > >> int >> main(int argc, char **argv) >> { >> @@ -1732,6 +1806,12 @@ main(int argc, char **argv) >> metrics_display(i); >> #endif >> >> + if (enable_shw_rx_desc_dump) >> + nic_descriptor_display(i, &rx_desc_param, >> + rte_eth_rx_descriptor_dump); > > I don't think you need the function nic_descriptor_display() to dump the descriptors. > You can call the rte_eth_rx_descriptor_dump() directly here. And same comment for below code too. > This way you can have the RX/TX descriptor scase specific dump printfs in these sections. > Also, the printf in the nic_descriptor_display() is not telling if your dumping TX descriptors or Rx descriptors. > If you want to keep nic_descriptor_display() that's fine but you need to make sure printf to be RX/TX specific. Good point, will do. Thanks, Dongdong > >> + if (enable_shw_tx_desc_dump) >> + nic_descriptor_display(i, &tx_desc_param, >> + rte_eth_tx_descriptor_dump); >> } >> >> #ifdef RTE_LIB_METRICS >> -- >> 2.22.0 > > . > ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v9 8/8] doc: add some extended features in procinfo guide 2022-10-08 10:53 ` [PATCH v9 0/8] app/procinfo: add some extended features Dongdong Liu ` (6 preceding siblings ...) 2022-10-08 10:53 ` [PATCH v9 7/8] app/procinfo: support descriptor dump Dongdong Liu @ 2022-10-08 10:53 ` Dongdong Liu 7 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-10-08 10:53 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Dongdong Liu, Maryam Tahhan Add the below extended features in procinfo guide. --show-port-private --version --firmware-version --show-rss-reta --show-module-eeprom --show-rx-descriptor --show-tx-descriptor Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> Acked-by: Reshma Pattan <reshma.pattan@intel.com> --- doc/guides/tools/proc_info.rst | 36 ++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/doc/guides/tools/proc_info.rst b/doc/guides/tools/proc_info.rst index 9772d97ef0..ad70bc47a5 100644 --- a/doc/guides/tools/proc_info.rst +++ b/doc/guides/tools/proc_info.rst @@ -17,9 +17,12 @@ The application has a number of command line options: .. code-block:: console - ./<build_dir>/app/dpdk-procinfo -- -m | [-p PORTMASK] [--stats | --xstats | + ./<build_dir>/app/dpdk-proc-info -- -m | [-p PORTMASK] [--stats | --xstats | --stats-reset | --xstats-reset] [ --show-port | --show-tm | --show-crypto | - --show-ring[=name] | --show-mempool[=name] | --iter-mempool=name ] + --show-ring[=name] | --show-mempool[=name] | --iter-mempool=name | + --show-port-private | --version | --firmware-version | --show-rss-reta | + --show-module-eeprom | --show-rx-descriptor queue_id:offset:num | + --show-tx-descriptor queue_id:offset:num] Parameters ~~~~~~~~~~ @@ -69,6 +72,35 @@ mempool. For invalid or no mempool name, whole list is dump. The iter-mempool parameter iterates and displays mempool elements specified by name. For invalid or no mempool name no elements are displayed. +**--show-port-private** +The show-port-private parameter displays ports private information. + +**--version** +The version parameter displays DPDK version. + +**--firmware-version** +The firmware-version parameter displays ethdev firmware version. + +**--show-rss-reta** +The show-rss-reta parameter displays ports rss redirection table. + +**--show-module-eeprom** +The show-module-eeprom parameter displays ports module eeprom information. + +**--show-rx-descriptor queue_id:offset:num** +The show-rx-descriptor parameter displays ports Rx descriptor information +specified by queue_id, offset and num. +queue_id: A Rx queue identifier on this port. +offset: The offset of the descriptor starting from tail. +num: The number of the descriptors to dump. + +**--show-tx-descriptor queue_id:offset:num** +The show-tx-descriptor parameter displays ports Tx descriptor information +specified by queue_id, offset and num. +queue_id: A Tx queue identifier on this port. +offset: The offset of the descriptor starting from tail. +num: The number of the descriptors to dump. + Limitations ----------- -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v10 0/8] app/procinfo: add some extended features 2022-07-22 9:12 [PATCH 0/6] app/procinfo: add some extended features Dongdong Liu ` (12 preceding siblings ...) 2022-10-08 10:53 ` [PATCH v9 0/8] app/procinfo: add some extended features Dongdong Liu @ 2022-10-11 11:18 ` Dongdong Liu 2022-10-11 11:18 ` [PATCH v10 1/8] app/procinfo: add dpdk version dump Dongdong Liu ` (10 more replies) 13 siblings, 11 replies; 89+ messages in thread From: Dongdong Liu @ 2022-10-11 11:18 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko; +Cc: Dongdong Liu This patchset is to add some extended features for dpdk-proc-info. Thanks to Reshma and Stephen help to review the patchset. v9->v10: - Fix some comments for Rx/Tx descriptor dump. v8->v9: - Fixed some checkpatch warnings. v7(v4)->v8: - Add Acked-by: Reshma Pattan for PATCH 4,6. - Add Rx/Tx descriptor dump. - Adjust procinfo doc guide. v3->v4: - Add Acked-by: Reshma Pattan for PATCH 1,2,3,5,7. - Rename show-module-info to show-module-eeprom to make more clear. v2->v3: Fix some comments from Stephen. - Use --version option for DPDK version. - Add --firmware-version option to show firmware. - Use errors on stderr, not stdout. - Delete some unnecessary code. v1->v2: Fix some comments from Reshma. Dongdong Liu (4): app/procinfo: add firmware version dump app/procinfo: fix some wrong doxygen syntax app/procinfo: support descriptor dump doc: add some extended features in procinfo guide Jie Hai (1): app/procinfo: add dump of Rx/Tx burst mode Min Hu (Connor) (3): app/procinfo: add dpdk version dump app/procinfo: add RSS RETA dump app/procinfo: add module eeprom info dump app/proc-info/main.c | 324 ++++++++++++++++++++++++++++++--- doc/guides/tools/proc_info.rst | 36 +++- 2 files changed, 336 insertions(+), 24 deletions(-) -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v10 1/8] app/procinfo: add dpdk version dump 2022-10-11 11:18 ` [PATCH v10 0/8] app/procinfo: add some extended features Dongdong Liu @ 2022-10-11 11:18 ` Dongdong Liu 2022-10-11 11:18 ` [PATCH v10 2/8] app/procinfo: add firmware " Dongdong Liu ` (9 subsequent siblings) 10 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-10-11 11:18 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Min Hu (Connor), Dongdong Liu, Maryam Tahhan From: "Min Hu (Connor)" <humin29@huawei.com> Add support for dump dpdk version. The command is like: dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --version Signed-off-by: Min Hu (Connor) <humin29@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> Acked-by: Reshma Pattan <reshma.pattan@intel.com> --- app/proc-info/main.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index d52ac8a038..d459c706d1 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -39,6 +39,7 @@ #include <rte_cryptodev.h> #include <rte_tm.h> #include <rte_hexdump.h> +#include <rte_version.h> /* Maximum long option length for option parsing. */ #define MAX_LONG_OPT_SZ 64 @@ -102,6 +103,8 @@ static char *mempool_iter_name; /**< Enable dump regs. */ static uint32_t enable_dump_regs; static char *dump_regs_file_prefix; +/* Enable show DPDK version. */ +static uint32_t enable_shw_version; /**< display usage */ static void @@ -130,6 +133,7 @@ proc_info_usage(const char *prgname) " --show-crypto: to display crypto information\n" " --show-ring[=name]: to display ring information\n" " --show-mempool[=name]: to display mempool information\n" + " --version: to display DPDK version\n" " --iter-mempool=name: iterate mempool elements to display content\n" " --dump-regs=file-prefix: dump registers to file with the file-prefix\n", prgname); @@ -242,6 +246,7 @@ proc_info_parse_args(int argc, char **argv) {"show-mempool", optional_argument, NULL, 0}, {"iter-mempool", required_argument, NULL, 0}, {"dump-regs", required_argument, NULL, 0}, + {"version", 0, NULL, 0}, {NULL, 0, 0, 0} }; @@ -313,7 +318,9 @@ proc_info_parse_args(int argc, char **argv) "dump-regs", MAX_LONG_OPT_SZ)) { enable_dump_regs = 1; dump_regs_file_prefix = optarg; - } + } else if (!strncmp(long_option[option_index].name, + "version", MAX_LONG_OPT_SZ)) + enable_shw_version = 1; break; case 1: /* Print xstat single value given by name*/ @@ -1476,6 +1483,14 @@ dump_regs(char *file_prefix) } } +static void +show_version(void) +{ + snprintf(bdr_str, MAX_STRING_LEN, " show - DPDK version "); + STATS_BDR_STR(10, bdr_str); + printf("DPDK version: %s\n", rte_version()); +} + int main(int argc, char **argv) { @@ -1589,6 +1604,8 @@ main(int argc, char **argv) iter_mempool(mempool_iter_name); if (enable_dump_regs) dump_regs(dump_regs_file_prefix); + if (enable_shw_version) + show_version(); RTE_ETH_FOREACH_DEV(i) rte_eth_dev_close(i); -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v10 2/8] app/procinfo: add firmware version dump 2022-10-11 11:18 ` [PATCH v10 0/8] app/procinfo: add some extended features Dongdong Liu 2022-10-11 11:18 ` [PATCH v10 1/8] app/procinfo: add dpdk version dump Dongdong Liu @ 2022-10-11 11:18 ` Dongdong Liu 2022-10-11 11:18 ` [PATCH v10 3/8] app/procinfo: add RSS RETA dump Dongdong Liu ` (8 subsequent siblings) 10 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-10-11 11:18 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Dongdong Liu, Min Hu, Maryam Tahhan Add support for dump ethdev firmware version. The command is like: dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --firmware-version Signed-off-by: Min Hu (Connor) <humin29@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> Acked-by: Reshma Pattan <reshma.pattan@intel.com> --- app/proc-info/main.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index d459c706d1..7b407c47d0 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -45,6 +45,8 @@ #define MAX_LONG_OPT_SZ 64 #define MAX_STRING_LEN 256 +#define ETHDEV_FWVERS_LEN 32 + #define STATS_BDR_FMT "========================================" #define STATS_BDR_STR(w, s) printf("%.*s%s%.*s\n", w, \ STATS_BDR_FMT, s, w, STATS_BDR_FMT) @@ -105,6 +107,8 @@ static uint32_t enable_dump_regs; static char *dump_regs_file_prefix; /* Enable show DPDK version. */ static uint32_t enable_shw_version; +/* Enable show ethdev firmware version. */ +static uint32_t enable_shw_fw_version; /**< display usage */ static void @@ -134,6 +138,7 @@ proc_info_usage(const char *prgname) " --show-ring[=name]: to display ring information\n" " --show-mempool[=name]: to display mempool information\n" " --version: to display DPDK version\n" + " --firmware-version: to display ethdev firmware version\n" " --iter-mempool=name: iterate mempool elements to display content\n" " --dump-regs=file-prefix: dump registers to file with the file-prefix\n", prgname); @@ -247,6 +252,7 @@ proc_info_parse_args(int argc, char **argv) {"iter-mempool", required_argument, NULL, 0}, {"dump-regs", required_argument, NULL, 0}, {"version", 0, NULL, 0}, + {"firmware-version", 0, NULL, 0}, {NULL, 0, 0, 0} }; @@ -321,6 +327,9 @@ proc_info_parse_args(int argc, char **argv) } else if (!strncmp(long_option[option_index].name, "version", MAX_LONG_OPT_SZ)) enable_shw_version = 1; + else if (!strncmp(long_option[option_index].name, + "firmware-version", MAX_LONG_OPT_SZ)) + enable_shw_fw_version = 1; break; case 1: /* Print xstat single value given by name*/ @@ -1491,6 +1500,30 @@ show_version(void) printf("DPDK version: %s\n", rte_version()); } +static void +show_firmware_version(void) +{ + char fw_version[ETHDEV_FWVERS_LEN]; + uint16_t i; + + snprintf(bdr_str, MAX_STRING_LEN, " show - firmware version "); + 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; + + if (rte_eth_dev_fw_version_get(i, fw_version, + ETHDEV_FWVERS_LEN) == 0) + printf("Ethdev port %u firmware version: %s\n", i, + fw_version); + else + printf("Ethdev port %u firmware version: %s\n", i, + "not available"); + } +} + int main(int argc, char **argv) { @@ -1606,6 +1639,8 @@ main(int argc, char **argv) dump_regs(dump_regs_file_prefix); if (enable_shw_version) show_version(); + if (enable_shw_fw_version) + show_firmware_version(); RTE_ETH_FOREACH_DEV(i) rte_eth_dev_close(i); -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v10 3/8] app/procinfo: add RSS RETA dump 2022-10-11 11:18 ` [PATCH v10 0/8] app/procinfo: add some extended features Dongdong Liu 2022-10-11 11:18 ` [PATCH v10 1/8] app/procinfo: add dpdk version dump Dongdong Liu 2022-10-11 11:18 ` [PATCH v10 2/8] app/procinfo: add firmware " Dongdong Liu @ 2022-10-11 11:18 ` Dongdong Liu 2022-10-11 11:18 ` [PATCH v10 4/8] app/procinfo: add module eeprom info dump Dongdong Liu ` (7 subsequent siblings) 10 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-10-11 11:18 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Min Hu (Connor), Dongdong Liu, Maryam Tahhan From: "Min Hu (Connor)" <humin29@huawei.com> This patch add support for RSS reta dump. The command is like: dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --show-rss-reta Signed-off-by: Min Hu (Connor) <humin29@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> Acked-by: Reshma Pattan <reshma.pattan@intel.com> --- app/proc-info/main.c | 57 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 7b407c47d0..4021279b17 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -46,6 +46,8 @@ #define MAX_STRING_LEN 256 #define ETHDEV_FWVERS_LEN 32 +#define RTE_RETA_CONF_GROUP_NUM 32 +#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) #define STATS_BDR_FMT "========================================" #define STATS_BDR_STR(w, s) printf("%.*s%s%.*s\n", w, \ @@ -109,6 +111,8 @@ static char *dump_regs_file_prefix; static uint32_t enable_shw_version; /* Enable show ethdev firmware version. */ static uint32_t enable_shw_fw_version; +/* Enable show RSS reta. */ +static uint32_t enable_shw_rss_reta; /**< display usage */ static void @@ -139,6 +143,7 @@ proc_info_usage(const char *prgname) " --show-mempool[=name]: to display mempool information\n" " --version: to display DPDK version\n" " --firmware-version: to display ethdev firmware version\n" + " --show-rss-reta: to display ports redirection table\n" " --iter-mempool=name: iterate mempool elements to display content\n" " --dump-regs=file-prefix: dump registers to file with the file-prefix\n", prgname); @@ -253,6 +258,7 @@ proc_info_parse_args(int argc, char **argv) {"dump-regs", required_argument, NULL, 0}, {"version", 0, NULL, 0}, {"firmware-version", 0, NULL, 0}, + {"show-rss-reta", 0, NULL, 0}, {NULL, 0, 0, 0} }; @@ -330,6 +336,9 @@ proc_info_parse_args(int argc, char **argv) else if (!strncmp(long_option[option_index].name, "firmware-version", MAX_LONG_OPT_SZ)) enable_shw_fw_version = 1; + else if (!strncmp(long_option[option_index].name, + "show-rss-reta", MAX_LONG_OPT_SZ)) + enable_shw_rss_reta = 1; break; case 1: /* Print xstat single value given by name*/ @@ -1524,6 +1533,52 @@ show_firmware_version(void) } } +static void +show_port_rss_reta_info(void) +{ + struct rte_eth_rss_reta_entry64 reta_conf[RTE_RETA_CONF_GROUP_NUM + 1]; + struct rte_eth_dev_info dev_info; + uint16_t i, idx, shift; + uint16_t num; + uint16_t id; + int ret; + + RTE_ETH_FOREACH_DEV(id) { + /* Skip if port is not in mask */ + if ((enabled_port_mask & (1ul << id)) == 0) + continue; + + snprintf(bdr_str, MAX_STRING_LEN, " Port %u ", id); + STATS_BDR_STR(5, bdr_str); + + ret = rte_eth_dev_info_get(id, &dev_info); + if (ret != 0) { + fprintf(stderr, "Error getting device info: %s\n", + strerror(-ret)); + return; + } + + num = DIV_ROUND_UP(dev_info.reta_size, RTE_ETH_RETA_GROUP_SIZE); + memset(reta_conf, 0, sizeof(reta_conf)); + for (i = 0; i < num; i++) + reta_conf[i].mask = ~0ULL; + + ret = rte_eth_dev_rss_reta_query(id, reta_conf, dev_info.reta_size); + if (ret != 0) { + fprintf(stderr, "Error getting RSS RETA info: %s\n", + strerror(-ret)); + return; + } + + for (i = 0; i < dev_info.reta_size; i++) { + idx = i / RTE_ETH_RETA_GROUP_SIZE; + shift = i % RTE_ETH_RETA_GROUP_SIZE; + printf("RSS RETA configuration: hash index=%u, queue=%u\n", + i, reta_conf[idx].reta[shift]); + } + } +} + int main(int argc, char **argv) { @@ -1641,6 +1696,8 @@ main(int argc, char **argv) show_version(); if (enable_shw_fw_version) show_firmware_version(); + if (enable_shw_rss_reta) + show_port_rss_reta_info(); RTE_ETH_FOREACH_DEV(i) rte_eth_dev_close(i); -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v10 4/8] app/procinfo: add module eeprom info dump 2022-10-11 11:18 ` [PATCH v10 0/8] app/procinfo: add some extended features Dongdong Liu ` (2 preceding siblings ...) 2022-10-11 11:18 ` [PATCH v10 3/8] app/procinfo: add RSS RETA dump Dongdong Liu @ 2022-10-11 11:18 ` Dongdong Liu 2022-10-11 11:18 ` [PATCH v10 5/8] app/procinfo: add dump of Rx/Tx burst mode Dongdong Liu ` (6 subsequent siblings) 10 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-10-11 11:18 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Min Hu (Connor), Dongdong Liu, Maryam Tahhan From: "Min Hu (Connor)" <humin29@huawei.com> This patch add support for module eeprom info dump. The command is like: dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --show-module-eeprom Signed-off-by: Min Hu (Connor) <humin29@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> Acked-by: Reshma Pattan <reshma.pattan@intel.com> --- app/proc-info/main.c | 52 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 4021279b17..90e7e41e38 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -48,6 +48,7 @@ #define ETHDEV_FWVERS_LEN 32 #define RTE_RETA_CONF_GROUP_NUM 32 #define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) +#define EEPROM_DUMP_CHUNKSIZE 1024 #define STATS_BDR_FMT "========================================" #define STATS_BDR_STR(w, s) printf("%.*s%s%.*s\n", w, \ @@ -113,6 +114,8 @@ static uint32_t enable_shw_version; static uint32_t enable_shw_fw_version; /* Enable show RSS reta. */ static uint32_t enable_shw_rss_reta; +/* Enable show module eeprom information. */ +static uint32_t enable_shw_module_eeprom; /**< display usage */ static void @@ -144,6 +147,7 @@ proc_info_usage(const char *prgname) " --version: to display DPDK version\n" " --firmware-version: to display ethdev firmware version\n" " --show-rss-reta: to display ports redirection table\n" + " --show-module-eeprom: to display ports module eeprom information\n" " --iter-mempool=name: iterate mempool elements to display content\n" " --dump-regs=file-prefix: dump registers to file with the file-prefix\n", prgname); @@ -259,6 +263,7 @@ proc_info_parse_args(int argc, char **argv) {"version", 0, NULL, 0}, {"firmware-version", 0, NULL, 0}, {"show-rss-reta", 0, NULL, 0}, + {"show-module-eeprom", 0, NULL, 0}, {NULL, 0, 0, 0} }; @@ -339,6 +344,9 @@ proc_info_parse_args(int argc, char **argv) else if (!strncmp(long_option[option_index].name, "show-rss-reta", MAX_LONG_OPT_SZ)) enable_shw_rss_reta = 1; + else if (!strncmp(long_option[option_index].name, + "show-module-eeprom", MAX_LONG_OPT_SZ)) + enable_shw_module_eeprom = 1; break; case 1: /* Print xstat single value given by name*/ @@ -1579,6 +1587,48 @@ show_port_rss_reta_info(void) } } +static void +show_module_eeprom_info(void) +{ + unsigned char bytes_eeprom[EEPROM_DUMP_CHUNKSIZE]; + struct rte_eth_dev_module_info module_info; + struct rte_dev_eeprom_info eeprom_info; + uint16_t i; + int ret; + + 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); + + ret = rte_eth_dev_get_module_info(i, &module_info); + if (ret != 0) { + fprintf(stderr, "Module EEPROM information read error: %s\n", + strerror(-ret)); + return; + } + + eeprom_info.offset = 0; + eeprom_info.length = module_info.eeprom_len; + eeprom_info.data = bytes_eeprom; + + ret = rte_eth_dev_get_module_eeprom(i, &eeprom_info); + if (ret != 0) { + fprintf(stderr, "Module EEPROM read error: %s\n", + strerror(-ret)); + return; + } + + rte_hexdump(stdout, "hexdump", eeprom_info.data, + eeprom_info.length); + printf("Finish -- Port: %u MODULE EEPROM length: %d bytes\n", + i, eeprom_info.length); + } +} + int main(int argc, char **argv) { @@ -1698,6 +1748,8 @@ main(int argc, char **argv) show_firmware_version(); if (enable_shw_rss_reta) show_port_rss_reta_info(); + if (enable_shw_module_eeprom) + show_module_eeprom_info(); RTE_ETH_FOREACH_DEV(i) rte_eth_dev_close(i); -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v10 5/8] app/procinfo: add dump of Rx/Tx burst mode 2022-10-11 11:18 ` [PATCH v10 0/8] app/procinfo: add some extended features Dongdong Liu ` (3 preceding siblings ...) 2022-10-11 11:18 ` [PATCH v10 4/8] app/procinfo: add module eeprom info dump Dongdong Liu @ 2022-10-11 11:18 ` Dongdong Liu 2022-10-11 11:18 ` [PATCH v10 6/8] app/procinfo: fix some wrong doxygen syntax Dongdong Liu ` (5 subsequent siblings) 10 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-10-11 11:18 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Jie Hai, Dongdong Liu, Maryam Tahhan From: Jie Hai <haijie1@huawei.com> Add dump of Rx/Tx burst mode in --show-port. Sample output changes: - rx queue - -- 0 descriptors 0/1024 drop_en rx buffer size 2048 \ mempool mb_pool_0 socket 0 + -- 0 descriptors 0/1024 drop_en rx buffer size 2048 \ mempool mb_pool_0 socket 0 burst mode : Vector Neon - tx queue - -- 0 descriptors 1024 thresh 32/928 \ offloads : MBUF_FAST_FREE + -- 0 descriptors 1024 thresh 32/928 \ offloads : MBUF_FAST_FREE burst mode : Scalar Signed-off-by: Jie Hai <haijie1@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> Acked-by: Reshma Pattan <reshma.pattan@intel.com> --- app/proc-info/main.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 90e7e41e38..67217ab68b 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -845,6 +845,7 @@ show_port(void) for (j = 0; j < dev_info.nb_rx_queues; j++) { struct rte_eth_rxq_info queue_info; + struct rte_eth_burst_mode mode; int count; ret = rte_eth_rx_queue_info_get(i, j, &queue_info); @@ -880,11 +881,18 @@ show_port(void) if (queue_info.conf.offloads != 0) show_offloads(queue_info.conf.offloads, rte_eth_dev_rx_offload_name); + if (rte_eth_rx_burst_mode_get(i, j, &mode) == 0) + printf(" burst mode : %s%s", + mode.info, + mode.flags & RTE_ETH_BURST_FLAG_PER_QUEUE ? + " (per queue)" : ""); + printf("\n"); } for (j = 0; j < dev_info.nb_tx_queues; j++) { struct rte_eth_txq_info queue_info; + struct rte_eth_burst_mode mode; ret = rte_eth_tx_queue_info_get(i, j, &queue_info); if (ret != 0) @@ -905,6 +913,13 @@ show_port(void) if (queue_info.conf.offloads != 0) show_offloads(queue_info.conf.offloads, rte_eth_dev_tx_offload_name); + + if (rte_eth_tx_burst_mode_get(i, j, &mode) == 0) + printf(" burst mode : %s%s", + mode.info, + mode.flags & RTE_ETH_BURST_FLAG_PER_QUEUE ? + " (per queue)" : ""); + printf("\n"); } -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v10 6/8] app/procinfo: fix some wrong doxygen syntax 2022-10-11 11:18 ` [PATCH v10 0/8] app/procinfo: add some extended features Dongdong Liu ` (4 preceding siblings ...) 2022-10-11 11:18 ` [PATCH v10 5/8] app/procinfo: add dump of Rx/Tx burst mode Dongdong Liu @ 2022-10-11 11:18 ` Dongdong Liu 2022-10-11 11:18 ` [PATCH v10 7/8] app/procinfo: support descriptor dump Dongdong Liu ` (4 subsequent siblings) 10 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-10-11 11:18 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Dongdong Liu, Maryam Tahhan This code is to do cleanup for the wrong doxygen syntax comments The DPDK API is documented using doxygen comment annotations in the header files. The procinfo code seems no need to use doxygen comment. Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> Acked-by: Reshma Pattan <reshma.pattan@intel.com> --- app/proc-info/main.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 67217ab68b..fe8285d2ce 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -54,33 +54,33 @@ #define STATS_BDR_STR(w, s) printf("%.*s%s%.*s\n", w, \ STATS_BDR_FMT, s, w, STATS_BDR_FMT) -/**< mask of enabled ports */ +/* mask of enabled ports */ static unsigned long enabled_port_mask; -/**< Enable stats. */ +/* Enable stats. */ static uint32_t enable_stats; -/**< Enable xstats. */ +/* Enable xstats. */ static uint32_t enable_xstats; -/**< Enable collectd format*/ +/* Enable collectd format */ static uint32_t enable_collectd_format; -/**< FD to send collectd format messages to STDOUT*/ +/* FD to send collectd format messages to STDOUT */ static int stdout_fd; -/**< Host id process is running on */ +/* Host id process is running on */ static char host_id[MAX_LONG_OPT_SZ]; #ifdef RTE_LIB_METRICS -/**< Enable metrics. */ +/* Enable metrics. */ static uint32_t enable_metrics; #endif -/**< Enable stats reset. */ +/* Enable stats reset. */ static uint32_t reset_stats; -/**< Enable xstats reset. */ +/* Enable xstats reset. */ static uint32_t reset_xstats; -/**< Enable memory info. */ +/* Enable memory info. */ static uint32_t mem_info; -/**< Enable displaying xstat name. */ +/* Enable displaying xstat name. */ static uint32_t enable_xstats_name; static char *xstats_name; -/**< Enable xstats by ids. */ +/* Enable xstats by ids. */ #define MAX_NB_XSTATS_IDS 1024 static uint32_t nb_xstats_ids; static uint64_t xstats_ids[MAX_NB_XSTATS_IDS]; @@ -88,24 +88,24 @@ static uint64_t xstats_ids[MAX_NB_XSTATS_IDS]; /* show border */ static char bdr_str[MAX_STRING_LEN]; -/**< Enable show port. */ +/* Enable show port. */ static uint32_t enable_shw_port; /* Enable show port private info. */ static uint32_t enable_shw_port_priv; -/**< Enable show tm. */ +/* Enable show tm. */ static uint32_t enable_shw_tm; -/**< Enable show crypto. */ +/* Enable show crypto. */ static uint32_t enable_shw_crypto; -/**< Enable show ring. */ +/* Enable show ring. */ static uint32_t enable_shw_ring; static char *ring_name; -/**< Enable show mempool. */ +/* Enable show mempool. */ static uint32_t enable_shw_mempool; static char *mempool_name; -/**< Enable iter mempool. */ +/* Enable iter mempool. */ static uint32_t enable_iter_mempool; static char *mempool_iter_name; -/**< Enable dump regs. */ +/* Enable dump regs. */ static uint32_t enable_dump_regs; static char *dump_regs_file_prefix; /* Enable show DPDK version. */ @@ -117,7 +117,7 @@ static uint32_t enable_shw_rss_reta; /* Enable show module eeprom information. */ static uint32_t enable_shw_module_eeprom; -/**< display usage */ +/* display usage */ static void proc_info_usage(const char *prgname) { -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v10 7/8] app/procinfo: support descriptor dump 2022-10-11 11:18 ` [PATCH v10 0/8] app/procinfo: add some extended features Dongdong Liu ` (5 preceding siblings ...) 2022-10-11 11:18 ` [PATCH v10 6/8] app/procinfo: fix some wrong doxygen syntax Dongdong Liu @ 2022-10-11 11:18 ` Dongdong Liu 2022-10-11 13:38 ` Pattan, Reshma 2022-10-11 11:18 ` [PATCH v10 8/8] doc: add some extended features in procinfo guide Dongdong Liu ` (3 subsequent siblings) 10 siblings, 1 reply; 89+ messages in thread From: Dongdong Liu @ 2022-10-11 11:18 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Dongdong Liu, Min Hu, Maryam Tahhan This patch support Rx/Tx descriptor dump The command is like: dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --show-rx-descriptor queue_id:offset:num dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --show-tx-descriptor queue_id:offset:num queue_id: A queue identifier on this port. offset: The offset of the descriptor starting from tail. num: The number of the descriptors to dump. Signed-off-by: Min Hu (Connor) <humin29@huawei.com> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> --- app/proc-info/main.c | 104 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index fe8285d2ce..53e852a07c 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -117,6 +117,21 @@ static uint32_t enable_shw_rss_reta; /* Enable show module eeprom information. */ static uint32_t enable_shw_module_eeprom; +/* Enable dump Rx/Tx descriptor. */ +static uint32_t enable_shw_rx_desc_dump; +static uint32_t enable_shw_tx_desc_dump; + +#define DESC_PARAM_NUM 3 + +struct desc_param { + uint16_t queue_id; /* A queue identifier on this port. */ + uint16_t offset; /* The offset of the descriptor starting from tail. */ + uint16_t num; /* The number of the descriptors to dump. */ +}; + +static struct desc_param rx_desc_param; +static struct desc_param tx_desc_param; + /* display usage */ static void proc_info_usage(const char *prgname) @@ -148,6 +163,14 @@ proc_info_usage(const char *prgname) " --firmware-version: to display ethdev firmware version\n" " --show-rss-reta: to display ports redirection table\n" " --show-module-eeprom: to display ports module eeprom information\n" + " --show-rx-descriptor queue_id:offset:num to display ports Rx descriptor information. " + "queue_id: A Rx queue identifier on this port. " + "offset: The offset of the descriptor starting from tail. " + "num: The number of the descriptors to dump.\n" + " --show-tx-descriptor queue_id:offset:num to display ports Tx descriptor information. " + "queue_id: A Tx queue identifier on this port. " + "offset: The offset of the descriptor starting from tail. " + "num: The number of the descriptors to dump.\n" " --iter-mempool=name: iterate mempool elements to display content\n" " --dump-regs=file-prefix: dump registers to file with the file-prefix\n", prgname); @@ -200,6 +223,19 @@ parse_xstats_ids(char *list, uint64_t *ids, int limit) { return length; } +static int +parse_descriptor_param(char *list, struct desc_param *desc) +{ + int ret; + + ret = sscanf(list, "%hu:%hu:%hu", &desc->queue_id, &desc->offset, + &desc->num); + if (ret != DESC_PARAM_NUM) + return -EINVAL; + + return 0; +} + static int proc_info_preparse_args(int argc, char **argv) { @@ -264,6 +300,8 @@ proc_info_parse_args(int argc, char **argv) {"firmware-version", 0, NULL, 0}, {"show-rss-reta", 0, NULL, 0}, {"show-module-eeprom", 0, NULL, 0}, + {"show-rx-descriptor", required_argument, NULL, 1}, + {"show-tx-descriptor", required_argument, NULL, 1}, {NULL, 0, 0, 0} }; @@ -367,6 +405,26 @@ proc_info_parse_args(int argc, char **argv) return -1; } nb_xstats_ids = ret; + } else if (!strncmp(long_option[option_index].name, + "show-rx-descriptor", MAX_LONG_OPT_SZ)) { + int ret = parse_descriptor_param(optarg, + &rx_desc_param); + if (ret < 0) { + fprintf(stderr, "Error parsing Rx descriptor param: %s\n", + strerror(-ret)); + return -1; + } + enable_shw_rx_desc_dump = 1; + } else if (!strncmp(long_option[option_index].name, + "show-tx-descriptor", MAX_LONG_OPT_SZ)) { + int ret = parse_descriptor_param(optarg, + &tx_desc_param); + if (ret < 0) { + fprintf(stderr, "Error parsing Tx descriptor param: %s\n", + strerror(-ret)); + return -1; + } + enable_shw_tx_desc_dump = 1; } break; default: @@ -1644,6 +1702,48 @@ show_module_eeprom_info(void) } } +static void +nic_rx_descriptor_display(uint16_t port_id, struct desc_param *desc) +{ + uint16_t queue_id = desc->queue_id; + uint16_t offset = desc->offset; + uint16_t num = desc->num; + int ret; + + snprintf(bdr_str, MAX_STRING_LEN, " show - Rx descriptor "); + STATS_BDR_STR(10, bdr_str); + + printf("Dump ethdev Rx descriptor for port %u, queue %u, offset %u, num %u\n", + port_id, queue_id, offset, num); + + ret = rte_eth_rx_descriptor_dump(port_id, queue_id, offset, num, + stdout); + if (ret < 0) + fprintf(stderr, "Error dumping ethdev Rx descriptor: %s\n", + strerror(-ret)); +} + +static void +nic_tx_descriptor_display(uint16_t port_id, struct desc_param *desc) +{ + uint16_t queue_id = desc->queue_id; + uint16_t offset = desc->offset; + uint16_t num = desc->num; + int ret; + + snprintf(bdr_str, MAX_STRING_LEN, " show - Tx descriptor "); + STATS_BDR_STR(10, bdr_str); + + printf("Dump ethdev Tx descriptor for port %u, queue %u, offset %u, num %u\n", + port_id, queue_id, offset, num); + + ret = rte_eth_tx_descriptor_dump(port_id, queue_id, offset, num, + stdout); + if (ret < 0) + fprintf(stderr, "Error dumping ethdev Tx descriptor: %s\n", + strerror(-ret)); +} + int main(int argc, char **argv) { @@ -1732,6 +1832,10 @@ main(int argc, char **argv) metrics_display(i); #endif + if (enable_shw_rx_desc_dump) + nic_rx_descriptor_display(i, &rx_desc_param); + if (enable_shw_tx_desc_dump) + nic_tx_descriptor_display(i, &tx_desc_param); } #ifdef RTE_LIB_METRICS -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* RE: [PATCH v10 7/8] app/procinfo: support descriptor dump 2022-10-11 11:18 ` [PATCH v10 7/8] app/procinfo: support descriptor dump Dongdong Liu @ 2022-10-11 13:38 ` Pattan, Reshma 0 siblings, 0 replies; 89+ messages in thread From: Pattan, Reshma @ 2022-10-11 13:38 UTC (permalink / raw) To: Dongdong Liu, dev, thomas, ferruh.yigit, andrew.rybchenko Cc: Min Hu, Maryam Tahhan > -----Original Message----- > From: Dongdong Liu <liudongdong3@huawei.com> > Subject: [PATCH v10 7/8] app/procinfo: support descriptor dump > > This patch support Rx/Tx descriptor dump > > The command is like: > dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --show-rx-descriptor > queue_id:offset:num > > dpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --show-tx-descriptor > queue_id:offset:num > > queue_id: A queue identifier on this port. > offset: The offset of the descriptor starting from tail. > num: The number of the descriptors to dump. > > Signed-off-by: Min Hu (Connor) <humin29@huawei.com> > Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> Acked-by: Reshma Pattan <reshma.pattan@intel.com> ^ permalink raw reply [flat|nested] 89+ messages in thread
* [PATCH v10 8/8] doc: add some extended features in procinfo guide 2022-10-11 11:18 ` [PATCH v10 0/8] app/procinfo: add some extended features Dongdong Liu ` (6 preceding siblings ...) 2022-10-11 11:18 ` [PATCH v10 7/8] app/procinfo: support descriptor dump Dongdong Liu @ 2022-10-11 11:18 ` Dongdong Liu 2022-10-20 7:48 ` [PATCH v10 0/8] app/procinfo: add some extended features Dongdong Liu ` (2 subsequent siblings) 10 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-10-11 11:18 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Cc: Dongdong Liu, Maryam Tahhan Add the below extended features in procinfo guide. --show-port-private --version --firmware-version --show-rss-reta --show-module-eeprom --show-rx-descriptor --show-tx-descriptor Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> Acked-by: Reshma Pattan <reshma.pattan@intel.com> --- doc/guides/tools/proc_info.rst | 36 ++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/doc/guides/tools/proc_info.rst b/doc/guides/tools/proc_info.rst index 9772d97ef0..ad70bc47a5 100644 --- a/doc/guides/tools/proc_info.rst +++ b/doc/guides/tools/proc_info.rst @@ -17,9 +17,12 @@ The application has a number of command line options: .. code-block:: console - ./<build_dir>/app/dpdk-procinfo -- -m | [-p PORTMASK] [--stats | --xstats | + ./<build_dir>/app/dpdk-proc-info -- -m | [-p PORTMASK] [--stats | --xstats | --stats-reset | --xstats-reset] [ --show-port | --show-tm | --show-crypto | - --show-ring[=name] | --show-mempool[=name] | --iter-mempool=name ] + --show-ring[=name] | --show-mempool[=name] | --iter-mempool=name | + --show-port-private | --version | --firmware-version | --show-rss-reta | + --show-module-eeprom | --show-rx-descriptor queue_id:offset:num | + --show-tx-descriptor queue_id:offset:num] Parameters ~~~~~~~~~~ @@ -69,6 +72,35 @@ mempool. For invalid or no mempool name, whole list is dump. The iter-mempool parameter iterates and displays mempool elements specified by name. For invalid or no mempool name no elements are displayed. +**--show-port-private** +The show-port-private parameter displays ports private information. + +**--version** +The version parameter displays DPDK version. + +**--firmware-version** +The firmware-version parameter displays ethdev firmware version. + +**--show-rss-reta** +The show-rss-reta parameter displays ports rss redirection table. + +**--show-module-eeprom** +The show-module-eeprom parameter displays ports module eeprom information. + +**--show-rx-descriptor queue_id:offset:num** +The show-rx-descriptor parameter displays ports Rx descriptor information +specified by queue_id, offset and num. +queue_id: A Rx queue identifier on this port. +offset: The offset of the descriptor starting from tail. +num: The number of the descriptors to dump. + +**--show-tx-descriptor queue_id:offset:num** +The show-tx-descriptor parameter displays ports Tx descriptor information +specified by queue_id, offset and num. +queue_id: A Tx queue identifier on this port. +offset: The offset of the descriptor starting from tail. +num: The number of the descriptors to dump. + Limitations ----------- -- 2.22.0 ^ permalink raw reply [flat|nested] 89+ messages in thread
* Re: [PATCH v10 0/8] app/procinfo: add some extended features 2022-10-11 11:18 ` [PATCH v10 0/8] app/procinfo: add some extended features Dongdong Liu ` (7 preceding siblings ...) 2022-10-11 11:18 ` [PATCH v10 8/8] doc: add some extended features in procinfo guide Dongdong Liu @ 2022-10-20 7:48 ` Dongdong Liu 2022-11-04 9:16 ` Dongdong Liu 2022-11-15 9:52 ` David Marchand 10 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-10-20 7:48 UTC (permalink / raw) To: dev, reshma.pattan, thomas, ferruh.yigit, andrew.rybchenko Hi Thomas Could you have a look at the patchset? Thanks, Dongdong On 2022/10/11 19:18, Dongdong Liu wrote: > This patchset is to add some extended features for dpdk-proc-info. > > Thanks to Reshma and Stephen help to review the patchset. > > v9->v10: > - Fix some comments for Rx/Tx descriptor dump. > > v8->v9: > - Fixed some checkpatch warnings. > > v7(v4)->v8: > - Add Acked-by: Reshma Pattan for PATCH 4,6. > - Add Rx/Tx descriptor dump. > - Adjust procinfo doc guide. > > v3->v4: > - Add Acked-by: Reshma Pattan for PATCH 1,2,3,5,7. > - Rename show-module-info to show-module-eeprom to make more clear. > > v2->v3: Fix some comments from Stephen. > - Use --version option for DPDK version. > - Add --firmware-version option to show firmware. > - Use errors on stderr, not stdout. > - Delete some unnecessary code. > > v1->v2: Fix some comments from Reshma. > > Dongdong Liu (4): > app/procinfo: add firmware version dump > app/procinfo: fix some wrong doxygen syntax > app/procinfo: support descriptor dump > doc: add some extended features in procinfo guide > > Jie Hai (1): > app/procinfo: add dump of Rx/Tx burst mode > > Min Hu (Connor) (3): > app/procinfo: add dpdk version dump > app/procinfo: add RSS RETA dump > app/procinfo: add module eeprom info dump > > app/proc-info/main.c | 324 ++++++++++++++++++++++++++++++--- > doc/guides/tools/proc_info.rst | 36 +++- > 2 files changed, 336 insertions(+), 24 deletions(-) > > -- > 2.22.0 > > . > ^ permalink raw reply [flat|nested] 89+ messages in thread
* Re: [PATCH v10 0/8] app/procinfo: add some extended features 2022-10-11 11:18 ` [PATCH v10 0/8] app/procinfo: add some extended features Dongdong Liu ` (8 preceding siblings ...) 2022-10-20 7:48 ` [PATCH v10 0/8] app/procinfo: add some extended features Dongdong Liu @ 2022-11-04 9:16 ` Dongdong Liu 2022-11-15 9:52 ` David Marchand 10 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-11-04 9:16 UTC (permalink / raw) To: thomas; +Cc: dev, reshma.pattan, ferruh.yigit, andrew.rybchenko Hi Thomas Kindly ping. Can this patchset be applied? Thanks, Dongdong On 2022/10/11 19:18, Dongdong Liu wrote: > This patchset is to add some extended features for dpdk-proc-info. > > Thanks to Reshma and Stephen help to review the patchset. > > v9->v10: > - Fix some comments for Rx/Tx descriptor dump. > > v8->v9: > - Fixed some checkpatch warnings. > > v7(v4)->v8: > - Add Acked-by: Reshma Pattan for PATCH 4,6. > - Add Rx/Tx descriptor dump. > - Adjust procinfo doc guide. > > v3->v4: > - Add Acked-by: Reshma Pattan for PATCH 1,2,3,5,7. > - Rename show-module-info to show-module-eeprom to make more clear. > > v2->v3: Fix some comments from Stephen. > - Use --version option for DPDK version. > - Add --firmware-version option to show firmware. > - Use errors on stderr, not stdout. > - Delete some unnecessary code. > > v1->v2: Fix some comments from Reshma. > > Dongdong Liu (4): > app/procinfo: add firmware version dump > app/procinfo: fix some wrong doxygen syntax > app/procinfo: support descriptor dump > doc: add some extended features in procinfo guide > > Jie Hai (1): > app/procinfo: add dump of Rx/Tx burst mode > > Min Hu (Connor) (3): > app/procinfo: add dpdk version dump > app/procinfo: add RSS RETA dump > app/procinfo: add module eeprom info dump > > app/proc-info/main.c | 324 ++++++++++++++++++++++++++++++--- > doc/guides/tools/proc_info.rst | 36 +++- > 2 files changed, 336 insertions(+), 24 deletions(-) > > -- > 2.22.0 > > . > ^ permalink raw reply [flat|nested] 89+ messages in thread
* Re: [PATCH v10 0/8] app/procinfo: add some extended features 2022-10-11 11:18 ` [PATCH v10 0/8] app/procinfo: add some extended features Dongdong Liu ` (9 preceding siblings ...) 2022-11-04 9:16 ` Dongdong Liu @ 2022-11-15 9:52 ` David Marchand 2022-11-15 11:00 ` Dongdong Liu 10 siblings, 1 reply; 89+ messages in thread From: David Marchand @ 2022-11-15 9:52 UTC (permalink / raw) To: Dongdong Liu, reshma.pattan; +Cc: dev, thomas, ferruh.yigit, andrew.rybchenko On Tue, Oct 11, 2022 at 1:20 PM Dongdong Liu <liudongdong3@huawei.com> wrote: > > This patchset is to add some extended features for dpdk-proc-info. > > Thanks to Reshma and Stephen help to review the patchset. > > v9->v10: > - Fix some comments for Rx/Tx descriptor dump. > > v8->v9: > - Fixed some checkpatch warnings. > > v7(v4)->v8: > - Add Acked-by: Reshma Pattan for PATCH 4,6. > - Add Rx/Tx descriptor dump. > - Adjust procinfo doc guide. > > v3->v4: > - Add Acked-by: Reshma Pattan for PATCH 1,2,3,5,7. > - Rename show-module-info to show-module-eeprom to make more clear. > > v2->v3: Fix some comments from Stephen. > - Use --version option for DPDK version. > - Add --firmware-version option to show firmware. > - Use errors on stderr, not stdout. > - Delete some unnecessary code. > > v1->v2: Fix some comments from Reshma. > > Dongdong Liu (4): > app/procinfo: add firmware version dump > app/procinfo: fix some wrong doxygen syntax > app/procinfo: support descriptor dump > doc: add some extended features in procinfo guide > > Jie Hai (1): > app/procinfo: add dump of Rx/Tx burst mode > > Min Hu (Connor) (3): > app/procinfo: add dpdk version dump > app/procinfo: add RSS RETA dump > app/procinfo: add module eeprom info dump > > app/proc-info/main.c | 324 ++++++++++++++++++++++++++++++--- > doc/guides/tools/proc_info.rst | 36 +++- > 2 files changed, 336 insertions(+), 24 deletions(-) The last patch was a mix of various changes in the documentation. Please make sure to update the documentation as part of the code changes, in the future. And separate fixes with proper Fixes: tag from other changes. Series applied, thanks. -- David Marchand ^ permalink raw reply [flat|nested] 89+ messages in thread
* Re: [PATCH v10 0/8] app/procinfo: add some extended features 2022-11-15 9:52 ` David Marchand @ 2022-11-15 11:00 ` Dongdong Liu 0 siblings, 0 replies; 89+ messages in thread From: Dongdong Liu @ 2022-11-15 11:00 UTC (permalink / raw) To: David Marchand, reshma.pattan; +Cc: dev, thomas, ferruh.yigit, andrew.rybchenko On 2022/11/15 17:52, David Marchand wrote: > On Tue, Oct 11, 2022 at 1:20 PM Dongdong Liu <liudongdong3@huawei.com> wrote: >> >> This patchset is to add some extended features for dpdk-proc-info. >> >> Thanks to Reshma and Stephen help to review the patchset. >> >> v9->v10: >> - Fix some comments for Rx/Tx descriptor dump. >> >> v8->v9: >> - Fixed some checkpatch warnings. >> >> v7(v4)->v8: >> - Add Acked-by: Reshma Pattan for PATCH 4,6. >> - Add Rx/Tx descriptor dump. >> - Adjust procinfo doc guide. >> >> v3->v4: >> - Add Acked-by: Reshma Pattan for PATCH 1,2,3,5,7. >> - Rename show-module-info to show-module-eeprom to make more clear. >> >> v2->v3: Fix some comments from Stephen. >> - Use --version option for DPDK version. >> - Add --firmware-version option to show firmware. >> - Use errors on stderr, not stdout. >> - Delete some unnecessary code. >> >> v1->v2: Fix some comments from Reshma. >> >> Dongdong Liu (4): >> app/procinfo: add firmware version dump >> app/procinfo: fix some wrong doxygen syntax >> app/procinfo: support descriptor dump >> doc: add some extended features in procinfo guide >> >> Jie Hai (1): >> app/procinfo: add dump of Rx/Tx burst mode >> >> Min Hu (Connor) (3): >> app/procinfo: add dpdk version dump >> app/procinfo: add RSS RETA dump >> app/procinfo: add module eeprom info dump >> >> app/proc-info/main.c | 324 ++++++++++++++++++++++++++++++--- >> doc/guides/tools/proc_info.rst | 36 +++- >> 2 files changed, 336 insertions(+), 24 deletions(-) > > The last patch was a mix of various changes in the documentation. > Please make sure to update the documentation as part of the code > changes, in the future. > And separate fixes with proper Fixes: tag from other changes. Thanks for pointing this and helping to fix. > > Series applied, thanks. Many thanks for the work. Thanks, Dongdong. > ^ permalink raw reply [flat|nested] 89+ messages in thread
end of thread, other threads:[~2022-11-15 11:00 UTC | newest] Thread overview: 89+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2022-07-22 9:12 [PATCH 0/6] app/procinfo: add some extended features Dongdong Liu 2022-07-22 9:12 ` [PATCH 1/6] app/procinfo: add version dump Dongdong Liu 2022-09-19 9:23 ` Pattan, Reshma 2022-09-20 2:35 ` Dongdong Liu 2022-07-22 9:12 ` [PATCH 2/6] app/procinfo: add RSS RETA dump Dongdong Liu 2022-07-22 9:12 ` [PATCH 3/6] app/procinfo: add module info dump Dongdong Liu 2022-07-22 9:12 ` [PATCH 4/6] app/proc-info: add dump of Rx/Tx burst mode Dongdong Liu 2022-07-22 9:12 ` [PATCH 5/6] app/procinfo: fix some wrong doxygen syntax Dongdong Liu 2022-07-22 9:12 ` [PATCH 6/6] doc: add some extended features in procinfo guide Dongdong Liu 2022-07-22 10:03 ` [PATCH 0/6] app/procinfo: add some extended features David Marchand 2022-07-25 11:03 ` Dongdong Liu 2022-09-17 1:12 ` Dongdong Liu 2022-09-20 10:51 ` [PATCH v2 " Dongdong Liu 2022-09-20 10:51 ` [PATCH v2 1/6] app/procinfo: add version dump Dongdong Liu 2022-09-20 15:21 ` Stephen Hemminger 2022-09-21 11:11 ` Dongdong Liu 2022-09-20 10:51 ` [PATCH v2 2/6] app/procinfo: add RSS RETA dump Dongdong Liu 2022-09-20 15:24 ` Stephen Hemminger 2022-09-21 11:21 ` Dongdong Liu 2022-09-20 10:51 ` [PATCH v2 3/6] app/procinfo: add module info dump Dongdong Liu 2022-09-20 15:22 ` Stephen Hemminger 2022-09-21 11:22 ` Dongdong Liu 2022-09-20 10:51 ` [PATCH v2 4/6] app/proc-info: add dump of Rx/Tx burst mode Dongdong Liu 2022-09-20 10:51 ` [PATCH v2 5/6] app/procinfo: fix some wrong doxygen syntax Dongdong Liu 2022-09-20 10:51 ` [PATCH v2 6/6] doc: add some extended features in procinfo guide Dongdong Liu 2022-09-21 14:26 ` [PATCH v3 0/7] app/procinfo: add some extended features Dongdong Liu 2022-09-21 14:26 ` [PATCH v3 1/7] app/procinfo: add dpdk version dump Dongdong Liu 2022-09-23 9:11 ` Pattan, Reshma 2022-09-21 14:26 ` [PATCH v3 2/7] app/procinfo: add firmware " Dongdong Liu 2022-09-23 9:22 ` Pattan, Reshma 2022-09-24 8:03 ` Dongdong Liu 2022-09-21 14:26 ` [PATCH v3 3/7] app/procinfo: add RSS RETA dump Dongdong Liu 2022-09-23 9:42 ` Pattan, Reshma 2022-09-21 14:26 ` [PATCH v3 4/7] app/procinfo: add module info dump Dongdong Liu 2022-09-23 9:51 ` Pattan, Reshma 2022-09-24 8:07 ` Dongdong Liu 2022-09-21 14:26 ` [PATCH v3 5/7] app/procinfo: add dump of Rx/Tx burst mode Dongdong Liu 2022-09-23 10:02 ` Pattan, Reshma 2022-09-24 8:06 ` Dongdong Liu 2022-09-21 14:26 ` [PATCH v3 6/7] app/procinfo: fix some wrong doxygen syntax Dongdong Liu 2022-09-23 7:53 ` Pattan, Reshma 2022-09-24 8:12 ` Dongdong Liu 2022-09-21 14:26 ` [PATCH v3 7/7] doc: add some extended features in procinfo guide Dongdong Liu 2022-09-23 8:57 ` Pattan, Reshma 2022-09-24 8:13 ` [PATCH v7 0/7] app/procinfo: add some extended features Dongdong Liu 2022-09-24 8:13 ` [PATCH v7 1/7] app/procinfo: add dpdk version dump Dongdong Liu 2022-09-24 8:13 ` [PATCH v7 2/7] app/procinfo: add firmware " Dongdong Liu 2022-09-24 8:13 ` [PATCH v7 3/7] app/procinfo: add RSS RETA dump Dongdong Liu 2022-09-24 8:13 ` [PATCH v7 4/7] app/procinfo: add module eeprom info dump Dongdong Liu 2022-09-26 11:54 ` Pattan, Reshma 2022-09-24 8:13 ` [PATCH v7 5/7] app/procinfo: add dump of Rx/Tx burst mode Dongdong Liu 2022-09-24 8:13 ` [PATCH v7 6/7] app/procinfo: fix some wrong doxygen syntax Dongdong Liu 2022-09-26 12:09 ` Pattan, Reshma 2022-09-24 8:13 ` [PATCH v7 7/7] doc: add some extended features in procinfo guide Dongdong Liu 2022-09-24 8:21 ` [PATCH v7 0/7] app/procinfo: add some extended features Dongdong Liu 2022-10-08 9:39 ` [PATCH v8 0/8] " Dongdong Liu 2022-10-08 9:39 ` [PATCH v8 1/8] app/procinfo: add dpdk version dump Dongdong Liu 2022-10-08 9:39 ` [PATCH v8 2/8] app/procinfo: add firmware " Dongdong Liu 2022-10-08 9:39 ` [PATCH v8 3/8] app/procinfo: add RSS RETA dump Dongdong Liu 2022-10-08 9:39 ` [PATCH v8 4/8] app/procinfo: add module eeprom info dump Dongdong Liu 2022-10-08 9:39 ` [PATCH v8 5/8] app/procinfo: add dump of Rx/Tx burst mode Dongdong Liu 2022-10-08 9:39 ` [PATCH v8 6/8] app/procinfo: fix some wrong doxygen syntax Dongdong Liu 2022-10-08 9:39 ` [PATCH v8 7/8] app/procinfo: support descriptor dump Dongdong Liu 2022-10-08 9:39 ` [PATCH v8 8/8] doc: add some extended features in procinfo guide Dongdong Liu 2022-10-08 10:53 ` [PATCH v9 0/8] app/procinfo: add some extended features Dongdong Liu 2022-10-08 10:53 ` [PATCH v9 1/8] app/procinfo: add dpdk version dump Dongdong Liu 2022-10-08 10:53 ` [PATCH v9 2/8] app/procinfo: add firmware " Dongdong Liu 2022-10-08 10:53 ` [PATCH v9 3/8] app/procinfo: add RSS RETA dump Dongdong Liu 2022-10-08 10:53 ` [PATCH v9 4/8] app/procinfo: add module eeprom info dump Dongdong Liu 2022-10-08 10:53 ` [PATCH v9 5/8] app/procinfo: add dump of Rx/Tx burst mode Dongdong Liu 2022-10-08 10:53 ` [PATCH v9 6/8] app/procinfo: fix some wrong doxygen syntax Dongdong Liu 2022-10-08 10:53 ` [PATCH v9 7/8] app/procinfo: support descriptor dump Dongdong Liu 2022-10-10 9:08 ` Pattan, Reshma 2022-10-10 13:13 ` Dongdong Liu 2022-10-08 10:53 ` [PATCH v9 8/8] doc: add some extended features in procinfo guide Dongdong Liu 2022-10-11 11:18 ` [PATCH v10 0/8] app/procinfo: add some extended features Dongdong Liu 2022-10-11 11:18 ` [PATCH v10 1/8] app/procinfo: add dpdk version dump Dongdong Liu 2022-10-11 11:18 ` [PATCH v10 2/8] app/procinfo: add firmware " Dongdong Liu 2022-10-11 11:18 ` [PATCH v10 3/8] app/procinfo: add RSS RETA dump Dongdong Liu 2022-10-11 11:18 ` [PATCH v10 4/8] app/procinfo: add module eeprom info dump Dongdong Liu 2022-10-11 11:18 ` [PATCH v10 5/8] app/procinfo: add dump of Rx/Tx burst mode Dongdong Liu 2022-10-11 11:18 ` [PATCH v10 6/8] app/procinfo: fix some wrong doxygen syntax Dongdong Liu 2022-10-11 11:18 ` [PATCH v10 7/8] app/procinfo: support descriptor dump Dongdong Liu 2022-10-11 13:38 ` Pattan, Reshma 2022-10-11 11:18 ` [PATCH v10 8/8] doc: add some extended features in procinfo guide Dongdong Liu 2022-10-20 7:48 ` [PATCH v10 0/8] app/procinfo: add some extended features Dongdong Liu 2022-11-04 9:16 ` Dongdong Liu 2022-11-15 9:52 ` David Marchand 2022-11-15 11:00 ` Dongdong Liu
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).