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 DD5FFA0528; Sat, 11 Jul 2020 12:46:59 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C66E51D9FD; Sat, 11 Jul 2020 12:45:13 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 102DD1DA83 for ; Sat, 11 Jul 2020 12:45:11 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200711104510euoutp011825ef45b2f44a59f611635bbfc6b89c~grNfITgyl0814708147euoutp01Y; Sat, 11 Jul 2020 10:45:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200711104510euoutp011825ef45b2f44a59f611635bbfc6b89c~grNfITgyl0814708147euoutp01Y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594464310; bh=UBIKSjvQGKvUwJ35oNwL6cz5h7c0u2Igh3CSm1TgPKQ=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=dFencHZb1m1TFhRjx5D6OlKfuRtvR0mywiX0jm7ZyICBdODiWN3ov5D0HDNIMNXud xqcBqOrMbHlv0Gpic+ZaVPsnlWbwc9w35TbESBw88nGODfWMTsngvLvi6i8SCwd0bc FhOjRQCE23eqsyf37X5C/i48PO0WbNt9TMvxxPzU= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200711104510eucas1p1f0cd7a19324377a8822a504f0aa41e81~grNe9e-ju1558215582eucas1p1s; Sat, 11 Jul 2020 10:45:10 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 02.2F.05997.638990F5; Sat, 11 Jul 2020 11:45:10 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200711104510eucas1p2f4e199a03e2b85311b65c1e1148c9967~grNehIGuA2336423364eucas1p2U; Sat, 11 Jul 2020 10:45:10 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200711104510eusmtrp2e29c6a55a80b00e0c0f8d093de9d1dd5~grNegIem41628816288eusmtrp2X; Sat, 11 Jul 2020 10:45:10 +0000 (GMT) X-AuditID: cbfec7f4-65dff7000000176d-5f-5f0998361725 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 5B.17.06314.638990F5; Sat, 11 Jul 2020 11:45:10 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200711104508eusmtip106a1609fe51174175f86cf802556a478~grNcvbCXw1304313043eusmtip1m; Sat, 11 Jul 2020 10:45:08 +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:03 +0300 Message-Id: <20200711104414.15422-17-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: H4sIAAAAAAAAA0WSfUwTdxjH89xd766VbrdS5QkacF2MolERjfmNzKmbLrdkU7NlWWKmeOoF yXgxrVWcf9gQZQy6biKbExUQ1DJYgmKhwGCRJlKlgKsRkcib+EJEAXnLBFtYy0H87/t8vs/r Lz+e1p1mw/mE5EOyMVlKNLAaprJhomXl+j/UcdGVliWkrCkPSG9XEU16cjpZkvXqBEUelGwk tc7zKpLdbaGILXuYIs7iTJa87EljyOCIkyIddR6O5N5N48iIq48jP985B6TP10+TswWjQO7k VajIRH0NS4Z8hQyxTbYC+cVxC4jbOsyQnOoqIOmZAnn1p50jRR0RZKTnFkM87dc58te4lyYV TX4gp9xlQJrTp1Wb3hcnCy6rxKLa55R4+qKXFhvaf+dE6+08Srw2WEWJQ/+0sqLNUQJiY28W LZY+ec3u0OzUfLRfTkw4LBtXf7xHc2CsvZg72K9O9VqraAt0c5mg5lFYh1OdExDUOqEY8Dfb zkzQBPQY4LObJ0EJRgHP+QdVcxWjdfmMYtgBn9jdrBKMAzqyLtHBLFZYhp6MPCpo6IVrLDp9 bVTQCBU+w87HVwKteJ4RluBF//Eg1gqx2FrUxyoTIrH06o2ZPuoA9w/9Syv7RWBb/thMTxSa eKw43whKwRZMG8+nFB2K/W7H7HGLcLp6jh/D/8rbOKU4A7Cr8ORs0kZ0vGjhggvRQhSW1axW 8GZ8edM+g1F4Bx8MvBfEdEBmV56hFazFjHSdkm3AG7fvzmJE/5sQBYt4Zto3+1Z1gE//9jK/ QmTu21kFACUQJptNSfGyKSZZPrLKJCWZzMnxq/alJJVD4Kt6ptxjVVDj2+sCgQdDiLZA4uN0 Kumw6WiSC5CnDXrtJ82e3TrtfunoD7IxJc5oTpRNLljIM4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GQKKaLpv99GC0PykKbLNtH/KJtEx5n6eXmqAN3 JsaeZqOda5t1QpwVP/Ypzl0TUWotitmmx75W6CcD3o07Iq05wXXtqpcHY7k1XGVFp0JbGLN5 R0dicnntoi+rne4e7ZMV9oWx+Zj9lf+Lq5aSrTfsyorBvrYFprbbj/cF9sv0mJ+qcvE625Rn uk6rJqRkgQvGTZLwD8sTTYsIAwAA X-CMS-MailID: 20200711104510eucas1p2f4e199a03e2b85311b65c1e1148c9967 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200711104510eucas1p2f4e199a03e2b85311b65c1e1148c9967 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200711104510eucas1p2f4e199a03e2b85311b65c1e1148c9967 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200711104414.15422-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v8 16/24] examples/l2fwd: 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/main.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c index e04c601b5..dd9ca43a0 100644 --- a/examples/l2fwd/main.c +++ b/examples/l2fwd/main.c @@ -571,6 +571,7 @@ check_all_ports_link_status(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); @@ -594,14 +595,9 @@ check_all_ports_link_status(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