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 82711A0540; Mon, 13 Jul 2020 14:09:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5826F1D67F; Mon, 13 Jul 2020 14:09:07 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60055.outbound.protection.outlook.com [40.107.6.55]) by dpdk.org (Postfix) with ESMTP id BD4E71D67D for ; Mon, 13 Jul 2020 14:09:05 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l9tzyYeFOGPLtSB05P+j1c4OIXZeZUDzDaBvHba9JNKI4cA/Hg4mJLuRYmC5pVIXR+X1/StxJc9YkBzSp+0cf41BPEKM5XMRlw8fIfXKPC3c3JwXGSp+xOYuqEjQuwNwFRZgyeh0Bn3ySo7c2PWZLPoAqe02s7czh2rzl++DRKBhZA038U440pbu0PwcWQ6w5Bo5J8U6PvvEEwdi4GbxxjCGLx8+SP6Vl+lKAIiO6IxaJdvGeBzTEjd2rwb9skdQ2zlblHpECVti3ZqOdnE11JUw2N9+tMKnEIfaWZPEyPnW6/NDSEAtPIs2VyUPj9Ax3fsWsn1FqnjQS6YpgnlxLA== 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=xu8O7WOiPmBUnbDTD4lmQXUyO0jJos5D0n22smAEoSE=; b=TwBgTpb3M6sFcKzhdNc46twXZPGz6UsjxLw7QalIJfk1T2QSvtm6/4Wz5581v2pushNJ7yTq8yRD3XYhSit7ZpE/+ZXhqrgY6iiB1mSb7Rv/0+E0G/yKm1HTHNuoP+TPea4Yo+Ks5DWISqCt7MKqlH3qfUcBr3Z6RpcrrCR6nQWpdYUbx58Lcs99/iYz78PRyMWvks5kXkIyi3Z0+gSIQFainFcIjFZFHH6Vu7EWr7naSe108NkpbuCFVjWOAOxHqDgYgDvT0ZpbU0qSrLq3sND/wkJHsGVq2rsMY446MbF0Sb7Vt0Na8+//6GubmPTH54kBAq4bjf2b6VUaSmhdcw== 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=xu8O7WOiPmBUnbDTD4lmQXUyO0jJos5D0n22smAEoSE=; b=JRZL5tlO4cwpTjV4nTtHFBSYNnu9fuFI7F4VZGg0wPAJiOB3kITIKPb9mJrkGv/1RP7bWvPzb0wi3mFuKZAYZJSeqBflZyiEy9U+G2UVwBjG//w2WJBYqImjbfhmO9RUUu2MY+tXpjcyZ8nTK3RsXDfftulhuLKqkGVIxyemf40= 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:09:04 +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:09:04 +0000 From: Hemant Agrawal To: Stephen Hemminger , "dev@dpdk.org" CC: Maryam Tahhan , Reshma Pattan Thread-Topic: [dpdk-dev] [PATCH v2 4/7] app/proc-info: add more info to show_ports Thread-Index: AQHWI+C/XuSdSnAUNkCm0qz4afGJRKkF09Mg Date: Mon, 13 Jul 2020 12:09:04 +0000 Message-ID: References: <20200506193741.24117-1-stephen@networkplumber.org> <20200506195758.27057-1-stephen@networkplumber.org> <20200506195758.27057-5-stephen@networkplumber.org> In-Reply-To: <20200506195758.27057-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=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: 32647a83-8f57-47d9-49a6-08d8272589a2 x-ms-traffictypediagnostic: AM5PR0401MB2676: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:89; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: AP9LYDdwe+0OLTFyU54iZ6wM/dYxhnSFe5m3W7CUNCnlp4OgSpP741CLfCnEd1JdIkhNes/f8JIOAwLfgtlFrwLf5YNNFtq5PnyFm4ZBm9V+AoexfLDr0ZjGo6biZvAsyhgn/v8oGtMLjRC6V6focMGxKVAY0zotm4NQzYDjCuPbxWN86YUIJk9vByXgg+boPb7ijOqTloGsBMSZ3w46KS1U4UaT7cL/fKEuLXKuM8MJLLDEgGGlF0Ny86Vc8yTUZ8HflZKXgkrbF820jhFw37bnrmJVPpryBgmzZjNL+VOJQG83fLvQnVZBxc964EZI89GuT3kXrg5HnlqdRYh5CA== 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)(8676002)(316002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: gRCciLgYvVKbQTX6ZQBq+yhsRXQW9vCTqNvEPW++VSeh+5fRl08IuAYbqTcnFrdsKUTy/d53shQFgqKeDdtckCHNRaqVIDTuDxViJDz4ZF3nlka/HKmz7yfSmnw72PuhKsW+SLztLJTEWwmqSAkmIIzNp2N40JXhw3RfWTXzgPh7zY6EbsNP7KWmIydmhsEH8clI4jy6mtcn3GuMU/Cmm10zZXBp+zQ3zMV1AghCDEsI9D8P0t470Vbl97Apfb5cTyOZR2e9fnM6Ys1WI7aN6N1dDS+/pM4mXoM0AlYa8biLioMEcUINm/5XTNzboltW2EoedJmPg7R6lksiF301IJ3N+BQQ+rCOUINI/88HSD6XOTgjo+on4TBEW8+elknv8MXsoLA8w9k+W1yccIfSzmx0FFuJZX60MMtm0nncH199S/6E8NdJbehMSJRuuuQ+UzmS0F3/9Tb5Tx/Nox2KRx9okAxtz+WvXi6Rusp6f7uSigt3Mhe+HfyiwqWg0utL 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: 32647a83-8f57-47d9-49a6-08d8272589a2 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Jul 2020 12:09:04.8713 (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: zA4e0hwwl3x34HEHi2n3pXD5YfC5LgVS9YtEDxzDyQpb2BBDziiWJusE6jic+AsTP5fHQhePCPeNJDfy8fFqoA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0401MB2676 Subject: Re: [dpdk-dev] [PATCH v2 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" Hi -----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 4/7] app/proc-info: add more info to show_por= ts 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 Signed-off-by: Stephen Hemminger --- app/proc-info/main.c | 78 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 63 insertions(+), 15 deletions(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index e4914191bef9= ..c4f1f99e7d5d 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,78 @@ 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" : ""); + } + + 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); } + printf("\t -- promiscuous (%d)\n", - rte_eth_promiscuous_get(i)); + rte_eth_promiscuous_get(i)); + ret =3D rte_eth_dev_get_mtu(i, &mtu); if (ret =3D=3D 0) printf("\t -- mtu (%d)\n", mtu); =20 [Hemant] will you please also add=20 printf("\t -- multicast mode: %s\n", rte_eth_allmulticast_get(i) ? "enable= d" : "disabled"); with that you can add Acked-by: Hemant Agrawal - 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.20.1