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 111C7A0528; Sat, 11 Jul 2020 12:47:16 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 21A0A1D99B; Sat, 11 Jul 2020 12:45:19 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 1AC5B1DACF for ; Sat, 11 Jul 2020 12:45:18 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200711104517euoutp02c22e1c1b07928325f4c90845285c8c49~grNlsUtSm1781617816euoutp02b; Sat, 11 Jul 2020 10:45:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200711104517euoutp02c22e1c1b07928325f4c90845285c8c49~grNlsUtSm1781617816euoutp02b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594464317; bh=/4ZIDTeAEPqhZ60Bn9trDwy5rli/mlDUelJbUnJtmzU=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=rFVsey+c1rmGS1soTx1MgEVxsOl9f8sOhSEEsmCaOOy1z9nx4bLj8UNfwgQOO8uhA a0Rk2aXM9yaGZKMMRKSMg8UsrgnbcP1GZxfAKYjQZKGmn4lN25QCwBJ9zfKB5LYqiN abiwxtwpvZ3ayVmaWyDjm3iOpGlBM+5PcW+GpFd4= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200711104516eucas1p17d022483e1dabdd7097311c330ee8df0~grNkrCdhr1599415994eucas1p1j; Sat, 11 Jul 2020 10:45:16 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id B8.87.06318.C38990F5; Sat, 11 Jul 2020 11:45:16 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200711104516eucas1p2265716f503d39b240109e4957b5ca8bd~grNj9z9-y2341523415eucas1p2N; Sat, 11 Jul 2020 10:45:16 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200711104516eusmtrp172293f9d4b0ef13b939063d5b373b1b2~grNj8-Ei-2954729547eusmtrp1A; Sat, 11 Jul 2020 10:45:16 +0000 (GMT) X-AuditID: cbfec7f5-371ff700000018ae-6e-5f09983cbdc2 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id D0.96.06017.B38990F5; Sat, 11 Jul 2020 11:45:15 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200711104514eusmtip15cfa882940c9001127873694df6570a7~grNiNViN31304313043eusmtip1o; Sat, 11 Jul 2020 10:45:14 +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: Sat, 11 Jul 2020 13:44:05 +0300 Message-Id: <20200711104414.15422-19-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200711104414.15422-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSa0wUZxSGc2ZmZ4aNa6aDiadapW7TRE28X3ogxlvaOrX9YYyXRGxxkQka AckuqNRUCVFCkaIFQivYlbIx3DSAgCABxA264CIsayl4W8mGxCIq96p00bIMxn/Ped/znnPy 5RNZOZOfIx6MiVPNMaYoI6/nrt1+075k3e8BYctvNC2i0lYrkNdjY6kn6zFPZwZPMdRdvIHq qi/oKONJIkPpGUMMVRem8vS8J4mjl8PVDD2qdwqU404SaNj+VKBf2nOBnvqesXQ+bwSo3Vql ozc3a3ka8OVzlD7eCXS2shnIkTbEUdb1GqDkVIkGiwoEsj2aT8M9zRw571cIdHmsg6Wq1gmg Xx2lQHeT3+k2LlDG8y7pFFtdH6Nk/tnBKrfvZwtKWouVUcpf1jDKQEMnr6RXFoNyx3uGVUp6 X/Pb9Hv06yLUqINHVPOy9fv0B8bLr0Bsjv5YmqeeSYSfxVQIEFFajVV/eNhU0IuyVAh4r/Uh aMUoYP9fhTqtGAH05juZ95Fe9x1BMwoA+6wjnFaMAWYXPwF/Fy8tRGeKlfEbs6RyHqt9XVPx QOk7bBvzJ0SRkz7He65wv2yQQrBq8IJO2xCEJWWNrJ8DJvWJAdcUy9J87Lo4OjUTJZeI2f8W CVrgS7R3PgCNA/GZo3Ja/wSdmWmcxsfx1dUuQQunAHryT083bcDK/jbBfxArLcLS2mV+RGkT +twhGs7E7hcf+ZvZScy49huryQZMSZa1GUZsbHFPy4gT/83QZAXrSx5Ov2494LmyFOYcBOV8 WJUHUAyz1XhLdKRqWRWjHl1qMUVb4mMil+4/HH0VJr+q861jrAYafOF2kEQwzjDkmcQwWWc6 YkmItgOKrHGWYfNd5w+yIcKU8KNqPhxm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8UE9QHuHq41VcosEqJotimmj530ewQWEZ6OxIWUqIduPKCt16XP/j p03a8JvZP7/U8zoxr2W7fDPJ4dWbeOeVDCtjfIKyu2Y1pS2rSA7f3F7t0r03rupfVDNoF53N ayYqvLHTXGr6Q2bamfgZsft2ffmYrCuVI8I//UjuK+1bVyR5fUQcn2DRlH3w7Huxybdmuq5z xdT0hWpKMhr4maRFMvwFMp+vtQgDAAA= X-CMS-MailID: 20200711104516eucas1p2265716f503d39b240109e4957b5ca8bd X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200711104516eucas1p2265716f503d39b240109e4957b5ca8bd X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200711104516eucas1p2265716f503d39b240109e4957b5ca8bd References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200711104414.15422-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v8 18/24] examples/l3fwd-power: 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-power/main.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index 9db94ce04..f5bf0a92d 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -1945,6 +1945,7 @@ check_all_ports_link_status(uint32_t port_mask) uint16_t portid; struct rte_eth_link link; int ret; + char link_status_text[60]; printf("\nChecking link status"); fflush(stdout); @@ -1964,15 +1965,9 @@ 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", (uint8_t)portid, - (unsigned)link.link_speed, - (link.link_duplex == ETH_LINK_FULL_DUPLEX) ? - ("full-duplex") : ("half-duplex")); - else - printf("Port %d Link Down\n", - (uint8_t)portid); + rte_eth_link_to_str(link_status_text, 60, NULL, + &link); + printf("Port %d %s", portid, link_status_text); continue; } /* clear all_ports_up flag if any link down */ -- 2.17.1