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 7B316A0528; Sat, 11 Jul 2020 12:47:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E97771DABA; Sat, 11 Jul 2020 12:45:15 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 662851DA46 for ; Sat, 11 Jul 2020 12:45:14 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200711104514euoutp0210648ee3f97d08f4113c96ca63acbb58~grNiQPbz72273222732euoutp02t; Sat, 11 Jul 2020 10:45:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200711104514euoutp0210648ee3f97d08f4113c96ca63acbb58~grNiQPbz72273222732euoutp02t DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594464314; bh=Mxm/6/TLoP3KY0eoO9SPi3kD8IBKHT08Z4Gze2Q8+Z4=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=soZbaqUm+jixEXGpdFXO4Rt+WpuYvvisfWw+gl4wTNtvuix3KHincaexsKs8wfIvL +nGfAxTXCKEWcH2h9CTR1TSnczI9Wagj3XP5oevftIZzgUqF2ZnnUVHUdKj3JsUjCA 7lwMqi02vgtgyNoy5Bv8xp5yp0kzQXmxWn1D0/VQ= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200711104513eucas1p23003f59d3b9505bdf674e361e1dfb0f4~grNh7lHF62332923329eucas1p2X; Sat, 11 Jul 2020 10:45:13 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 7A.55.06456.938990F5; Sat, 11 Jul 2020 11:45:13 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200711104513eucas1p1d73b9bc2ecf1c7bd3a3bc07bf85fcc2c~grNhc7adG1559215592eucas1p1s; Sat, 11 Jul 2020 10:45:13 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200711104513eusmtrp171e5d3e70e9910c33f504e39a7f29735~grNhcGZdO2954729547eusmtrp1_; Sat, 11 Jul 2020 10:45:13 +0000 (GMT) X-AuditID: cbfec7f2-7efff70000001938-4f-5f099839a961 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 9E.86.06017.938990F5; Sat, 11 Jul 2020 11:45:13 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200711104511eusmtip173c3fea1215b6c4083908fa68853e328~grNfjFDcy0946309463eusmtip15; Sat, 11 Jul 2020 10:45:11 +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: Sat, 11 Jul 2020 13:44:04 +0300 Message-Id: <20200711104414.15422-18-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200711104414.15422-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSb0xTZxTGc+69vfe2oeZa2TxRA7FOoyaK6JacmUU344f7wWQu24dJ4vAq N+gGFVsQYYlBpAQLogMy+aO1QkSHGhSxRcXNVSNicSgLQYN2BK0ok3/FuhXBjXIxfnvO75zn vO/z5hVZUxk/R9xhSVetFiXFzBs4961w+7JPy/WJK54djKP6NidQr7+GpZ6yxzwVDucx9KBu LTV7juqo5K8chopLRhjynHbw9LInl6PBoIehR9d8AlV25AoU9PYJdLC9CqhvvJ+lCtcoULvz ko7Cv1/haWi8mqPisU6gQ423gVqKRjgqu9wElO+QaPiXUwLVPIqhYM9tjnwPLwp0NnSfpUtt E0A/tdQD3c3/T/f5fHnMdVIn1zS/YOTSE/dZ+dbDnwW5qNXJyBcGmxh56NdOXi5urAP5Tm8h K595+i+/0ZBg+CxJTdmxW7XGrdli2N4c6ufSag17AuO5XA4MCg7Qiyh9jG8vd/EOMIgm6TTg 0YqXgla8AvTt+xO0YhTw2ehxnQPEKcsRP6fxU4DHRvJYrQgB1rde5SJ7eWkx+gqcTKQRLV3g 0TPexUQas6QNWFhdoItoTlqI/d1eiGijtBo9524y2qVi8cz562xE6yf5xNC9KW2SYrDr+Kup pSi1iTgwFgLNsB7vud6ZZ2F/S+N0unnoKy3iNP0j/tPQJWjmAkB/tX16aC02/v2HEMnGSkuw /kqchr/A1/YJQYs8Ax8MzIxgdlKWuI+wGjZiQb5Jmzbj9daOaYw48SZKwzLu9w5Pv881wNJ9 fuEwxFa+P8sFUAez1QxbarJqi7eomcttSqotw5K8fNvO1AaY/Ku+ty3BJgh1bPWCJII5yuhS xESTTtlty0r1AoqsOdq47q7vO5MxScnKVq07E60ZKarNC3NF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UKSoP8/RzAyrzRk2Xk+Y+nntKyXn3Z5tHMOxn66 avZ50v7pUcqwzrfTufKzw9w0V9/CGzv8uJqy5l91u8oii/t/2Y8XOsonL8j8hrvX+KSs3Z0a cGloovfnDRxuQZbIA+r8vausBWMRjs0pnvHeioLAbH9INWcedW8y9AbuKExNqU15krzeOV0D SkqM06j8Sb2o+QerKjv1BwMAAA== X-CMS-MailID: 20200711104513eucas1p1d73b9bc2ecf1c7bd3a3bc07bf85fcc2c X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200711104513eucas1p1d73b9bc2ecf1c7bd3a3bc07bf85fcc2c X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200711104513eucas1p1d73b9bc2ecf1c7bd3a3bc07bf85fcc2c References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200711104414.15422-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v8 17/24] examples/l3fwd-graph: 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-graph/main.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/examples/l3fwd-graph/main.c b/examples/l3fwd-graph/main.c index c70270c4d..8af835e15 100644 --- a/examples/l3fwd-graph/main.c +++ b/examples/l3fwd-graph/main.c @@ -599,6 +599,7 @@ check_all_ports_link_status(uint32_t port_mask) struct rte_eth_link link; uint16_t portid; int ret; + char link_status_text[60]; printf("\nChecking link status"); fflush(stdout); @@ -623,16 +624,9 @@ 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", - portid, link.link_speed, - (link.link_duplex == - ETH_LINK_FULL_DUPLEX) - ? ("full-duplex") - : ("half-duplex\n")); - else - printf("Port %d Link Down\n", portid); + rte_eth_link_to_str(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