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 BA58BA04C7; Tue, 15 Sep 2020 21:11:34 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A5D031C210; Tue, 15 Sep 2020 21:08:50 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id A10A91C204 for ; Tue, 15 Sep 2020 21:08:48 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200915190848euoutp01fc7b5706b2d667d39ae83405b43ddf5b~1CqDTI5Ws0516505165euoutp01o; Tue, 15 Sep 2020 19:08:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200915190848euoutp01fc7b5706b2d667d39ae83405b43ddf5b~1CqDTI5Ws0516505165euoutp01o DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1600196928; bh=jaolOMwppEWttOA38f35lGVL8aPkv9Cah3B7/iAVP9g=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=iIL9mrR1PkimvxaDPdAL0o894q4W6KYttnz8NKwisCrQx5xO47aHKPhY6q7G0BWqF fbC1h7UtRONKPGy3q/KjrdIgV7489CIQISaIZPYc12lpq613uMMEat3TA7NFILYw0l hrDEkh3pYanUUCICv9SdBqWYe/l7bWzdfhcU7ySo= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200915190848eucas1p1d4a389bbe7d37dd00288fb92ab86e4a4~1CqC83o8Q0048000480eucas1p11; Tue, 15 Sep 2020 19:08:48 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 3A.63.06456.F31116F5; Tue, 15 Sep 2020 20:08:47 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200915190847eucas1p28539b8571d5060f354c0263b96358ce2~1CqCCDxEd1274512745eucas1p2P; Tue, 15 Sep 2020 19:08:47 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200915190847eusmtrp1213c658c3a252d07f31dcbe5312d8bf2~1CqCAvuJb3148631486eusmtrp11; Tue, 15 Sep 2020 19:08:47 +0000 (GMT) X-AuditID: cbfec7f2-7efff70000001938-9e-5f61113f139f Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 56.FB.06017.E31116F5; Tue, 15 Sep 2020 20:08:46 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200915190845eusmtip249048eff4a43c639cebf755579ed606e~1CqAPI-qa1755217552eusmtip2N; Tue, 15 Sep 2020 19:08: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, 15 Sep 2020 22:07:19 +0300 Message-Id: <20200915190728.18143-25-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200915190728.18143-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSeUwTeRTH85uZzgxda8Zq5AVXjY0moiuo6+rTdcUrOmaNx8aYeGKREc1y aEe8FhPiQQlWrhKIsGIFCS4Qu2g5Ix78YcHComSJqCgVDwIeSKFRkaqtU+N/n/d53/d7v/zy 42ltFhvE74ndLxli9dE6Vs1U3vrQMiNslD585qOCX9HalE+w63Ehjc6sRyyeenuCwvaSMLxa 9bcKMzsTKUzN7Kew6mIKi6+cxxh846qisKPOwWFu6zEOXfXdHJ5uySPYPdxL4xnLAMGW/AoV frhZy2LfcAGDqUNtBNNsDQTtpn4Gs2qqCSalCPj2n2IOCzsmoMvZwKDj/hUOy9x3aaxo8hDM sFsJNid9Vi2eJA5ZilRi4dUeSjSfv0uLt+5nc6KpMZ8Sy99UU2LftTZWTLWVEPF21ylaLH32 nl2n3qxeGClF7zkgGUIX7VDvtqbnMHszfziU2l9OJ5I+PoUE8CDMAbf5HedjrXCRwECt16u9 PEigM8VGlGKAgKUoj/028aQxl1YaxQTaPdf8KTeBy9d7v6ZYYSo4kvMpX2OMUM5C1fA9b8Hz o4XVYHct8WUYYQr0dKSpfKwRFsDTTrtK2TARSv+9Qfs4wOtba9r895sA984Nfj0ThCYeStuN /oHlUO6uYxQeDb12G6fwj+AwmxhlwEggo/IKpxTpBI7nvfanwsD28j/OdztaCAZrbaiil4Dz 3DOVT4MwEtpfj/Jp2ouZlTm0ojWQnKRV0jq40djq1wCejyMULcKrF5/9j1VHoKyomUsnE3O/ 77IQUkICpXg5JkqSZ8VKB0NkfYwcHxsVsjMu5jLx/lXHJ7urmrhbI+qJwBPdCI3l4Y5wrUp/ QD4cU0+Ap3VjNEubHdu1mkj94SOSIS7cEB8tyfVkHM/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oPyLg4tV44KgjJgu5/jmDdvNOR9v5SW/aStJndjRXmRZ70+js/H474 FHrtC8l5tafPcXJtlHZkyeGOZxnhkevLHFd2rvPdcL4mr3a1Pa19avJudXSMhb60QtBbfcuT PXMXX9zJdbm3PT1timQGlt9KGzIvOGW0RayqPZuX3xa1mR88yXW1bPmUM3Hq9a4Ij7Rrw7h1 r5wS49XKdaROVP8BxUaebwYDAAA= X-CMS-MailID: 20200915190847eucas1p28539b8571d5060f354c0263b96358ce2 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200915190847eucas1p28539b8571d5060f354c0263b96358ce2 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200915190847eucas1p28539b8571d5060f354c0263b96358ce2 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200915190728.18143-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v11 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