From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 535DCA04B1; Thu, 24 Sep 2020 07:35:14 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 42F7E1DCFC; Thu, 24 Sep 2020 07:34:54 +0200 (CEST) Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by dpdk.org (Postfix) with ESMTP id F0A3D1DD2F for ; Thu, 24 Sep 2020 07:34:46 +0200 (CEST) Received: by mail-pg1-f194.google.com with SMTP id k133so1203131pgc.7 for ; Wed, 23 Sep 2020 22:34:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lcUOeme3pd+4myZZ+wZofT4Go8L2mLkArnPdeVNO+FA=; b=b9PBygNNzVKZdvvLkmPWpwTTAAz+CojIq/PO3bxd/gyzpBigQO6/T8PJWxZkrPvjlZ 8hBQQyq+wKBMyv0cAxTHliu/fSdpcn04pjCvcxVcfaANJL/486ba9KcjYYz7SM7mHAxe i4zdG+yPYUHJb3n5WDZuW8fsuvP/FJ7/iBQHxohxMLYONaUAS27Xm+QAt5l4DFVcenwQ Hx49T0ieEj80zfPdRHbFDkw/IgEywVKiabRnD7rpmpJyBfgY9jMPwtDhROyWVWjeqwdQ voNrmpN3LVFU0+xX/FMo/vI85/bAdQKLcfNxi8/Yc+oCcJKH5KcidU6/YwC2T312qBog jJWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lcUOeme3pd+4myZZ+wZofT4Go8L2mLkArnPdeVNO+FA=; b=Rx57cnBtD7wu9BEC2IubUze6YWxjGaLJyRg7aR6IwzbMRNA7VBQYHSvF9LOmpKXXK6 rWgHKCr/KWbHvT01WEwa9YtCoO5T37yxhLpQLlia3aUM+jaUuO+/tVPiR0FMqXbs856s hlhxoSMy0PG9TeVEJHthr9QZJNPY7Bfa/dwjj5ghG037iGmLzBj+8aClhn1J50AEhyFr zQ5ERUwbSGY+ibUqp+pe6axI+HEZAjSlhwjL08mD1S9KyV+CM8/3N1bVP4CS2GdrZdMl ZKu2q+rTpnst7P7S5daOxOaUjitZ3KnWHY78xQfPMoG0hsiVP8Tu93WbiF4TVXcN6CB2 xYng== X-Gm-Message-State: AOAM532UKpdRwoJ4yRqDxRlSyvN8WLRBo25pZazkXCmiGNDO+JMRrDj2 Hoi561f4KvItGnonyPLyf7T+tmFI9WPnHQ== X-Google-Smtp-Source: ABdhPJx8jXGxEh2CisDz3yR8kwI0jmpY967uXZeMhZJqH8YgvYK0Nfpt02onKJe0wSaJrxl7NWc3Xw== X-Received: by 2002:a65:468b:: with SMTP id h11mr2681012pgr.46.1600925685758; Wed, 23 Sep 2020 22:34:45 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id v8sm1529609pgg.58.2020.09.23.22.34.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Sep 2020 22:34:45 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Hemant Agrawal Date: Wed, 23 Sep 2020 22:34:30 -0700 Message-Id: <20200924053433.12648-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200924053433.12648-1-stephen@networkplumber.org> References: <20200728191330.20864-1-stephen@networkplumber.org> <20200924053433.12648-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v6 4/7] app/proc-info: add more info to show_ports 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" Revise the display of port information to include more data and be more human friendly. * Show driver and device information * Show MAC address * Show flow control information * Combine lines if possible * Show all multicast mode * Show queue mempool name Signed-off-by: Stephen Hemminger Acked-by: Hemant Agrawal --- app/proc-info/main.c | 77 +++++++++++++++++++++++++++++++++----------- 1 file changed, 59 insertions(+), 18 deletions(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 66918a834877..ab754daefa50 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -670,6 +670,8 @@ show_port(void) struct rte_eth_rxq_info queue_info; struct rte_eth_rss_conf rss_conf; char link_status_text[RTE_ETH_LINK_MAX_STR_LEN]; + struct rte_eth_fc_conf fc_conf; + struct rte_ether_addr mac; memset(&rss_conf, 0, sizeof(rss_conf)); @@ -677,7 +679,17 @@ show_port(void) STATS_BDR_STR(5, bdr_str); printf(" - generic config\n"); - printf("\t -- Socket %d\n", rte_eth_dev_socket_id(i)); + ret = rte_eth_dev_info_get(i, &dev_info); + if (ret != 0) { + printf("Error during getting device info: %s\n", + strerror(-ret)); + return; + } + + printf("\t -- driver %s device %s socket %d\n", + dev_info.driver_name, dev_info.device->name, + rte_eth_dev_socket_id(i)); + ret = rte_eth_link_get(i, &link); if (ret < 0) { printf("Link get failed (port %u): %s\n", @@ -688,32 +700,56 @@ show_port(void) &link); printf("\t%s\n", link_status_text); } - printf("\t -- promiscuous (%d)\n", - rte_eth_promiscuous_get(i)); + + ret = rte_eth_dev_flow_ctrl_get(i, &fc_conf); + if (ret == 0 && fc_conf.mode != RTE_FC_NONE) { + printf("\t -- flow control mode %s%s high %u low %u pause %u%s%s\n", + fc_conf.mode == RTE_FC_RX_PAUSE ? "rx " : + fc_conf.mode == RTE_FC_TX_PAUSE ? "tx " : + fc_conf.mode == RTE_FC_FULL ? "full" : "???", + fc_conf.autoneg ? " auto" : "", + fc_conf.high_water, + fc_conf.low_water, + fc_conf.pause_time, + fc_conf.send_xon ? " xon" : "", + fc_conf.mac_ctrl_frame_fwd ? " mac_ctrl" : ""); + } + + ret = rte_eth_macaddr_get(i, &mac); + if (ret == 0) { + char ebuf[RTE_ETHER_ADDR_FMT_SIZE]; + rte_ether_format_addr(ebuf, sizeof(ebuf), &mac); + printf("\t -- mac %s\n", ebuf); + } + + ret = rte_eth_promiscuous_get(i); + if (ret >= 0) + printf("\t -- promiscuous mode %s\n", + ret > 0 ? "enabled" : "disabled"); + + ret = rte_eth_allmulticast_get(i); + if (ret >= 0) + printf("\t -- all multicast mode %s\n", + ret > 0 ? "enabled" : "disabled"); + ret = rte_eth_dev_get_mtu(i, &mtu); if (ret == 0) printf("\t -- mtu (%d)\n", mtu); - ret = rte_eth_dev_info_get(i, &dev_info); - if (ret != 0) { - printf("Error during getting device (port %u) info: %s\n", - i, strerror(-ret)); - return; - } - printf(" - queue\n"); for (j = 0; j < dev_info.nb_rx_queues; j++) { ret = rte_eth_rx_queue_info_get(i, j, &queue_info); if (ret == 0) { printf("\t -- queue %u rx scatter %u" - " descriptors %u" - " offloads 0x%" PRIx64 - " mempool socket %d", - j, - queue_info.scattered_rx, - queue_info.nb_desc, - queue_info.conf.offloads, - queue_info.mp->socket_id); + " descriptors %u" + " offloads %#" PRIx64 + " mempool name %s socket %d", + j, + queue_info.scattered_rx, + queue_info.nb_desc, + queue_info.conf.offloads, + queue_info.mp->name, + queue_info.mp->socket_id); if (queue_info.rx_buf_size != 0) printf(" rx buffer size %u", @@ -1167,7 +1203,10 @@ show_mempool(char *name) if (name != NULL) { struct rte_mempool *ptr = rte_mempool_lookup(name); if (ptr != NULL) { + struct rte_mempool_ops *ops; + 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" @@ -1197,6 +1236,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"); return; } -- 2.27.0