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 2066CA04C3; Tue, 11 Aug 2020 10:57:46 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EA47C1C1D5; Tue, 11 Aug 2020 10:53:36 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 5CB4B1C1D0 for ; Tue, 11 Aug 2020 10:53:35 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200811085335euoutp0142067bf8074604de6970f6cb671f0ea4~qKr5pThdv0826508265euoutp017; Tue, 11 Aug 2020 08:53:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200811085335euoutp0142067bf8074604de6970f6cb671f0ea4~qKr5pThdv0826508265euoutp017 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1597136015; bh=8B29X3PKtMuTPHh3rG9R91AskagKWcSpF4U/3CmUWwQ=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=Hzz9TikMPZ6PLDE/RKjevDbFD18/Lq0bMxJAfMGpoiJgghsaaMazWqF+KFi6+Pnu7 W5Y1MCxECvnOkdtSPCN+kg5wlNQsnNmXjFMTFuImcyqASoC28KZxppi2RgdhLhQbam UaKBgPV8zmQ3Pwx+FOVHBe0RWz7AClhax896ju8A= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200811085334eucas1p131f0796e9b71f9fe90b21320f191e83a~qKr5bjO7v1188011880eucas1p1Y; Tue, 11 Aug 2020 08:53:34 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 5E.B1.06456.E8C523F5; Tue, 11 Aug 2020 09:53:34 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200811085334eucas1p261a004aefcdd3819a9c5e029ddc9808d~qKr4xSWmM1587515875eucas1p2d; Tue, 11 Aug 2020 08:53:34 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200811085334eusmtrp29cc379b865d4218176bee3ad5dc77389~qKr4ubNfr2338923389eusmtrp2M; Tue, 11 Aug 2020 08:53:34 +0000 (GMT) X-AuditID: cbfec7f2-7efff70000001938-45-5f325c8e2dd6 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 3E.1B.06314.E8C523F5; Tue, 11 Aug 2020 09:53:34 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200811085332eusmtip128df9b1f326910b0bfe19fb17dac9c68~qKr25CoY11849018490eusmtip18; Tue, 11 Aug 2020 08:53:32 +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:36 +0300 Message-Id: <20200811085246.28735-18-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: H4sIAAAAAAAAA0WSbUxTdxTGc+69vffS2e1aTTjTRWcTk00jwvTDCXtxb1mu2ZaMD2q26LDO GzSWii3gIGYhbGOmMEBEySirIBoRtiADWmpksmYBtAUGRBEVachcAwhCgSmvjvbW7Nt5fud5 zjn55y+y+jP8GvGwOVWxmI0mA6/lnK2znVvy976RGJs7F0u1PgfQ0INKlvzFAzzlTnzH0J3q HXTNVaahosEshvKLJhlyVdl4euTP5mg86GLofrNXoNKebIGCnoBAP3bZgQILIyz9VD4F1OVo 1NDsH1d5erxwnqP8uVtABQ3tQG15kxwVu5uAcmwSTVy+JFDl/XUU9Ldz5O2vF+iXmW6WGn2L QKfaaoE6cp5p3t0gz5Vf1MiV14YZ+XRFNyu39p8V5LwbDkauG29i5Me/3+Ll/IZqkG8O5bJy zd9P+c+0X2jfOqiYDqcrlq3v7NceKrAnpNzVft01eQGywC7aIEpEaTu2PvBobKAV9VIV4MI/ FZwqpgGf9vsYVUwBDvlHhOeRsTMFoDYuAQ603BZUMQPoXhpkQy5eeg29Jx3h+GqpjkfXQh8T aqySPsGZnzvDozhpI/7pXgoHdFI8jhXksOqK9VhzpSVcRy3zGrs6VC+tw75z0+GhKP0lYu/l OkYNfIhV4/WcWq/CkbaGyK2v4DP3uUjgB8BTznpBFYWA39rHIq4d2DAaOkkUWel1rL26VcXv YcAxwoQwSi/inbGVIcwul0XOElbFOjyZo1fdBmy50RPBiIvzK1QsY6/bGXngZsBHPhtXCOtL /99VDlAN0UqaNTlJscaZleMxVmOyNc2cFPPV0eTfYPmzepfagk0w03PAA5IIhhW6lDfjEvUa Y7o1I9kDKLKG1br3O7xf6nUHjRmZiuVooiXNpFg9sF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ampBalFMH1MHJxSDYwCwjkXCzmLSk7dz++9OMfxh3If7zrVIvX9 e7/kZjkLGDg5LX8ob8j9+KgKt5/i9PeJbl4p54xXP1+YmRZSl63lY/RM2upIZLqOr2rF0521 4TqLYtPlMjmkeY7enCy86HFV5o9LO/aLqu2akClc4GT0dNLXja6rJr1arBP5Xs576+biI+tn /VdiKc5INNRiLipOBAA81NqeCAMAAA== X-CMS-MailID: 20200811085334eucas1p261a004aefcdd3819a9c5e029ddc9808d X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200811085334eucas1p261a004aefcdd3819a9c5e029ddc9808d X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200811085334eucas1p261a004aefcdd3819a9c5e029ddc9808d References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200811085246.28735-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v9 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..ccf55859f 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[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), NULL, &link); + printf("Port %d %s\n", portid, + link_status_text); continue; } /* Clear all_ports_up flag if any link down */ -- 2.17.1