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 C1A05A04B5; Thu, 10 Sep 2020 21:36:59 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1C0131C18E; Thu, 10 Sep 2020 21:35:08 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 883831C0DA for ; Thu, 10 Sep 2020 21:35:06 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200910193506euoutp022b645938f0313eb58fa9b862d0e8b22a~zgyler1eD0500705007euoutp02Z; Thu, 10 Sep 2020 19:35:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200910193506euoutp022b645938f0313eb58fa9b862d0e8b22a~zgyler1eD0500705007euoutp02Z DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1599766506; bh=kjiDZOgx4RVk31QgFA7JiC93FXZ7jB4R8xwyUSv77Cc=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=N2OiNsT1FpPC7y2ibD1B5HR53AexRmdZt3uJGtoY8JDFBoST45zuWYXSkiWUmsvgu da7C7WJWHRowA3DnV9p0hxADw7StJXPiO2WMYxfP5DEE6iGFD5ikRk3bNByYzhRhRQ hTLo+lZSZYgo9VoxKEuGQYxoityssRINANM0ndNQ= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200910193505eucas1p119680800b9b1473a505010f5c2b8fc5b~zgylGs5xd2933229332eucas1p1R; Thu, 10 Sep 2020 19:35:05 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 5A.42.06318.9EF7A5F5; Thu, 10 Sep 2020 20:35:05 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200910193505eucas1p1c72b003752070200f63b999e6ffb7c5f~zgykpLQrB0308403084eucas1p1w; Thu, 10 Sep 2020 19:35:05 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200910193505eusmtrp29b88e7dafbb3cf794b8ab9bd2bfe452e~zgykoWKta1027210272eusmtrp26; Thu, 10 Sep 2020 19:35:05 +0000 (GMT) X-AuditID: cbfec7f5-38bff700000018ae-55-5f5a7fe9d089 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id E7.19.06314.9EF7A5F5; Thu, 10 Sep 2020 20:35:05 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200910193503eusmtip23b988a52d1326bd7be774022a2ec32b0~zgyi0ylO91654016540eusmtip2H; Thu, 10 Sep 2020 19:35:03 +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:51 +0300 Message-Id: <20200910193400.15326-19-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: H4sIAAAAAAAAA0WSf0yUdRzH93me557n4ea1p0cbn5lCXbNZlma09hlzUY2155+C9WMNltCR T+ACzt0jpK3NS9jlDiVBsQl1XjASwQbowR1ODWh5wqEIxoDCAnbLIXLIcbQgiDgeXP99Pq/P +/3+fPbdV2TlMn6juDd/v2rLt+SaeSPXem3+5vMTh9IzXzjnTKDGHhfQ+O81LI2evMNTyYNi hobqk+iy9xsDlf9hZ6i0fIYhb52Tp/ujhzkKhb0MjVwJCFTZf1igcOddgY71VgHdXbzH0mn3 LFCvq8VA8x2XeJperOaodGEA6CvPdSD/0RmOTrb5gBxOiR6cOytQzUgchUevcxQYvijQ+bk+ llp6loDK/I1ANxzLhlefVBbctQal5vIEo5z4ro9Vrg2fEpSjXS5GaQ75GGX66gCvlHrqQeke L2GVhuDffKox3bhrj5q7t1C17XjlQ2POX64mbl+P8UBxR1CwQ4vohBgRpZfw26kw6wSjKEt1 gI6i+0x0IEsRwIW2DL2eBeyuf/Oh4ee6Ck43nAUMVX5v0Js5QN/gLxBV8dJWDBxxMdHBBqmZ R+/i4GrseikF3V0XBCeIIidtwcEfuCg2SYnYW17C6BvisaGpnY1KYlb42Mhu/Yg4HDwTWY1E 6ZaIv45UMVENSslYF07Srevxnt8j6PUmXG47s6b/ErCs9aKgN8cBi6qm1lRJ6Jm8uXoPKz2D jZd26Pg1DAeCnJ7/CA5NPRrF7EpZ3vo1q2MTHnHIutqM7V39axhx6Z91OlZwyFfB669zBdC+ 3M0fh/jK/3e5AeohVi3Q8rJVLSFf/XS7ZsnTCvKzt39kzbsAKx818K9/zgdXF7M6QRLBvM7U npieKRsshdrBvE5AkTVvML1+I5Ahm/ZYDn6m2qy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gumdP938MoJ0kG2hJVLB3PkUyXj2RuvBJpO3i/ df/t/Kz0Z1UNB4IvHLYNovDJnDva5mSlNqzCxzbk5Y27dXoVP125J4rYUVk1mpT/mfDMyogY P300zaQM3Pp8oP/NVFxMPNc53RpRE3I2uN14bqe7r7urpnfuk2VQknDi+RtP4libYrqkajzc eqhWSvAJKrkXruNV/wAdPD10BwMAAA== X-CMS-MailID: 20200910193505eucas1p1c72b003752070200f63b999e6ffb7c5f X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200910193505eucas1p1c72b003752070200f63b999e6ffb7c5f X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200910193505eucas1p1c72b003752070200f63b999e6ffb7c5f References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200910193400.15326-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v10 18/24] examples/l3fwd-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/l3fwd-power/main.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index 9db94ce04..bcd737994 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -1945,6 +1945,7 @@ check_all_ports_link_status(uint32_t port_mask) uint16_t portid; struct rte_eth_link link; int ret; + char link_status_text[RTE_ETH_LINK_MAX_STR_LEN]; printf("\nChecking link status"); fflush(stdout); @@ -1964,15 +1965,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", (uint8_t)portid, - (unsigned)link.link_speed, - (link.link_duplex == ETH_LINK_FULL_DUPLEX) ? - ("full-duplex") : ("half-duplex")); - else - printf("Port %d Link Down\n", - (uint8_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