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 67498A00C5; Mon, 6 Jul 2020 22:41:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 721091DD84; Mon, 6 Jul 2020 22:38:54 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id E76CC1DD01 for ; Mon, 6 Jul 2020 22:38:47 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200706203847euoutp01b9e45394b9cd3d5e5bf90b2660e7a7b7~fRFWkVR8O3113131131euoutp01b; Mon, 6 Jul 2020 20:38:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200706203847euoutp01b9e45394b9cd3d5e5bf90b2660e7a7b7~fRFWkVR8O3113131131euoutp01b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594067927; bh=xMUQMNB8i6t8ay1gcbcdZCHyGWgNvOkvIPzWBMqAo/g=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=SGDGFzX4u+1/FNRUBb+qzNDkQXMwyd4qYUGAnQSGAlZDlaLjUbZPKer2/6i3vyjg/ yg34WlkrxWlevfJjz3XSQcU6LvbZkXrVqtV1gb9gQe4ze3z35Zj4T4jowlKZPzY7Tv fXcCXuLdxI4AWD5xpe2QZKDtiY9cnL9zwErGvoAU= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200706203846eucas1p262094025f9606b87f765920285d0d48b~fRFVtmCFm2127421274eucas1p25; Mon, 6 Jul 2020 20:38:46 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 12.D9.05997.6DB830F5; Mon, 6 Jul 2020 21:38:46 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200706203846eucas1p21bbcbf41b435e8fcb0ef75aa0d0c2b82~fRFVXI4k12067820678eucas1p2A; Mon, 6 Jul 2020 20:38:46 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200706203846eusmtrp21881ce9aaba93e4c98783b2775d101bd~fRFVWWJ2t0640206402eusmtrp28; Mon, 6 Jul 2020 20:38:46 +0000 (GMT) X-AuditID: cbfec7f4-65dff7000000176d-dd-5f038bd679cb Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id B2.8E.06017.6DB830F5; Mon, 6 Jul 2020 21:38:46 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200706203844eusmtip1e5ebfc75dbaa5719d2ef868cc6cb7996~fRFTlMaKd1791017910eusmtip1s; Mon, 6 Jul 2020 20:38:44 +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:37:34 +0300 Message-Id: <20200706203743.29416-21-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200706203743.29416-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSf0wTZxjH89xd745ql6NqeIUFs2Yz00S0w+gTNTqNZpfNP5Zlm4kJYtVL QQFND0RmYkClI0WRdYZF1FrASYWZipafosE2AqVAJ4YhiyASnRFFoOIP2DlGOZb9930+3+/z Pk+evDytt7PRfHJaumRJM6UYWC1T0zzRueyPfDpxRWf5UnS3OwAH+8toHDjdx2L+6HEK71ds wMbacxq0P8ymsMA+RmGty8bii4GjDL4M1VL44GaAw+KuoxyGvE85PBk8C/hUGaLxjPMVYNBR rcGJ2w0sjiilDBZMdgOe8rQCtpwYY/B0fR2g1Sbg6OVyDssexGJooJXBQO91Dn97fZfG6vb3 gD+1uAE7rFOazz8SJ52/asSyxmeU+HPJXVps7i3ixBN+ByVWvayjxJFb3axY4KkAsW0wnxYr H79jv9Zu167bI6UkH5Qsy9fv1Cb1P3YyB4ILDjmLWyEbKiNtwPNEWEkmS4w20PJ6wQVkIPdP jVqMA3l70k2rxSsgw75LYIOImY46xxCnGuVArIqPUYvXQJpG3VQ4xQqfkkCegwob84UqltQq PTPGPGErOf/Ox4Y1I3xC/H0dM1onrCG5z6/T6ohFpPJqEx1eMGKan78THcZ6IZb0XBifeZMI v/OksWSQU/ObiW/Ixah6Hhlq8czyD8lU/QVK1YfJ22s9nNqcB6S/NHc2tIF4nndy4WG0sIS4 G5areCOpKq3h1CN9QO4PR4YxPS3tNb/QKtaRPKteTRtIk79rFhPy/u+5KhbJJWsfo25/E4hi 5QphUfH/o5wAFRAlZcipZkn+LE3KjJNNqXJGmjlu9/7UazD9UwP/tIzXQYOyywsCD4a5ujyW TtRrTAflrFQvEJ42zNdt6gjs0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oropIUevYYy2pZ3f8+TOAlzkDlfjMu+8nYiM9NFQ/Ux5ei z/tpS8cT4u5UFjl/6jJ/QtLI4/2vDkef+dyuXdsa0DOU62QyVyp9D97Ul4zVumxz8UomK2D3 khFfNC9Lk7puZ54YvrL3fUxNQeCTgIWmPeZ8pd9rY0gUa87aqLneG3+Z2GSUzB8dalmTN+xV F+mfLSG4ZIVsM67jFL8BTvbzJQcDAAA= X-CMS-MailID: 20200706203846eucas1p21bbcbf41b435e8fcb0ef75aa0d0c2b82 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200706203846eucas1p21bbcbf41b435e8fcb0ef75aa0d0c2b82 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200706203846eucas1p21bbcbf41b435e8fcb0ef75aa0d0c2b82 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200706203743.29416-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v6 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