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 D245BA04AF; Tue, 11 Aug 2020 10:55:31 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ACA8B1C12A; Tue, 11 Aug 2020 10:53:20 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 6BAFB1C122 for ; Tue, 11 Aug 2020 10:53:19 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200811085319euoutp014870c485c0fee5583708a137a1cd2389~qKrq0Uba90892608926euoutp01R; Tue, 11 Aug 2020 08:53:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200811085319euoutp014870c485c0fee5583708a137a1cd2389~qKrq0Uba90892608926euoutp01R DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1597135999; bh=dvfFw37UQuDLpsrBIxFOndEZRyFbf9bRa3Rm/liUUPQ=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=NrYrRvJ2hKsxau20MyIwQaBnCAmnCetCu2X+lDPdBcQpRQpyL8IemjO/x6BkhZPV/ NdkGKEIqF63VIykRwJfP/PnLhPyWG9I7XakoJIy0L3KMJFKDkCuhLi14NCGxpZHOuv 6VVuIAK4Qi85VfGsvRrgbSkMn2OB+u0CELzmNitE= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200811085318eucas1p18e6bb5c13e66e93669204c0b9e619cef~qKrql_dMg1187911879eucas1p1W; Tue, 11 Aug 2020 08:53:18 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id F5.ED.06318.E7C523F5; Tue, 11 Aug 2020 09:53:18 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200811085318eucas1p1bdd1fc51fccb907167a338785d2fdf86~qKrqH18_u1584615846eucas1p18; Tue, 11 Aug 2020 08:53:18 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200811085318eusmtrp10cb8017ac6a5744332c1483ab298cb07~qKrqGpj6r1606216062eusmtrp1k; Tue, 11 Aug 2020 08:53:18 +0000 (GMT) X-AuditID: cbfec7f5-371ff700000018ae-fe-5f325c7ee86a Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 49.0B.06314.E7C523F5; Tue, 11 Aug 2020 09:53:18 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200811085316eusmtip18b0054b4af7cbd83ca18585e7b3601ec~qKroPixON1725317253eusmtip1j; Tue, 11 Aug 2020 08:53:16 +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:28 +0300 Message-Id: <20200811085246.28735-10-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: H4sIAAAAAAAAA0VSe1BMcRT2u/fuvbed1lyb4TcxjDvDxCDkccabwVzGcxgznlncyaPS7C3P GROR3S3RYzZERcyyxZLVLiPDotKGqampHVZJNG0pRYZsaLtr/Ped73zfOd/5zY8l1al0MLs7 OlbURmsieVpJFZX8fDXh6OYp4ZMqz88AS0U2gsZ3eSQ0ZLhpSPpygoA68zx4aLuogLT6eAJS 0joJsF030NDWcJyC9i4bAW+LnQxcqDrOQJejmYHTr7MQNHs9JJzP/YrgdfY9Bfx88oCGDu8V ClJ6ahCcsZYhKE3upCDjvh1BooGDLzdMDOS9HQFdDWUUOF13GSjoriThXkUvgtRSC4KXiX8U 80cJPbnXFELewxZCSL9cSQolLiMjJL/IJoQ77XZC6HhUQwspVjMSyhuTSCG/6Qe9WrlROXun GLl7v6gNnbtNueuY+yIV8z7gYJL1ExOPvjMGFMBibio26UwKA1Kyau46wjkZpylfQ819Q7iz ZJ2MvyKsd40zILbf0NxyWNabEE7VFxFy0Y3wtQQb7TPQXAh26rL7G4O5OzS2eWsJnzuIW4zd 54J9Goobjd9UNfSnUHEzcas+hZITjcT5tx+TPhzQx+dn1ZNyiBG4Nudb/0zMVbA4QRdPy4ZF uMdT4sdB2FNq9Z82HDvTkynZcKovatFdRi7OIpyQ9dmvmoetra8YXzqSG4stD0LlMxfgukxe hgNx3edBPjHZB9OKMkmZVmFdolqewePHL6r8NMa9vwJlWsAF1en+5ylG+Jb5Nn0Wjbzwf1Uu QmY0VIyToiJEKSxaPDBR0kRJcdERE3fsiypEfR/V+bu0244eebc7EMciPlAVM2tyuFqh2S8d inIgzJL8YNXCl86tatVOzaHDonZfuDYuUpQcaBhL8UNVYVdatqi5CE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UUwRDf/rCNZNmYYyrkWtSHOf2bPxrHmR/3hhoKOm CoSuyVeRtpWK39aJPq+ddR+zxjtTC84nbpkjt4YFtp6CyEZDwbBHflQuzp4nloW3V28P6Nea 6lnvQ7JrRUc0PtnFwzM3+4ZCZgmPik+h5g2NvU2+0T93XNnlq9Ts7pgJzH90SpKvYU5aSvdG qCgpQcuvJQ2S9i+k0VuFBwMAAA== X-CMS-MailID: 20200811085318eucas1p1bdd1fc51fccb907167a338785d2fdf86 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200811085318eucas1p1bdd1fc51fccb907167a338785d2fdf86 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200811085318eucas1p1bdd1fc51fccb907167a338785d2fdf86 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200811085246.28735-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v9 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..bb8cff7c1 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[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), NULL, &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