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 A2088A04B5; Thu, 10 Sep 2020 21:36:51 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A2CAB1C1A4; Thu, 10 Sep 2020 21:35:04 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 34A2F1C1A4 for ; Thu, 10 Sep 2020 21:35:03 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200910193502euoutp0292d60b833d5886ef3b74603a5ad88142~zgyiWzcet0501005010euoutp02X; Thu, 10 Sep 2020 19:35:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200910193502euoutp0292d60b833d5886ef3b74603a5ad88142~zgyiWzcet0501005010euoutp02X DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1599766503; bh=hWLcmMyVuKFoVFPzJm+8zZ/bn73NfLWC3PPR6DROxJc=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=miNFqC/phhmO7JBz9ypS4pDC2IXbAqnyUn32sV46MwuiWdp7CNODc59iYAccC4eQd nGT3PHtT3+xjxMqLbdCo3JbZDSxcEQbTv5KkgML8c45wnR+le0y4/F7ehtWomacz2d AmVprarWan8kU0fQRz1wTlxmm+zSfuUafMowkKpI= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200910193502eucas1p14fd0c6817659a7e65261a4e4421596c7~zgyhe6OjM2935329353eucas1p1T; Thu, 10 Sep 2020 19:35:02 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 38.42.06318.5EF7A5F5; Thu, 10 Sep 2020 20:35:01 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200910193501eucas1p118effa649709ad3c377df1922e7786a1~zgyhHuq3P2933229332eucas1p1Q; Thu, 10 Sep 2020 19:35:01 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200910193501eusmtrp14630052d247cace462aa14fccc42587b~zgyhG2XQo3165331653eusmtrp19; Thu, 10 Sep 2020 19:35:01 +0000 (GMT) X-AuditID: cbfec7f5-371ff700000018ae-50-5f5a7fe5d817 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 9A.9A.06017.5EF7A5F5; Thu, 10 Sep 2020 20:35:01 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200910193459eusmtip2dc0052b179dcb2633f6cb9616a5aaf01~zgyfUrelC1654016540eusmtip2G; Thu, 10 Sep 2020 19:34:59 +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:50 +0300 Message-Id: <20200910193400.15326-18-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: H4sIAAAAAAAAA0VSa0wTaRTNnZnODNXiWDR88YFrjc9EYYOJN/jAXTfZ+ecaE6MYrVUnSKTF tIKvRBFNJRVZCj4WNIhUBakRH4UWBIKgPLYgj8ACEdZC3CWKD0AwgvXBOGz237nnnO87JzeX p7V2dhYfYzoomU2GWB2rZoprxpqW/3MiSh9WMrYaCxuyAfv+dtDoO9/D4tnB0xR2FkRimfuK CtOfJ1KYmj5EoTvfxuJrXxKDb4fdFHaXeznMak3icLiqn8NzTZcB+/2vaMzMeQ/YlF2kwrFH pSy+8+cymDreDvi7qw6wNmWIwfMlHkCrTcDBW3kcOrpDcNhXx6C36wGHt0dbaCxq+Axory0E bLR+Va2fL47n3FCJjrKXlJhxrYUWa7oucmJKfTYl3nvrocR3Fe2smOoqAPHPvrO06Hzxkf1N HaVes1eKjUmQzKHrdqn35T2zsQc61YefZxRRiZDF24DnibCStF7T20DNa4V8IC7/ENggYGIY AXL9cZQivAeS6e1RyYL8IKOhhlaEPCCOC6mgDKNAkm6NU7KLFZYQb3I2JQszhHsscfs7vgtB wkbivHPh+1eMsJBcqihlZKwRIsjV/F5KiZhHnHcrablfwATf271DqRRCOq6OTFqaeZLWHajg X8gz+wCr4CDyqtbFKXgO8WakMHIHIpwBYi9+wClDGpBTl99MuiKJa+ApJ4fRwlJSWBqq0D8R 68lWVtlRIOl8M12m6QmYXnyJVmgNSbZqFbeOVNa3TtKEfP40VaFF4vA1Ty60HEhH85Y0mJf1 f1QOQAEES/EWY7RkCTdJh1ZYDEZLvCl6xZ44432YOFTvl9pRD1T4d1eBwINuqqYyIkqvVRkS LEeMVUB4WjdD83Ojd6dWs9dw5KhkjtOb42MlSxXM5hldsCY89+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GgO/p2BdR1KXu2sO/uz JaLledFxd+68xL6Frajn+lcWPDWOmmrZKK2zKbth58TLaf/0gTNE3/q2xfzxrPjZL+oJyXR0 6bPT5tdfsorT1kSlhmVeGOmSVsWayqia3hbM9UgnpOYdLD/Qsb7YVb3K4XtT36sqvfJNmFLd m12MlCsIIVGj3IwbBc1fIBCI+wcDAAA= X-CMS-MailID: 20200910193501eucas1p118effa649709ad3c377df1922e7786a1 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200910193501eucas1p118effa649709ad3c377df1922e7786a1 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200910193501eucas1p118effa649709ad3c377df1922e7786a1 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200910193400.15326-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v10 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..0f3f4088c 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[RTE_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), &link); + printf("Port %d %s\n", portid, + link_status_text); continue; } /* Clear all_ports_up flag if any link down */ -- 2.17.1