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 65F03A0526; Fri, 10 Jul 2020 09:07:22 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 18FDD1DC99; Fri, 10 Jul 2020 09:03:46 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 12F741DD9A for ; Fri, 10 Jul 2020 09:03:43 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200710070342euoutp0134a6695c916c9ab35470e09721051809~gUi1dYV_02078320783euoutp01Z; Fri, 10 Jul 2020 07:03:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200710070342euoutp0134a6695c916c9ab35470e09721051809~gUi1dYV_02078320783euoutp01Z DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594364622; bh=U2zVf/WfC+GxbbAndLEN5cAyOf8BWxrHjaueCQ0L+Sc=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=P9AfKyaWJw5QokJY0ImGBfmNmGbgJeWy3E8SIDAzyz3kueOyVxcomV0ZI/A9IvqcX CUsaZgwStmJu57zchDJjcraLRUEpWCRDOi6rkCB5Q7NAGSXN8xS5C2kOZsKzvvsAuT XBzl6CvH7I3NmEzzVtISNmUY2/W5lDyDFB0wfczI= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200710070342eucas1p12f2eebfb3b131f2af98469d1efd13afd~gUi1Oo58w1829318293eucas1p15; Fri, 10 Jul 2020 07:03:42 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 1D.5F.06456.EC2180F5; Fri, 10 Jul 2020 08:03:42 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200710070342eucas1p209727bb328f2d2dbe6cefa2f7c237525~gUi0ul1M62518525185eucas1p2p; Fri, 10 Jul 2020 07:03:42 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200710070342eusmtrp1bb4268c3a4c54ea9807b846cadd5d5a1~gUi0tX6He1241112411eusmtrp1F; Fri, 10 Jul 2020 07:03:42 +0000 (GMT) X-AuditID: cbfec7f2-7efff70000001938-60-5f0812ce95a3 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 5D.A4.06314.DC2180F5; Fri, 10 Jul 2020 08:03:41 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200710070340eusmtip1f1e7f1b84780f00c5f09ae2300f38d29~gUiy7iV9S1336213362eusmtip1i; Fri, 10 Jul 2020 07:03:40 +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: Fri, 10 Jul 2020 10:02:23 +0300 Message-Id: <20200710070226.6045-26-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200710070226.6045-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0VSe0gUexTuzMzOjItb0xT0wyJpqfBGbwtOFG0vZKigqKDoYrbVYJFa7Krd nnjNbFnNzBUjq83cStsiH7mPSqNW0q21RKE2u14TuxFmaVnetKzNdTb67zvn+873HQ6Hp8Vc NoLflZQsG5L0CVpWzTjrBhpnPBH5uNkXvJFY1mAF7Giz0die/y+LWR8yKHxu12G165wK816m UZiT95FCV6mZxXft6Qx297oobK3xcVjYnM5hr+cNhycazwK+GXxL45miT4CNVocKB+7fZrFn sJjBnK9PAU9WeQHrsz8ymH/LDZhpFvDD1RIOba0Tsbfdy6Cv5SaH1/uaaHQ0fAc8VV8G+Dgz oFoySfpadFkl2ao7KclysYmW6loKOCn7oZWSKrrdlNRz9ykr5VTZQXrUkUVL1/7rZ9eqN6sX 7ZATdqXKhlmLt6p3lrsssLdL/VdnYIBOAw9vBp4nwjzyI7DRDGpeFEqB3PFns0rxGUhtbQ2n FJ+AXLlUMsSEDU9cMfUMY1EoAfLqlkoR9QFx3DhJBwlWiCI+k5UKEmOFCpa4Bv1UMG+MsIrU lOqCGkaYQpzOoCaM1wgLSFtzBaMERJJr5feGfcKG+sfMxZwSNpH4L3we9iRCA0+eef8PbbSC /N3fr1LwGPK2vopT8ATis2SHTA+SL5V+Thk2AWkrPhYS6UhV1xMuuBwt/EHKbs9S7rKUODsj FDiSPH8/Oiimh2Ce8zSttDXElCkqHlpy72FzqE3I92/hCpTI1azQOauBnK99AbkQWfg7qQjA DuPkFGNivGyckyTvm2nUJxpTkuJnbt+TWAlDf+r7Ud/rhr7mbR4QeNCGa9wBNk5U6VON+xM9 QHhaO1az7LFvi6jZod9/QDbsiTOkJMhGD4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ed5PpPX/89hdGikERnzqkfEln05oypz8qWK6Y1Y iIe0+lbMJlh1MQWuPSpPDP5u3V5nbmz7yR7fyW3jFpT6tI9qvfLLO1zI9I/fPia75nkUVW1Z tUPf77+Vt+aCv2EsWaFWDK2jBtzGE932mkhNTvSPDlt28T7/N416brTJ715sHAsPT5vYf2pN spQQNEr5WlwvKP8Ann6dRgcDAAA= X-CMS-MailID: 20200710070342eucas1p209727bb328f2d2dbe6cefa2f7c237525 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200710070342eucas1p209727bb328f2d2dbe6cefa2f7c237525 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200710070342eucas1p209727bb328f2d2dbe6cefa2f7c237525 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200710070226.6045-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v7 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