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 14F62A00C5; Mon, 6 Jul 2020 22:41:51 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EE23F1DDF5; Mon, 6 Jul 2020 22:39:09 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 0681D1DDE3 for ; Mon, 6 Jul 2020 22:39:02 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200706203901euoutp01627112f026ea05970bbd9cf740f48cef~fRFjsWg1W0553305533euoutp01n; Mon, 6 Jul 2020 20:39:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200706203901euoutp01627112f026ea05970bbd9cf740f48cef~fRFjsWg1W0553305533euoutp01n DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594067941; bh=U2zVf/WfC+GxbbAndLEN5cAyOf8BWxrHjaueCQ0L+Sc=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=NnsszgiDXChJIn5LrXb4Fp/8Io1SQlcf/3ylZ4JmQUzTk7+UBz6gMG5EMHSDw8IYC 7efxufJOScbyY4T86n21BTE3uuTfYaGWfRMIA/ZWjBMazg9NEYackCueIwEeCitDA5 QGyHfOctvzG+Bebo0s4xnAoFDwKO9attOqHpV1PY= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200706203901eucas1p1f311bdef850c6435460d7b47bc0dadb1~fRFjgFvhB0771107711eucas1p14; Mon, 6 Jul 2020 20:39:01 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id D5.D6.06318.5EB830F5; Mon, 6 Jul 2020 21:39:01 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200706203900eucas1p1da635a7b8512d7c087ea0def6de3223d~fRFiR4HCr2656126561eucas1p1H; Mon, 6 Jul 2020 20:39:00 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200706203900eusmtrp162391a1da290811395c319a5109fb92a~fRFiRG_jg2965829658eusmtrp1y; Mon, 6 Jul 2020 20:39:00 +0000 (GMT) X-AuditID: cbfec7f5-38bff700000018ae-5d-5f038be505a1 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 28.EF.06314.4EB830F5; Mon, 6 Jul 2020 21:39:00 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200706203858eusmtip1235043423b66ee7e8e507fba87bb3302~fRFgby2sP1560515605eusmtip1J; Mon, 6 Jul 2020 20:38:58 +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: Mon, 6 Jul 2020 23:37:39 +0300 Message-Id: <20200706203743.29416-26-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200706203743.29416-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSbUxTdxTGOffe3ntp6HKtJJygYmx0bnODKXOeGDcmM+YmfvHL5mIysZMb dFDUFvAtJqjIWGFMwGHkTQYaatmGL2iLinFNpLriKiS8GBnrFNMhiFpAoYMx6q3Zt+f5Pc8/ 5+TkL7L6Mj5W3JGZpZgzjRkGXstdbpv0vveokE153303jpraa4Ae9Nez5Dv+B0+Fz/IY6rUn 0TVHlYZK/8xlqLj0OUMOm5WnYd9hjkYCDob6Wj0CVXQeFijg8gv0nbcSyD/1mKWTtaNA3ppL Gpr89QpPT6fqOCoOdgF933wLyF30nKPjLU6gfKtEz842CFTfF0cB3y2OPPcuCvTTeAdLl9qn gUrcTUB38mc0nyySg7VnNHL9tUFGLvuxg5Xb7pULctHtGkY+P+Jk5KfXu3i5uNkO8m8PClm5 cWCC36jdrF2TqmTsyFHMCR9v1W4/5yiDXUPavYMzk2wuuEQrRIoofYBPxn9graAV9ZINsMf1 UKOaMcAXM1cF1YwCHu2+yb1+8nfesXDQAGi73w6qGQecCHbwoRYvvYWeghomFERL53l0TPUw oWCutAGt5S2akOakJVj5l+0V10mr0dfrZdURC7Hx3I1ZLYqRs7z6ZmwI66U47Dk1xqiVdhF9 eZtUvQ6dV8sFVc/Fx+7msJ6PnrKi8NYH8OWFnldbo1QA2F93NFxKwuah34XQLFZ6G5uuJKh4 Ldqr7BDCKL2BvU/mhDA7K0svn2BVrMOCfL3aNuCN251hjDj9T5SKZXR+WxU+VStg/aEZ4Rgs rPh/Vi2AHWKUbIspTbEkZip74i1GkyU7My1+207TBZj9qp5/3eNOuD71lQskEQxROp/Ipug1 xhzLPpMLUGQN0brkO54tel2qcd9+xbwzxZydoVhcME/k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O34kUjXT+vx6i6tafvYuzZp UbG38sDAaakjdbbsRvjyNC9ToHW6NjKh2WIpcqzvjnl2ZcCyNMqmWSU3BWavqHemjeg2BqCM IL8X6ovJtugp296IAn/11aKVcZLk3VPTjCuRCzzWvUvG7u/Aq+rmresOP9zzvq4j7LxPZ7z/ IUZBCYka1UbSIGj+AqZrbeQGAwAA X-CMS-MailID: 20200706203900eucas1p1da635a7b8512d7c087ea0def6de3223d X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200706203900eucas1p1da635a7b8512d7c087ea0def6de3223d X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200706203900eucas1p1da635a7b8512d7c087ea0def6de3223d References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200706203743.29416-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v6 25/25] 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_strf 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..05aec1aad 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_strf(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