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 B2313A04B5; Thu, 10 Sep 2020 21:36:43 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 045FC1C1A3; Thu, 10 Sep 2020 21:35:01 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 008F61C1AE for ; Thu, 10 Sep 2020 21:34:59 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200910193459euoutp012ab6f6845c3481dee24b04db8c32700e~zgyfYSaLB0119101191euoutp01d; Thu, 10 Sep 2020 19:34:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200910193459euoutp012ab6f6845c3481dee24b04db8c32700e~zgyfYSaLB0119101191euoutp01d DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1599766499; bh=zmZz7YLNZwsZfzlBrodbxoobMXy1KSIqos1a6ezRVA4=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=bcEm9JEvE9wzrBDSnJYew4fQ2JB1PZzzSWNnCvOPUOnXYfg+kUzHi9kF7UnJMfPuL N/f6h5VKDl3RG9xsz26nx2l0qW3tPQaqiTnW5CjP7xg0spB1zzIe2TLq1TI0CuAuyi 3Ykz2UWS5m09i7fAoP7G371ropIgOBkId4ViKAoo= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200910193459eucas1p1e4746377597b9a1c31e14480f021f234~zgyfD3guj0307203072eucas1p10; Thu, 10 Sep 2020 19:34:59 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 16.42.06318.3EF7A5F5; Thu, 10 Sep 2020 20:34:59 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200910193458eucas1p1ae0f16b4519b299d2edf3378458e5113~zgyegAtt22934729347eucas1p1S; Thu, 10 Sep 2020 19:34:58 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200910193458eusmtrp256ce58a7ec75128d54c114cb12c232e7~zgyee-nJp1027210272eusmtrp23; Thu, 10 Sep 2020 19:34:58 +0000 (GMT) X-AuditID: cbfec7f5-371ff700000018ae-4c-5f5a7fe3b1ab Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 85.19.06314.2EF7A5F5; Thu, 10 Sep 2020 20:34:58 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200910193456eusmtip229b29384cceb758112cd0799eb765a0f~zgycuSV571532615326eusmtip2X; Thu, 10 Sep 2020 19:34:56 +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: Thu, 10 Sep 2020 22:33:49 +0300 Message-Id: <20200910193400.15326-17-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200910193400.15326-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSXUwTeRTFc2emM0Ol7lhRbpRorNG4m6y4wWRvjNFdMXGMPuyD4YGobFcm YJYCaUVlQ5QUQdMiCOI38iEalGoQqRQIGORBYAtFiKgkgFWrqCggSlQsy1IG49s5v3Pu/96H v8jqT/KLxL2J+xRzojHBwGu5mntfPD8/Pxwds+ZhdyhVthcBPRsoY8lb0M+TffQIQ48rNlKD q1BD+U/SGcrJf8+Q66qNp7deK0fDYy6G+hrdAp3vtgo01jwo0PHOC0CD/jcsnSv5ANRZdFtD X+7W8zTiv8RRzkQPUK6zFagl+z1HBXW1QFk2iUavlQtU1reExrytHLl7qwW6Pt7F0u32SaC8 lkqgjqwpzW/L5ImSKxq5rOE1I58s7WLle72nBTm7rYiRq4ZrGXnkTg8v5zgrQP73mZ2VHb7P /B/aaO36WCVh737FHL7hT218Zl4lJBdqD1qv2Zl0sIs2CBJRWovXPQ7WBlpRL10FfJHeKqjm I2DfqE+jmg+Al9++4L+N2MYdoAblgP1NVbNmHPDsxd6ZFi+tQvexIiYQhEhVPLr8j5hAMF/a gqemXs1oTlqBvgfH2YDWSesw0zsB6oql6LjZNM1FMWiaP+3bFcB6aQk+Kv448yZK90V01V3h 1P5mzPQ91Kh6Pr5pcQqqDsOpuuLZgaOAeTXVgmpOAGZceDfb2ojOIY8Q2MZKP2JlfbiKf8eC gnYmgFGai4/fzQtgdlrm15xhVazDY1l6tW3AprbuWYw4+TVYlTJahyX1+kbALEfSCVh6/vum EoAKCFVSLKY4xRKRqBxYbTGaLCmJcav3JJluwfRXdf/XMl4Ld/x/NYMkgiFY17QuOkavMe63 pJqaAUXWEKLb1OHerdfFGlP/UcxJMeaUBMXSDItFzh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MZQGR2l1PMxPB/H6/73YZSDSxI6dHh08OvPRPeohLvubut3 GNMTSdcYj36CE9V7Xyylk1NDh8/EhTa+lnxsjgjrztD4OVmynb2Pk9AQ3LfnUKjVU3t5smPZ qpXr1pzAslKvdoxbvVRr93TvK6i59nBk8wzrNx4z1u21+0OyqtXjbM7Bpdke6OXsgZFd5dBW uFLc4yYnBJVS4YXrBOVfez26tggDAAA= X-CMS-MailID: 20200910193458eucas1p1ae0f16b4519b299d2edf3378458e5113 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200910193458eucas1p1ae0f16b4519b299d2edf3378458e5113 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200910193458eucas1p1ae0f16b4519b299d2edf3378458e5113 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200910193400.15326-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v10 16/24] examples/l2fwd: 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/main.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c index e04c601b5..28bede684 100644 --- a/examples/l2fwd/main.c +++ b/examples/l2fwd/main.c @@ -571,6 +571,7 @@ check_all_ports_link_status(uint32_t port_mask) uint8_t count, all_ports_up, print_flag = 0; struct rte_eth_link link; int ret; + char link_status_text[RTE_ETH_LINK_MAX_STR_LEN]; printf("\nChecking link status"); fflush(stdout); @@ -594,14 +595,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")); - 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