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 92CABA00C5; Mon, 6 Jul 2020 22:40:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E83631DDB2; Mon, 6 Jul 2020 22:38:44 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 8B7C81DD99 for ; Mon, 6 Jul 2020 22:38:42 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200706203842euoutp0104e723e623d6857ec52a07774ca19f63~fRFRjoDfJ0553305533euoutp01l; Mon, 6 Jul 2020 20:38:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200706203842euoutp0104e723e623d6857ec52a07774ca19f63~fRFRjoDfJ0553305533euoutp01l DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594067922; bh=FZgu+DseHLusxJkCwaRQ1GfffzIWoM6QnM8E1SGa7oc=; h=From:To:Subject:Date:In-Reply-To:Reply-To:References:From; b=A5NH4q1oLDV39y1EUiFWQtHe/QS0ul6CsxR8gccwLYRwAxbdgMNMHmx4v4K4W+z2O IccqS5fnhwWtOBr8a0hIPQyDdSKFdv2MiW/Bi3E6bpHAkus6OQ9wKuvBH3BNl8UmkD pcJFhKA3bE+9pBq6RceAJRJO3cNzhLwgmxXXQk2g= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200706203841eucas1p2140acdc93e341c1f3daeb7063f1a7633~fRFQ3c6N12126421264eucas1p21; Mon, 6 Jul 2020 20:38:41 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 7F.C9.05997.1DB830F5; Mon, 6 Jul 2020 21:38:41 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200706203840eucas1p2366ef5cffa8f367969343fe9240cd919~fRFQPZZoe1728517285eucas1p2B; Mon, 6 Jul 2020 20:38:40 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200706203840eusmtrp2725d0473b1c94314d1faedcd87aeb046~fRFQOcHS60640206402eusmtrp26; Mon, 6 Jul 2020 20:38:40 +0000 (GMT) X-AuditID: cbfec7f4-65dff7000000176d-d5-5f038bd18b81 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id FF.7E.06017.0DB830F5; Mon, 6 Jul 2020 21:38:40 +0100 (BST) Received: from idyukov.rnd.samsung.ru (unknown [106.109.129.29]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200706203839eusmtip16beb4e6e101d3c739a846710a6772f3e~fRFOcpqDb1791017910eusmtip1q; Mon, 6 Jul 2020 20:38:38 +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:32 +0300 Message-Id: <20200706203743.29416-19-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: H4sIAAAAAAAAA0WSe0xTdxTH97tvqtW74uMMN4lNzNjiGzVnxgd7JF6jMcZETZYp6/AGjVBJ r+B8kBAitTxEhwSVasU2vlojqECByIb1AdiCgkE0QSWNzskULY+pXRUpt8b/vudzvt9zcn75 CbTuIBcjbDZuk01GQ4qe0zDVN962Tm/LpxNntZfGYrnPRtD/0EFjd/EDDvNf7aHwnnMJXnYf ZbHoURaFhUUBCt1n8jh83p3NYG+fm8Kuei+Ppe3ZPPZ5nvK475aV4NNQD41HyvoJ3rJVsfj2 Sh2HL0N2BguDHQT3VzYRbCwIMFhcW0PQnCfiq7OneXR0Tca+7iYGvfcv8XhusI3GKt87gn80 lhNsMQ+xCVOkYNlJVnJcfkZJB0+00dKN+yW8VNBso6QLvTWU9PLPDk4qrHQS6aY/n5Zcj99w qzQ/axZulFM2Z8immYt/1Ww6dP4BSbNrfs+tLqGySA+fR6IEEOdCqMJP5xGNoBPPEGj4x8qq xQCBuxV2Si36CXSZg+zHyLV+J6c2ThPw3hmiwg2dOEjAaR0V1pwYB16LbSQ9TrzAgTvUOWKK FleAt9U7MokRp4Jjb4AOa624AOrz2yMbYsFV0TDMBSFqmB+7HqPOnwydxwdGZoLoE8D6l5uo /p9gT85gJBsNPY2VkeO+hKHa45Sqd8Hri528GrYQeGjPiZiWQOW/rXx4GS1+A+V1M1X8Pfif WNgwBnEM3HvxeRjTw7Ko+hCtYi1YzDrVrYeG5vYIBnj3/2gVSxCoHWTUp6onkNvyhj1AYks/ 7SojxEkmyulKarKszDHK22cohlQl3Zg8I2lr6kUy/FW97xsHakhd6DcPEQWiH621cHSijjVk KDtSPQQEWj9O+0OLd4NOu9GwY6ds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5oIqNEUzicVFMFI3/fQSj8E5DLT475t1Gk+aTFdNCa4TfdYde u12XIxxxG9Jza2zXTiW/9sNi6l4lc+OY/60685ewoJkmWYNUvp/0WTLX4lu8aXhgGiJKdNS6 Y6s9fANeRRcyvwKO76zyVBzoobnmtfmrT3THN18+YY3Skmj3ycb10+lZn+2T8/t01VMThwbK 1ZQUK2j8SKMk/AVpiZE1BwMAAA== X-CMS-MailID: 20200706203840eucas1p2366ef5cffa8f367969343fe9240cd919 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200706203840eucas1p2366ef5cffa8f367969343fe9240cd919 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200706203840eucas1p2366ef5cffa8f367969343fe9240cd919 References: <20200427095737.11082-1-i.dyukov@samsung.com> <20200706203743.29416-1-i.dyukov@samsung.com> Subject: [dpdk-dev] [PATCH v6 18/25] examples/l3fwd-graph: 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 --- examples/l3fwd-graph/main.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/examples/l3fwd-graph/main.c b/examples/l3fwd-graph/main.c index c70270c4d..cd8e3aad1 100644 --- a/examples/l3fwd-graph/main.c +++ b/examples/l3fwd-graph/main.c @@ -599,6 +599,7 @@ check_all_ports_link_status(uint32_t port_mask) struct rte_eth_link link; uint16_t portid; int ret; + char link_status_text[60]; printf("\nChecking link status"); fflush(stdout); @@ -623,16 +624,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\n")); - 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