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 64DC9A0540; Mon, 13 Jul 2020 14:08:59 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CACDC1D674; Mon, 13 Jul 2020 14:08:58 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60082.outbound.protection.outlook.com [40.107.6.82]) by dpdk.org (Postfix) with ESMTP id 0F0B81D66F for ; Mon, 13 Jul 2020 14:08:58 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fyAMR7mdS2r3/3y0W7tF4AT1rHpcWmk9v4xN26gXvH5mFko/ySubIpvR/xU+NvsqCUkmWbOQdDHqkgYkTFuxkCbmoPDuFcnqhTtfR/i36RAM0ocjMbSL9h3LHufpx3phMnioEJhPXoYsrKoeUXK9cz56c4ev0yH/388VlCqLX5tJIZzJFHFm65k2cbtG3QpCH4B04X8EEOnUClXCmq6OH3pnZE2BMr4v7GlZSBczo9uFXRWFAqH/Y+8aWWzGcDWjPVJT5acWYJsxLRpYWABlvXP9cRAm2ewhCWDXICBxh9TjP74XS/w5gt6Ga4JBTOIoTQkELExczW9t58pUwZRnzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vWvl7lVDw0kqQ9KPKZ4F083gjPrYHcsyC3IVJUEBo2M=; b=VGjEawXgittcUau3Oa0sG9YYd0S2ZFGFPKuMPJOTbeYcG1vJpU4gyFK9ZcqDlbefzlgYDakXsuuHE3285VajjzUQVYXOyM4C1xGhDzAZW8rQz/1FKbZDd+M/4Uf9+g8wsViu1PruiMWXixclr0CjxjH1M4g8UflPVKe16afSCJLeQG/LmV+ivEINZ5FB9Ms7nGXLt6YECaeZqqyIaEX5bNuCRyW8TmaHIL+JgFNzQAUuWRm9I3DMVImoG0xh/SiEsSfS/+Vr9/DxqUEZoU5AETmpgCeBfhzTa6rwFLCOMejJRqVLEjBL7DZFS3Oa8dlU1nX6F15/Tzs3IYcqFeMCMQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vWvl7lVDw0kqQ9KPKZ4F083gjPrYHcsyC3IVJUEBo2M=; b=PYNhY38mPZMX33oyoop/S2Q19H7euOrQIsoZABvZ3vv9XALlNe4AkwN9VINHeCwtG6UTCKjyvoJlwTd5C0TO7e99KQqYJ+s5ngOIVeysv/WZLEszWGYGPOw+PhF2JxwDY/fNar9+NxcsBGjl9dO3E7q5DA69WCdRq590K+BSXwg= Received: from AM6PR04MB4456.eurprd04.prod.outlook.com (2603:10a6:20b:22::25) by AM5PR0401MB2676.eurprd04.prod.outlook.com (2603:10a6:203:2f::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.20; Mon, 13 Jul 2020 12:08:57 +0000 Received: from AM6PR04MB4456.eurprd04.prod.outlook.com ([fe80::52:2324:96c9:f3ae]) by AM6PR04MB4456.eurprd04.prod.outlook.com ([fe80::52:2324:96c9:f3ae%7]) with mapi id 15.20.3174.025; Mon, 13 Jul 2020 12:08:57 +0000 From: Hemant Agrawal To: Stephen Hemminger , "dev@dpdk.org" CC: Maryam Tahhan , Reshma Pattan Thread-Topic: [dpdk-dev] [PATCH v2 6/7] app/proc-info: dump rx and tx descriptor info Thread-Index: AQHWI+DIdemZcayF+0mV/v2TOSRmJKkF1IYw Date: Mon, 13 Jul 2020 12:08:56 +0000 Message-ID: References: <20200506193741.24117-1-stephen@networkplumber.org> <20200506195758.27057-1-stephen@networkplumber.org> <20200506195758.27057-7-stephen@networkplumber.org> In-Reply-To: <20200506195758.27057-7-stephen@networkplumber.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: networkplumber.org; dkim=none (message not signed) header.d=none; networkplumber.org; dmarc=none action=none header.from=nxp.com; x-originating-ip: [182.69.104.93] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 9216fdeb-31a0-4adc-17a3-08d8272584fb x-ms-traffictypediagnostic: AM5PR0401MB2676: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:163; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: VhgPfGmCrA8dQAIpbXi1ROlHH0c4KOgDiCc4LXj03OXlC6eKWGU24lz3ovYKBH40Z6Ap0mgJm5FoUB60uGU7TOzolzEwwrZbvDg6OvLT1Lxca+1cC8WxYmpcA8XHPFW3dKD8WspSDMVHtN+PGIc9FpqThSSQBU6A8mbemuughUA7b0K9+CnB8IShRgIfvXmVcFLNQH5hNjcOxNZUTVafDOSKRZdvhVxsVLExZ13P2OFw7hmRAIwAAKxMie3ftbAidyZequF1bUeCEJPcVLjldcy8mXMKHHcjhNMFwvTcuB9OuOJCjAoXqLnODWFBAGBiH9+5fZ4FvY7Hfwy9IpHU1g== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB4456.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(346002)(136003)(39860400002)(366004)(376002)(396003)(86362001)(33656002)(2906002)(55016002)(4326008)(26005)(186003)(66446008)(83380400001)(66556008)(66476007)(7696005)(64756008)(66946007)(76116006)(6506007)(53546011)(9686003)(478600001)(5660300002)(110136005)(44832011)(54906003)(52536014)(71200400001)(8936002)(316002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: BaJa8siSqOBrzuFp5AFTCdxGgXqmLgPSOqdeFI/QO80OxDET0Qbl9K0ROVQHx8B4I66zk3B+wc4G7V/0IlTHuGvvPv9eNn7Sc8VlO5Bu8jg3iKdSXv5DBSz2Nh6ELT9cq3INFFfIv37YadHlKg4z34C1WG6GyfxrFF3qa1D8KOnoJs7zhgqRTsvUz6l/REDAUp8gOJEjXWVEm13aJ6jeVDfDIp1OGYe7hK0pSPY60WUAW9brG7udt5pwu7TOhjwABnyI9DCulWI4Q4XqfF54r0kYSiwKB2eyAjLssAIndgA39HO9IDy4jkIgUfSyJ/KQVE7QMHgeaqzNIrNG0fRasEUOSnOde7/kXJAvv/qwbU/ErFGo9Wvb0IkWc1oeCF8wWFlt0YjZcDyhYfAnlR40ON97ZJVKamEdSQRxN+ml7NoTYku/unBYou6Ly3n3nlneJ8wzlqgteHWzBF1E6XEhQdmL+NtlgqYbSBoNKmWu7zVr1mCc2cPYzq/UfbutgTow x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4456.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9216fdeb-31a0-4adc-17a3-08d8272584fb X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Jul 2020 12:08:57.0167 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 5zgS5uKKT360G5iJGU4t3Kn+Czd655F6CiyITO3lkWefWZ4CFtBFgQ1h4eaQOxkEBRLR+wjDFrVmJopYxty7yw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0401MB2676 Subject: Re: [dpdk-dev] [PATCH v2 6/7] app/proc-info: dump rx and tx descriptor 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" -----Original Message----- From: dev On Behalf Of Stephen Hemminger Sent: Thursday, May 7, 2020 1:28 AM To: dev@dpdk.org Cc: Stephen Hemminger ; Maryam Tahhan ; Reshma Pattan Subject: [dpdk-dev] [PATCH v2 6/7] app/proc-info: dump rx and tx descriptor= info Many drivers will report per queue info for both rx and tx as well as how m= any descriptors are in use. Signed-off-by: Stephen Hemminger --- app/proc-info/main.c | 79 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 66 insertions(+), 13 deletions(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 804c0fd63b3e= ..00e06c986e27 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -654,6 +654,25 @@ metrics_display(int port_id) rte_free(names); } =20 +/* This could be replaced by an ethdev hook in future */ static int=20 +eth_tx_queue_available(uint16_t port_id, uint16_t queue_id, uint16_t n)=20 +{ + uint16_t offset; + int count =3D 0; + + for (offset =3D 0; offset < n; offset++) { + int status; + + status =3D rte_eth_tx_descriptor_status(port_id, queue_id, offset); + if (status < 0) + return status; + if (status =3D=3D RTE_ETH_TX_DESC_DONE) + ++count; + } + return count; +} + static void show_port(void) { @@ -667,7 +686,6 @@ show_port(void) uint16_t mtu =3D 0; struct rte_eth_link link; struct rte_eth_dev_info dev_info; - struct rte_eth_rxq_info queue_info; struct rte_eth_rss_conf rss_conf; struct rte_eth_fc_conf fc_conf; struct rte_ether_addr mac; @@ -739,6 +757,7 @@ show_port(void) ret =3D rte_eth_macaddr_get(i, &mac); if (ret =3D=3D 0) { char ebuf[RTE_ETHER_ADDR_FMT_SIZE]; + rte_ether_format_addr(ebuf, sizeof(ebuf), &mac); printf("\t -- mac %s\n", ebuf); } @@ -750,20 +769,54 @@ show_port(void) if (ret =3D=3D 0) printf("\t -- mtu (%d)\n", mtu); =20 - printf(" - queue\n"); for (j =3D 0; j < dev_info.nb_rx_queues; j++) { + struct rte_eth_rxq_info queue_info; + int count; + ret =3D rte_eth_rx_queue_info_get(i, j, &queue_info); - if (ret =3D=3D 0) { - printf("\t -- queue %d rx scatter %d" - " descriptors %d" - " offloads 0x%"PRIx64 - " mempool socket %d\n", - j, - queue_info.scattered_rx, - queue_info.nb_desc, - queue_info.conf.offloads, - queue_info.mp->socket_id); - } + if (ret !=3D 0) + break; + + if (j =3D=3D 0) + printf(" - rx queue\n"); + + printf("\t -- %d descriptors ", j); + count =3D rte_eth_rx_queue_count(i, j); + if (count >=3D 0) + printf("%d/", count); + printf("%d", queue_info.nb_desc); + + if (queue_info.scattered_rx) + printf(" scattered_rx"); + + printf(" offloads %#"PRIx64" socket %d\n", + queue_info.conf.offloads, + queue_info.mp->socket_id); [Hemant] will you please also add printf("\t -- mempool name: %s\n", (que= ue_info.mp =3D=3D NULL) ? "NULL" : queue_info.mp->name); + } + + for (j =3D 0; j < dev_info.nb_tx_queues; j++) { + struct rte_eth_txq_info queue_info; + int count; + + ret =3D rte_eth_tx_queue_info_get(i, j, &queue_info); + if (ret !=3D 0) + break; + + if (j =3D=3D 0) + printf(" - tx queue\n"); + + printf("\t -- %d descriptors ", j); + + count =3D eth_tx_queue_available(i, j, queue_info.nb_desc); + if (count >=3D 0) + printf("%d/", count); + printf("%d", queue_info.nb_desc); + + if (queue_info.conf.tx_deferred_start) + printf(" deferred_start"); + + printf(" offloads %#"PRIx64"\n", + queue_info.conf.offloads); } =20 ret =3D rte_eth_dev_rss_hash_conf_get(i, &rss_conf); -- 2.20.1