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 9B809A00C5; Mon, 6 Jul 2020 22:40:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 231041DDAB; Mon, 6 Jul 2020 22:38:41 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id E6E101DD76 for ; Mon, 6 Jul 2020 22:38:39 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200706203839euoutp023ee92059c6930e376cf27389c76f8b5d~fRFPIsp0R2313123131euoutp02r; Mon, 6 Jul 2020 20:38:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200706203839euoutp023ee92059c6930e376cf27389c76f8b5d~fRFPIsp0R2313123131euoutp02r DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594067919; bh=mj3hE/gu7NzVbUKqiHTNl/YjUhTA6ayvrigfQL+Dyrc=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=Qi6ctS98RMWrv7EdEw1Izijvm7bf6R6nBzYJmpAW6uzyb58sryPWeOW6Hc9zQX3LU wsorlm8mVVjmLitMXkKLA4YAI1UmY9rU/8UVY9vua8x83D4dIr837H5ugqusSl7T6l WRow/LnmWcljXQCt/69xMxABGpUr2BHisgeoDUXc= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200706203838eucas1p168514718b1738aa6305faea92db718b4~fRFOQZXkk2654826548eucas1p1A; Mon, 6 Jul 2020 20:38:38 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 5D.C9.05997.ECB830F5; Mon, 6 Jul 2020 21:38:38 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200706203838eucas1p25a3b38dc4c1a04f7c15f76f190dff8a2~fRFNmlRWj2126821268eucas1p2D; Mon, 6 Jul 2020 20:38:38 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200706203838eusmtrp16c59d13b5ed7031f0441247d0509a7d6~fRFNlhGht2965829658eusmtrp1q; Mon, 6 Jul 2020 20:38:38 +0000 (GMT) X-AuditID: cbfec7f4-677ff7000000176d-d2-5f038bce087a Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id E0.EF.06314.DCB830F5; Mon, 6 Jul 2020 21:38:38 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200706203836eusmtip17d8d643f52e6e9bfb0b4c269b649f559~fRFLyIxJC1560515605eusmtip1E; Mon, 6 Jul 2020 20:38:36 +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:37:31 +0300 Message-Id: <20200706203743.29416-18-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200706203743.29416-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSaUxTaRSG892dxpprbeIZxrg0MVHjNuqYM6gjGmPuxIzLHxONUKveIBGq aQF1xh8EEQlF0MJIdBARolUwwWJpEcuInQyLBbQoFjdERRBFWYSMYl1aLsZ/73nOec/7neQT aI2VCxdijQmyyWiI03Eqxln7oXlus4XWLzh2ZS6WNRYQfNZeTGNH7mMOLf2pFLaVrEC3K59F 65NkCrOsAxS6LmRw2NuRwuDbQReFj6q9PJ5qSeFx0NPN49FbfxPsDryi8WThO4K3CipY/HCj isO+QBGDWSOtBLMd9QTrMgcYzL1aSTAtQ8T+izYeix9NwcGOega996/weGnYR2NF4yeCx+vK CDalfWEjp0sjhedYqdjdQ0k5Z320VHv/BC9lNhRQkv1tJSX1/dPKSVmOEiLdfGahpdLO99wG 1RbVsp1yXGySbJr/6zbVrjvPHdzerrD9tjI/k0we8hkkTABxMZzvrAlqlaARLxA45zvKKMUQ gfbjGZRSvCPQZaugvlmcAT+rNGwEHL0eWimGCaTmvxhdzIkzwZteMGrXinYOXAH/qH2iuAac qdlsSDPiDDg08pCEtFqMAG9DD6dETIXSyzXBrYIQFuSn/wsPYY04BfxnhkZ3gtgoQPH1p6wy vxpyruePeSfCqzrH2HWTwZuTySj6T/i/3M8r5vTgcUWHx4ZWgON1Mx8Ko8VZUFY1X8Er4cUX KxPCII6HtjcTQpgOSqszj1awGtLTNMq0DmoaWsYwwKeP4xQpgc8yWXl8NQHL3YhjZOqp70mF hJSQSXKiOT5GNi80yvvmmQ3x5kRjzLwde+LLSfCnej/XDVWSqsB2DxEFohunTudovYY1JJkP xHsICLROq17V5I3WqHcaDvwhm/boTYlxstlDfhQY3ST1oqKeKI0YY0iQd8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uPyEaF2tdR7aX4ftn85Qdi3i1f2GOP Wxee3NkxGL2ZGZlJYjgf+jHpvq/koObHvPnyBldO0aaEa0vjUhYN7Cxas262WcfPWnBoYHY5 KFZrqp1NSfhOOKcrznVX5uzwt21YP3H2VZ/06KfHcKmGn7AXVcCWnlWHXfZXyZ9teUt6PzN5 KkpK1/OLSbOk/wsicQc1BgMAAA== X-CMS-MailID: 20200706203838eucas1p25a3b38dc4c1a04f7c15f76f190dff8a2 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200706203838eucas1p25a3b38dc4c1a04f7c15f76f190dff8a2 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200706203838eucas1p25a3b38dc4c1a04f7c15f76f190dff8a2 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200706203743.29416-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v6 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