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 644B9A00C5; Mon, 6 Jul 2020 22:29:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6788D1DC41; Mon, 6 Jul 2020 22:27:29 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 879271DD10 for ; Mon, 6 Jul 2020 22:27:27 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200706202727euoutp01756545be9af6418e7459e4517369d4a7~fQ7c33lq52799827998euoutp01D; Mon, 6 Jul 2020 20:27:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200706202727euoutp01756545be9af6418e7459e4517369d4a7~fQ7c33lq52799827998euoutp01D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594067247; bh=mj3hE/gu7NzVbUKqiHTNl/YjUhTA6ayvrigfQL+Dyrc=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=r/5uobxKBb6dkF4kFhc0fPmaRcsXuaPDevnrRVKqh6A+G43cjS8cPH6iQUTk5xejP BPXcD23E14QCiRBykZ8x0wcz7oT+kqcA+FVxB/TmQwNGJe7ySXjgZpmpaTEfENzsVW HSxViCyDXI4ll9DfjoJ9QE8v/IsV0IYEHWAP3zDg= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200706202726eucas1p1bf5a7dc2e3042ced44a70fbea2240134~fQ7b2ao6F1288412884eucas1p1n; Mon, 6 Jul 2020 20:27:26 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 7C.96.06318.E29830F5; Mon, 6 Jul 2020 21:27:26 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200706202724eucas1p196ad6a9590f4b488e13b265fee3b854a~fQ7arm0IQ0814308143eucas1p1q; Mon, 6 Jul 2020 20:27:24 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200706202724eusmtrp1d0fcf8b756c5318e6025e4657532fb12~fQ7aqlTyu2178321783eusmtrp1t; Mon, 6 Jul 2020 20:27:24 +0000 (GMT) X-AuditID: cbfec7f5-38bff700000018ae-3b-5f03892ee903 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 9F.AF.06314.C29830F5; Mon, 6 Jul 2020 21:27:24 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200706202723eusmtip1b7201daf8b1b2df60f8c593be1f74a48~fQ7Y7OroN1560515605eusmtip1a; Mon, 6 Jul 2020 20:27:23 +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: Mon, 6 Jul 2020 23:26:07 +0300 Message-Id: <20200706202626.28628-18-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200706202626.28628-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSa0wTWRTHPTPTmaFrzThgvIsGYhPjIy4qYnJiNj6Ij/lgjH7wERWwyqQa yyOtuD6yEc1KsLAFq9H4CNYBRVBTHsVWFAK4oWJRFINFRa3oyuqygiCKCrtSp2a//c/v/7/n nHtzeVq0s5H8ttQdsjnVYNKzWuZK46c7P8UcopNmHcrXorO5ALDzaSGNgaNPWMzp/Y3C9tIF eN19WoP2Z5kU2uzvKHRfsLLYHTjA4Ns+N4UdNT4OT7Ye4LCvoYvD31tOAXYNvaHxhKMfsKWg SoOf6qtZ7BlSGLR9bgPMc90E9Oa+Y/DoVQ9gllXA3pJiDgs7orAvcJNB38NKDi8N3KOxqnkY 8LDXCXg76z/NwknSZ8c5jVR4/TUlHTl7j5YaHx7jpNymAkoqf+uhpJ7aNlayuUpButWZQ0sX Xw6yK7XrtT8ny6ZtO2XzzPmbtFvvv3Cx6a/CdhU7/UwmPOasEMYTIY647TfAClpeFC4A+dNb RKvFeyDtgRIIpkShH4jSlvj9RJ2tRqOGioE4Oh+FigEgdQcrqGCKFaYSX3YBFTQihHKWuIf8 34xwYSnpqvrABDUjTCY3bE3fFtEJ80jll1uMOiKaXCyro4M6bIT/0VPJqmtEEf+Z95SaucuT vxxoBX5ELyYPepepOJy88bpCd5tIfEdyQy33ko8Vfi64DxGygTxVDoZCC4jr7ztcsA8tTCPO 6pkqXkQUfy6rth9D2v8ZG8T0iLRfOU6rWEeys0Q1rSd1Ta0hTMjwl9Eqlkjt+TOh16kBMvj4 PJsP0Sf/n+UAKIXxcoYlxShb5qTKv8RYDCmWjFRjzJa0lAoY+am+f70DHqgd2twAAg/60boA TyeJGsNOy+6UBiA8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kTSZqd0vYyI1Bv4ozx/j9f/7CImbVwJaw4d+rkittZZEhAjdeaeb 2kxJIaZ85cChDzvw6t0kxqEe9tfGs0SrqCHGP6Nn8YvavRE7+xqdvku2p3c716waTM9QHa/O mhor+75r6fx7A1uDDh05P6f93ZlgsffC/PVDb5fLwrKfsspTidl7PMbvDIfmuj+4ZlNX26iI lCpyXCWnhCgNu47UC5p/QExviQkDAAA= X-CMS-MailID: 20200706202724eucas1p196ad6a9590f4b488e13b265fee3b854a X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200706202724eucas1p196ad6a9590f4b488e13b265fee3b854a X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200706202724eucas1p196ad6a9590f4b488e13b265fee3b854a References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200706202626.28628-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v5 17/25] 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_strf function to example applications Signed-off-by: Ivan Dyukov --- examples/l2fwd/main.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c index e04c601b5..9d5f7307e 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[60]; printf("\nChecking link status"); fflush(stdout); @@ -594,14 +595,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")); - else - printf("Port %d Link Down\n", 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