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 02098A0528; Sat, 11 Jul 2020 12:46:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8E4691DA89; Sat, 11 Jul 2020 12:45:11 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 9171B1DA9D for ; Sat, 11 Jul 2020 12:45:09 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200711104509euoutp02b5cb46679cd266700d1531cf06e32c31~grNdwxabk1781817818euoutp02c; Sat, 11 Jul 2020 10:45:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200711104509euoutp02b5cb46679cd266700d1531cf06e32c31~grNdwxabk1781817818euoutp02c DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594464309; bh=Gx8oDJpmTpjVn5IyghjT1J24+AE+Pf8nC0ZYfcG7HWE=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=I3Egj1EPfAlrn+c9qFbNyXT8xsC9Zth/W26T3XKjM+Ip53l9+KBFPpCM1/mXnbBxH fQ3Zj/GIP7RBtKCr02b/2MJcImZ/Hajev+YArdjGvnPYzewP+YZpTgALMwghx+GzwF iItYWrPzBM3GsswLc3uPVjC31tJakfr8WTh5wVq4= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200711104508eucas1p1dbb29f1e7f0671d585879b7f16415de9~grNc5RRCO1645216452eucas1p1z; Sat, 11 Jul 2020 10:45:08 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 67.55.06456.438990F5; Sat, 11 Jul 2020 11:45:08 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200711104507eucas1p2568514a4d979f3ac2a9a6d36c3d7fca6~grNb9OZXE1737917379eucas1p2K; Sat, 11 Jul 2020 10:45:07 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200711104507eusmtrp1fff37a7b3654728757646c2bb7aab95f~grNb8G-t82954729547eusmtrp18; Sat, 11 Jul 2020 10:45:07 +0000 (GMT) X-AuditID: cbfec7f2-7efff70000001938-47-5f0998342593 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 5C.86.06017.338990F5; Sat, 11 Jul 2020 11:45:07 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200711104505eusmtip17d0fcd5a4f1a89117ac87ed0c6dc390b~grNaMSvbs0946309463eusmtip13; Sat, 11 Jul 2020 10:45:05 +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:02 +0300 Message-Id: <20200711104414.15422-16-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: H4sIAAAAAAAAA0VSfUyMcRzf73mee57nTteeLuY3L5nbMmxKw/ZlJi/NniWbTZsY8uBZXrqr 3SlvQxqnnbr0IlTOqSgxJdWlVbg/HK5EXgpJEikUvcxLV9zdk/nv8/18P5/v57vvviypSqMn sTu1e0SdVohW0wqq8t6vxjnzz8oj53aW+UJJvRlBR1s+Ce2Zb2g4+e0YAS3FwVBjzZVB+tsE Akzp3wmwFhlp+NKeSEFvv5WA1loHA9lNiQz027oYSGnMQdDl7CHhnGUAQaO5Qga/7lbT0OfM o8D0+zmC1PL7COzJ3ynIvFWFwGDk4NuVQgbyW/2gv/0+BY6XNxm4NvSEhIr6EQRp9hIEDYY/ sqXT+d+WSzI+v6ab4DMuPiH5ey+zGD75gZngb/RWEXxf3XOaN5UXI/5hx0mSv9r5k16j2KBY vF2M3hkv6gKXbFHsqEvpk8XmKfZVnohNQKdZI2JZzM3HxlyFESlYFVeE8JXXCYRUDCJc+s7G SMUAwhX2AVdH7nHUNN2WSY1ChOs+XENSMYRwT6mBdKtobiZ2JJk9s8ZzN2hsdTYT7kBfLgxf +rzXraE4f3ziYwFyYyW3CF/MfjqWMA1fLb3jmSN38SN9jz1Yxfnh5guDnpmYe8zi4dFntGQI wZbuo2NmX9xjL2ckPAU7MpIpCR/EP8qaGcmchHBb3vExUTAu//yIcS9HcrNwSXWgRC/Dju5U WjqSN2756uOmSRdMrzxDSrQSJxlUklqN7zxoGqMxHhn2kmget1UUEtL2ta5bFficQtOy/0dZ ECpGE8U4vSZK1Adpxb0BekGjj9NGBWyL0ZQh16M6Ru39VWioaasNcSxSeyktAhupkgnx+v0a G8IsqR6vXN7g2KxSbhf2HxB1MZG6uGhRb0OTWUo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6A28Ad4PoXX/88RjMQ/E6k0Ww//5EzNjdvtFR1pvsO7 bxdnH+WYOTHL5QtXaLpv7z9iD/JzzvWNKRqaWpKeZR4adwRl44P5L8IW/PXetmBZ8GjiHdu3 oMLPIdIpCxdXFbBppK8sYMwhsS5uuXUt45PDJ2n9LFH1hc1d80yt500byt+d3P/s10tXXHVg TlvcTZOcEjRq5UpSL6j/AapPWMkHAwAA X-CMS-MailID: 20200711104507eucas1p2568514a4d979f3ac2a9a6d36c3d7fca6 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200711104507eucas1p2568514a4d979f3ac2a9a6d36c3d7fca6 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200711104507eucas1p2568514a4d979f3ac2a9a6d36c3d7fca6 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200711104414.15422-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v8 15/24] examples/l2fwd-event: 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 --- examples/l2fwd-event/main.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/examples/l2fwd-event/main.c b/examples/l2fwd-event/main.c index 4fe500333..3849aaae0 100644 --- a/examples/l2fwd-event/main.c +++ b/examples/l2fwd-event/main.c @@ -366,6 +366,7 @@ check_all_ports_link_status(struct l2fwd_resources *rsrc, 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); @@ -389,14 +390,9 @@ check_all_ports_link_status(struct l2fwd_resources *rsrc, } /* print link status if flag set */ if (print_flag == 1) { - if (link.link_status) - printf( - "Port%d Link Up. Speed %u Mbps - %s\n", - port_id, link.link_speed, - (link.link_duplex == ETH_LINK_FULL_DUPLEX) ? - ("full-duplex") : ("half-duplex")); - else - printf("Port %d Link Down\n", port_id); + rte_eth_link_to_str(link_status_text, 60, NULL, + &link); + printf("Port %d %s", port_id, link_status_text); continue; } /* clear all_ports_up flag if any link down */ -- 2.17.1