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 44BA7A04D9; Tue, 11 Aug 2020 10:59:34 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8557D1C226; Tue, 11 Aug 2020 10:53:50 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id E13221C21A for ; Tue, 11 Aug 2020 10:53:48 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200811085348euoutp01af0b7caf6c21fb3841c1112cd3171cdb~qKsGQHloc0904509045euoutp01a; Tue, 11 Aug 2020 08:53:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200811085348euoutp01af0b7caf6c21fb3841c1112cd3171cdb~qKsGQHloc0904509045euoutp01a DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1597136028; bh=c/SsShCDywaXv7qsQyrAPBhUXLWfHhov4Jh+TlapfEU=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=fN0vOC3q2y88OC9PrheTExkfoih46H1EDvB47OseE7FaCvVM/EPLPuKeZYsU6UZxk naojnc2OcJOfuYqMDI9bXuYNXsGANLpkt0vw8X0IhzAkQBvakUlcvczd/vdFighJmI FTExpwIh4Z1+DbLiXFndK57FizcPPSs5v7KZ9x+A= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200811085348eucas1p1a693917fcc15726bb41225731a575b52~qKsF_Xacj1586915869eucas1p1Y; Tue, 11 Aug 2020 08:53:48 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 9F.FD.06318.C9C523F5; Tue, 11 Aug 2020 09:53:48 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200811085347eucas1p12d1f10a867d75cec369bdaf0949f32a0~qKsFYkWIK1975819758eucas1p1I; Tue, 11 Aug 2020 08:53:47 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200811085347eusmtrp10a014862e184bfbc5caf073dc0573d0b~qKsFXrBgn1680216802eusmtrp1W; Tue, 11 Aug 2020 08:53:47 +0000 (GMT) X-AuditID: cbfec7f5-38bff700000018ae-65-5f325c9c435d Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id B4.7D.06017.B9C523F5; Tue, 11 Aug 2020 09:53:47 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200811085345eusmtip11b68c384a66d53054dbb90e9662b55d7~qKsDmMlZi1849018490eusmtip1E; Tue, 11 Aug 2020 08:53:45 +0000 (GMT) From: Ivan Dyukov To: dev@dpdk.org, i.dyukov@samsung.com, v.kuramshin@samsung.com, thomas@monjalon.net, david.marchand@redhat.com, ferruh.yigit@intel.com, arybchenko@solarflare.com, wei.zhao1@intel.com, jia.guo@intel.com, beilei.xing@intel.com, qiming.yang@intel.com, wenzhuo.lu@intel.com, mb@smartsharesystems.com, stephen@networkplumber.org, nicolas.chautru@intel.com, bruce.richardson@intel.com, konstantin.ananyev@intel.com, cristian.dumitrescu@intel.com, radu.nicolau@intel.com, akhil.goyal@nxp.com, declan.doherty@intel.com, skori@marvell.com, pbhagavatula@marvell.com, jerinj@marvell.com, kirankumark@marvell.com, david.hunt@intel.com, anatoly.burakov@intel.com, xiaoyun.li@intel.com, jingjing.wu@intel.com, john.mcnamara@intel.com, jasvinder.singh@intel.com, byron.marohn@intel.com, yipeng1.wang@intel.com Date: Tue, 11 Aug 2020 11:52:43 +0300 Message-Id: <20200811085246.28735-25-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200811085246.28735-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSWUwTURSGvTPTmaFaHQvREzAgTYyocUF9OHHfopP4osb4YFCsMkFlTUfc XkRANAWxLMEADbKoQFFxAVqIGCRKxSIIxrgDrkQU2Y0iqG2nxrfzf/9/7z3n5PK0NpP15Q9E H5IM0fpIHatmqht/ts43hywOXWSK98GK5nyC7zqKaezKesNiSn8Shc8tq/G21azCjM54CtMy Bii0lhpZ/NqVwOC3QSuFr+scHOa2J3A42NDN4dnWPILdYz005hQMEWzNr1Lhz7u1LPaNFTGY NvqU4LnKBwTtqQMMZtXYCCYbBewvK+Gw+LU/DnY9YNDx4haHV0baaKxqHieYbq8g+Cj5j2pN oDhacEklFt/+TImZhW202PgimxNTm/Ip8cY3GyX23XnKimmVFiI+fJdCi+UffrBb1DvVK8Kk yAOHJcPCVXvU+xOHmrjYrIlH7xunxpN+3ki8eBCWgiWlU2Ukal4rlBKoOj3iEcMEXmbXcYoY IlCW0+10ePcRs1mv8BICV/qSiCJGCLx/2EO77mWFIHCcyadcho9wgwXr2DPKZXgLm+G9Pccd YoRZMN57ys01wjKw1aQwSlMBUH693p3xcvLyvE53rRX84dmFYUrJNPNQOxis1BugraPQw72h x17JKfUMcGSmMq4mQDhNIL36FqcIE4HEvF5PajVUfmnhXLPRwhyoqF2o4LWQ0J5IKyNPhue9 U12YdpYZ1ec9WANnkrVKWgf1Te0eDDD+a5KCRfjV0kUr+6lzrtdqUplIQO7/twoIsZDpUpwc FS7JS6KlIwtkfZQcFx2+YF9M1E3i/KqO3/YRG7kztreBCDzRTdLELg8O1ar0h+VjUQ0EeFrn o1n3yLFbqwnTHzsuGWJCDXGRktxA/HhGN12zpOjzLq0Qrj8kRUhSrGT451K8l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xfp69ikPnhZ6Jn6uKvX7iMdmEkbXHr87Y+mfbNvspJDVrA7i+2zGdPXw/afSl6sP9cwbo9K 3ubd1+gfUZ9WHNkRdVqyd81R5Z3qUbOV3zN722Pfm4DYgo4lmeExWo02Vbe96/zLiM9eRPK1 ZgUlJvCqVaRR5P8CcRjUtgYDAAA= X-CMS-MailID: 20200811085347eucas1p12d1f10a867d75cec369bdaf0949f32a0 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200811085347eucas1p12d1f10a867d75cec369bdaf0949f32a0 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200811085347eucas1p12d1f10a867d75cec369bdaf0949f32a0 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200811085246.28735-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v9 24/24] examples/vm_power_*: new link status print format X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: i.dyukov@samsung.com List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add usage of rte_eth_link_to_str function to example applications Signed-off-by: Ivan Dyukov --- examples/vm_power_manager/main.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c index 273bfec29..b2bd8b4cf 100644 --- a/examples/vm_power_manager/main.c +++ b/examples/vm_power_manager/main.c @@ -244,6 +244,7 @@ check_all_ports_link_status(uint32_t port_mask) uint16_t portid, count, all_ports_up, print_flag = 0; struct rte_eth_link link; int ret; + char link_status_text[ETH_LINK_MAX_STR_LEN]; printf("\nChecking link status"); fflush(stdout); @@ -267,15 +268,10 @@ check_all_ports_link_status(uint32_t port_mask) } /* print link status if flag set */ if (print_flag == 1) { - if (link.link_status) - printf("Port %d Link Up - speed %u " - "Mbps - %s\n", (uint16_t)portid, - (unsigned int)link.link_speed, - (link.link_duplex == ETH_LINK_FULL_DUPLEX) ? - ("full-duplex") : ("half-duplex")); - else - printf("Port %d Link Down\n", - (uint16_t)portid); + rte_eth_link_to_str(link_status_text, + sizeof(link_status_text), NULL, &link); + printf("Port %d %s\n", portid, + link_status_text); continue; } /* clear all_ports_up flag if any link down */ -- 2.17.1