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 CC7F8A04C7; Tue, 15 Sep 2020 21:10:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CF4661C0D9; Tue, 15 Sep 2020 21:08:32 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 855A21C114 for ; Tue, 15 Sep 2020 21:08:31 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200915190831euoutp017ec18fe1b4ae8f4d825d9697b083f080~1CpzVQ3wL0530105301euoutp01c; Tue, 15 Sep 2020 19:08:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200915190831euoutp017ec18fe1b4ae8f4d825d9697b083f080~1CpzVQ3wL0530105301euoutp01c DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1600196911; bh=kjiDZOgx4RVk31QgFA7JiC93FXZ7jB4R8xwyUSv77Cc=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=fmgJszBBpbULEQGzimK7N6yN4d79mP2Zbwqpe/8ExvQGXb2qxdfxLRWXI1oJX4aqe ZIIjsantQJzughSPALje8y1ZZs30kZLhrtPQMO7zbmHbAh4/pdnrILLLUA9tcga+xR EtwxllEVbuq3AJtf2sVh6u7y81R9UDf+Ue9E9ax0= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200915190831eucas1p2cf119cd441308f15775e1689722398a4~1CpzJgzX-2576625766eucas1p2z; Tue, 15 Sep 2020 19:08:31 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 70.EF.05997.E21116F5; Tue, 15 Sep 2020 20:08:30 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200915190830eucas1p1104f3abf3de5ca32e43f8efc0e53a524~1CpyvqE1T0047600476eucas1p1d; Tue, 15 Sep 2020 19:08:30 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200915190830eusmtrp1bf34d66cded3524c22fd07468cf5cc02~1Cpyu05c83148631486eusmtrp1h; Tue, 15 Sep 2020 19:08:30 +0000 (GMT) X-AuditID: cbfec7f4-677ff7000000176d-7c-5f61112eb7e4 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id BE.EB.06017.E21116F5; Tue, 15 Sep 2020 20:08:30 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200915190828eusmtip2b17a41cc3f77cb0cd8e0dd9f2023ccdf~1Cpw_k84J1712017120eusmtip2M; Tue, 15 Sep 2020 19:08: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, 15 Sep 2020 22:07:13 +0300 Message-Id: <20200915190728.18143-19-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: H4sIAAAAAAAAA0WSa0wUZxSGPTOzM8PGbcfFlKNVjJs00VbBVk1Oqqml9cf8qtSYJmoUR52C gV3pLqi0fwgiEkDutimYBUUDLkRUlosEDIvRRRak0CyKRSHiJVoRwfUCLFKWwfTfe573Pd/7 5csnssaT/GLxgCVBtVqUOBOv5+pujHetDlugRK0517mRqjvsQA/ul7E0WHiPp8yXqQzdcWyi pvpTOsofSGYoO3+UofqKDJ6eD6Zw9GKsnqH+Zo9ART0pAo21PhHoRFcx0BP/M5b+LH0F1GWv 1dG4q5GnEf8ZjrInvEA5zjYgd9YoR4VXGoDSMiR6eb5coLL+UBobbOPI01cjUNXrbpZqO6aA 8tzVQJ1p07pvl8sTped0clnTU0YuON3Nyjf6fhfkrJt2Rr70ooGRR656eTnb6QC5/UEmK1c+ fMdH6nfoN+5X4w4cUq3h3+zRx7yxX+TiO/RHUl0PhWSoFTMgSERpHaa/aYMM0ItGqQIwp9fN Bwyj5AO8cDlWM14BjhYN6j5s5DgGWM0oB/QPlQva8Bqw33uBCaR4aQV60u1MwFgoXeKx3n97 1giWtuDJRy4hoDnpMyxw5s72GaSvsXKojNEqlmHlxRY2oINmeM8Vr6DdKRRvl/hmD0WpTcSR pkzQFjbjcEo+q+lgfOZ2Cppegp6CLE5bOA6YV1cjaEMu4NHi4bnUJnT+e2tGiyIrrcTqxnAN R+D79hI2gFH6CO8MLwhgdkbm1/0xhw2YnmbU0iZsudkzhxGnJudrWMbrJZNzD9QM2Dt+nMuF ZUX/d5UCOCBETbSZo1XbVxb1cJhNMdsSLdFh+w6aL8PMZ/W8d/saoNG/txUkEUzzDaX/7Iky 6pRDtiRzK6DImhYavu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qI0GjDtGHLQD1LeZyr36Xi4kWztF+SDkim/30E6x1gQaK2eV9/+aJ9u3+XRTB9YqAuQxGo exeuvG8pXtMfPbfsyJag744Zfb41L7ZvjNrl/rzxhFj35mBe847+9BRdSJotaFb2k3iCsdgS 16abGOf61ixpmwG6/Bvx3XWK27PPNoYU5O9XbejsXHBh5XfbYE+uXlnlVecu7v+p7/Cq3fxB TckJoiaINMniX+VGxtoHAwAA X-CMS-MailID: 20200915190830eucas1p1104f3abf3de5ca32e43f8efc0e53a524 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200915190830eucas1p1104f3abf3de5ca32e43f8efc0e53a524 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200915190830eucas1p1104f3abf3de5ca32e43f8efc0e53a524 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200915190728.18143-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v11 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 | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index 9db94ce04..bcd737994 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[RTE_ETH_LINK_MAX_STR_LEN]; printf("\nChecking link status"); fflush(stdout); @@ -1964,15 +1965,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", (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, + 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