From patchwork Tue Nov 6 02:31:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Varghese, Vipin" X-Patchwork-Id: 47858 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EAA1F5B26; Tue, 6 Nov 2018 03:35:54 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id A983E5B1C for ; Tue, 6 Nov 2018 03:35:53 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Nov 2018 18:35:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,469,1534834800"; d="scan'208";a="86950255" Received: from unknown (HELO saesrv02-S2600CWR.intel.com) ([10.224.122.203]) by orsmga007.jf.intel.com with ESMTP; 05 Nov 2018 18:35:49 -0800 From: Vipin Varghese To: dev@dpdk.org, thomas@monjalon.net, reshma.pattan@intel.com, stephen@networkplumber.org, john.mcnamara@intel.com Cc: stephen1.byrne@intel.com, michael.j.glynn@intel.com, amol.patel@intel.com, Vipin Varghese Date: Tue, 6 Nov 2018 08:01:51 +0530 Message-Id: <20181106023154.36687-6-vipin.varghese@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181106023154.36687-1-vipin.varghese@intel.com> References: <20181105175128.33297-8-vipin.varghese@intel.com> <20181106023154.36687-1-vipin.varghese@intel.com> Subject: [dpdk-dev] [PATCH v5 6/9] app/procinfo: add support for show crypto X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Function show_crypto is used for displaying the crypto PMD under the primary process. Signed-off-by: Vipin Varghese --- v4: - add space to compare - Vipin Varghese V3: - replace MACRO to function - Reshma Pathan & Stephen Hemminger - add memset for struct elements - Reshma Pathan - change display formating of flags - Vipin Varghese - use MACRO for string - Vipin Varghese --- app/proc-info/main.c | 80 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 79 insertions(+), 1 deletion(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 8ec2e9474..7213b43fe 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -1032,10 +1032,88 @@ show_tm(void) STATS_BDR_STR(50, ""); } +static void +display_crypto_feature_info(uint64_t x) +{ + if (x == 0) + return; + + printf("\t -- feature flags\n"); + printf("\t\t + symmetric (%c), asymmetric (%c)\n" + "\t\t + symmetric operation chaining (%c)\n", + (x & RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO) ? 'y' : 'n', + (x & RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO) ? 'y' : 'n', + (x & RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING) ? 'y' : 'n'); + printf("\t\t + CPU: SSE (%c), AVX (%c), AVX2 (%c), AVX512 (%c)\n", + (x & RTE_CRYPTODEV_FF_CPU_SSE) ? 'y' : 'n', + (x & RTE_CRYPTODEV_FF_CPU_AVX) ? 'y' : 'n', + (x & RTE_CRYPTODEV_FF_CPU_AVX2) ? 'y' : 'n', + (x & RTE_CRYPTODEV_FF_CPU_AVX512) ? 'y' : 'n'); + printf("\t\t + AESNI: CPU (%c), HW (%c)\n", + (x & RTE_CRYPTODEV_FF_CPU_AESNI) ? 'y' : 'n', + (x & RTE_CRYPTODEV_FF_HW_ACCELERATED) ? 'y' : 'n'); + printf("\t\t + INLINE (%c)\n", + (x & RTE_CRYPTODEV_FF_SECURITY) ? 'y' : 'n'); + printf("\t\t + ARM: NEON (%c), CE (%c)\n", + (x & RTE_CRYPTODEV_FF_CPU_NEON) ? 'y' : 'n', + (x & RTE_CRYPTODEV_FF_CPU_ARM_CE) ? 'y' : 'n'); + printf("\t -- buffer offload\n"); + printf("\t\t + IN_PLACE_SGL (%c)\n", + (x & RTE_CRYPTODEV_FF_IN_PLACE_SGL) ? 'y' : 'n'); + printf("\t\t + OOP_SGL_IN_SGL_OUT (%c)\n", + (x & RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT) ? 'y' : 'n'); + printf("\t\t + OOP_SGL_IN_LB_OUT (%c)\n", + (x & RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT) ? 'y' : 'n'); + printf("\t\t + OOP_LB_IN_SGL_OUT (%c)\n", + (x & RTE_CRYPTODEV_FF_OOP_LB_IN_SGL_OUT) ? 'y' : 'n'); + printf("\t\t + OOP_LB_IN_LB_OUT (%c)\n", + (x & RTE_CRYPTODEV_FF_OOP_LB_IN_LB_OUT) ? 'y' : 'n'); +} + static void show_crypto(void) { - printf(" crypto\n"); + uint8_t crypto_dev_count = rte_cryptodev_count(), i; + + snprintf(bdr_str, MAX_STRING_LEN, " show - CRYPTO PMD %"PRIu64, + rte_get_tsc_hz()); + STATS_BDR_STR(10, bdr_str); + + for (i = 0; i < crypto_dev_count; i++) { + struct rte_cryptodev_info dev_info; + struct rte_cryptodev_stats stats; + + memset(&dev_info, 0, sizeof(dev_info)); + rte_cryptodev_info_get(i, &dev_info); + + printf(" - device (%u)\n", i); + printf("\t -- name (%s)\n" + "\t -- driver (%s)\n" + "\t -- id (%u) on socket (%d)\n" + "\t -- queue pairs (%d)\n", + rte_cryptodev_name_get(i), + dev_info.driver_name, + dev_info.driver_id, + dev_info.device->numa_node, + rte_cryptodev_queue_pair_count(i)); + + display_crypto_feature_info(dev_info.feature_flags); + + printf("\t -- stats\n"); + memset(&stats, 0, sizeof(0)); + if (rte_cryptodev_stats_get(i, &stats) == 0) { + printf("\t\t + enqueue count (%"PRIu64")" + " error (%"PRIu64")\n", + stats.enqueued_count, + stats.enqueue_err_count); + printf("\t\t + dequeue count (%"PRIu64")" + " error (%"PRIu64")\n", + stats.dequeued_count, + stats.dequeue_err_count); + } + } + + STATS_BDR_STR(50, ""); } static void From patchwork Tue Nov 6 02:31:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Varghese, Vipin" X-Patchwork-Id: 47859 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 93A5C5B3C; Tue, 6 Nov 2018 03:35:57 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 5FA795B3C for ; Tue, 6 Nov 2018 03:35:56 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Nov 2018 18:35:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,469,1534834800"; d="scan'208";a="86950291" Received: from unknown (HELO saesrv02-S2600CWR.intel.com) ([10.224.122.203]) by orsmga007.jf.intel.com with ESMTP; 05 Nov 2018 18:35:53 -0800 From: Vipin Varghese To: dev@dpdk.org, thomas@monjalon.net, reshma.pattan@intel.com, stephen@networkplumber.org, john.mcnamara@intel.com Cc: stephen1.byrne@intel.com, michael.j.glynn@intel.com, amol.patel@intel.com, Vipin Varghese Date: Tue, 6 Nov 2018 08:01:52 +0530 Message-Id: <20181106023154.36687-7-vipin.varghese@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181106023154.36687-1-vipin.varghese@intel.com> References: <20181105175128.33297-8-vipin.varghese@intel.com> <20181106023154.36687-1-vipin.varghese@intel.com> Subject: [dpdk-dev] [PATCH v5 7/9] app/procinfo: add support for debug ring X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Function show_ring is used for displaying the RING of the primary process. Signed-off-by: Vipin Varghese --- V3: - replace space to tab in printf - Reshma Pathan - change ring display information - Vipin Varghese --- app/proc-info/main.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 7213b43fe..b97668d7f 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -1119,7 +1119,39 @@ show_crypto(void) static void show_ring(char *name) { - printf(" rings Name (%s)\n", name); + snprintf(bdr_str, MAX_STRING_LEN, " show - RING %"PRIu64, + rte_get_tsc_hz()); + STATS_BDR_STR(10, bdr_str); + + if (name != NULL) { + struct rte_ring *ptr = rte_ring_lookup(name); + if (ptr != NULL) { + printf(" - Name (%s) on socket (%d)\n" + " - flags:\n" + "\t -- Single Producer Enqueue (%u)\n" + "\t -- Single Consmer Dequeue (%u)\n", + ptr->name, + ptr->memzone->socket_id, + ptr->flags & RING_F_SP_ENQ, + ptr->flags & RING_F_SC_DEQ); + printf(" - size (%u) mask (0x%x) capacity (%u)\n", + ptr->size, + ptr->mask, + ptr->capacity); + printf(" - count (%u) free count (%u)\n", + rte_ring_count(ptr), + rte_ring_free_count(ptr)); + printf(" - full (%d) empty (%d)\n", + rte_ring_full(ptr), + rte_ring_empty(ptr)); + + STATS_BDR_STR(50, ""); + return; + } + } + + rte_ring_list_dump(stdout); + STATS_BDR_STR(50, ""); } static void From patchwork Tue Nov 6 02:31:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Varghese, Vipin" X-Patchwork-Id: 47860 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1F3AA5B32; Tue, 6 Nov 2018 03:36:02 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 214875B2A for ; Tue, 6 Nov 2018 03:35:59 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Nov 2018 18:36:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,469,1534834800"; d="scan'208";a="86950304" Received: from unknown (HELO saesrv02-S2600CWR.intel.com) ([10.224.122.203]) by orsmga007.jf.intel.com with ESMTP; 05 Nov 2018 18:35:56 -0800 From: Vipin Varghese To: dev@dpdk.org, thomas@monjalon.net, reshma.pattan@intel.com, stephen@networkplumber.org, john.mcnamara@intel.com Cc: stephen1.byrne@intel.com, michael.j.glynn@intel.com, amol.patel@intel.com, Vipin Varghese Date: Tue, 6 Nov 2018 08:01:53 +0530 Message-Id: <20181106023154.36687-8-vipin.varghese@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181106023154.36687-1-vipin.varghese@intel.com> References: <20181105175128.33297-8-vipin.varghese@intel.com> <20181106023154.36687-1-vipin.varghese@intel.com> Subject: [dpdk-dev] [PATCH v5 8/9] app/procinfo: add support for show mempool X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Function show_mempool is used for displaying the MEMPOOL of the primary process. For valid mempool elements are iterated for max of 256 bytes. Signed-off-by: Vipin Varghese --- v4: - add spacing for flag compare - Vipin Varghese V3: - add avail and in use - Vipin Varghese - add flag split - Vipin Varghese --- app/proc-info/main.c | 67 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index b97668d7f..bd28556ed 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -33,6 +33,7 @@ #include #include #include +#include /* Maximum long option length for option parsing. */ #define MAX_LONG_OPT_SZ 64 @@ -1154,10 +1155,74 @@ show_ring(char *name) STATS_BDR_STR(50, ""); } +static void +mempool_itr_obj(struct rte_mempool *mp, + void *opaque, void *obj, + unsigned int obj_idx) +{ + printf(" - obj_idx %u opaque %p obj %p\n", + obj_idx, opaque, obj); + + if (obj) + rte_hexdump(stdout, " Obj Content", + obj, (mp->elt_size > 256)?256:mp->elt_size); +} + static void show_mempool(char *name) { - printf(" mempools Name (%s)\n", name); + uint64_t flags = 0; + + snprintf(bdr_str, MAX_STRING_LEN, " show - MEMPOOL %"PRIu64, + rte_get_tsc_hz()); + STATS_BDR_STR(10, bdr_str); + + if (name != NULL) { + struct rte_mempool *ptr = rte_mempool_lookup(name); + if (ptr != NULL) { + flags = ptr->flags; + printf(" - Name: %s on socket %d\n" + " - flags:\n" + "\t -- No spread (%c)\n" + "\t -- No cache align (%c)\n" + "\t -- SP put (%c), SC get (%c)\n" + "\t -- Pool created (%c)\n" + "\t -- No IOVA config (%c)\n", + ptr->name, + ptr->socket_id, + (flags & MEMPOOL_F_NO_SPREAD) ? 'y' : 'n', + (flags & MEMPOOL_F_NO_CACHE_ALIGN) ? 'y' : 'n', + (flags & MEMPOOL_F_SP_PUT) ? 'y' : 'n', + (flags & MEMPOOL_F_SC_GET) ? 'y' : 'n', + (flags & MEMPOOL_F_POOL_CREATED) ? 'y' : 'n', + (flags & MEMPOOL_F_NO_IOVA_CONTIG) ? 'y' : 'n'); + printf(" - Size %u Cache %u element %u\n" + " - header %u trailer %u\n" + " - private data size %u\n", + ptr->size, + ptr->cache_size, + ptr->elt_size, + ptr->header_size, + ptr->trailer_size, + ptr->private_data_size); + printf(" - memezone - socket %d\n", + ptr->mz->socket_id); + printf(" - Count: avail (%u), in use (%u)\n", + rte_mempool_avail_count(ptr), + rte_mempool_in_use_count(ptr)); + + /* iterate each object */ + int ret = rte_mempool_obj_iter(ptr, + mempool_itr_obj, NULL); + printf(" - iterated %u objects\n", ret); + + STATS_BDR_STR(50, ""); + return; + } + } + + rte_mempool_list_dump(stdout); + STATS_BDR_STR(50, ""); } int From patchwork Tue Nov 6 02:31:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Varghese, Vipin" X-Patchwork-Id: 47861 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8B2085F13; Tue, 6 Nov 2018 03:36:04 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id BA5435B30 for ; Tue, 6 Nov 2018 03:36:03 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Nov 2018 18:36:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,469,1534834800"; d="scan'208";a="86950335" Received: from unknown (HELO saesrv02-S2600CWR.intel.com) ([10.224.122.203]) by orsmga007.jf.intel.com with ESMTP; 05 Nov 2018 18:36:00 -0800 From: Vipin Varghese To: dev@dpdk.org, thomas@monjalon.net, reshma.pattan@intel.com, stephen@networkplumber.org, john.mcnamara@intel.com Cc: stephen1.byrne@intel.com, michael.j.glynn@intel.com, amol.patel@intel.com, Vipin Varghese Date: Tue, 6 Nov 2018 08:01:54 +0530 Message-Id: <20181106023154.36687-9-vipin.varghese@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181106023154.36687-1-vipin.varghese@intel.com> References: <20181105175128.33297-8-vipin.varghese@intel.com> <20181106023154.36687-1-vipin.varghese@intel.com> Subject: [dpdk-dev] [PATCH v5 9/9] doc/procinfo: add information for debug options X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Document update for debug options and information for PMD instances like port, traffic manager, crypto, mempool and ring instances. Signed-off-by: Vipin Varghese --- V3: - update document from dbg to show - Vipin Varghese V2: - update word style for content - Vipin Varghese --- doc/guides/tools/proc_info.rst | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/doc/guides/tools/proc_info.rst b/doc/guides/tools/proc_info.rst index d5b5ed6a6..5c2ce762b 100644 --- a/doc/guides/tools/proc_info.rst +++ b/doc/guides/tools/proc_info.rst @@ -6,9 +6,9 @@ dpdk-procinfo Application The dpdk-procinfo application is a Data Plane Development Kit (DPDK) application that runs as a DPDK secondary process and is capable of retrieving port -statistics, resetting port statistics and printing DPDK memory information. -This application extends the original functionality that was supported by -dump_cfg. +statistics, resetting port statistics and printing DPDK memory information and +debug information for port|tm|crypto|ring|mempool. This application extends the +original functionality that was supported by dump_cfg. Running the Application ----------------------- @@ -17,7 +17,8 @@ The application has a number of command line options: .. code-block:: console ./$(RTE_TARGET)/app/dpdk-procinfo -- -m | [-p PORTMASK] [--stats | --xstats | - --stats-reset | --xstats-reset] + --stats-reset | --xstats-reset | --show-port | --show-tm | --show-crypto | + --show-mempool[=name] | --show-ring[=name]] Parameters ~~~~~~~~~~ @@ -41,6 +42,28 @@ If no port mask is specified xstats are reset for all DPDK ports. **-m**: Print DPDK memory information. +**--show-port** +The show-port parameter displays port level various configuration and +mbuf pool information associated to RX queues. + +**--show-tm** +The show-tm parameter displays per port traffic manager settings and +current configuration. It also display statistics too. + +**--show-crypto** +The show-crypto parameter displays available cryptodev configurations, +settings and stats per node. + +**--show-mempool[=name]** +The show-mempool parameter display current allocation of all mempool +with debug information. Specifying the name allows display details for +specific mempool. For invalid|no mempool name, whole list is dump. + +**--show-ring[=name]** +The show-ring pararmeter display current allocation of all ring with +debug information. Specifying the name allows to display details for specific +ring. For invalid|no ring name, whole list is dump. + Limitations -----------