From patchwork Sat Jul 11 09:53:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 235288 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp1197021ilg; Sat, 11 Jul 2020 02:58:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7GIv0wbTudoQ+w6UxMhkGyNPFdxWQiqpTa56bpJKdfvYRdBo+R55w6b300H90hD8SpEsP X-Received: by 2002:a17:906:384a:: with SMTP id w10mr67517546ejc.235.1594461488037; Sat, 11 Jul 2020 02:58:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594461488; cv=none; d=google.com; s=arc-20160816; b=r0q37IgGYYZREvgzWIlngtBoChxWWrdbgZx7UsoXsAUcP+WJlAC5cRO+1oeT68lx5j L7jFJJiOCWQxPeAFt3Y5EeeNnwANEPZjtDJjVivqQklc7/MHQ4Nb1oh2sKEcWdUxipyS 0xjTxd/XvNpk/l/wUn0WA+x/fFdYikVj6+i//nxYV486Fm6hD7iLCov14lmhSqfFP6E3 vr26Rl7dKshyuqIdJNH++sW+q+hgwvGBZLt6RU5W+iEgRCDvZEIp9H3zquByRFyD2thJ ppF7S5kLERQcZaS0Wk6Gsaty7nzh0MTsRSA/wI9X95ygs26mYhUI2vIDIrMnfiERjgJW VkvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=3B0qIQrLKK6ZyApWRakLN2p2WNqEN//DxrK4CDcSy/Y=; b=JJAyKOV5eiufr+O9mSTL6QDU7AJ+oTyis09ydv7Shy4QUHCAbzswlluu6PM1G2bJZ+ EfQ0c0Pj8vPzuK8KBrkt8zRGqchexcuvLgaejS/hj7ZFadNZjiXUoree00Prjjd5+wYV ZVJ4yae+SG/egtd/c5HXgWM7U5BN/n6r4GOYlp8vRerAM8DrOv5WMeJqTDlpq8vFf4QJ jSeGB9k0/5doc4ehyiE6FfTX7GDws/BwFk5ufvdEXb4sU9uSPROnqItHygaqhjzUqTq3 oCPj3kE5YDPPhzL4GvFpAVD7g4s/pNgdmXRJZ3WYvFPcpu54cSl3o0oeLqPtwKULiZbg HQlg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id d19si5694717ejt.396.2020.07.11.02.58.07; Sat, 11 Jul 2020 02:58:08 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 412B91D93F; Sat, 11 Jul 2020 11:58:07 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 8CEE91D93D for ; Sat, 11 Jul 2020 11:58:05 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 6A44D1A0620; Sat, 11 Jul 2020 11:58:05 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 286311A05D4; Sat, 11 Jul 2020 11:58:03 +0200 (CEST) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 26132402AE; Sat, 11 Jul 2020 17:58:00 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org Cc: maryam.tahhan@intel.com, reshma.pattan@intel.com, Hemant Agrawal Date: Sat, 11 Jul 2020 15:23:43 +0530 Message-Id: <20200711095343.10523-1-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200710160610.22844-1-hemant.agrawal@nxp.com> References: <20200710160610.22844-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2] app/procinfo: enhance port mempool and crypto info 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" This patch enhances the port info for more details about the port and queues. This patch also add support to get info about the mempool ops and security context for crypto devices. Signed-off-by: Hemant Agrawal --- app/proc-info/main.c | 84 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 72 insertions(+), 12 deletions(-) -- 2.17.1 diff --git a/app/proc-info/main.c b/app/proc-info/main.c index abeca4aab..818c85d61 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -661,6 +661,7 @@ show_port(void) { uint16_t i = 0; int ret = 0, j, k; + int rxq_count; snprintf(bdr_str, MAX_STRING_LEN, " show - Port PMD %"PRIu64, rte_get_tsc_hz()); @@ -672,12 +673,26 @@ show_port(void) struct rte_eth_dev_info dev_info; struct rte_eth_rxq_info queue_info; struct rte_eth_rss_conf rss_conf; + struct rte_ether_addr ethaddr; + char name[RTE_ETH_NAME_MAX_LEN]; memset(&rss_conf, 0, sizeof(rss_conf)); - snprintf(bdr_str, MAX_STRING_LEN, " Port (%u)", i); + rte_eth_dev_get_name_by_port(i, name); + + snprintf(bdr_str, MAX_STRING_LEN, " Port (%u)(%s)", i, name); STATS_BDR_STR(5, bdr_str); printf(" - generic config\n"); + ret = rte_eth_macaddr_get(i, ðaddr); + if (ret != 0) { + printf("macaddr get failed (port %u): %s\n", + i, rte_strerror(-ret)); + } else { + char buf[RTE_ETHER_ADDR_FMT_SIZE]; + rte_ether_format_addr(buf, RTE_ETHER_ADDR_FMT_SIZE, + ðaddr); + printf("\t -- MAC:%s\n", buf); + } printf("\t -- Socket %d\n", rte_eth_dev_socket_id(i)); ret = rte_eth_link_get(i, &link); @@ -685,18 +700,21 @@ show_port(void) printf("Link get failed (port %u): %s\n", i, rte_strerror(-ret)); } else { - printf("\t -- link speed %d duplex %d," - " auto neg %d status %d\n", - link.link_speed, - link.link_duplex, - link.link_autoneg, - link.link_status); + printf("\t -- link speed: %d Mbps %s," + ":auto neg %d :status-%s\n", + link.link_speed, + (link.link_duplex == ETH_LINK_FULL_DUPLEX) ? + ("full-duplex") : ("half-duplex"), + link.link_autoneg, + (link.link_status) ? ("up") : ("down")); } - printf("\t -- promiscuous (%d)\n", - rte_eth_promiscuous_get(i)); + printf("\t -- promiscuous: %s\n", + rte_eth_promiscuous_get(i) ? "enabled" : "disabled"); ret = rte_eth_dev_get_mtu(i, &mtu); if (ret == 0) printf("\t -- mtu (%d)\n", mtu); + printf("\t -- multicast mode: %s\n", + rte_eth_allmulticast_get(i) ? "enabled" : "disabled"); ret = rte_eth_dev_info_get(i, &dev_info); if (ret != 0) { @@ -704,7 +722,17 @@ show_port(void) i, strerror(-ret)); return; } - + printf("\t -- Driver name: %s\n", dev_info.driver_name); + if (dev_info.device->devargs && dev_info.device->devargs->args) + printf("\t -- Devargs: %s\n", + dev_info.device->devargs->args); + printf("\t -- min size of RX buf: %u\n", + dev_info.min_rx_bufsize); + printf("\t -- max config length of RX pkt: %u\n", + dev_info.max_rx_pktlen); + + printf("\t -- num of RX queues: %u\n", dev_info.nb_rx_queues); + printf("\t -- num of TX queues: %u\n", dev_info.nb_tx_queues); printf(" - queue\n"); for (j = 0; j < dev_info.nb_rx_queues; j++) { ret = rte_eth_rx_queue_info_get(i, j, &queue_info); @@ -718,7 +746,15 @@ show_port(void) queue_info.nb_desc, queue_info.conf.offloads, queue_info.mp->socket_id); + printf("\t -- mempool name: %s\n", + (queue_info.mp == NULL) ? + "NULL" : queue_info.mp->name); + } + rxq_count = rte_eth_rx_queue_count(i, j); + if (rxq_count >= 0) + printf("\t -- used rx desc count: %d\n", + rxq_count); } ret = rte_eth_dev_rss_hash_conf_get(i, &rss_conf); @@ -734,7 +770,7 @@ show_port(void) } } - printf(" - cyrpto context\n"); + printf(" - crypto context\n"); #ifdef RTE_LIBRTE_SECURITY void *p_ctx = rte_eth_dev_get_sec_ctx(i); printf("\t -- security context - %p\n", p_ctx); @@ -1064,7 +1100,7 @@ display_crypto_feature_info(uint64_t x) 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", + printf("\t\t + SECURITY OFFLOAD(%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', @@ -1122,6 +1158,26 @@ show_crypto(void) stats.dequeued_count, stats.dequeue_err_count); } +#ifdef RTE_LIBRTE_SECURITY + void *p_ctx = rte_cryptodev_get_sec_ctx(i); + printf("\t -- security context - %p\n", p_ctx); + + if (p_ctx) { + printf("\t -- size %u\n", + rte_security_session_get_size(p_ctx)); + const struct rte_security_capability *s_cap = + rte_security_capabilities_get(p_ctx); + if (s_cap) { + printf("\t -- action (0x%x), protocol (0x%x)," + " offload flags (0x%x)\n", + s_cap->action, + s_cap->protocol, + s_cap->ol_flags); + printf("\t -- capabilities - oper type %x\n", + s_cap->crypto_capabilities->op); + } + } +#endif } STATS_BDR_STR(50, ""); @@ -1176,8 +1232,10 @@ show_mempool(char *name) if (name != NULL) { struct rte_mempool *ptr = rte_mempool_lookup(name); + struct rte_mempool_ops *ops; if (ptr != NULL) { flags = ptr->flags; + ops = rte_mempool_get_ops(ptr->ops_index); printf(" - Name: %s on socket %d\n" " - flags:\n" "\t -- No spread (%c)\n" @@ -1207,6 +1265,8 @@ show_mempool(char *name) printf(" - Count: avail (%u), in use (%u)\n", rte_mempool_avail_count(ptr), rte_mempool_in_use_count(ptr)); + printf(" - ops_index %d ops_name %s\n", + ptr->ops_index, ops ? ops->name:"NA"); STATS_BDR_STR(50, ""); return;