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 D5017A04B5; Thu, 10 Sep 2020 21:37:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CAEA61C1DD; Thu, 10 Sep 2020 21:35:24 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id CB2B91C1DC for ; Thu, 10 Sep 2020 21:35:23 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200910193523euoutp02afc74f4c115199d440583873a007d08d~zgy1k0PFn0500705007euoutp02c; Thu, 10 Sep 2020 19:35:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200910193523euoutp02afc74f4c115199d440583873a007d08d~zgy1k0PFn0500705007euoutp02c DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1599766523; bh=jaolOMwppEWttOA38f35lGVL8aPkv9Cah3B7/iAVP9g=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=ZIxwWicJmqFm9gy9bALJC5U1QREzo6T0ITAj9ZLxnteFZbuiYm+pfiyDy4UIlq05L mMp9qKfjwVzMGlGceqxA1mcYcneMVS5gu3AQzYoaixab3c9zes83W9J10Z1dfK0c0h zER+ZXdnBZnH8NNkyf3oOpEbj+Pc3pfygbCJW7ok= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200910193523eucas1p10f223fb02b01561ad6b1e3a014b1cbf3~zgy1YnaVN2933129331eucas1p1m; Thu, 10 Sep 2020 19:35:23 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 3D.1D.06456.BFF7A5F5; Thu, 10 Sep 2020 20:35:23 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200910193522eucas1p102187e623e0e9649bd7b3e93a15a680a~zgy0gNKql0307203072eucas1p13; Thu, 10 Sep 2020 19:35:22 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200910193522eusmtrp28a2212d8add66ddcfb68a9fb48b165c7~zgy0fW5l-1027210272eusmtrp2C; Thu, 10 Sep 2020 19:35:22 +0000 (GMT) X-AuditID: cbfec7f2-7efff70000001938-ce-5f5a7ffb7cf5 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 41.29.06314.AFF7A5F5; Thu, 10 Sep 2020 20:35:22 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200910193520eusmtip2250855d0d168912a255b7b564e78a10d~zgyyxqXex1654016540eusmtip2N; Thu, 10 Sep 2020 19:35:20 +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: Thu, 10 Sep 2020 22:33:57 +0300 Message-Id: <20200910193400.15326-25-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200910193400.15326-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSf0wTZxjH99xd745izVl0PjIis4mJzqhrZpYnuOk0JLtFl2j8w0hU1o0L Eim4FnBumiFulVXXQYUxRQuCBi1qx6CUOp0IGxWLQ0iMNWEbOhInDpEKblCco1yX/ff9fp6f 75NXZPVlfKKYlZOnWHJM2QZeyzV3jHcvjXyalv7qiR/nkKfLBXTv11qW+st+4enQ488YCrlX 0yXfcQ05fytkyOEcYch3xs7Tn/1FHD0K+xjquxwU6FhvkUDhtvsCfdldCXR/cpClo9VPgLpd Xg2NX73I0/BkDUeOiVtAXzVdAwocHuGozN8CZLNL9PhsnUC1ffMp3H+No+CdRoHOjfWw5O16 BlQa8ADdsD3XvLVAnqg+rZFrLz1g5CMne1i5487Xgny408XIDY9aGHn4h1u87Ghyg3z93iFW rh/4m9+gTdO+kaFkZxUoluWr3tPu8JRUcLuc8R85RhrYQhgW7RAnorQCC8trODtoRb10BtDR Phgzo4C25oigmieA1yOTrB3E6ZIj9mSV1wH+tT/Eq2YM8PT5YSbal5cWYbDYxUQDs6UGHn2T t6cDCdJ6bH/oYqOakxais8bJRbVOSsGBUAerLpWM9d+2Tk+Lm+J3+7ZFsV6aj7erRqd7otQl 4qmKC5yan4rl4VJQdQIOBpoEVSfhc39VrOAgYGlzo6CaEsADlUOxrNXY9PBnITqNlRaj5+Jy Fa/BQL1Xoz55JoaGZkUxOyWdzRWxS+iw2KZXsw3Y2tkbw4jPIjNULKPr96exI14GHAi7+BJI Pvb/rGoAN8xV8q3mTMVqzFF2L7OazNb8nMxlH+Sav4Opvxr8JxBugbHe99tAEsEwQ9eakpau 15gKrHvMbYAia5itW3sjuF2vyzDt+Vix5KZb8rMVaxu8J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A/h1F+skJEHXINb66xm9apw5Jv64bTXAs2 zfGGl/n92g7724KIA8nhQbHwbEfSxW+HLcBr2HdrQnflbktcK5KRoyUjxRPbm0w7T97sSOub wadWiovig51fqgP6UmZeR11gv6867E5oW53eoyxZn/kxYu24LKEiRXnw1rfiTXawTNZ1j+5x yAkhS61YjxsE9V/ZearrBwMAAA== X-CMS-MailID: 20200910193522eucas1p102187e623e0e9649bd7b3e93a15a680a X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200910193522eucas1p102187e623e0e9649bd7b3e93a15a680a X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200910193522eucas1p102187e623e0e9649bd7b3e93a15a680a References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200910193400.15326-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v10 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..37c4a9c50 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[RTE_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), &link); + printf("Port %d %s\n", portid, + link_status_text); continue; } /* clear all_ports_up flag if any link down */ -- 2.17.1