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 1B82EA0521; Tue, 28 Jul 2020 09:22:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 77AEC1C0CE; Tue, 28 Jul 2020 09:22:26 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60043.outbound.protection.outlook.com [40.107.6.43]) by dpdk.org (Postfix) with ESMTP id EE0A71C0CA for ; Tue, 28 Jul 2020 09:22:25 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RwUVh5CBPOX+cj3JylhcTySMVRydGxzIRnCndITVUk0cU8aRQGyhLwTn6p1usqV2Vdh22hO0wIER8gtW4QalIE4a9tXmNcb9C3ByXMnKv3A4zAiCvyzI1XRc9U83F1tOBvcPGkmONWsn2c5sCkvqf1D2TqdSSp2bvS2Nzbhh/KRKykoBwT1CLTW3kYJ6jHTt/h5xa7srZOVmQZqc8k/qZfgMt/UupcB2RwiZUhmsirGbFXTJEz6dM0zeWBVBdPPP/m0Sz5TXcPodBOhZXJkqJm2cP4fOmWY0Ff7InhdFCx+LJVPmgY4BQFRhpMF43eE9152KpQEbLdbac3zoDGfjzQ== 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=DDh7AFU+6+M773U9MvJxfJJ4ZM7gzeyRD/1We9kKOeY=; b=TaiMLmFpKUZdZyVQms5OBxK77hRBDT5te5U6qkkn+OXdsYyVT4kMbo0owngc247H7r/viIkqrWQrvo/pLg9ENCf7GUR2wEXh6y+apBkI51Hy9+luQ3au3kvjiyD889igELvt2N6vigUWbnPWgJeoAO2Qc+KzBGQVjLWIGN+XIcEvR0wTEBBx2u48CNPKIxhCDoI9qIJ+WKdHe6sQzYf9W3n4d0uAg3ZYclg6ieZVLK98xs4vFJt7qkiOlDvhNqi0D/fbI5mTKNDJUoq5nrNbGPDZ9mggW1aqdrTkb5dE4xBkTyJa7NirBXUyEXG4YPVglvp+hPiZk+9bHuJjvA/lwQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DDh7AFU+6+M773U9MvJxfJJ4ZM7gzeyRD/1We9kKOeY=; b=WyreLh95VotUjfMsokbDiV3zJymRqStmqb1AZuaUXG4Ebs3lP5ZdROiMekPVQo4/FpLeYXTRaFNLvpTaQo9mtkryGRMrjU3FzFVXgqiTzBq6oV+zkzjqGDR9ZKyynaxHW2fIyu8mUnwP0HsjitF4GJzHb6z2RI/zA6cWXsa5H/w= Received: from AM6PR04MB4456.eurprd04.prod.outlook.com (2603:10a6:20b:22::25) by AM6PR0402MB3782.eurprd04.prod.outlook.com (2603:10a6:209:1a::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.23; Tue, 28 Jul 2020 07:22:24 +0000 Received: from AM6PR04MB4456.eurprd04.prod.outlook.com ([fe80::50d:1b5:ef9f:655c]) by AM6PR04MB4456.eurprd04.prod.outlook.com ([fe80::50d:1b5:ef9f:655c%7]) with mapi id 15.20.3216.033; Tue, 28 Jul 2020 07:22:24 +0000 From: "Hemant Agrawal (OSS)" To: Stephen Hemminger , "dev@dpdk.org" Thread-Topic: [PATCH v4 4/8] app/proc-info: add more info to show_ports Thread-Index: AQHWZK/WEYZRJQwF70KoaLFCZiBSoQ== Date: Tue, 28 Jul 2020 07:22:24 +0000 Message-ID: References: <20200506193741.24117-1-stephen@networkplumber.org> <20200721182242.5366-1-stephen@networkplumber.org> <20200721182242.5366-5-stephen@networkplumber.org> In-Reply-To: <20200721182242.5366-5-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=oss.nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [182.69.57.113] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 253b8a8f-2b75-41c5-1ba3-08d832c6f97e x-ms-traffictypediagnostic: AM6PR0402MB3782: x-ms-exchange-sharedmailbox-routingagent-processed: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:168; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 6Q2lFaNQMkKVjJCOZSkyT32b9bUfiFg5OOBNam/x9VHQhXT5YSs/nVq3HFbKgRlBp601g+QJ9e6RMQ4SLuwtjHw3CLyjmHIU1Rm2drZqpEwS+Qv6TuMadvpqES0AJhwDQGl7e+PPdbElfE6vsVlTWlow3HW9D77bSlJxTHpuJENc9kuz/FRhRCNlmCm57LmuMFr1lyhReIXxxlIu57Ijt89lNO0VSAdZAryd7NraxRd2DUx7IOmf1ud+LgNiBFHsyFHIv/5NjcUcBT59MpCgbiej/7HlmwR2CoOlgIS8qxIaTWoZG5yDtD7Ivu+CBEN+KWeEVuXSdxv87TYZN3ieRA== 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)(136003)(366004)(396003)(346002)(39860400002)(376002)(5660300002)(71200400001)(83380400001)(52536014)(86362001)(7696005)(186003)(53546011)(6506007)(8676002)(316002)(110136005)(26005)(8936002)(55016002)(66946007)(76116006)(66446008)(64756008)(66556008)(66476007)(478600001)(9686003)(33656002)(2906002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: esNAxlbm4pmcl3dHTjH+0Ze3eazGBsvujJHnnKimL1DYk6hRe2aelTWsyab9nq00edGBWMcEmdkIiUHI57vDH88ZKULMXm3q1xJb5bwiRuLz98jxlfJNgSHkDqFJxv1Mp+d6iQA7MieNW0dpP1QUmU77p2YWKnvCtssfy+WlUHj3WzeZGE1yjCaUAuLuS90dkHDnfF9WG+HuOMOSZis4MGMyQ5wEzZqvTub60gQYUAZ+wf9OppzFVnCRyryf2SeSl/AkyrqT9AtzNUqggJY169riSNE42NUSv3ZQNcx26NfhHopbVROGqqnbEEJOEeXd/v1RWl8D6pqRCD8n+uXB70fnFrSFRS76IUE1QS6eBbykiZ3jc+H2COLRs+RmevymkbjLis7tziffTeLhgXxCq3KI+p1P3Vj8/cppfIXRQNGRdUEVwc/+6LxFwkS2j/NZTR0p2Xq5ugxGMTeN6JEwl01o6UH4FoTJ97aHYBHYMjVth3yEE1DTziwiCMQbz8ly x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: oss.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: 253b8a8f-2b75-41c5-1ba3-08d832c6f97e X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Jul 2020 07:22:24.2960 (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: 3Knh/Ib+xNWEDAeCHmV+nlRxi54r1ZvE+Cf5wMzMN2krJ5vrh2SPbnpQpgZPPiGSmBy8lPEnXSUFbScFS9VdTQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3782 Subject: Re: [dpdk-dev] [PATCH v4 4/8] 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" Will you please also print queue mempool info + printf("\t -- mempool name: %s\n", + (queue_info.mp =3D=3D NULL) ? + "NULL" : queue_info.mp->name); -----Original Message----- From: Stephen Hemminger =20 Sent: Tuesday, July 21, 2020 11:53 PM To: dev@dpdk.org Cc: Stephen Hemminger ; Hemant Agrawal Subject: [PATCH v4 4/8] app/proc-info: add more info to show_ports Revise the display of port information to include more data and be more hum= an friendly. * Display units for port speed, and decode link fields. * Show driver and device information * Show MAC address * Show flow control information * Combine lines if possible * Show all multicast mode Signed-off-by: Stephen Hemminger Acked-by: Hemant Agrawal --- app/proc-info/main.c | 88 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 72 insertions(+), 16 deletions(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index e4914191bef9= ..7c1276b7fbc1 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -669,6 +669,8 @@ 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_eth_fc_conf fc_conf; + struct rte_ether_addr mac; =20 memset(&rss_conf, 0, sizeof(rss_conf)); =20 @@ -676,32 +678,86 @@ show_port(void) STATS_BDR_STR(5, bdr_str); printf(" - generic config\n"); =20 - printf("\t -- Socket %d\n", rte_eth_dev_socket_id(i)); + ret =3D rte_eth_dev_info_get(i, &dev_info); + if (ret !=3D 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 =3D rte_eth_link_get(i, &link); if (ret < 0) { 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); + uint32_t speed =3D link.link_speed; + char suffix =3D 'M'; + const char *duplex, *autoneg, *status; + + if (speed > 1000) { + suffix =3D 'G'; + speed /=3D 1000; + } + + if (link.link_duplex =3D=3D ETH_LINK_FULL_DUPLEX) + duplex =3D "full"; + else + duplex =3D "half"; + + if (link.link_autoneg =3D=3D ETH_LINK_AUTONEG) + autoneg =3D "auto neg"; + else + autoneg =3D "fixed"; + + if (link.link_status =3D=3D ETH_LINK_UP) + status =3D "up"; + else + status =3D "down"; + + printf("\t -- link speed %u%cbps (%s), duplex %s, %s\n", + speed, suffix, autoneg, duplex, status); + } + + ret =3D rte_eth_dev_flow_ctrl_get(i, &fc_conf); + if (ret =3D=3D 0 && fc_conf.mode !=3D RTE_FC_NONE) { + printf("\t -- flow control mode %s%s high %u low %u pause %u%s%s\n", + fc_conf.mode =3D=3D RTE_FC_RX_PAUSE ? "rx " : + fc_conf.mode =3D=3D RTE_FC_TX_PAUSE ? "tx " : + fc_conf.mode =3D=3D 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" : ""); } - printf("\t -- promiscuous (%d)\n", - rte_eth_promiscuous_get(i)); + + 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); + } + + + ret =3D rte_eth_promiscuous_get(i); + if (ret >=3D 0) + printf("\t -- promiscuous mode %s\n", + ret > 0 ? "enabled" : "disabled"); + + ret =3D rte_eth_allmulticast_get(i); + if (ret >=3D 0) + printf("\t -- all multicast mode %s\n", + ret > 0 ? "enabled" : "disabled"); + ret =3D rte_eth_dev_get_mtu(i, &mtu); if (ret =3D=3D 0) printf("\t -- mtu (%d)\n", mtu); =20 - ret =3D rte_eth_dev_info_get(i, &dev_info); - if (ret !=3D 0) { - printf("Error during getting device (port %u) info: %s\n", - i, strerror(-ret)); - return; - } - printf(" - queue\n"); for (j =3D 0; j < dev_info.nb_rx_queues; j++) { ret =3D rte_eth_rx_queue_info_get(i, j, &queue_info); -- 2.27.0