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 BD2D5A00C5; Mon, 6 Jul 2020 22:29:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7E5621DD1F; Mon, 6 Jul 2020 22:27:36 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 857BD1DB88 for ; Mon, 6 Jul 2020 22:27:34 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200706202734euoutp026cdf55b4438a7afa5b4ed45111f083d6~fQ7jbw5tG2313123131euoutp02K; Mon, 6 Jul 2020 20:27:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200706202734euoutp026cdf55b4438a7afa5b4ed45111f083d6~fQ7jbw5tG2313123131euoutp02K DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594067254; bh=xMUQMNB8i6t8ay1gcbcdZCHyGWgNvOkvIPzWBMqAo/g=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=iPz5wn+A1GPIjANCf9EMF5vnPucW4UJRnpIynHBPyx1V60M+dHFJMSIES7DF9yx7D RU6kc5bGFv1QOaFOZSVNrp8/JzI2nPUFmgZ1qCBKkYBIxV1fQX7AvZtBePEpJFRFUg r0qmtrK2gBKwSZj/yDP7m/csP1U04cWea9WYxwHM= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200706202733eucas1p272490d59328d89c290a9291ecfba0530~fQ7jFK7xv3131931319eucas1p28; Mon, 6 Jul 2020 20:27:33 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 6C.99.05997.539830F5; Mon, 6 Jul 2020 21:27:33 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200706202732eucas1p1f8fd4a2c9fc271e08f8b416dd0af0712~fQ7h7iLpA1288412884eucas1p1p; Mon, 6 Jul 2020 20:27:32 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200706202732eusmtrp2342ac012bd6242c3e22e3ab1e534894b~fQ7h6u_I03205132051eusmtrp23; Mon, 6 Jul 2020 20:27:32 +0000 (GMT) X-AuditID: cbfec7f4-65dff7000000176d-cb-5f0389354241 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id D0.5E.06017.439830F5; Mon, 6 Jul 2020 21:27:32 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200706202730eusmtip1305a6c3b75b2ca7e6661f7c2d6b5e489~fQ7gHiGJu1791017910eusmtip1E; Mon, 6 Jul 2020 20:27:30 +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: Mon, 6 Jul 2020 23:26:10 +0300 Message-Id: <20200706202626.28628-21-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200706202626.28628-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0VSe0xTZxTfuff23ktDzbWinKHTrHGZuviamp24KWwxy83iH9OZLc4oq3qD OoqmV5hKtlUiDa+hAttCVawQAxYSBCuPxgc2CtXyGCYEnYqEMRxulLdMAZFyMf73e53zO/ny iawxi48Q98YdVKxx5lgTr+cqap83Ll2TykavuOD6iErr84A62gpYas95xFN63zGG7rki6Url aR1lPbYxlJnVz1BlURpP/7UncRQYqGTo4VW/QI67SQINeJ8I9EvTKaAnY09ZynUOAjXlXdbR 8xsennrH8jnKfNECdNztA6rL6Ocop7oKyJ4mUd+FQoEKHs6ngXYfR/77lwQqGW5m6XL9ONDJ ulKgBvuELupd+YXzvE4uuNLNyNnnmlm59v5vgpxxO4+RywJVjNx7rYWXM90ukO90pLNycef/ /Jf6b/Wf7FZi9yYo1uXrv9Pvaet0cgeaZh9yOnxgg+KZaRAiorQaW/7u4NJALxqlIsCqGi+r kSHAiS43aGQQsCz1BP965FZjvRDERqkQMOm0RQsNA9r/aNAFDV5ahP6UPCZohEllPFaOtU4S UZwlbUSvLSyY4aT3MPWfo1NLDdJazPjLB1rBAiy+WMMGccikfrP3Eq+VzcfWs0NTO1HyiVjd VTo9sAE9/T3TeBY+rXMLGp6HE9VnGQ0n4kh5q6ANpwC25SdPhyLR/W+jEDyOlRZjqWe5Jn+K Pb928kEZpRl4r2fqvdhJmFXxO6vJBkyxG7W0CWtu352WEcdHQzVZxlzPn5x2/VXAzIy1J2CB 402VE8AF4Uq8aolR1A/jlB+WqWaLGh8Xs2zXfks5TP5U/8u6oSrwjO30giSCKdSQwrPRRp05 QT1s8QKKrCnM8FmDf4fRsNt8+Ihi3R9tjY9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jIRJVOq4Cxyn4bT/c4TIw9eANn73MOk1y6UOm6Yqt9Vpj1V0CbPG ou0rp+4W1Ttk2xaoM1dUk4Er5bbHUdba4fCOlD2jikLLW58j1ouhjSF0m248eWtlSuZt/+kY UbfO0Du5OcPrGASU742JnjzLyO9Lcv0dNYM1zt6g8TvM6ZOF26Wa7HhzdWBZAg7IerpeSvFJ SnkgqeWVfwGWWGUQBwMAAA== X-CMS-MailID: 20200706202732eucas1p1f8fd4a2c9fc271e08f8b416dd0af0712 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200706202732eucas1p1f8fd4a2c9fc271e08f8b416dd0af0712 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200706202732eucas1p1f8fd4a2c9fc271e08f8b416dd0af0712 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200706202626.28628-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v5 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