[dpdk-dev] [PATCH v1 4/9] app/procinfo: add code for debug port

Pattan, Reshma reshma.pattan at intel.com
Thu Oct 25 17:38:26 CEST 2018



> -----Original Message-----
> From: Varghese, Vipin
> Sent: Tuesday, October 23, 2018 2:58 PM
> To: dev at dpdk.org; Tahhan, Maryam <maryam.tahhan at intel.com>; Pattan,
> Reshma <reshma.pattan at intel.com>
> Cc: Patel, Amol <amol.patel at intel.com>; Tummala, Sivaprasad
> <sivaprasad.tummala at intel.com>; Byrne, Stephen1
> <stephen1.byrne at intel.com>; Glynn, Michael J
> <michael.j.glynn at intel.com>; Varghese, Vipin <vipin.varghese at intel.com>
> Subject: [PATCH v1 4/9] app/procinfo: add code for debug port
> 
> Function debug_port is used for displaying the port PMD under the primary
> process. This covers basic and per queue configuration.
> 
> Signed-off-by: Vipin Varghese <vipin.varghese at intel.com>
> ---
>  app/proc-info/main.c | 113
> ++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 112 insertions(+), 1 deletion(-)
> 
> diff --git a/app/proc-info/main.c b/app/proc-info/main.c index
> 5511fcb71..668f7febf 100644
> --- a/app/proc-info/main.c
> +++ b/app/proc-info/main.c
> @@ -29,6 +29,9 @@
>  #include <rte_branch_prediction.h>
>  #include <rte_string_fns.h>
>  #include <rte_metrics.h>
> +#include <rte_cycles.h>
> +#include <rte_security.h>
> +#include <rte_cryptodev.h>
> 
>  /* Maximum long option length for option parsing. */  #define
> MAX_LONG_OPT_SZ 64 @@ -40,6 +43,8 @@  #define STATS_BDR_STR(w, s)
> printf("%.*s%s%.*s\n", w, \
>  	STATS_BDR_FMT, s, w, STATS_BDR_FMT)
> 
> +char bdr_str[100];

#define for marco size would be good. Instead of hard code.
> +
> +	snprintf(bdr_str, 100, " debug - Port PMD %"PRIu64, rte_get_tsc_hz());
> +	STATS_BDR_STR(10, bdr_str);
> +
> +	RTE_ETH_FOREACH_DEV(i) {
> +		uint16_t mtu = 0;
> +		struct rte_eth_link link = {0};

Initialize structs using memset here and in other places.

> +
> +		for (j = 0; j < dev_info.nb_rx_queues; j++) {
> +
> +			ret = rte_eth_dev_rss_hash_conf_get(i, &rss_conf);
> +			if ((ret) || (rss_conf.rss_key == NULL))
> +				continue;
> +
> +			printf("\t  -- RSS len %u key (hex):",
> +			       rss_conf.rss_key_len);
> +			for (k = 0; k < rss_conf.rss_key_len; k++)
> +				printf(" %x", rss_conf.rss_key[k]);
> +			printf("\t  -- hf 0x%"PRIx64"\n",
> +			       rss_conf.rss_hf);

Is this per port? not per queue. Can this be moved to outside of the queue for loop.
> +		}
> +
> +		printf("  - drop packet information\n");

Printf heading can be changed as it is printing input and output packets also.

> +		ret = rte_eth_stats_get(i, &stats);
> +		if (ret == 0) {
> +			printf("\t  -- input %"PRIu64
> +			       " output %"PRIu64"\n",
> +			       stats.ipackets,
> +			       stats.opackets);




More information about the dev mailing list