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 EAC52A0526; Fri, 10 Jul 2020 09:06:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EE1201DB1C; Fri, 10 Jul 2020 09:03:32 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 0B2ED1C131 for ; Fri, 10 Jul 2020 09:03:30 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200710070329euoutp02137a66fbb801ae096491ef2c3760dd81~gUipUGXiL1749817498euoutp02O; Fri, 10 Jul 2020 07:03:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200710070329euoutp02137a66fbb801ae096491ef2c3760dd81~gUipUGXiL1749817498euoutp02O DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594364609; bh=xMUQMNB8i6t8ay1gcbcdZCHyGWgNvOkvIPzWBMqAo/g=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=F/Vnqrw2rFNWRAQSuLSWh0qrQc9azgsFAmFbuebRF5QsuSnWwXHPsG6Jv9S2kCrWk D+nRVQSwcNnqyONg2nW0djg3yBHVZYna8LcTqMFS9OoydCKMn3sJR+ioUmlVVJxnGJ r8DD1uYQdxFtdp2rdgcwWkrilZh2xywyO6docies= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200710070329eucas1p1594b0d25e50941b0eea427ec1129b4f7~gUipBXof02484724847eucas1p1M; Fri, 10 Jul 2020 07:03:29 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 04.5F.06456.1C2180F5; Fri, 10 Jul 2020 08:03:29 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200710070329eucas1p24159b4685ac117448ed03004ac2473b5~gUios7a_d2520225202eucas1p2n; Fri, 10 Jul 2020 07:03:29 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200710070329eusmtrp166a32286ec6c71d156578c8c01d5d914~gUiosFE4h1113611136eusmtrp1X; Fri, 10 Jul 2020 07:03:29 +0000 (GMT) X-AuditID: cbfec7f2-809ff70000001938-3f-5f0812c1baef Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 34.A4.06314.1C2180F5; Fri, 10 Jul 2020 08:03:29 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200710070327eusmtip19d955e5442f2d55c072c23fa69a8e0b1~gUim9vqUz1544115441eusmtip1p; Fri, 10 Jul 2020 07:03:27 +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: Fri, 10 Jul 2020 10:02:18 +0300 Message-Id: <20200710070226.6045-21-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200710070226.6045-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSfUxTVxTAc997fe/RWfeoOI/VSGxAnQl+bcmOZtHNaPL+MJnL4kwUxQ7e kEgBW2CwJYboZKwUUCB+oLIC8mGrgligaGe0ElssSiAqNRME58eUqVgFv8oY7euy/37nd869 95yTy9PqMlbDp6RlSoY0XaqWVTKtV952x11S8wlLJvo12NhVSfDeQA2Ng+X9LBaO/Eyhz7oK nW1HFVh6N4/C4tIXFLY1mFj8e3A3g8/8bRTe+d3LYUXvbg79rkccFnUfIfgo8ITGw5aXBLsr WxT49tI5Fp8HqhksfneTYIndQ9BtfsFgebuDYL5JwJET9RzW3JmD/kEPg97bZzk8OdpDY0vX OMH97kaC1/InFF/MFd9ZahVijfMxJZZV9dDildsHONHcWUmJZ545KPH5hZusWGy3EvHqvUJa tN1/w65XblJ+niSlpmRLhsUrtym3D9y3MBnd03MsFR6SR2yRJhLBg/Ap3DrfQZmIklcLDQR8 v7oZOXhFwFlbx8nBSwJVPR6FifChI+NDG2RfT6DofUn4+CiBs7/0MsF7WWEBeAsqQ4ko4QwL bYE+KpiYJqwD38ibUBEjxILHfIMNskpYDgeO3qDkpqLB1nSRDnLEpN9rquaCrBbmQN9vr8I1 XTyY/1LLvAaOnWoJ+2nwxG3nZJ4N3jIzI/NP8Lq5LzQOCAUEBqr3hotWgX34OhccjRY+hsZz i2X9Jfg7Whl54qngexraFz2Jpa0HaVmroCA/3IEWLnb2hjXA+PspshahZ2g4vEMngcvO49w+ El3x/1sWQqxkhpRl1CdLxqVp0g+LjDq9MSsteVFiur6ZTH5V7z9uv4OM9n7nIgJPtFNUjgk2 Qa3QZRtz9S4CPK2NUq2+5t2qViXpcn+UDOkJhqxUyegis3hGO0P1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r+PYMIic5HazKXE/loymPT0ZI82tYQLOKPb oowva3uyP+Xzk75E/d7Zsmnh/ojTeE3rlBb8uL1sW87uPt+cmJSm6lTd9n6re2rkap/7zptn ojNtXMyZhvnu5YsWR+eod7O9HZD+oM6/Sh8bv2NZVu2h4kB53QrV/YvdZvWmo+/jdtnbC6aF GzWUlGngp5JWyfAPpZKoMQgDAAA= X-CMS-MailID: 20200710070329eucas1p24159b4685ac117448ed03004ac2473b5 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200710070329eucas1p24159b4685ac117448ed03004ac2473b5 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200710070329eucas1p24159b4685ac117448ed03004ac2473b5 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200710070226.6045-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v7 20/25] 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_strf function to example applications Signed-off-by: Ivan Dyukov --- .../client_server_mp/mp_server/init.c | 14 +++++--------- examples/multi_process/symmetric_mp/main.c | 12 ++++-------- 2 files changed, 9 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..3ca9bcae3 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[60]; printf("\nChecking link status"); fflush(stdout); @@ -204,15 +205,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", 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_strf(link_status_text, 60, NULL, + &link); + printf("Port %d %s", (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..0480874f8 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[60]; printf("\nChecking link status"); fflush(stdout); @@ -384,14 +385,9 @@ 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_strf(link_status_text, 60, NULL, + &link); + printf("Port %d %s", portid, link_status_text); continue; } /* clear all_ports_up flag if any link down */ -- 2.17.1