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 66D82A04B5; Thu, 10 Sep 2020 21:35:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8F8361C12C; Thu, 10 Sep 2020 21:34:41 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 885931C129 for ; Thu, 10 Sep 2020 21:34:40 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200910193440euoutp0168c5393a98529cf2285c0cccab88bd5f~zgyNASWOc0325703257euoutp01I; Thu, 10 Sep 2020 19:34:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200910193440euoutp0168c5393a98529cf2285c0cccab88bd5f~zgyNASWOc0325703257euoutp01I DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1599766480; bh=zr14D0fDL7SjhFN+jVIm/DVAQiqOuCvoeH8ErtcPSmA=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=k5OCEvcemQs2vgE8OW7K2CltRfVmqRul4FLOrWLRTB79bsVJwLkx7/axUeG8215B5 WMFFFm/v+UWq1i8pNFxyGswIlFsUJ3MXjDHwco0k7fMb+4KVCvl28UVII4lyk4X1rC bgznKhtgitrsLkSFTML2riyX/R0MqtnHa1cM6/88= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200910193439eucas1p2db61e764fb95a4e8b484f241ecd884d9~zgyMzUIc81147811478eucas1p2l; Thu, 10 Sep 2020 19:34:39 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 81.1D.06456.FCF7A5F5; Thu, 10 Sep 2020 20:34:39 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200910193439eucas1p18263bdec6cef7f5790fef06338888528~zgyMVwmjU2934729347eucas1p1M; Thu, 10 Sep 2020 19:34:39 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200910193439eusmtrp1ab8e30714200fd52460daa4a9c3915c2~zgyMU6Adc3165331653eusmtrp10; Thu, 10 Sep 2020 19:34:39 +0000 (GMT) X-AuditID: cbfec7f2-809ff70000001938-99-5f5a7fcf0e24 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id BF.8A.06017.FCF7A5F5; Thu, 10 Sep 2020 20:34:39 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200910193437eusmtip2499c9744b5c392e3a7e557b7839326bb~zgyKhy6LP1654016540eusmtip2A; Thu, 10 Sep 2020 19:34:37 +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: Thu, 10 Sep 2020 22:33:42 +0300 Message-Id: <20200910193400.15326-10-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200910193400.15326-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSe0xTdxTHc+69vffS2O1ajR510dgE4xM1mniCU5xZtjtdsv1hYoIgVrmi ESq24mNZMgZaXOmYPJwOtooCgmBEobwUDJbJq7hqfUGogsTF4CYCUiMC2ygXs/++38/5nt/J OfmJrD6Tny3uNR1UzCZjrIHXcpWNw55lnu/Co1acSV9BpW0OoJ4neSx1Zz3mKbX/GEPtxWFU W/WrhjK6EhlKyxhgqKrIxtPf3Ukc9Q1WMeSrcwuU7U0SaND1XKAfPTlAz0dfsPRL7msgj6NC Q8M3r/H0avQ8R2nvHgD95GwGarIPcJRVUw1ktUnUf7FQoDzfXBrsbubI3VEu0CX/XZYq2saA 0ptKgW5b/9VsmC+/yy3QyHm1vYycee4uKzd2/CzI9hYHI1/tq2bkVzce8HKasxjk1p5UVi55 9pb/Whuu/Thaid17SDEvX79Du8fX0MXEdwUdcV4vEBLBL9hAFFFajUX5c2ygFfVSEeDAqRug miHAtnIvq5rXgP3ljez7jje/b1V5IWCKx86oxg84nHpqPBQk8tJCdJ9wTBSmS1d5rBp9xAQK 06TP8J53RAhoTgrGhrLrfEDrpFC0d9ZCQKM0D0uu1E9MCxrnT32RAayX5uKjs0MTb6J0R8TO 5GaNmv8Ub9X4BFVPwxdNzkn9Eboz7ZzakAKYXlkuqOYkYHLOy8lUGDr/+mPiGqy0CEuvLVfx J1j4pIZXV/4A219ODWB2XGZUnp68hA5PWPVq2oD1Ld5JjDg2MkXFMtY9vKVR71MH2HrMxZyE edn/z8oFKIaZSoIlLkaxrDQph0MsxjhLgikmZNf+uDIY/6ruf5oGq8Hv3ekCSQTDFF19aHiU XmM8ZDka5wIUWcN03cbb7u16XbTx6DeKeX+UOS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QrxXl022EJrVLquBMcl8Zp//dhQpFvFjrwedBsPb3FvKlDX201LW9p upRbL/L3ZIc3vF6tm292HK+bWWHNVwW/DP8orR/IjHY01OVOW76nFRe8c1gMh7y3tb6/M6Z4 sMqqs7beUC2MbFkzKd8YYNG9OnHmZ1DbdcXZgP69uOjg8fGK2JurrEElm6MzfHYbssJ3BRae W15+2E9K8ElK+VZcyyv/AmfnASkHAwAA X-CMS-MailID: 20200910193439eucas1p18263bdec6cef7f5790fef06338888528 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200910193439eucas1p18263bdec6cef7f5790fef06338888528 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200910193439eucas1p18263bdec6cef7f5790fef06338888528 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200910193400.15326-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v10 09/24] examples/ioat: 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/ioat/ioatfwd.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/examples/ioat/ioatfwd.c b/examples/ioat/ioatfwd.c index b66ee73bc..f77012eb9 100644 --- a/examples/ioat/ioatfwd.c +++ b/examples/ioat/ioatfwd.c @@ -700,6 +700,7 @@ check_link_status(uint32_t port_mask) uint16_t portid; struct rte_eth_link link; int ret, link_status = 0; + char link_status_text[RTE_ETH_LINK_MAX_STR_LEN]; printf("\nChecking link status\n"); RTE_ETH_FOREACH_DEV(portid) { @@ -715,15 +716,12 @@ check_link_status(uint32_t port_mask) } /* Print link status */ - 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")); + rte_eth_link_to_str(link_status_text, + sizeof(link_status_text), &link); + printf("Port %d %s\n", portid, link_status_text); + + if (link.link_status) link_status = 1; - } else - printf("Port %d Link Down\n", portid); } return link_status; } -- 2.17.1