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 D9420A04C7; Tue, 15 Sep 2020 21:10:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 90E0D1C1D5; Tue, 15 Sep 2020 21:08:27 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 5DD711C1D7 for ; Tue, 15 Sep 2020 21:08:26 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200915190826euoutp0287a24a7511b428f22d5787a590eba734~1CpujK46p1840518405euoutp02E; Tue, 15 Sep 2020 19:08:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200915190826euoutp0287a24a7511b428f22d5787a590eba734~1CpujK46p1840518405euoutp02E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1600196906; bh=zmZz7YLNZwsZfzlBrodbxoobMXy1KSIqos1a6ezRVA4=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=sklUWwvasDtjhrNzx9TlzKz5DzYlfJNSLOuGvIOrUcQccJfcPLpuGAAQXY9IZTAlb ipCaOsfMgV1rbEMuK/RScLlhUIk/YdAYHSSXc/VQkaj/SbmEwZB7RG9HZ6KRo1bxgy rH7YinSKcHsRMtOxA+vJZSbYvWMRyJWuIWkbq9Oo= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200915190825eucas1p2de13a036dede87968de7285a38a3e05a~1CptvzgpB2576625766eucas1p2t; Tue, 15 Sep 2020 19:08:25 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id FC.DF.05997.921116F5; Tue, 15 Sep 2020 20:08:25 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200915190824eucas1p2244766de5d98225fea4c2c3e074f99d5~1CptUSOS41703717037eucas1p2V; Tue, 15 Sep 2020 19:08:24 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200915190824eusmtrp16d742e08ad4e38e0460068beb367b72d~1CptTjCTJ2872428724eusmtrp1i; Tue, 15 Sep 2020 19:08:24 +0000 (GMT) X-AuditID: cbfec7f4-677ff7000000176d-72-5f611129f999 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 11.FB.06314.821116F5; Tue, 15 Sep 2020 20:08:24 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200915190822eusmtip24c397f1b11da6852e90cab54f03953bb~1Cprh-n891759817598eusmtip2P; Tue, 15 Sep 2020 19:08:22 +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: Tue, 15 Sep 2020 22:07:11 +0300 Message-Id: <20200915190728.18143-17-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200915190728.18143-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSe0xTdxTHPffe3nupVq/F6c8HEJsZxWUqm5oTXOY7Xl+JWUJ8RIXruEED VNMCPhJNA465FhEK6kYREeZ4KMFHeQYXqZmlVHxAGoThRpwRBRXBQiajOsrtsv++38/3/M75 nV9+PK3NYWfxB/RJskEvJehYNVN99/39z8OnStFL8p9PxMp7BYBP/yimsTv3CYuWtycpfFy+ Ehtq8lVo/dNEYaZ1gMKaUjOLr7pTGXwzWENh1y03h3mtqRwOOno4PP3ABtgz2kvjT4XvAB8U VKnwfWM9i/2jRQxmjngAz9ibAJ0ZAwzm1tUCppsFfFtWwmFxVygOdjcx6O64yeHVoUc0Vt3z AWY7KwFb0j+qVs0VRwovq8TihpeUmHPpES3e7TjHiRmuAkq8/qaWEvt/9bBipr0cxOanFlq8 8uxvdpt6l/qrWDnhQIpsWPx1jHr/d9mVcChffSS1zEKZwMKbIYgnwlJiP/szYwY1rxVKgRSV nqUV4wXSNdIZMO+ANLaZODPw40fufFym8BIg58r6VYoZAtLy0EP5+7LCAuI+VUD5g2nCdZbU jLaPB8HCBtL5Sz3l78QI84jvxm4/1giRpKnTQil3CiNXrt2m/TpojLfWeTi/1gqhpP2iN1Dz kCe9v61T9DoyZG0HRQeTXqedU/Qc4s7JGN+NCN8Dya6+ySkmC0ia7XWgaiWx990fX40Wwkll /WIFryaunGegbDyZPH491Y/pMWmtPk8rWENOpWuVah257WoNYEJ8/0xSsEhc9o7A694C8sRd osqCsLz/ZxUClMMMOdmYGCcbv9DLhxcZpURjsj5u0bcHE2/A2Fd1f3B6a6F+dJ8DBB50kzSF v8dEa1VSivFoogMIT+umada0uPdqNbHS0WOy4WC0ITlBNjpgNs/oZmi+LHq5RyvESU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Y5RtoRCei+b6v1Zkior9DsWA/e2ag IMi/fvWifTb9Z+WWqGLNOY3P0xK/8e7d3cVzuTkfb+9qnanqXFoYSx6t7o2qNUWJk2sfxg4Y Lk+VO9dUZY6qe+53Ur+M5mnBnRbj2cRI2103GTl9waIqKCl/dmQlL7rUNdJ/cF7/ZSL8Utfr X2arlOAT1fJduJ5X/wX/pJNyBwMAAA== X-CMS-MailID: 20200915190824eucas1p2244766de5d98225fea4c2c3e074f99d5 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200915190824eucas1p2244766de5d98225fea4c2c3e074f99d5 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200915190824eucas1p2244766de5d98225fea4c2c3e074f99d5 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200915190728.18143-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v11 16/24] examples/l2fwd: 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/l2fwd/main.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c index e04c601b5..28bede684 100644 --- a/examples/l2fwd/main.c +++ b/examples/l2fwd/main.c @@ -571,6 +571,7 @@ check_all_ports_link_status(uint32_t port_mask) uint8_t count, all_ports_up, print_flag = 0; struct rte_eth_link link; int ret; + char link_status_text[RTE_ETH_LINK_MAX_STR_LEN]; printf("\nChecking link status"); fflush(stdout); @@ -594,14 +595,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", - portid, link.link_speed, - (link.link_duplex == ETH_LINK_FULL_DUPLEX) ? - ("full-duplex") : ("half-duplex")); - else - printf("Port %d Link Down\n", 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