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 351DAA0528; Sat, 11 Jul 2020 12:47:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F234D1DAEE; Sat, 11 Jul 2020 12:45:20 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id A3E841D9D3 for ; Sat, 11 Jul 2020 12:45:19 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200711104519euoutp01a264dbd5f166a94fdb82e99bf761ab02~grNnJFHbg0814708147euoutp01Z; Sat, 11 Jul 2020 10:45:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200711104519euoutp01a264dbd5f166a94fdb82e99bf761ab02~grNnJFHbg0814708147euoutp01Z DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594464319; bh=Q3FDVPqYih6h2xo05nFO4KV5xFIKOVLEyZFeSaipgvY=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=gTcMPwuHJRo6docD0iQ5jKSkfCiPvyxh/uT+g3whGjABaiWTP3pkQi92jyJBGDt4k 2g9Q01jr6N87pyp0QcCH55J5UYktDAqPZ7BR6dbu6CybyHSwv/xfE/nv8UijyK9c+h B+po5vu7B75EAW33bcjYfpJLhMlEO7bihn/0HWDA= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200711104519eucas1p1e653baf04abd5c5271997c41e4b57e40~grNm3jF1D0930309303eucas1p1u; Sat, 11 Jul 2020 10:45:19 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id BC.55.06456.F38990F5; Sat, 11 Jul 2020 11:45:19 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200711104518eucas1p2a5c67adeb9fa512a6b1bb8c05ac8199c~grNmhzlWD2342023420eucas1p2P; Sat, 11 Jul 2020 10:45:18 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200711104518eusmtrp2a785ccfcb7818cefc7cb391dc66d5843~grNmgyxZZ1628816288eusmtrp2a; Sat, 11 Jul 2020 10:45:18 +0000 (GMT) X-AuditID: cbfec7f2-7efff70000001938-55-5f09983f7192 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 1E.17.06314.E38990F5; Sat, 11 Jul 2020 11:45:18 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200711104516eusmtip16e3e646c772db4668a81362e9513fef4~grNkvCfMs0946309463eusmtip17; Sat, 11 Jul 2020 10:45:16 +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: Sat, 11 Jul 2020 13:44:06 +0300 Message-Id: <20200711104414.15422-20-i.dyukov@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200711104414.15422-1-i.dyukov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSbUxTZxTHc+57G2quReVEF2VdFtRERbcsj0Rlc8ty9/JBo/GDieJ13iAR kLWiMoZBMxmpDDeozqGWjkZhuFhBpBSBuCbSYlWUiC2+AEEjwRdeqohVCqPcLvv2P7/z/z/n 5OQRaH0pN1dIy9yjGDPldAOnZepbQzeXJJ/QpCQWVLLEcd0KpK/bTpNey0OOHBn+iSKB6mTS 5DzFkpKefIoUl4xQxFll5sjz3kMMGQw6KfKg2ceTso5DPAm6+3nyS/tJIP3jT2nyh+0lkHbr JZaE/mnkyNB4BUOK33YCOVrnBeIpGmGIxdUApMAskuG/KnlifzCfBHu9DPF1XeTJ36O3aXLp ehjIbx4HkBsFk+yn70tvbWdYyd40QEmlf96mpdau47xU1GalpJrBBkoaaunkpOK6apCu9R2h pXOP33DrtJu1q3Yo6Wl7FeOyNdu0O/uGErI6Z++/+66NyYeamWYQBBQ/xqvhBDNoBb1YBei5 bGPU4hXgXb+VU4uXgK8fFlFm0EwnQu7zrNqoBKwa6YlGRgE7LSGIuDhxIfoKrVSkMUus4dA5 7p+Ox4rfor3wFB/RjPghuge9XETrxCS0NL7m1BEL8NyFK3REa6Z4eOjWtNaL89Ff/mr6URRv Cdhj/5lXA19g/TUvqDoWn3rqovw9nHSVR/fOxbFaP6+GCwG7Kw5HTclY9+wmHzkHLS5CR+My FX+GTeP3GPVKMzDwYmYE01OypP53WsU6LCzQq24DXmnriGLE8LsYFUsY6m2n1fs0Az4ud7K/ woKy/2fZAKohTsk2ZaQqpuWZyr6lJjnDlJ2ZuvS73Rm1MPVVfROeYAOMdmx3gyiAIUZnk4UU PSvvNeVkuAEF2jBLt/aGb6tet0PO+UEx7k4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cP/HEaJAjOQf35ReNrH9rW1tuz4tpUn XY2YnyuBzVRqF0KH5rFu+5MLoh219f1fjryK6OIbDhetunf63O7mk0Oh+9N9TaF+64JL/IfC 030Eh9aXr6+4e+LX+dd6195+91dXR4hviVt1Q12xo1DVO2BRTtC9cZIccZyqUp/dWqpt990U n9RS/llG8MkaRQhu4DX/AAkRpQYIAwAA X-CMS-MailID: 20200711104518eucas1p2a5c67adeb9fa512a6b1bb8c05ac8199c X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200711104518eucas1p2a5c67adeb9fa512a6b1bb8c05ac8199c X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200711104518eucas1p2a5c67adeb9fa512a6b1bb8c05ac8199c References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200711104414.15422-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v8 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 | 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..57f3c24a8 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_to_str(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..2cfed33d3 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_to_str(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