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 C8460A04C7; Tue, 15 Sep 2020 21:09:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E3CA61C19E; Tue, 15 Sep 2020 21:08:08 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 87A4A1C19B for ; Tue, 15 Sep 2020 21:08:07 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200915190807euoutp01e01958228e6d725f31174246c1ba345c~1Cpc69SD00516505165euoutp01b; Tue, 15 Sep 2020 19:08:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200915190807euoutp01e01958228e6d725f31174246c1ba345c~1Cpc69SD00516505165euoutp01b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1600196887; bh=zr14D0fDL7SjhFN+jVIm/DVAQiqOuCvoeH8ErtcPSmA=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=bMi/TFyznoACbsCjGg9J/xYD3inq4pbt1OZkZ9VUHFLE1zzV+JRiTgSfa1Xu7mdRC p0fpocLoZV7s2zkavOfZizqXBpQ9IY6HQ6ZwURhFba1HP2+qAPe26GzTTtF2c2umT8 QV/v9qdBYGlVx6AkZ/fT/zWJJbCOYF0h82p/6HJw= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200915190806eucas1p2f1cbc506f1ba1e3722302332b8f3ef42~1Cpca-Kg71274112741eucas1p2t; Tue, 15 Sep 2020 19:08:06 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 06.DF.05997.611116F5; Tue, 15 Sep 2020 20:08:06 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200915190805eucas1p17a324ccd4d81cd51dc855b6be17d13a5~1CpbOtKEU3097030970eucas1p1m; Tue, 15 Sep 2020 19:08:05 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200915190805eusmtrp184b14ef36ca36ef34c80b1c1545a6dbe~1CpbN57ri3148631486eusmtrp1O; Tue, 15 Sep 2020 19:08:05 +0000 (GMT) X-AuditID: cbfec7f4-677ff7000000176d-52-5f6111168d30 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 36.EB.06017.511116F5; Tue, 15 Sep 2020 20:08:05 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200915190803eusmtip2feec93f6aebf3035eb6924ec0a851e3c~1CpZfGEeg1712017120eusmtip2K; Tue, 15 Sep 2020 19:08:03 +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, 15 Sep 2020 22:07:04 +0300 Message-Id: <20200915190728.18143-10-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200915190728.18143-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0VSa0yTZxjN893pqH5UM54psbGJCerEbRrzZNM5t8V8f0ww6pYscVDHJxIp mBZ07hcTRQRELnVOMOUWI5eNghao3AJIBCyukYQgGQohGoNyv2QgxY3yYfbvnPOc8z7nffNK rOG6sEGKiUtQrXHmWJOg42ofLnh3fBhkjvgkeSyUnN0OoOHnJSwN2Z8JlD55kaGn5fupse4W TzmDSQxl5kwxVFeaJtDo0AWOxqfrGBpo8oiU13NBpOm2VyJd9eYDvfK9Zulm4QyQ11HD00Jr vUATvmKOMt/2Al1zdQJ1ZExxZL/vBkpJk2my7I5IJQObaHqokyNP/z2R/ph7wlJN9xJQdocT 6HHKv/xXm5W3hbd5paRxhFFyi56wysP+30Qlo8vBKNXjbkaZaO4VlExXOSiPhtNZpeLFvBCu +0G3N0qNjTmrWnd+Gak7NfBgkDkzGPCzq+G2mARzYhoESCjvRrtzXkgDnWSQSwHtjS9ZjcwC pncOMxqZARxZymLeR/5sdvPa4A6gez4XNDIH6C1r5v0uQQ5FT6pjJb5erhawzte3TCRpnXwQ L70L9Xs4eQu2t/SzfqyXP8eu4hustsGIFVUtKzhgWe+537tS1iBvwr6C2ZUzUe6W8J+8xdXA t5gz/Lug4XX4usO1ersQ9ORmcFrgMmB27T1RI1mAyfljq6796Hrzl+hvx8pb0Vm/U5MP4NXs ds4vo7wGn44F+WV2GebU+ov6ZT2mphg0twlbunpWZcSlxUBNVvBSZSenvU8T4FBfEZ8Fxrz/ dxUClEOwmmizRKu2z+LUc2E2s8WWGBcd9lO85S4sf1bPu45ZN9T7TrSBLIEpUF/4d2SEgTef tZ23tAFKrGm9/uvHnh8N+ijz+V9Ua3yENTFWt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R+4hy6+biETlDruWSOS+N0/30YJfI3IBPf8Kun6/wEZTi8hy9ze0Xg2owG 83dX5vx6g/JQxOkLDZHJeWfW5xdF7TraGd/+psw2OuPt44oeb729bb8999CRME3gOrcYfXGo BtNU2cWBFw4c3dPu/pjsVxilKHw0t/zg6tiN70QF1oBTppSKsJGiy1XOloH8S07rKjO5TxIr JfhEtXwDruPVfwE8kvWYCAMAAA== X-CMS-MailID: 20200915190805eucas1p17a324ccd4d81cd51dc855b6be17d13a5 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200915190805eucas1p17a324ccd4d81cd51dc855b6be17d13a5 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200915190805eucas1p17a324ccd4d81cd51dc855b6be17d13a5 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200915190728.18143-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v11 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