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 83679A04C3; Tue, 11 Aug 2020 10:57:06 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3BC4D1C1B9; Tue, 11 Aug 2020 10:53:32 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 5E96A1C1B3 for ; Tue, 11 Aug 2020 10:53:31 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200811085331euoutp0149649b4aa6e1671ae2231d93899bced5~qKr17To7z0904909049euoutp01L; Tue, 11 Aug 2020 08:53:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200811085331euoutp0149649b4aa6e1671ae2231d93899bced5~qKr17To7z0904909049euoutp01L DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1597136011; bh=SucFH4l3rSaiHqLe5lm4cnqm4i9He+Oklu5r03FX5EY=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=odo2bCqXmCewyF0dgT/0d11WlmtT2kdhXv8Czl3h4MsNGnKDXuh2U2PWqKM8giMtv NQRG/GdJYob6XbRK6zbnZOW3m7lmKHIRlPJ4OXSvzOaahrWI1RLIKUMHsdd4sJmc98 s/tEqZCY6h0+IV9Kg+fD5PIhdSlEUKwMGBhy0twY= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200811085330eucas1p1cd52bc67f04be0a784b60a1004df6dcb~qKr1dkJPn1188011880eucas1p1U; Tue, 11 Aug 2020 08:53:30 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id CD.2C.05997.A8C523F5; Tue, 11 Aug 2020 09:53:30 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200811085330eucas1p15e9a44970a46fa161477c76d90bd44c6~qKr1IXGoX1584615846eucas1p1I; Tue, 11 Aug 2020 08:53:30 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200811085330eusmtrp257d61ccb80fcc5f2ed517a809bfa5d6a~qKr1HaX-T2338923389eusmtrp2F; Tue, 11 Aug 2020 08:53:30 +0000 (GMT) X-AuditID: cbfec7f4-65dff7000000176d-e4-5f325c8ae84b Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id E9.1B.06314.A8C523F5; Tue, 11 Aug 2020 09:53:30 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200811085328eusmtip1230748e5bb076d5b034a70fb9a4a014e~qKrzTlF3u1748717487eusmtip1T; Tue, 11 Aug 2020 08:53:28 +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:34 +0300 Message-Id: <20200811085246.28735-16-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: H4sIAAAAAAAAA0WSfUxTZxTG9957e++l2nlXJJ4ggdhI0EVFUJMTXUANiTeLiYtbZmKGrJMb bIDCesGvvxgzDAuiQoMbkJaBRj6MHRYoMnBYE74KGEiYlIA0+IGIgHwlU2FKuRj/+53nnOc8 J29entYWsIG8wZgmmYz6JB2rZupb3/RsN/8QGbdzyhGK9i4rwdHH5TR6LcMs5ry+QOFAVTQ2 OUtUmD+SQWFe/gyFzgozi6+8mQxOzTopHGp2c1jUl8nhrGuMw0sPiwmOLb6k8Y/SOYIPrXUq fHO/kcXpxTIG8972E7xc206wLXeGQcvdBoJZZgFfV97ksHwoGGe97Qy6PQ4Oby300ljXtUTw apudYHfWe9X+TeLb0hsqsbxpnBIL/uylxVZPISfmdlgpsWaqgRKn7/WzYl5tFRE7R3Nosfrp f+w36uPqr+KlJMNpyRQe9aP6VGGmlU79V332+WQNm0FcvJn48SDshvJX7bSZqHmtUEGgMHea U4p5AiXDWUQp5gh0DixRHy227tuMj7XCTQLFlYeUoQUCzot9rK/BClvAnW2lfI31Qg0LzsVH K25/4TA0Z9uWA3meEULBNmXwyRphLzTl3KaVgBCo/qtlhf2W9eriEVoJC4ZHtvmVnSB08dA4 1ssqhhiwND9YZX942VbLKRwE7+/aVg2/Ebha7+CU4gqBX4snV6eioXaih/NdRAtbwd4Y7kMQ DkDTxD4FP4eByS98w/Qy5tdfoxVZA9lZWmWHDlo6+lZlgKV3axVZhIL5Z6zyPM0EvGUt1BUS UvQpqpSQKrJBSpeTEyQ50iid2SHrk+V0Y8KOkynJd8jyV3X/3zbfQBoXf3IRgSe6tZrUfRFx WpX+tHwu2UWAp3XrNQe73Se0mnj9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CA4KAXS7PopuiFXS82iAcE4RkQf9/DqM8fFMRhBZMl73LuNbe780PzLBUZO9v +UGSQ8bmFGt4ZW2P7HlZyW7nz4po1avS+Tzvc2/Gnn3aL1l/KjzOHNF4fvWRHY5RHdsyTp2O L2laG7HP5wVvbCsc7m7zl1yf9yIj5/Yc9S/4cCQtb/1g8ZdbjjdBSy6HpUVFbEs50/MjKGe1 Vy9LiAlqbh2uF9V/Acjk/sAIAwAA X-CMS-MailID: 20200811085330eucas1p15e9a44970a46fa161477c76d90bd44c6 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200811085330eucas1p15e9a44970a46fa161477c76d90bd44c6 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200811085330eucas1p15e9a44970a46fa161477c76d90bd44c6 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200811085246.28735-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v9 15/24] examples/l2fwd-event: 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/l2fwd-event/main.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/examples/l2fwd-event/main.c b/examples/l2fwd-event/main.c index 4fe500333..f43b61daf 100644 --- a/examples/l2fwd-event/main.c +++ b/examples/l2fwd-event/main.c @@ -366,6 +366,7 @@ check_all_ports_link_status(struct l2fwd_resources *rsrc, uint8_t count, all_ports_up, print_flag = 0; struct rte_eth_link link; int ret; + char link_status_text[ETH_LINK_MAX_STR_LEN]; printf("\nChecking link status..."); fflush(stdout); @@ -389,14 +390,10 @@ check_all_ports_link_status(struct l2fwd_resources *rsrc, } /* print link status if flag set */ if (print_flag == 1) { - if (link.link_status) - printf( - "Port%d Link Up. Speed %u Mbps - %s\n", - port_id, link.link_speed, - (link.link_duplex == ETH_LINK_FULL_DUPLEX) ? - ("full-duplex") : ("half-duplex")); - else - printf("Port %d Link Down\n", port_id); + rte_eth_link_to_str(link_status_text, + sizeof(link_status_text), NULL, &link); + printf("Port %d %s\n", port_id, + link_status_text); continue; } /* clear all_ports_up flag if any link down */ -- 2.17.1