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 0641FA04C7; Tue, 15 Sep 2020 21:10:33 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B040C1C1CB; Tue, 15 Sep 2020 21:08:30 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id CDCAD1C1DC for ; Tue, 15 Sep 2020 21:08:28 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200915190828euoutp0191bb06b8fd8d4a7909f10655ec8ee84d~1Cpw2WuU80517005170euoutp01i; Tue, 15 Sep 2020 19:08:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200915190828euoutp0191bb06b8fd8d4a7909f10655ec8ee84d~1Cpw2WuU80517005170euoutp01i DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1600196908; bh=hWLcmMyVuKFoVFPzJm+8zZ/bn73NfLWC3PPR6DROxJc=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=MnoUalswLfq+Y1KLlP/c8a34w+2ho+DxREQih09ho3w3YRi7ydkejSfzWtc6MXC6n xFvRPqpQvpQMM4aW/XVx2Ry0OyAUJh8Gla6MOnHMc0C83UBuzpUQbElecdW27MYKLC YD+RMrYVRCOnwgicigbojIshZrM+9tlk5hd2YJCs= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200915190828eucas1p11fde35c31e8a60028bd254d8a6358669~1CpwoHyfU3106731067eucas1p13; Tue, 15 Sep 2020 19:08:28 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id F5.56.06318.C21116F5; Tue, 15 Sep 2020 20:08:28 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200915190827eucas1p227a32a8f74b364decb7ebbc096172949~1CpwHV-7Z1703717037eucas1p2Y; Tue, 15 Sep 2020 19:08:27 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200915190827eusmtrp1be8e9c8f5f241c4c7faf8e48f83910a5~1CpwGjV433148631486eusmtrp1e; Tue, 15 Sep 2020 19:08:27 +0000 (GMT) X-AuditID: cbfec7f5-371ff700000018ae-94-5f61112c6599 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 44.FB.06314.B21116F5; Tue, 15 Sep 2020 20:08:27 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200915190825eusmtip2ac3ea44f225555eb233fb9fc09b4da59~1CpuWToXp1712317123eusmtip2N; Tue, 15 Sep 2020 19:08:25 +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:12 +0300 Message-Id: <20200915190728.18143-18-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: H4sIAAAAAAAAA0WSe0wTWRTGc2amM0OXmqGQcNVVtInGXQXXoNkTs1kfMTpqjK+gCckKVSbI SqvpiIDZBKIGpCIiRQ1oKkgMD4nAUigQQERjwaKsrOUhKKxrYkBFBGp81AftYPzvO7/vO+fe c3N5WnuOncXHGQ9LJqM+Xseqmdo77ztDlwToo35pnwjCig4r4NMnRTQO5T5m8dTYCQp7y1Zh o/2SCnMGUynMynlDob3EzOLLoWMMjo7bKRxocnKY33WMw/HW5xye7rwI+NwzQmNewQRgp7VG he9vNrD42nOFwawPLsAztjZAR+YbBnPr6wDTzAKOlRZzWDQwF8eH2hh09lVzWO5+QGNNxyfA s44KwHtpX1Sr54sfCq6qxKLGYUq0FD6gxTt95zkxs91KiVWjdZT4utnFilm2MhDvPj1Fi9ee vWO3qSPVv8VI8XFHJNPS36PV+4v7zeyhXnXSoKWGSoV83gx+PBGWk4rqbjCDmtcKJUAqm8po pZgE0pBxg1GKCSBV2Q7ODLyvpbpcrfBiIB21b6dDbiDDnnTOO5cVFhHnSSvlNYKEKpbYPT2U 1wgUtpLLpTdpr2aEBcRpHld5tUZYSQr7XKBcKoRcq2zxZfymeFe9yzdUK8wlPZcnfUOJ0MGT QfewSmlYRzLKH9KKDiQjDhun6B+J05LJKA3pQM7WVnNKkQ3k+MVX06lVxPbivm85WviJVDQs VfAact7yjlZ2nkF6XwV4MT0lc2ovTGMNOZmmVdI60tLeNY0J+fTRX8EiseQ+VCkP1ASk/ZGd zYaQ/O9nFQCUQbCUIBtiJTncKCWGyXqDnGCMDdt30PA3TH1W52eHuw6aPXtbQeBB568p6I+O 0qr0R+RkQysQntYFadbec+7RamL0yUcl08EoU0K8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1jFI6KYIFr+5wjGyy8ZcYvHXYMHw/Sm6g3OXU9L9Y3E nfWfRs4fDPgwdLK8245P+0b9aE8KpI8Y5m9cMDm483DHjOatEby3ZPdN2ZZvtCRkztxfst2B /Y+GCIWROinapo5Y1xOU3qSP3Fy084kxeemxF/Vep1rA//PugMuKyeBB0ylTaf6c/tEtTVED QTu0lBQrcEtJiyT8A0kO6GcIAwAA X-CMS-MailID: 20200915190827eucas1p227a32a8f74b364decb7ebbc096172949 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200915190827eucas1p227a32a8f74b364decb7ebbc096172949 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200915190827eucas1p227a32a8f74b364decb7ebbc096172949 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200915190728.18143-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v11 17/24] examples/l3fwd-graph: 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/l3fwd-graph/main.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/examples/l3fwd-graph/main.c b/examples/l3fwd-graph/main.c index c70270c4d..0f3f4088c 100644 --- a/examples/l3fwd-graph/main.c +++ b/examples/l3fwd-graph/main.c @@ -599,6 +599,7 @@ check_all_ports_link_status(uint32_t port_mask) struct rte_eth_link link; uint16_t portid; int ret; + char link_status_text[RTE_ETH_LINK_MAX_STR_LEN]; printf("\nChecking link status"); fflush(stdout); @@ -623,16 +624,10 @@ 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\n")); - else - printf("Port %d Link Down\n", portid); + rte_eth_link_to_str(link_status_text, + sizeof(link_status_text), &link); + printf("Port %d %s\n", portid, + link_status_text); continue; } /* Clear all_ports_up flag if any link down */ -- 2.17.1