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 D9F06A04D9; Tue, 11 Aug 2020 10:59:17 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 248A31C215; Tue, 11 Aug 2020 10:53:48 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 02FB71C211 for ; Tue, 11 Aug 2020 10:53:47 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200811085346euoutp0201936b587dc78b7807c0c345480749bd~qKsEdV02Y0674006740euoutp02W; Tue, 11 Aug 2020 08:53:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200811085346euoutp0201936b587dc78b7807c0c345480749bd~qKsEdV02Y0674006740euoutp02W DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1597136026; bh=hLGhAsT2cVQHkuOVemN2w0DT3uZyUZ6vteJJJYvUoWo=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=ALgJNoMGu9/KYuV2h2U3gOnOUrDkLtKtnNycHQhbBXxzS082bdcjySK9E1ukdwUv2 Xtce7RuXmTPYwH8FSicxHsBeu/eDfovy2owzgqnSB3Vp8aqYEAKRePfIXKYmiQZUHy nBcoQ+agFzuSIvfxOAA50+Keq4ovKifG+BsXNwpU= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200811085346eucas1p131aad1f277cb053b04881dd151bae1b7~qKsEEPjxa1188011880eucas1p1t; Tue, 11 Aug 2020 08:53:46 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id FF.C1.06456.A9C523F5; Tue, 11 Aug 2020 09:53:46 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200811085345eucas1p2c9484c5266788e3748bb86b48b4a1862~qKsDqOOFq1791917919eucas1p2a; Tue, 11 Aug 2020 08:53:45 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200811085345eusmtrp14d66341c5e3c2b9ea40c6a889e010a39~qKsDpYZR91667616676eusmtrp15; Tue, 11 Aug 2020 08:53:45 +0000 (GMT) X-AuditID: cbfec7f2-809ff70000001938-6c-5f325c9a6a21 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 32.7D.06017.99C523F5; Tue, 11 Aug 2020 09:53:45 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200811085343eusmtip16946246105e7b60a9f72fedfe4d58f45~qKsB1mhov1801618016eusmtip1Y; Tue, 11 Aug 2020 08:53:43 +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:42 +0300 Message-Id: <20200811085246.28735-24-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: H4sIAAAAAAAAA0WSbUxTZxTHc+69vfe2WnOtZjxRB7GLEd9QlA9nanQuy3a3mMgH3+Yb1HID RKisV1RwWTpQRloGUl6MxQBKUNZuooItIgo204IVjShBHCpxJCgqr5IAwhzlsuzb///7n3Oe 5zx5eFpXwM7j402HJLPJkKBnNYz7zuj9FY49q6NWeU9osfJeMeDL52U0duY/Y9HWf5zCJ86N WOc5o0L7CwuF2fYBCj0VVhbfdqYx2DvoobDjhp9DR0sah4Pebg5/fVAE2D3eQ+Pp0iHAB8VX VTh6q5bFvvFzDGaPtQLmVDcC+rIGGMy/VgOYYRWw/7cLHJZ1BONgZyOD/vYqDn8ffkjj1XsT gLm+SsDmjI+qLxaKY6XlKrGs7jUl5p19SIt32gs5MaupmBIv99ZQYt/NVlbMrnaCePeljRZd XSNspGaXZn2MlBB/WDKv3BCtiXtq/xmSLs446rPXshbIVltBzRMhgty97WKtoOF1QgUQ5+Ny UMx7IOdbXdNmCEiJp56yAj/VMlK3VeEXgJy1tKkUMwyk7w87HZjLCqHEn1lMBYK5wmWWeMbb qEAwR9hMSno+cgHNCIvIq5a/2IDWCmtJ+p9dlHKpEOK61DA1SD3JXUUvprROCCZtJe+nhhKh kSf1J9y00vAVmXjUAIqeQ3p81ZyiFxB/XhajNPwCJNddxSnmJJD0onfTVRtJ9Zv7XGA5WlhC KmtXKngTcbaPMMrOs8iTd7MDmJ6UdvcpWsFakpmhU6r1pKGpZRoTMvFhpoJFUp5znFEe6AaQ ukIbexJCHP+fVQrghCApWU6MleRwk3QkTDYkysmm2DDjwcQrMPlZ/f/4BmtguGW/FwQe9DO1 SevCo3Qqw2E5JdELhKf1c7VfNvv36bQxhpRUyXwwypyc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ojJEyMUstd57hETvO/jxA5uOmQ7ubbiogwcfzMdq+rvGd28kB0eE9i tBeuDVUUGcpHPcQ7T2tem9QnJoZMqWsTqU6C9baMky7lzukN+9qby/u8Z/84M+/Lwz4aTed/ v648HlrVllu4Yp2uKlmqyUTZ5tbrZ7uCYoedx4JDdXtdz+3qvO1Ycy2vX20KG59k863FWErx sUr5flLDK/8BcjUbzwgDAAA= X-CMS-MailID: 20200811085345eucas1p2c9484c5266788e3748bb86b48b4a1862 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200811085345eucas1p2c9484c5266788e3748bb86b48b4a1862 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200811085345eucas1p2c9484c5266788e3748bb86b48b4a1862 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200811085246.28735-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v9 23/24] examples/server_nod*: 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/server_node_efd/server/init.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/examples/server_node_efd/server/init.c b/examples/server_node_efd/server/init.c index 378a74fa5..daf4c452f 100644 --- a/examples/server_node_efd/server/init.c +++ b/examples/server_node_efd/server/init.c @@ -247,6 +247,7 @@ check_all_ports_link_status(uint16_t port_num, uint32_t port_mask) uint16_t portid; struct rte_eth_link link; int ret; + char link_status_text[ETH_LINK_MAX_STR_LEN]; printf("\nChecking link status"); fflush(stdout); @@ -266,16 +267,10 @@ check_all_ports_link_status(uint16_t port_num, 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", - info->id[portid], - link.link_speed, - (link.link_duplex == ETH_LINK_FULL_DUPLEX) ? - ("full-duplex") : ("half-duplex")); - else - printf("Port %d Link Down\n", - info->id[portid]); + rte_eth_link_to_str(link_status_text, + sizeof(link_status_text), NULL, &link); + printf("Port %d %s\n", info->id[portid], + link_status_text); continue; } /* clear all_ports_up flag if any link down */ -- 2.17.1