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 17BD1A04C3; Tue, 11 Aug 2020 10:58:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 53B0A1C1E5; Tue, 11 Aug 2020 10:53:42 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 0BAFD1C1DC for ; Tue, 11 Aug 2020 10:53:39 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200811085338euoutp02323e5f98eac6921a0234b04239ca3195~qKr9Di6uA0724507245euoutp02o; Tue, 11 Aug 2020 08:53:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200811085338euoutp02323e5f98eac6921a0234b04239ca3195~qKr9Di6uA0724507245euoutp02o DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1597136018; bh=eiFmzpP/WtyT5kv8HiwRyX/NJBmfHYjorTGhRagslq4=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=snwN3vBO9SKWTuuOT60KS7ET1PKpRQ4pp3mRYJ3xZpw58wrDjnHIdc5292UXVkrHR ly6GDnvUyQ/me4+D/0Hwxuc1ZWsEKfXtLDqVntgXGEAvACeBTgCE6AIQlZxXn7tvlU X/AlRHTOo7xv82z6kheB8OndN7KrOjMT7r4SJMok= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200811085338eucas1p28f7790644ebba32399379a80223a3282~qKr8vP6_P1211012110eucas1p2o; Tue, 11 Aug 2020 08:53:38 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 15.C1.06456.29C523F5; Tue, 11 Aug 2020 09:53:38 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200811085338eucas1p22bc87cd8b124722fc751b15c341e5549~qKr8YyRG-3145931459eucas1p2e; Tue, 11 Aug 2020 08:53:38 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200811085338eusmtrp15ea9d244f2ac6e434007bd763f681997~qKr8X32xM1680216802eusmtrp1L; Tue, 11 Aug 2020 08:53:38 +0000 (GMT) X-AuditID: cbfec7f2-7efff70000001938-51-5f325c9267a4 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 56.6D.06017.19C523F5; Tue, 11 Aug 2020 09:53:38 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200811085336eusmtip11b63d742faa8457ba8c16d1398fc840f~qKr6gw4YV1865118651eusmtip1Y; Tue, 11 Aug 2020 08:53:36 +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:38 +0300 Message-Id: <20200811085246.28735-20-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: H4sIAAAAAAAAA0WSbUxTdxTGd+69vffSWHNXiZ7UBWK3ZZtGGc7Ek7kNMftwsyyLiV+MOliV GzSDii34lixBRhgryLAwja0yFJkKJEXBljedJdMCrYBkHS9hgrjNtylQqJmKMuit2bfn/M7z nHPyz19k9eW8QdxlzlYsZlOGkddy7utPu1fat61OfT90ykCuQAXQ2K0qlkbL/+CpaCKfoYGa JGrznNCQfSSXoRL7JEOeczae/hnN4+hxyMPQ8GW/QI6+PIFC7XcFOtzjBLo784Cl45VTQD0V lzT01NvC0/jMaY5KngWBfmjsAPIVT3JU3twEVGCTaOL8WYGqhuMoNNrBkX+wQaC68E2WLgVe AB3xuYBuFMxq1i+Tn1VWa+SqtvuMXHbqJitfHzwqyMWdFYx84XETI49fCfJySWMNyF1jRaxc ++e//EbtFu1HaUrGrr2KJeGTr7Q7G44vz2pdvH/UfQxyoUhvgxgRpTUYyK/jbKAV9dI5wN5g j6AW04DNrSejnSlAX8EvzKvIvZfdjNo4C3j0yQCrFmFA+9RDYd7FS++iv7Ai4oqVLvDomemP xBdJn+O1v3MjJk56G89PDrHzWid9iNPD+YK6Ih5r669GeMwcr3WORLReisP+n6YjQ1HqELHu 2m1eDXyKbbNhUPUifOBrjA56A/1lxZwa+A7wiLtBUItSwG+dj6KuJGx82D2nRZGV3kNXS4KK k/FXbzc7j1FaiAOPXp/H7Jy0u49FsQ4LC6IvacSrnX1RjPji+QIVy3jC5wH1/MuAv/caSyHe 8f+qSoAaWKLkWDPTFWuiWdm3ymrKtOaY01ft2J15Eeb+qv+lL9QE4b7t7SCJYFygy1qXmKrX mPZaD2S2A4qsMVa34YY/Ra9LMx04qFh2p1pyMhRrOywVOeMS3Q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8jpP4hZmQu8JuKiSp2bfRsdI202y7L7Elz PEWl7Vv1NW8JHFGWX7iwh20/Eiq4J8esmik6cRyh8pj7Nn+HPd6gU6cFbrlSor6dcjypKfDC 9m664luxusxQ2XaodfO069XgAnUCZ6fjV2g2qMMDa26E2yyVx6fxsui2vSsrShN/a0teKigx XcuFkUZR+xerYRF7CAMAAA== X-CMS-MailID: 20200811085338eucas1p22bc87cd8b124722fc751b15c341e5549 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200811085338eucas1p22bc87cd8b124722fc751b15c341e5549 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200811085338eucas1p22bc87cd8b124722fc751b15c341e5549 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200811085246.28735-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v9 19/24] examples/multi_proc*: 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 --- .../client_server_mp/mp_server/init.c | 15 ++++++--------- examples/multi_process/symmetric_mp/main.c | 13 +++++-------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/examples/multi_process/client_server_mp/mp_server/init.c b/examples/multi_process/client_server_mp/mp_server/init.c index c2ec07ac6..bb194fecf 100644 --- a/examples/multi_process/client_server_mp/mp_server/init.c +++ b/examples/multi_process/client_server_mp/mp_server/init.c @@ -185,6 +185,7 @@ check_all_ports_link_status(uint16_t port_num, uint32_t port_mask) uint8_t count, all_ports_up, print_flag = 0; struct rte_eth_link link; int ret; + char link_status_text[ETH_LINK_MAX_STR_LEN]; printf("\nChecking link status"); fflush(stdout); @@ -204,15 +205,11 @@ 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", ports->id[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)ports->id[portid]); + rte_eth_link_to_str(link_status_text, + sizeof(link_status_text), NULL, &link); + printf("Port %d %s\n", + (uint8_t)ports->id[portid], + link_status_text); continue; } /* clear all_ports_up flag if any link down */ diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c index 9a16e198c..d3aec32cb 100644 --- a/examples/multi_process/symmetric_mp/main.c +++ b/examples/multi_process/symmetric_mp/main.c @@ -365,6 +365,7 @@ check_all_ports_link_status(uint16_t port_num, uint32_t port_mask) uint8_t count, all_ports_up, print_flag = 0; struct rte_eth_link link; int ret; + char link_status_text[ETH_LINK_MAX_STR_LEN]; printf("\nChecking link status"); fflush(stdout); @@ -384,14 +385,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", - 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), NULL, &link); + printf("Port %d %s\n", portid, + link_status_text); continue; } /* clear all_ports_up flag if any link down */ -- 2.17.1