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 00C91A04D9; Tue, 11 Aug 2020 10:58:51 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D2C571C202; Tue, 11 Aug 2020 10:53:44 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id D792E1C1EB for ; Tue, 11 Aug 2020 10:53:42 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200811085342euoutp0221e6f5bce62a52a2e2d22f050b006a1d~qKsApEd0l0674006740euoutp02T; Tue, 11 Aug 2020 08:53:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200811085342euoutp0221e6f5bce62a52a2e2d22f050b006a1d~qKsApEd0l0674006740euoutp02T DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1597136022; bh=LRORBOggtz49UEFwPLXkqDJxBG0kESiE4Ao8Fn0DyTQ=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=MTzIj5AvQSlR+7UTLWYVwMvUoqS8iWUVfea86teHs0OXH/Llh5/d0YCfk2psufTAv /ywdBLl3krXZilw3mOAv6tD88GlUaxN89ndTzkKThQ45PTHZvmX6ZA1izgAoVOrTFJ O9L/Ry4IklywOSckzTW6QEUgbf92lgzpMsAB77w8= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200811085342eucas1p20fa2556e69251c9a416610fe3b1c9b97~qKsAbnsHJ1791917919eucas1p2U; Tue, 11 Aug 2020 08:53:42 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id A9.C1.06456.69C523F5; Tue, 11 Aug 2020 09:53:42 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200811085342eucas1p18fc9692be1516b1b97db78406696a78d~qKsABoi4d1584215842eucas1p1Q; Tue, 11 Aug 2020 08:53:42 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200811085341eusmtrp1faef40d10a5ce7103a56ea428729a672~qKsAAptmY1680216802eusmtrp1P; Tue, 11 Aug 2020 08:53:41 +0000 (GMT) X-AuditID: cbfec7f2-7efff70000001938-5d-5f325c961530 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id EB.6D.06017.59C523F5; Tue, 11 Aug 2020 09:53:41 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200811085340eusmtip14b770f13aa05e846ee0e357ed415ba23~qKr_O9OyY1807218072eusmtip1Y; Tue, 11 Aug 2020 08:53: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: Tue, 11 Aug 2020 11:52:40 +0300 Message-Id: <20200811085246.28735-22-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200811085246.28735-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0VSa0wTaRT1m5nODMWa2RHDDRqMTYy68bH4ylUJihozPzTR+EeNLltlRGNB 0gqIibE+QFMQsRKMoAXBB4K7FUEKBFltFChF1KoBE1QEEwUFeUekPlqmxn/nnHvuufd++Xha zGJD+L1xB2RDnE6vZdVMRd1o87zs7Quj/nL2BaGtyUqw43Uhje1Zr1hM6ztBYWvxSqyxX1Sh 5Y2JwgxLP4X2IjOLn9qPMdg7YKew7a6Lwxz3MQ4HHO85PP04l+B7TzeNF/IHCT623lHh6P1q Fj97ChjM+PqC4JnyBoL16f0MZlVVEkw1C9h34zqHhW2hONDewKDrZRmHN4ef0nin6RvBs/U2 go9Sf6hWzZC+5l9VSYU1XZR07vJTWqp7mc1J6U4rJZX2VlLS59oXrJRRXkykxo40Wip594Xd qN6mDo+W9XsTZcOCiH/Ue67dsKnirYEHn9hv0iZiCTCTAB6ExfA2N4c1EzUvCkUE+itGOIUM eUnaGKOQQQJnPzXSv1rMzzxEKVwnMNLUSitkmEBZyn+Mz8UKs8F1ykr5CkFCKQt2T4uX8Pxk YT0UPV/q8zDCTHjd8mE8VSMsB0vTA06ZMB1Kbt0b1wO8eknum3EsCqHQkjc0ngnCAx66s2uI 0rAWqjoc/vUmQ3d9uT9oGrjOpTNKw0nvDRVlnEIyCRzP7fG7VkL5x2bOtx0tzAFb9QIfBCES 8t2sAidBa88fPjPthZaK87Qia+BUqqhkaOGe0+2XAb6NTVRkCVyjdf5HvEugpN3BZZLpOb9H 5RNSTILlBGNsjGwMi5OT5ht1scaEuJj5u/bH3ibev+r6Xj9QSYbdOx1E4Il2oiZ+RViUqNIl GpNjHQR4WhukWf3I9beoidYlH5IN+6MMCXrZ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JsqJNf1HX8V5BfbL+hJj0l1LWnPbr1Vu3J 3LlbncWVfRn3A4Mj7PtNdGt12LbLc/xHimja91DePJuU2xi1QyEbIhcc7EqcTG4frIlofDhW tBPnlK580fN8kWq9sziN5Hz33l2cdGK3snKLrftydl5IgWH84t5J60C4J0hMSBSr246qKTFG z60gzaL+H8/QopQIAwAA X-CMS-MailID: 20200811085342eucas1p18fc9692be1516b1b97db78406696a78d X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200811085342eucas1p18fc9692be1516b1b97db78406696a78d X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200811085342eucas1p18fc9692be1516b1b97db78406696a78d References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200811085246.28735-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v9 21/24] example/performance*: 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/performance-thread/l3fwd-thread/main.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c index 84c1d7b3a..15aa25054 100644 --- a/examples/performance-thread/l3fwd-thread/main.c +++ b/examples/performance-thread/l3fwd-thread/main.c @@ -3433,6 +3433,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[ETH_LINK_MAX_STR_LEN]; printf("\nChecking link status"); fflush(stdout); @@ -3452,14 +3453,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), NULL, &link); + printf("Port %d %s\n", portid, + link_status_text); continue; } /* clear all_ports_up flag if any link down */ -- 2.17.1