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 05840A04B5; Thu, 10 Sep 2020 21:37:11 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 738EA1C1BD; Thu, 10 Sep 2020 21:35:12 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id AF71A1C1BB for ; Thu, 10 Sep 2020 21:35:09 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200910193509euoutp0194ae581a226240dc36b2bcfae2e5dbfe~zgyoaE6L-0119101191euoutp01e; Thu, 10 Sep 2020 19:35:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200910193509euoutp0194ae581a226240dc36b2bcfae2e5dbfe~zgyoaE6L-0119101191euoutp01e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1599766509; bh=6p7H3O/p30P7+DqRWD5odx/9ARdFqIE8TJnlYcrXyzc=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=XHAQ77jXhvpQIEUaUcw5jiRaq3h0CyxLg6LXV/XbCQPSMpFUJi9jDuGK4QB7MdMFb jFQs1JkjHCDgpmqABF930HLobDS0z19MMCWQr64CE+jjxn1Msk5j+nRcZG3cPpFABA VmxnTnh2QDcAsGO/H2s5gb9pKy4h5aTfKwO/A7IA= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200910193509eucas1p2661e70d6c4428cc701ccfc721163af87~zgyoA-sZd1798017980eucas1p2R; Thu, 10 Sep 2020 19:35:09 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id D4.E5.05997.CEF7A5F5; Thu, 10 Sep 2020 20:35:08 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200910193508eucas1p154962900717e9e5a57a6dc6643f80b3d~zgyndFCLp0325103251eucas1p16; Thu, 10 Sep 2020 19:35:08 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200910193508eusmtrp1fea6ba7b4eb8f0769c8382256ad16f80~zgyncQ6oJ3165331653eusmtrp1C; Thu, 10 Sep 2020 19:35:08 +0000 (GMT) X-AuditID: cbfec7f4-677ff7000000176d-cb-5f5a7fec076c Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 0E.9A.06017.CEF7A5F5; Thu, 10 Sep 2020 20:35:08 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200910193506eusmtip24ded06f3b707cfa19062914095e37552~zgyltUzLN1532615326eusmtip2Z; Thu, 10 Sep 2020 19:35:06 +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:52 +0300 Message-Id: <20200910193400.15326-20-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: H4sIAAAAAAAAA0WSbUhTYRTHee69u/c6unWbvTzYG42kksrKoINGWgTdbxV9CcV05UUlNdnN siBaGmpzaU7JrFiWlU4LM6cz01hCvrSlzJCyLKdFpmWp015svTiv0bfz//3/55yHw8OSKiPt x8YnHRG1SZoENa2kapt/dKz9dCo8av2ZxyFQ6TAh6H9TQoKr4DUN2SNnCHhRHgoN1isKMPbq CMgxjhJgLdPT8MmVRsHnMSsBPY12Bi51pjEw1jTAwLmOywgGPEMkFBW7EXSYahTw41E9DV88 1ynImexCkGtpRdBiGKWg4H4dggw9DyPmUgZKepbCmKuVAnt3NQO3J5wk1Dh+IchrqUTwNOOP Imy5MFl8UyGUNAwSQv41Jyk0d19gBEObiRCqPtcRwpeHXbSQYylHwpP+bFKoePed3q0MV26J ERPij4rawK3Ryrhs3YJk64LU9NwCSofOqvSIZTG/Cec59+mRklXxZQjf+X6NkcU4wm/adaQs 3AhPVj2h9MhnusNt8FCyUYqwoX1CIYsJhAttGYQ3RfOrsD3LRHiNeXwVja2e59OGL78LZ1na GG9N8f64xzpMeR/C8cH4YgUjb1iGK+7aSC/2mcJ9PZFerOKX4udXx6dHYt7B4g7nT4Wc34Gd ZuNM7YuHWiwzcxZje76BkhsyEc6rrWZkcR7h9MvDM6lQbPnYzni3kfxqXFkfKONtuLf1IiEf aTZ+MTzXi8mp0lhbSMqYw1kZKjmtxra2zhmM8a+fs2Qs4CsvnYR8nkaES925xHm07NL/XcUI laOFYoqUGCtKG5PEY+skTaKUkhS77uDhxHto6qfaf7eM16F6z4EmxLNIPYuzBYdHqRSao9Lx xCaEWVI9j9v+1L5fxcVojp8QtYejtCkJotSEFrGUe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+zxESL1k26sd8Kp+rSedvXV7deaBQt8l/ x/ioiq2y6x9bR6tk8cHrr5lDXIXPta92Ef6yzTHFC4Jqt0dqDgR9mXvzveWx3wOWX7txhzV6 4+QEnVHnHcANBqp9lwa/qW/v3bnBEWHdGr+ifPrI+UUf8wKN5m6/0pipFL02fDrLWaJZHjdW FCSnhFS1Mog0COq//VNMPAYDAAA= X-CMS-MailID: 20200910193508eucas1p154962900717e9e5a57a6dc6643f80b3d X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200910193508eucas1p154962900717e9e5a57a6dc6643f80b3d X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200910193508eucas1p154962900717e9e5a57a6dc6643f80b3d References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200910193400.15326-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v10 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..a7f5207c3 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[RTE_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), &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..33643d354 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[RTE_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), &link); + printf("Port %d %s\n", portid, + link_status_text); continue; } /* clear all_ports_up flag if any link down */ -- 2.17.1