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 714B0A00C5; Mon, 6 Jul 2020 22:30:43 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 09FC61DD59; Mon, 6 Jul 2020 22:27:50 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 359BF1DD50 for ; Mon, 6 Jul 2020 22:27:48 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200706202748euoutp017dffc0a2cd141bd984368e05bccff19e~fQ7wJSsWD2593425934euoutp01j; Mon, 6 Jul 2020 20:27:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200706202748euoutp017dffc0a2cd141bd984368e05bccff19e~fQ7wJSsWD2593425934euoutp01j DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594067268; bh=U2zVf/WfC+GxbbAndLEN5cAyOf8BWxrHjaueCQ0L+Sc=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=oaGwpIw66kdMbranPp3eHEsXCGCl0vpX/e7iUQtKFlS4ns5+YUpr3d+gZaK8R3HwQ T8kNybv52gqhTAZpW0x7LzhNPBuI1WtJb3KAGXsbtAtxBLAlmoefpJEhGOVGEB/JQL vavje2j2uARplBVOnienB8aGPhzTjvXJEzX+3h8c= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200706202747eucas1p12893b783051496fca3597be88cbfc2fd~fQ7v391HO0894308943eucas1p1j; Mon, 6 Jul 2020 20:27:47 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 01.A6.06318.349830F5; Mon, 6 Jul 2020 21:27:47 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200706202747eucas1p241ac7df0719d3c05dbc5ba55450a1a7b~fQ7vcAnbV2938529385eucas1p2I; Mon, 6 Jul 2020 20:27:47 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200706202747eusmtrp20ba4712b2ddeff253321cc2b9bf51ca1~fQ7vbNw3_3205132051eusmtrp2_; Mon, 6 Jul 2020 20:27:47 +0000 (GMT) X-AuditID: cbfec7f5-371ff700000018ae-54-5f03894374a4 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 57.5E.06017.349830F5; Mon, 6 Jul 2020 21:27:47 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200706202745eusmtip10eb0f2201873e5e5b9f9f0a78a6469be~fQ7trbRF31791017910eusmtip1G; Mon, 6 Jul 2020 20:27: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: Mon, 6 Jul 2020 23:26:15 +0300 Message-Id: <20200706202626.28628-26-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200706202626.28628-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSbUxTZxTHc+69vffSUL2rGJ/5TqPLNBGd+OHMGPEteqNflmwxUdnYndxU MqikBTfUD0Ck1qqAFDVqBwhxIJJRECg6IKwQAWtlJSFo5E22SCoCWiAKFpFyMX77n9//f85z TvLwtNbGLuXjDEmy0SDF61g1U/Ng8vGG3efomE1tFWuw/FEe4EBvEY39uT0snn99hsInpVFY 57SrMKcvlcLMnDcUOkusLL7qT2dwxO+ksLvezeH1jnQO/a5BDi+23wAcDLyk8VrBGGB7XrUK J/+5z+JooJDBzKlOwKyqVsCWC28YzL1XC2i2Cvj6djGHRd0r0d/fyqD76V0Oyya8NFY/mga8 1FIO6DHPqHaEi1MFt1RiUZ2PEm03vbT44OkVTrzQlkeJFSO1lDja0MmKmVWlID4cOE+Ld/5/ x36nPqzeFivHx52QjRu3/6w+5nDaIHFI/btvZpJOBRdvhRCeCFtIRo+XsYKa1wolQPpSHaAU 40Da/3o+74wBMXc2q6zAz7V4z4YrvBhI9W0HpRQTQN4XD0NwLit8TdyWvDkjTKhgiTPQRQWN RcIBMn7RwwY1I6wlHX0jqqDWCFtJky9NpSy1itxxNNJBHTLLm0fvzuW1wkrSlT8+N5QIrTyp rEtnlYY9xFn+Yl4vIi9bqjhFLycz9/IpRZ8ibyu7OKXZAqS3MGM+FEWqhh5zwdtoYR0pv79R wTvJlZliTjl5AXky/EUQ07Myp+YqrWANsZi1SlpHGts65jEh0+9DFSySsTQnKNvXA2nzrMiG Vdc/P1UAUApL5GRTgl42RRrk3yJMUoIp2aCPOHo8oRJmv6r7Q8tELTQEfnGBwIMuVNPP0zFa lXTClJLgAsLTujDNLo/7J60mVko5KRuPxxiT42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+U54/x+v8+gvHyz0K39sZFrDcFHekS/15j+TPPX5F0 9kb3Wt45Yj/65UbaAuN7prTTsdpKH6Uj/XRPZ3q5RRK5ae9y6tue0XWtj77ZzzkVIKh+/VjQ 2Noto13XZ+Lv+Yx0PN54Kl98tsxWZohSjWLX05iotEsn2uyxXc5ZVC+qN6RmbS58Ex0WSXrL KSFFrdxA6gX1X5fTMowHAwAA X-CMS-MailID: 20200706202747eucas1p241ac7df0719d3c05dbc5ba55450a1a7b X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200706202747eucas1p241ac7df0719d3c05dbc5ba55450a1a7b X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200706202747eucas1p241ac7df0719d3c05dbc5ba55450a1a7b References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200706202626.28628-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v5 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