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 3ABA9A0528; Sat, 11 Jul 2020 12:48:10 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3B2171DB53; Sat, 11 Jul 2020 12:45:36 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 8A9681D9BB for ; Sat, 11 Jul 2020 12:45:34 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200711104534euoutp021bd9976e85e5bc7ec8bc5336c93fdec5~grN0_gnEl3129031290euoutp02B; Sat, 11 Jul 2020 10:45:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200711104534euoutp021bd9976e85e5bc7ec8bc5336c93fdec5~grN0_gnEl3129031290euoutp02B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594464334; bh=LMKl1/5U9x+uii+TKB06k1f6ZYo7iRRo2CAmnc6rzpk=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=mJ50wW8br+KrycnZkF0bwgvfj4UhFs3BwiO1YI9MgKOuKDhmlg0AyOUXEy3nooO1P QtiOGBI4vcV18Ic8Ggca/4eLkibVFz7WVGAKgM60nW0IB3p45rXFOSI0N4vq73Bn/V 0QENDXybYTobcjbgkbUpBVSEoEyg4LJhXetvnp6g= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200711104533eucas1p2d16e62d42582d6f36c48c6c47aa0ecc7~grN0X_UaY2330423304eucas1p2S; Sat, 11 Jul 2020 10:45:33 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 6F.55.06456.D48990F5; Sat, 11 Jul 2020 11:45:33 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200711104532eucas1p2273dfdc1ad227e4730b643dbea7a8da3~grNzMgJvv2337623376eucas1p2Y; Sat, 11 Jul 2020 10:45:32 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200711104532eusmtrp2d39f87a8bb9fc056203d63550c2f0332~grNzLj3sX1628816288eusmtrp2i; Sat, 11 Jul 2020 10:45:32 +0000 (GMT) X-AuditID: cbfec7f2-809ff70000001938-68-5f09984d37d0 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 15.27.06314.C48990F5; Sat, 11 Jul 2020 11:45:32 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200711104530eusmtip1c21cc7dbe08f66b6137f5b4afca9e926~grNxXZdxa1966919669eusmtip1D; Sat, 11 Jul 2020 10:45:30 +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: Sat, 11 Jul 2020 13:44:11 +0300 Message-Id: <20200711104414.15422-25-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200711104414.15422-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSa0hTYRjHec/d5eLsJPR2s1oZ3cykPjxE2PXDgQxM+mSknepgkZfYmnah kLIl0yxnVFrMeUtTySx1Kmpmpa5VpiAaZIlGlq3UmZjmMucx+vZ7/v/n/z7w5+VIIZ1ZyB2P OSXrYqQoLaOiKpvGW/333vaK2Fg44gelrywIej/kktBzo5uB5KFEArqKtkGt7S4N5o8JBKSa hwmwFZoYcPZcpOCHy0bA+zoHC5ntF1lwNfazcLX1DoL+yQESMqwjCFotFTSMP61hYHAyh4LU iQ4E18pbEDSnDFNwo7oKgdHEw9D9AhZy3/uCq6eFAse7xyyUjLaRUPHKjSCtuRTBa+MUvX25 OGHNp8Xc2q+EmJ7dRopN726yYordQohlP6oIcbC+gxFTy4uQ+LI3mRSLP/1iQlRhqq1H5ajj cbIuIOiQ6lhZf9jJQdVpU0cimYCaOBPiOMxvxinGWBNScQJfiHCypQcpw0+Ee3tdrDKMIPzl V9W04zWTqM7OoxSjAGFbSfZsZBThsZe1tGeL4VdjR5KF8Bg+fBmDbZOdhMeYx+/BFXeGKA9T vB9O70ic0dX8Fpyf5KaUE0tx8cMG0sNe07p78O0MC7wv7sz6OfMo5ls43N1wnVYCu/HEl0pW 4Xl4oLl8lhfjqeosQuFzeOxRJ6uEkxD+kHN5dmkbLv/2hvXUQfJrcGlNgCLvwGnGB6zS0lzc 9V3jkclpNFfeIhVZjZOMgrKtxQ329lkZY/dvb0UWcf4TO6P0U4fwixIncR0tzfx/y4pQEZov G/TRkbI+MEaO36CXovWGmMgNR2KjH6Hpr+r40+yqQqPthxsRzyGtt9oqcRECLcXpz0Q3IsyR Wh/1zteOcEF9VDpz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Mog+4OFdMxSh0Xx3GJnPZ/H0bZOKegwgi1W0X0hYvvjnuNwO5dJyfGAjtb 7rjg4Htj+pzuVlBuceQpednn1t1uZ5LtVZJyfegr/3nTZnRb9dGbbvk/c5Lt7YbOR4SFyR/G FSwEnr7iF7KQrutfiFWZXZyC1/pdZ+euuwd0Bb0qjWvna8aLvpjrLTOve/XSKsstRfMPl0UJ wccqZW64llf+A9coY/YIAwAA X-CMS-MailID: 20200711104532eucas1p2273dfdc1ad227e4730b643dbea7a8da3 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200711104532eucas1p2273dfdc1ad227e4730b643dbea7a8da3 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200711104532eucas1p2273dfdc1ad227e4730b643dbea7a8da3 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200711104414.15422-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v8 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..b4b960151 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[60]; 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, 60, NULL, + &link); + printf("Port %d %s", portid, + link_status_text); continue; } /* clear all_ports_up flag if any link down */ -- 2.17.1